mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
Remove Dialog Adapter (#446)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { Dialog, DialogType, DialogFooter, IDialogProps } from "office-ui-fabric-react/lib/Dialog";
|
||||
import { Dialog as FluentDialog, DialogType, DialogFooter, IDialogProps } from "office-ui-fabric-react/lib/Dialog";
|
||||
import { IButtonProps, PrimaryButton, DefaultButton } from "office-ui-fabric-react/lib/Button";
|
||||
import { ITextFieldProps, TextField } from "office-ui-fabric-react/lib/TextField";
|
||||
import { Link } from "office-ui-fabric-react/lib/Link";
|
||||
@@ -50,7 +50,7 @@ const DIALOG_TITLE_FONT_SIZE = "17px";
|
||||
const DIALOG_TITLE_FONT_WEIGHT = 400;
|
||||
const DIALOG_SUBTEXT_FONT_SIZE = "15px";
|
||||
|
||||
export class DialogComponent extends React.Component<DialogProps, {}> {
|
||||
export class Dialog extends React.Component<DialogProps> {
|
||||
constructor(props: DialogProps) {
|
||||
super(props);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ export class DialogComponent extends React.Component<DialogProps, {}> {
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<Dialog {...dialogProps}>
|
||||
<FluentDialog {...dialogProps}>
|
||||
{choiceGroupProps && <ChoiceGroup {...choiceGroupProps} />}
|
||||
{textFieldProps && <TextField {...textFieldProps} />}
|
||||
{linkProps && (
|
||||
@@ -104,7 +104,7 @@ export class DialogComponent extends React.Component<DialogProps, {}> {
|
||||
<PrimaryButton {...primaryButtonProps} />
|
||||
{secondaryButtonProps && <DefaultButton {...secondaryButtonProps} />}
|
||||
</DialogFooter>
|
||||
</Dialog>
|
||||
</FluentDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/**
|
||||
* This adapter is responsible to render the Dialog React component
|
||||
* If the component signals a change through the callback passed in the properties, it must render the React component when appropriate
|
||||
* and update any knockout observables passed from the parent.
|
||||
*/
|
||||
import * as React from "react";
|
||||
import { DialogComponent, DialogProps } from "./DialogComponent";
|
||||
import { ReactAdapter } from "../../../Bindings/ReactBindingHandler";
|
||||
|
||||
export class DialogComponentAdapter implements ReactAdapter {
|
||||
public parameters: ko.Observable<DialogProps>;
|
||||
|
||||
public renderComponent(): JSX.Element {
|
||||
return <DialogComponent {...this.parameters()} />;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import * as React from "react";
|
||||
import { IGalleryItem, IJunoResponse, IPublicGalleryData, JunoClient } from "../../../Juno/JunoClient";
|
||||
import * as GalleryUtils from "../../../Utils/GalleryUtils";
|
||||
import { DialogComponent, DialogProps } from "../DialogReactComponent/DialogComponent";
|
||||
import { Dialog, DialogProps } from "../Dialog";
|
||||
import { GalleryCardComponent, GalleryCardComponentProps } from "./Cards/GalleryCardComponent";
|
||||
import "./GalleryViewerComponent.less";
|
||||
import { HttpStatusCodes } from "../../../Common/Constants";
|
||||
@@ -196,7 +196,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
||||
<div className="galleryContainer">
|
||||
<Pivot {...pivotProps}>{pivotItems}</Pivot>
|
||||
|
||||
{this.state.dialogProps && <DialogComponent {...this.state.dialogProps} />}
|
||||
{this.state.dialogProps && <Dialog {...this.state.dialogProps} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as GalleryUtils from "../../../Utils/GalleryUtils";
|
||||
import { NotebookClientV2 } from "../../Notebook/NotebookClientV2";
|
||||
import { NotebookComponentBootstrapper } from "../../Notebook/NotebookComponent/NotebookComponentBootstrapper";
|
||||
import NotebookReadOnlyRenderer from "../../Notebook/NotebookRenderer/NotebookReadOnlyRenderer";
|
||||
import { DialogComponent, DialogProps, TextFieldProps } from "../DialogReactComponent/DialogComponent";
|
||||
import { Dialog, DialogProps, TextFieldProps } from "../Dialog";
|
||||
import { NotebookMetadataComponent } from "./NotebookMetadataComponent";
|
||||
import "./NotebookViewerComponent.less";
|
||||
import Explorer from "../../Explorer";
|
||||
@@ -179,7 +179,7 @@ export class NotebookViewerComponent
|
||||
hidePrompts: this.props.hidePrompts,
|
||||
})}
|
||||
|
||||
{this.state.dialogProps && <DialogComponent {...this.state.dialogProps} />}
|
||||
{this.state.dialogProps && <Dialog {...this.state.dialogProps} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,10 +28,8 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"changeFeedPolicy": [Function],
|
||||
"conflictResolutionPolicy": [Function],
|
||||
"container": Explorer {
|
||||
"_addSynapseLinkDialogProps": [Function],
|
||||
"_closeModalDialog": [Function],
|
||||
"_closeSynapseLinkModalDialog": [Function],
|
||||
"_dialogProps": [Function],
|
||||
"_isAfecFeatureRegistered": [Function],
|
||||
"_isInitializingNotebooks": false,
|
||||
"_isSystemDatabasePredicate": [Function],
|
||||
@@ -677,9 +675,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"addDatabaseText": [Function],
|
||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"addTableEntityPane": AddTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -786,6 +781,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
},
|
||||
"clickHostedAccountSwitch": [Function],
|
||||
"clickHostedDirectorySwitch": [Function],
|
||||
"closeDialog": undefined,
|
||||
"closeSidePanel": undefined,
|
||||
"collapsedResourceTreeWidth": 36,
|
||||
"collectionCreationDefaults": Object {
|
||||
@@ -841,9 +837,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"deleteDatabaseText": [Function],
|
||||
"dialogComponentAdapter": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"editTableEntityPane": EditTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -1004,6 +997,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"onRefreshResourcesClick": [Function],
|
||||
"onSwitchToConnectionString": [Function],
|
||||
"onToggleKeyDown": [Function],
|
||||
"openDialog": undefined,
|
||||
"openSidePanel": undefined,
|
||||
"provideFeedbackEmail": [Function],
|
||||
"queriesClient": QueriesClient {
|
||||
@@ -1267,10 +1261,8 @@ exports[`SettingsComponent renders 1`] = `
|
||||
}
|
||||
container={
|
||||
Explorer {
|
||||
"_addSynapseLinkDialogProps": [Function],
|
||||
"_closeModalDialog": [Function],
|
||||
"_closeSynapseLinkModalDialog": [Function],
|
||||
"_dialogProps": [Function],
|
||||
"_isAfecFeatureRegistered": [Function],
|
||||
"_isInitializingNotebooks": false,
|
||||
"_isSystemDatabasePredicate": [Function],
|
||||
@@ -1916,9 +1908,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"addDatabaseText": [Function],
|
||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"addTableEntityPane": AddTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -2025,6 +2014,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
},
|
||||
"clickHostedAccountSwitch": [Function],
|
||||
"clickHostedDirectorySwitch": [Function],
|
||||
"closeDialog": undefined,
|
||||
"closeSidePanel": undefined,
|
||||
"collapsedResourceTreeWidth": 36,
|
||||
"collectionCreationDefaults": Object {
|
||||
@@ -2080,9 +2070,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"deleteDatabaseText": [Function],
|
||||
"dialogComponentAdapter": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"editTableEntityPane": EditTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -2243,6 +2230,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"onRefreshResourcesClick": [Function],
|
||||
"onSwitchToConnectionString": [Function],
|
||||
"onToggleKeyDown": [Function],
|
||||
"openDialog": undefined,
|
||||
"openSidePanel": undefined,
|
||||
"provideFeedbackEmail": [Function],
|
||||
"queriesClient": QueriesClient {
|
||||
@@ -2519,10 +2507,8 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"changeFeedPolicy": [Function],
|
||||
"conflictResolutionPolicy": [Function],
|
||||
"container": Explorer {
|
||||
"_addSynapseLinkDialogProps": [Function],
|
||||
"_closeModalDialog": [Function],
|
||||
"_closeSynapseLinkModalDialog": [Function],
|
||||
"_dialogProps": [Function],
|
||||
"_isAfecFeatureRegistered": [Function],
|
||||
"_isInitializingNotebooks": false,
|
||||
"_isSystemDatabasePredicate": [Function],
|
||||
@@ -3168,9 +3154,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"addDatabaseText": [Function],
|
||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"addTableEntityPane": AddTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -3277,6 +3260,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
},
|
||||
"clickHostedAccountSwitch": [Function],
|
||||
"clickHostedDirectorySwitch": [Function],
|
||||
"closeDialog": undefined,
|
||||
"closeSidePanel": undefined,
|
||||
"collapsedResourceTreeWidth": 36,
|
||||
"collectionCreationDefaults": Object {
|
||||
@@ -3332,9 +3316,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"deleteDatabaseText": [Function],
|
||||
"dialogComponentAdapter": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"editTableEntityPane": EditTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -3495,6 +3476,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"onRefreshResourcesClick": [Function],
|
||||
"onSwitchToConnectionString": [Function],
|
||||
"onToggleKeyDown": [Function],
|
||||
"openDialog": undefined,
|
||||
"openSidePanel": undefined,
|
||||
"provideFeedbackEmail": [Function],
|
||||
"queriesClient": QueriesClient {
|
||||
@@ -3758,10 +3740,8 @@ exports[`SettingsComponent renders 1`] = `
|
||||
}
|
||||
container={
|
||||
Explorer {
|
||||
"_addSynapseLinkDialogProps": [Function],
|
||||
"_closeModalDialog": [Function],
|
||||
"_closeSynapseLinkModalDialog": [Function],
|
||||
"_dialogProps": [Function],
|
||||
"_isAfecFeatureRegistered": [Function],
|
||||
"_isInitializingNotebooks": false,
|
||||
"_isSystemDatabasePredicate": [Function],
|
||||
@@ -4407,9 +4387,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"addDatabaseText": [Function],
|
||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"addTableEntityPane": AddTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -4516,6 +4493,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
},
|
||||
"clickHostedAccountSwitch": [Function],
|
||||
"clickHostedDirectorySwitch": [Function],
|
||||
"closeDialog": undefined,
|
||||
"closeSidePanel": undefined,
|
||||
"collapsedResourceTreeWidth": 36,
|
||||
"collectionCreationDefaults": Object {
|
||||
@@ -4571,9 +4549,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"visible": [Function],
|
||||
},
|
||||
"deleteDatabaseText": [Function],
|
||||
"dialogComponentAdapter": DialogComponentAdapter {
|
||||
"parameters": [Function],
|
||||
},
|
||||
"editTableEntityPane": EditTableEntityPane {
|
||||
"addButtonLabel": "Add Property",
|
||||
"attributeNameLabel": "Property Name",
|
||||
@@ -4734,6 +4709,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"onRefreshResourcesClick": [Function],
|
||||
"onSwitchToConnectionString": [Function],
|
||||
"onToggleKeyDown": [Function],
|
||||
"openDialog": undefined,
|
||||
"openSidePanel": undefined,
|
||||
"provideFeedbackEmail": [Function],
|
||||
"queriesClient": QueriesClient {
|
||||
|
||||
Reference in New Issue
Block a user