mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-12 15:37:27 +01:00
Merge branch 'master' into remove_explorer.defaultExperience
This commit is contained in:
Generated
+30486
-33
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -176,7 +176,7 @@
|
|||||||
"typescript": "4.2.4",
|
"typescript": "4.2.4",
|
||||||
"url-loader": "1.1.1",
|
"url-loader": "1.1.1",
|
||||||
"wait-on": "4.0.2",
|
"wait-on": "4.0.2",
|
||||||
"webpack": "4.43.0",
|
"webpack": "4.46.0",
|
||||||
"webpack-bundle-analyzer": "3.6.1",
|
"webpack-bundle-analyzer": "3.6.1",
|
||||||
"webpack-cli": "3.3.10",
|
"webpack-cli": "3.3.10",
|
||||||
"webpack-dev-server": "3.11.0"
|
"webpack-dev-server": "3.11.0"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export interface TableEntityProps {
|
|||||||
entityValuePlaceholder: string;
|
entityValuePlaceholder: string;
|
||||||
entityValue: string | Date;
|
entityValue: string | Date;
|
||||||
isEntityTypeDate: boolean;
|
isEntityTypeDate: boolean;
|
||||||
|
isEntityValueDisable?: boolean;
|
||||||
entityTimeValue: string;
|
entityTimeValue: string;
|
||||||
entityValueType: string;
|
entityValueType: string;
|
||||||
onEntityValueChange: (event: React.FormEvent<HTMLElement>, newInput?: string) => void;
|
onEntityValueChange: (event: React.FormEvent<HTMLElement>, newInput?: string) => void;
|
||||||
@@ -22,6 +23,7 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
|
|||||||
entityValueType,
|
entityValueType,
|
||||||
onEntityValueChange,
|
onEntityValueChange,
|
||||||
onSelectDate,
|
onSelectDate,
|
||||||
|
isEntityValueDisable,
|
||||||
onEntityTimeValueChange,
|
onEntityTimeValueChange,
|
||||||
}: TableEntityProps): JSX.Element => {
|
}: TableEntityProps): JSX.Element => {
|
||||||
if (isEntityTypeDate) {
|
if (isEntityTypeDate) {
|
||||||
@@ -33,6 +35,7 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
|
|||||||
value={entityValue && new Date(entityValue)}
|
value={entityValue && new Date(entityValue)}
|
||||||
ariaLabel={entityValuePlaceholder}
|
ariaLabel={entityValuePlaceholder}
|
||||||
onSelectDate={onSelectDate}
|
onSelectDate={onSelectDate}
|
||||||
|
disabled={isEntityValueDisable}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
label={entityValueLabel && entityValueLabel}
|
label={entityValueLabel && entityValueLabel}
|
||||||
@@ -41,6 +44,7 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
|
|||||||
type="time"
|
type="time"
|
||||||
value={entityTimeValue}
|
value={entityTimeValue}
|
||||||
onChange={onEntityTimeValueChange}
|
onChange={onEntityTimeValueChange}
|
||||||
|
disabled={isEntityValueDisable}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -52,6 +56,7 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
|
|||||||
className="addEntityTextField"
|
className="addEntityTextField"
|
||||||
id="entityValueId"
|
id="entityValueId"
|
||||||
autoFocus
|
autoFocus
|
||||||
|
disabled={isEntityValueDisable}
|
||||||
type={entityValueType}
|
type={entityValueType}
|
||||||
placeholder={entityValuePlaceholder}
|
placeholder={entityValuePlaceholder}
|
||||||
value={typeof entityValue === "string" && entityValue}
|
value={typeof entityValue === "string" && entityValue}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export interface TableEntityProps {
|
|||||||
options: { key: string; text: string }[];
|
options: { key: string; text: string }[];
|
||||||
isPropertyTypeDisable: boolean;
|
isPropertyTypeDisable: boolean;
|
||||||
entityTimeValue: string;
|
entityTimeValue: string;
|
||||||
|
isEntityValueDisable?: boolean;
|
||||||
onDeleteEntity?: () => void;
|
onDeleteEntity?: () => void;
|
||||||
onEditEntity?: () => void;
|
onEditEntity?: () => void;
|
||||||
onEntityPropertyChange: (event: React.FormEvent<HTMLElement>, newInput?: string) => void;
|
onEntityPropertyChange: (event: React.FormEvent<HTMLElement>, newInput?: string) => void;
|
||||||
@@ -55,6 +56,7 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
|
|||||||
isPropertyTypeDisable,
|
isPropertyTypeDisable,
|
||||||
isEntityTypeDate,
|
isEntityTypeDate,
|
||||||
entityTimeValue,
|
entityTimeValue,
|
||||||
|
isEntityValueDisable,
|
||||||
onEditEntity,
|
onEditEntity,
|
||||||
onDeleteEntity,
|
onDeleteEntity,
|
||||||
onEntityPropertyChange,
|
onEntityPropertyChange,
|
||||||
@@ -113,6 +115,7 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
|
|||||||
<EntityValue
|
<EntityValue
|
||||||
entityValueLabel={entityValueLabel}
|
entityValueLabel={entityValueLabel}
|
||||||
entityValueType={getEntityValueType()}
|
entityValueType={getEntityValueType()}
|
||||||
|
isEntityValueDisable={isEntityValueDisable}
|
||||||
entityValuePlaceholder={entityValuePlaceholder}
|
entityValuePlaceholder={entityValuePlaceholder}
|
||||||
entityValue={entityValue}
|
entityValue={entityValue}
|
||||||
isEntityTypeDate={isEntityTypeDate}
|
isEntityTypeDate={isEntityTypeDate}
|
||||||
@@ -121,10 +124,11 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
|
|||||||
onSelectDate={onSelectDate}
|
onSelectDate={onSelectDate}
|
||||||
onEntityTimeValueChange={onEntityTimeValueChange}
|
onEntityTimeValueChange={onEntityTimeValueChange}
|
||||||
/>
|
/>
|
||||||
<TooltipHost content="Edit property" id="editTooltip">
|
{!isEntityValueDisable && (
|
||||||
<Image {...imageProps} src={EditIcon} alt="editEntity" id="editEntity" onClick={onEditEntity} />
|
<TooltipHost content="Edit property" id="editTooltip">
|
||||||
</TooltipHost>
|
<Image {...imageProps} src={EditIcon} alt="editEntity" id="editEntity" onClick={onEditEntity} />
|
||||||
|
</TooltipHost>
|
||||||
|
)}
|
||||||
{isDeleteOptionVisible && userContext.apiType !== "Cassandra" && (
|
{isDeleteOptionVisible && userContext.apiType !== "Cassandra" && (
|
||||||
<TooltipHost content="Delete property" id="deleteTooltip">
|
<TooltipHost content="Delete property" id="deleteTooltip">
|
||||||
<Image {...imageProps} src={DeleteIcon} alt="delete entity" id="deleteEntity" onClick={onDeleteEntity} />
|
<Image {...imageProps} src={DeleteIcon} alt="delete entity" id="deleteEntity" onClick={onDeleteEntity} />
|
||||||
|
|||||||
@@ -20,51 +20,6 @@ describe("Component Registerer", () => {
|
|||||||
expect(ko.components.isRegistered("json-editor")).toBe(true);
|
expect(ko.components.isRegistered("json-editor")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should register documents-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("documents-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register stored-procedure-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("stored-procedure-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register trigger-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("trigger-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register user-defined-function-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("user-defined-function-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register settings-tab-v2 component", () => {
|
|
||||||
expect(ko.components.isRegistered("database-settings-tab-v2")).toBe(true);
|
|
||||||
expect(ko.components.isRegistered("collection-settings-tab-v2")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register query-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("query-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register tables-query-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("tables-query-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register graph-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("graph-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register notebookv2-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("notebookv2-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register terminal-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("terminal-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register mongo-shell-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("mongo-shell-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should registeradd-collection-pane component", () => {
|
it("should registeradd-collection-pane component", () => {
|
||||||
expect(ko.components.isRegistered("add-collection-pane")).toBe(true);
|
expect(ko.components.isRegistered("add-collection-pane")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,21 +8,6 @@ import { JsonEditorComponent } from "./Controls/JsonEditor/JsonEditorComponent";
|
|||||||
import { ThroughputInputComponentAutoPilotV3 } from "./Controls/ThroughputInput/ThroughputInputComponentAutoPilotV3";
|
import { ThroughputInputComponentAutoPilotV3 } from "./Controls/ThroughputInput/ThroughputInputComponentAutoPilotV3";
|
||||||
import { GraphStyleComponent } from "./Graph/GraphStyleComponent/GraphStyleComponent";
|
import { GraphStyleComponent } from "./Graph/GraphStyleComponent/GraphStyleComponent";
|
||||||
import * as PaneComponents from "./Panes/PaneComponents";
|
import * as PaneComponents from "./Panes/PaneComponents";
|
||||||
import ConflictsTab from "./Tabs/ConflictsTab";
|
|
||||||
import DocumentsTab from "./Tabs/DocumentsTab";
|
|
||||||
import GalleryTab from "./Tabs/GalleryTab";
|
|
||||||
import GraphTab from "./Tabs/GraphTab";
|
|
||||||
import MongoShellTab from "./Tabs/MongoShellTab";
|
|
||||||
import NotebookTabV2 from "./Tabs/NotebookV2Tab";
|
|
||||||
import NotebookViewerTab from "./Tabs/NotebookViewerTab";
|
|
||||||
import QueryTab from "./Tabs/QueryTab";
|
|
||||||
import QueryTablesTab from "./Tabs/QueryTablesTab";
|
|
||||||
import SchemaAnalyzerTab from "./Tabs/SchemaAnalyzerTab";
|
|
||||||
import { DatabaseSettingsTabV2, SettingsTabV2 } from "./Tabs/SettingsTabV2";
|
|
||||||
import StoredProcedureTab from "./Tabs/StoredProcedureTab";
|
|
||||||
import TerminalTab from "./Tabs/TerminalTab";
|
|
||||||
import TriggerTab from "./Tabs/TriggerTab";
|
|
||||||
import UserDefinedFunctionTab from "./Tabs/UserDefinedFunctionTab";
|
|
||||||
|
|
||||||
ko.components.register("input-typeahead", new InputTypeaheadComponent());
|
ko.components.register("input-typeahead", new InputTypeaheadComponent());
|
||||||
ko.components.register("error-display", new ErrorDisplayComponent());
|
ko.components.register("error-display", new ErrorDisplayComponent());
|
||||||
@@ -33,26 +18,6 @@ ko.components.register("diff-editor", new DiffEditorComponent());
|
|||||||
ko.components.register("dynamic-list", DynamicListComponent);
|
ko.components.register("dynamic-list", DynamicListComponent);
|
||||||
ko.components.register("throughput-input-autopilot-v3", ThroughputInputComponentAutoPilotV3);
|
ko.components.register("throughput-input-autopilot-v3", ThroughputInputComponentAutoPilotV3);
|
||||||
|
|
||||||
// Collection Tabs
|
|
||||||
[
|
|
||||||
DocumentsTab,
|
|
||||||
StoredProcedureTab,
|
|
||||||
TriggerTab,
|
|
||||||
UserDefinedFunctionTab,
|
|
||||||
SettingsTabV2,
|
|
||||||
QueryTab,
|
|
||||||
QueryTablesTab,
|
|
||||||
GraphTab,
|
|
||||||
MongoShellTab,
|
|
||||||
ConflictsTab,
|
|
||||||
NotebookTabV2,
|
|
||||||
TerminalTab,
|
|
||||||
GalleryTab,
|
|
||||||
NotebookViewerTab,
|
|
||||||
DatabaseSettingsTabV2,
|
|
||||||
SchemaAnalyzerTab,
|
|
||||||
].forEach(({ component: { name, template } }) => ko.components.register(name, { template }));
|
|
||||||
|
|
||||||
// Panes
|
// Panes
|
||||||
ko.components.register("add-database-pane", new PaneComponents.AddDatabasePaneComponent());
|
ko.components.register("add-database-pane", new PaneComponents.AddDatabasePaneComponent());
|
||||||
ko.components.register("add-collection-pane", new PaneComponents.AddCollectionPaneComponent());
|
ko.components.register("add-collection-pane", new PaneComponents.AddCollectionPaneComponent());
|
||||||
|
|||||||
@@ -177,40 +177,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -479,40 +445,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
@@ -805,40 +737,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -1107,40 +1005,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
@@ -1446,40 +1310,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -1748,40 +1578,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
@@ -2074,40 +1870,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -2376,40 +2138,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
|
|||||||
+46
-60
@@ -42,11 +42,13 @@ import * as ComponentRegisterer from "./ComponentRegisterer";
|
|||||||
import { ArcadiaWorkspaceItem } from "./Controls/Arcadia/ArcadiaMenuPicker";
|
import { ArcadiaWorkspaceItem } from "./Controls/Arcadia/ArcadiaMenuPicker";
|
||||||
import { CommandButtonComponentProps } from "./Controls/CommandButton/CommandButtonComponent";
|
import { CommandButtonComponentProps } from "./Controls/CommandButton/CommandButtonComponent";
|
||||||
import { DialogProps, TextFieldProps } from "./Controls/Dialog";
|
import { DialogProps, TextFieldProps } from "./Controls/Dialog";
|
||||||
import { GalleryTab } from "./Controls/NotebookGallery/GalleryViewerComponent";
|
import { GalleryTab as GalleryTabKind } from "./Controls/NotebookGallery/GalleryViewerComponent";
|
||||||
import { CommandBarComponentAdapter } from "./Menus/CommandBar/CommandBarComponentAdapter";
|
import { CommandBarComponentAdapter } from "./Menus/CommandBar/CommandBarComponentAdapter";
|
||||||
import { ConsoleData } from "./Menus/NotificationConsole/NotificationConsoleComponent";
|
import { ConsoleData } from "./Menus/NotificationConsole/NotificationConsoleComponent";
|
||||||
import * as FileSystemUtil from "./Notebook/FileSystemUtil";
|
import * as FileSystemUtil from "./Notebook/FileSystemUtil";
|
||||||
import { NotebookContentItem, NotebookContentItemType } from "./Notebook/NotebookContentItem";
|
import { NotebookContentItem, NotebookContentItemType } from "./Notebook/NotebookContentItem";
|
||||||
|
import type NotebookManager from "./Notebook/NotebookManager";
|
||||||
|
import type { NotebookPaneContent } from "./Notebook/NotebookManager";
|
||||||
import { NotebookUtil } from "./Notebook/NotebookUtil";
|
import { NotebookUtil } from "./Notebook/NotebookUtil";
|
||||||
import AddCollectionPane from "./Panes/AddCollectionPane";
|
import AddCollectionPane from "./Panes/AddCollectionPane";
|
||||||
import { AddCollectionPanel } from "./Panes/AddCollectionPanel";
|
import { AddCollectionPanel } from "./Panes/AddCollectionPanel";
|
||||||
@@ -64,16 +66,16 @@ import { SettingsPane } from "./Panes/SettingsPane/SettingsPane";
|
|||||||
import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel";
|
import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel";
|
||||||
import { StringInputPane } from "./Panes/StringInputPane";
|
import { StringInputPane } from "./Panes/StringInputPane";
|
||||||
import { AddTableEntityPanel } from "./Panes/Tables/AddTableEntityPanel";
|
import { AddTableEntityPanel } from "./Panes/Tables/AddTableEntityPanel";
|
||||||
import EditTableEntityPane from "./Panes/Tables/EditTableEntityPane";
|
import { EditTableEntityPanel } from "./Panes/Tables/EditTableEntityPanel";
|
||||||
import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel";
|
import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel";
|
||||||
import { UploadFilePane } from "./Panes/UploadFilePane/UploadFilePane";
|
import { UploadFilePane } from "./Panes/UploadFilePane/UploadFilePane";
|
||||||
import { UploadItemsPane } from "./Panes/UploadItemsPane/UploadItemsPane";
|
import { UploadItemsPane } from "./Panes/UploadItemsPane/UploadItemsPane";
|
||||||
import TableListViewModal from "./Tables/DataTable/TableEntityListViewModel";
|
import TableListViewModal from "./Tables/DataTable/TableEntityListViewModel";
|
||||||
import QueryViewModel from "./Tables/QueryBuilder/QueryViewModel";
|
import QueryViewModel from "./Tables/QueryBuilder/QueryViewModel";
|
||||||
import { CassandraAPIDataClient, TableDataClient, TablesAPIDataClient } from "./Tables/TableDataClient";
|
import { CassandraAPIDataClient, TableDataClient, TablesAPIDataClient } from "./Tables/TableDataClient";
|
||||||
|
import type { GalleryTabOptions } from "./Tabs/GalleryTab";
|
||||||
import NotebookV2Tab, { NotebookTabOptions } from "./Tabs/NotebookV2Tab";
|
import NotebookV2Tab, { NotebookTabOptions } from "./Tabs/NotebookV2Tab";
|
||||||
import QueryTablesTab from "./Tabs/QueryTablesTab";
|
import QueryTablesTab from "./Tabs/QueryTablesTab";
|
||||||
import TabsBase from "./Tabs/TabsBase";
|
|
||||||
import { TabsManager } from "./Tabs/TabsManager";
|
import { TabsManager } from "./Tabs/TabsManager";
|
||||||
import TerminalTab from "./Tabs/TerminalTab";
|
import TerminalTab from "./Tabs/TerminalTab";
|
||||||
import Database from "./Tree/Database";
|
import Database from "./Tree/Database";
|
||||||
@@ -161,15 +163,12 @@ export default class Explorer {
|
|||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
public isTabsContentExpanded: ko.Observable<boolean>;
|
public isTabsContentExpanded: ko.Observable<boolean>;
|
||||||
public galleryTab: any;
|
|
||||||
public notebookViewerTab: any;
|
|
||||||
public tabsManager: TabsManager;
|
public tabsManager: TabsManager;
|
||||||
|
|
||||||
// Contextual panes
|
// Contextual panes
|
||||||
public addDatabasePane: AddDatabasePane;
|
public addDatabasePane: AddDatabasePane;
|
||||||
public addCollectionPane: AddCollectionPane;
|
public addCollectionPane: AddCollectionPane;
|
||||||
public graphStylingPane: GraphStylingPane;
|
public graphStylingPane: GraphStylingPane;
|
||||||
public editTableEntityPane: EditTableEntityPane;
|
|
||||||
public cassandraAddCollectionPane: CassandraAddCollectionPane;
|
public cassandraAddCollectionPane: CassandraAddCollectionPane;
|
||||||
public stringInputPane: StringInputPane;
|
public stringInputPane: StringInputPane;
|
||||||
public gitHubReposPane: ContextualPaneBase;
|
public gitHubReposPane: ContextualPaneBase;
|
||||||
@@ -199,7 +198,7 @@ export default class Explorer {
|
|||||||
public hasStorageAnalyticsAfecFeature: ko.Observable<boolean>;
|
public hasStorageAnalyticsAfecFeature: ko.Observable<boolean>;
|
||||||
public isSynapseLinkUpdating: ko.Observable<boolean>;
|
public isSynapseLinkUpdating: ko.Observable<boolean>;
|
||||||
public memoryUsageInfo: ko.Observable<DataModels.MemoryUsageInfo>;
|
public memoryUsageInfo: ko.Observable<DataModels.MemoryUsageInfo>;
|
||||||
public notebookManager?: any; // This is dynamically loaded
|
public notebookManager?: NotebookManager;
|
||||||
public openDialog: ExplorerParams["openDialog"];
|
public openDialog: ExplorerParams["openDialog"];
|
||||||
public closeDialog: ExplorerParams["closeDialog"];
|
public closeDialog: ExplorerParams["closeDialog"];
|
||||||
|
|
||||||
@@ -494,13 +493,6 @@ export default class Explorer {
|
|||||||
container: this,
|
container: this,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.editTableEntityPane = new EditTableEntityPane({
|
|
||||||
id: "edittableentitypane",
|
|
||||||
visible: ko.observable<boolean>(false),
|
|
||||||
|
|
||||||
container: this,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cassandraAddCollectionPane = new CassandraAddCollectionPane({
|
this.cassandraAddCollectionPane = new CassandraAddCollectionPane({
|
||||||
id: "cassandraaddcollectionpane",
|
id: "cassandraaddcollectionpane",
|
||||||
visible: ko.observable<boolean>(false),
|
visible: ko.observable<boolean>(false),
|
||||||
@@ -527,7 +519,6 @@ export default class Explorer {
|
|||||||
this.addDatabasePane,
|
this.addDatabasePane,
|
||||||
this.addCollectionPane,
|
this.addCollectionPane,
|
||||||
this.graphStylingPane,
|
this.graphStylingPane,
|
||||||
this.editTableEntityPane,
|
|
||||||
this.cassandraAddCollectionPane,
|
this.cassandraAddCollectionPane,
|
||||||
this.stringInputPane,
|
this.stringInputPane,
|
||||||
];
|
];
|
||||||
@@ -598,7 +589,6 @@ export default class Explorer {
|
|||||||
this.addCollectionPane.collectionIdTitle("Table id");
|
this.addCollectionPane.collectionIdTitle("Table id");
|
||||||
this.addCollectionPane.collectionWithThroughputInSharedTitle("Provision dedicated throughput for this table");
|
this.addCollectionPane.collectionWithThroughputInSharedTitle("Provision dedicated throughput for this table");
|
||||||
this.refreshTreeTitle("Refresh tables");
|
this.refreshTreeTitle("Refresh tables");
|
||||||
this.editTableEntityPane.title("Edit Table Entity");
|
|
||||||
this.tableDataClient = new TablesAPIDataClient();
|
this.tableDataClient = new TablesAPIDataClient();
|
||||||
break;
|
break;
|
||||||
case "Cassandra":
|
case "Cassandra":
|
||||||
@@ -612,7 +602,6 @@ export default class Explorer {
|
|||||||
this.addCollectionPane.collectionIdTitle("Table id");
|
this.addCollectionPane.collectionIdTitle("Table id");
|
||||||
this.addCollectionPane.collectionWithThroughputInSharedTitle("Provision dedicated throughput for this table");
|
this.addCollectionPane.collectionWithThroughputInSharedTitle("Provision dedicated throughput for this table");
|
||||||
this.refreshTreeTitle("Refresh tables");
|
this.refreshTreeTitle("Refresh tables");
|
||||||
this.editTableEntityPane.title("Edit Table Row");
|
|
||||||
this.tableDataClient = new CassandraAPIDataClient();
|
this.tableDataClient = new CassandraAPIDataClient();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -630,10 +619,10 @@ export default class Explorer {
|
|||||||
this.isNotebookEnabled = ko.observable(false);
|
this.isNotebookEnabled = ko.observable(false);
|
||||||
this.isNotebookEnabled.subscribe(async () => {
|
this.isNotebookEnabled.subscribe(async () => {
|
||||||
if (!this.notebookManager) {
|
if (!this.notebookManager) {
|
||||||
const notebookManagerModule = await import(
|
const NotebookManager = await (
|
||||||
/* webpackChunkName: "NotebookManager" */ "./Notebook/NotebookManager"
|
await import(/* webpackChunkName: "NotebookManager" */ "./Notebook/NotebookManager")
|
||||||
);
|
).default;
|
||||||
this.notebookManager = new notebookManagerModule.default();
|
this.notebookManager = new NotebookManager();
|
||||||
this.notebookManager.initialize({
|
this.notebookManager.initialize({
|
||||||
container: this,
|
container: this,
|
||||||
notebookBasePath: this.notebookBasePath,
|
notebookBasePath: this.notebookBasePath,
|
||||||
@@ -1418,7 +1407,11 @@ export default class Explorer {
|
|||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async publishNotebook(name: string, content: string | unknown, parentDomElement?: HTMLElement): Promise<void> {
|
public async publishNotebook(
|
||||||
|
name: string,
|
||||||
|
content: NotebookPaneContent,
|
||||||
|
parentDomElement?: HTMLElement
|
||||||
|
): Promise<void> {
|
||||||
if (this.notebookManager) {
|
if (this.notebookManager) {
|
||||||
await this.notebookManager.openPublishNotebookPane(name, content, parentDomElement);
|
await this.notebookManager.openPublishNotebookPane(name, content, parentDomElement);
|
||||||
this.publishNotebookPaneAdapter = this.notebookManager.publishNotebookPaneAdapter;
|
this.publishNotebookPaneAdapter = this.notebookManager.publishNotebookPaneAdapter;
|
||||||
@@ -1916,86 +1909,66 @@ export default class Explorer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async openGallery(
|
public async openGallery(
|
||||||
selectedTab?: GalleryTab,
|
selectedTab?: GalleryTabKind,
|
||||||
notebookUrl?: string,
|
notebookUrl?: string,
|
||||||
galleryItem?: IGalleryItem,
|
galleryItem?: IGalleryItem,
|
||||||
isFavorite?: boolean
|
isFavorite?: boolean
|
||||||
) {
|
) {
|
||||||
let title: string = "Gallery";
|
const title = "Gallery";
|
||||||
let hashLocation: string = "gallery";
|
const hashLocation = "gallery";
|
||||||
|
const GalleryTab = await (await import(/* webpackChunkName: "GalleryTab" */ "./Tabs/GalleryTab")).default;
|
||||||
|
|
||||||
const galleryTabOptions: any = {
|
const galleryTabOptions: GalleryTabOptions = {
|
||||||
// GalleryTabOptions
|
|
||||||
account: userContext.databaseAccount,
|
account: userContext.databaseAccount,
|
||||||
container: this,
|
container: this,
|
||||||
junoClient: this.notebookManager?.junoClient,
|
junoClient: this.notebookManager?.junoClient,
|
||||||
selectedTab: selectedTab || GalleryTab.PublicGallery,
|
selectedTab: selectedTab || GalleryTabKind.PublicGallery,
|
||||||
notebookUrl,
|
notebookUrl,
|
||||||
galleryItem,
|
galleryItem,
|
||||||
isFavorite,
|
isFavorite,
|
||||||
// TabOptions
|
|
||||||
tabKind: ViewModels.CollectionTabKind.Gallery,
|
tabKind: ViewModels.CollectionTabKind.Gallery,
|
||||||
title: title,
|
title: title,
|
||||||
tabPath: title,
|
tabPath: title,
|
||||||
documentClientUtility: null,
|
|
||||||
isActive: ko.observable(false),
|
|
||||||
hashLocation: hashLocation,
|
hashLocation: hashLocation,
|
||||||
onUpdateTabsButtons: this.onUpdateTabsButtons,
|
onUpdateTabsButtons: this.onUpdateTabsButtons,
|
||||||
isTabsContentExpanded: ko.observable(true),
|
isTabsContentExpanded: ko.observable(true),
|
||||||
onLoadStartKey: null,
|
onLoadStartKey: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const galleryTabs = this.tabsManager.getTabs(
|
const galleryTab = this.tabsManager
|
||||||
ViewModels.CollectionTabKind.Gallery,
|
.getTabs(ViewModels.CollectionTabKind.Gallery)
|
||||||
(tab) => tab.hashLocation() == hashLocation
|
.find((tab) => tab.hashLocation() == hashLocation);
|
||||||
);
|
|
||||||
let galleryTab = galleryTabs && galleryTabs[0];
|
|
||||||
|
|
||||||
if (galleryTab) {
|
if (galleryTab instanceof GalleryTab) {
|
||||||
this.tabsManager.activateTab(galleryTab);
|
this.tabsManager.activateTab(galleryTab);
|
||||||
(galleryTab as any).reset(galleryTabOptions);
|
galleryTab.reset(galleryTabOptions);
|
||||||
} else {
|
} else {
|
||||||
if (!this.galleryTab) {
|
this.tabsManager.activateNewTab(new GalleryTab(galleryTabOptions));
|
||||||
this.galleryTab = await import(/* webpackChunkName: "GalleryTab" */ "./Tabs/GalleryTab");
|
|
||||||
}
|
|
||||||
const newTab = new this.galleryTab.default(galleryTabOptions);
|
|
||||||
this.tabsManager.activateNewTab(newTab);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async openNotebookViewer(notebookUrl: string) {
|
public async openNotebookViewer(notebookUrl: string) {
|
||||||
const title = path.basename(notebookUrl);
|
const title = path.basename(notebookUrl);
|
||||||
const hashLocation = notebookUrl;
|
const hashLocation = notebookUrl;
|
||||||
|
const NotebookViewerTab = await (
|
||||||
|
await import(/* webpackChunkName: "NotebookViewerTab" */ "./Tabs/NotebookViewerTab")
|
||||||
|
).default;
|
||||||
|
|
||||||
if (!this.notebookViewerTab) {
|
const notebookViewerTab = this.tabsManager.getTabs(ViewModels.CollectionTabKind.NotebookV2).find((tab) => {
|
||||||
this.notebookViewerTab = await import(/* webpackChunkName: "NotebookViewerTab" */ "./Tabs/NotebookViewerTab");
|
return tab.hashLocation() == hashLocation && tab instanceof NotebookViewerTab && tab.notebookUrl === notebookUrl;
|
||||||
}
|
|
||||||
|
|
||||||
const notebookViewerTabModule = this.notebookViewerTab;
|
|
||||||
|
|
||||||
let isNotebookViewerOpen = (tab: TabsBase) => {
|
|
||||||
const notebookViewerTab = tab as typeof notebookViewerTabModule.default;
|
|
||||||
return notebookViewerTab.notebookUrl === notebookUrl;
|
|
||||||
};
|
|
||||||
|
|
||||||
const notebookViewerTabs = this.tabsManager.getTabs(ViewModels.CollectionTabKind.NotebookV2, (tab) => {
|
|
||||||
return tab.hashLocation() == hashLocation && isNotebookViewerOpen(tab);
|
|
||||||
});
|
});
|
||||||
let notebookViewerTab = notebookViewerTabs && notebookViewerTabs[0];
|
|
||||||
|
|
||||||
if (notebookViewerTab) {
|
if (notebookViewerTab) {
|
||||||
this.tabsManager.activateNewTab(notebookViewerTab);
|
this.tabsManager.activateNewTab(notebookViewerTab);
|
||||||
} else {
|
} else {
|
||||||
notebookViewerTab = new this.notebookViewerTab.default({
|
const notebookViewerTab = new NotebookViewerTab({
|
||||||
account: userContext.databaseAccount,
|
account: userContext.databaseAccount,
|
||||||
tabKind: ViewModels.CollectionTabKind.NotebookViewer,
|
tabKind: ViewModels.CollectionTabKind.NotebookViewer,
|
||||||
node: null,
|
node: null,
|
||||||
title: title,
|
title: title,
|
||||||
tabPath: title,
|
tabPath: title,
|
||||||
documentClientUtility: null,
|
|
||||||
collection: null,
|
collection: null,
|
||||||
hashLocation: hashLocation,
|
hashLocation: hashLocation,
|
||||||
isActive: ko.observable(false),
|
|
||||||
isTabsContentExpanded: ko.observable(true),
|
isTabsContentExpanded: ko.observable(true),
|
||||||
onLoadStartKey: null,
|
onLoadStartKey: null,
|
||||||
onUpdateTabsButtons: this.onUpdateTabsButtons,
|
onUpdateTabsButtons: this.onUpdateTabsButtons,
|
||||||
@@ -2221,6 +2194,19 @@ export default class Explorer {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public openEditTableEntityPanel(queryTablesTab: QueryTablesTab, tableEntityListViewModel: TableListViewModal): void {
|
||||||
|
this.openSidePanel(
|
||||||
|
"Edit Table Entity",
|
||||||
|
<EditTableEntityPanel
|
||||||
|
explorer={this}
|
||||||
|
closePanel={this.closeSidePanel}
|
||||||
|
queryTablesTab={queryTablesTab}
|
||||||
|
tableEntityListViewModel={tableEntityListViewModel}
|
||||||
|
cassandraApiClient={new CassandraAPIDataClient()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public openTableSelectQueryPanel(queryViewModal: QueryViewModel): void {
|
public openTableSelectQueryPanel(queryViewModal: QueryViewModel): void {
|
||||||
this.openSidePanel(
|
this.openSidePanel(
|
||||||
"Select Column",
|
"Select Column",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
* Contains all notebook related stuff meant to be dynamically loaded by explorer
|
* Contains all notebook related stuff meant to be dynamically loaded by explorer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ImmutableNotebook } from "@nteract/commutable";
|
import type { ImmutableNotebook } from "@nteract/commutable";
|
||||||
import { IContentProvider } from "@nteract/core";
|
import type { IContentProvider } from "@nteract/core";
|
||||||
import ko from "knockout";
|
import ko from "knockout";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { contents } from "rx-jupyter";
|
import { contents } from "rx-jupyter";
|
||||||
@@ -28,6 +28,10 @@ import { NotebookContentProvider } from "./NotebookComponent/NotebookContentProv
|
|||||||
import { NotebookContainerClient } from "./NotebookContainerClient";
|
import { NotebookContainerClient } from "./NotebookContainerClient";
|
||||||
import { NotebookContentClient } from "./NotebookContentClient";
|
import { NotebookContentClient } from "./NotebookContentClient";
|
||||||
|
|
||||||
|
type NotebookPaneContent = string | ImmutableNotebook;
|
||||||
|
|
||||||
|
export type { NotebookPaneContent };
|
||||||
|
|
||||||
export interface NotebookManagerOptions {
|
export interface NotebookManagerOptions {
|
||||||
container: Explorer;
|
container: Explorer;
|
||||||
notebookBasePath: ko.Observable<string>;
|
notebookBasePath: ko.Observable<string>;
|
||||||
@@ -116,7 +120,7 @@ export default class NotebookManager {
|
|||||||
|
|
||||||
public async openPublishNotebookPane(
|
public async openPublishNotebookPane(
|
||||||
name: string,
|
name: string,
|
||||||
content: string | ImmutableNotebook,
|
content: NotebookPaneContent,
|
||||||
parentDomElement: HTMLElement
|
parentDomElement: HTMLElement
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await this.publishNotebookPaneAdapter.open(name, getFullName(), content, parentDomElement);
|
await this.publishNotebookPaneAdapter.open(name, getFullName(), content, parentDomElement);
|
||||||
|
|||||||
@@ -153,40 +153,6 @@ exports[`Settings Pane should render Default properly 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -455,40 +421,6 @@ exports[`Settings Pane should render Default properly 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
@@ -904,40 +836,6 @@ exports[`Settings Pane should render Gremlin properly 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -1206,40 +1104,6 @@ exports[`Settings Pane should render Gremlin properly 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import { mount } from "enzyme";
|
||||||
|
import * as ko from "knockout";
|
||||||
|
import React from "react";
|
||||||
|
import Explorer from "../../Explorer";
|
||||||
|
import TableListViewModal from "../../Tables/DataTable/TableEntityListViewModel";
|
||||||
|
import * as Entities from "../../Tables/Entities";
|
||||||
|
import { CassandraAPIDataClient } from "../../Tables/TableDataClient";
|
||||||
|
import QueryTablesTab from "../../Tabs/QueryTablesTab";
|
||||||
|
import { EditTableEntityPanel } from "./EditTableEntityPanel";
|
||||||
|
|
||||||
|
describe("Excute Edit Table Entity Pane", () => {
|
||||||
|
const fakeExplorer = {} as Explorer;
|
||||||
|
const fakeQueryTablesTab = {} as QueryTablesTab;
|
||||||
|
const fakeTableEntityListViewModel = {} as TableListViewModal;
|
||||||
|
fakeTableEntityListViewModel.items = ko.observableArray<Entities.ITableEntity>();
|
||||||
|
const fakeCassandraApiClient = {} as CassandraAPIDataClient;
|
||||||
|
fakeTableEntityListViewModel.headers = [];
|
||||||
|
fakeTableEntityListViewModel.selected = ko.observableArray<Entities.ITableEntity>([{}]);
|
||||||
|
|
||||||
|
const props = {
|
||||||
|
explorer: fakeExplorer,
|
||||||
|
closePanel: (): void => undefined,
|
||||||
|
queryTablesTab: fakeQueryTablesTab,
|
||||||
|
tableEntityListViewModel: fakeTableEntityListViewModel,
|
||||||
|
cassandraApiClient: fakeCassandraApiClient,
|
||||||
|
};
|
||||||
|
|
||||||
|
it("should render Default properly", () => {
|
||||||
|
const wrapper = mount(<EditTableEntityPanel {...props} />);
|
||||||
|
expect(wrapper).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("initially display 4 input field, 2 properties and 1 entity values", () => {
|
||||||
|
const wrapper = mount(<EditTableEntityPanel {...props} />);
|
||||||
|
expect(wrapper.find("input[type='text']")).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("add a new entity row", () => {
|
||||||
|
const wrapper = mount(<EditTableEntityPanel {...props} />);
|
||||||
|
wrapper.find(".addButtonEntiy").last().simulate("click");
|
||||||
|
expect(wrapper.find("input[type='text']")).toHaveLength(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("remove a entity field", () => {
|
||||||
|
const wrapper = mount(<EditTableEntityPanel {...props} />);
|
||||||
|
// Since default entity row doesn't have delete option, so added row then delete for test cases.
|
||||||
|
wrapper.find(".addButtonEntiy").last().simulate("click");
|
||||||
|
wrapper.find("#deleteEntity").last().simulate("click");
|
||||||
|
expect(wrapper.find("input[type='text']")).toHaveLength(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,419 @@
|
|||||||
|
import { useBoolean } from "@uifabric/react-hooks";
|
||||||
|
import {
|
||||||
|
IDropdownOption,
|
||||||
|
Image,
|
||||||
|
IPanelProps,
|
||||||
|
IRenderFunction,
|
||||||
|
Label,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
TextField,
|
||||||
|
} from "office-ui-fabric-react";
|
||||||
|
import React, { FunctionComponent, useEffect, useState } from "react";
|
||||||
|
import * as _ from "underscore";
|
||||||
|
import AddPropertyIcon from "../../../../images/Add-property.svg";
|
||||||
|
import RevertBackIcon from "../../../../images/RevertBack.svg";
|
||||||
|
import { TableEntity } from "../../../Common/TableEntity";
|
||||||
|
import { userContext } from "../../../UserContext";
|
||||||
|
import Explorer from "../../Explorer";
|
||||||
|
import * as TableConstants from "../../Tables/Constants";
|
||||||
|
import * as DataTableUtilities from "../../Tables/DataTable/DataTableUtilities";
|
||||||
|
import TableEntityListViewModel from "../../Tables/DataTable/TableEntityListViewModel";
|
||||||
|
import * as Entities from "../../Tables/Entities";
|
||||||
|
import { CassandraAPIDataClient } from "../../Tables/TableDataClient";
|
||||||
|
import * as TableEntityProcessor from "../../Tables/TableEntityProcessor";
|
||||||
|
import QueryTablesTab from "../../Tabs/QueryTablesTab";
|
||||||
|
import { PanelContainerComponent } from "../PanelContainerComponent";
|
||||||
|
import {
|
||||||
|
attributeNameLabel,
|
||||||
|
attributeValueLabel,
|
||||||
|
backImageProps,
|
||||||
|
cassandraOptions,
|
||||||
|
columnProps,
|
||||||
|
dataTypeLabel,
|
||||||
|
defaultStringPlaceHolder,
|
||||||
|
detailedHelp,
|
||||||
|
entityFromAttributes,
|
||||||
|
getAddButtonLabel,
|
||||||
|
getEntityValuePlaceholder,
|
||||||
|
getFormattedTime,
|
||||||
|
imageProps,
|
||||||
|
isValidEntities,
|
||||||
|
options,
|
||||||
|
} from "./Validators/EntityTableHelper";
|
||||||
|
|
||||||
|
interface EditTableEntityPanelProps {
|
||||||
|
explorer: Explorer;
|
||||||
|
closePanel: () => void;
|
||||||
|
queryTablesTab: QueryTablesTab;
|
||||||
|
tableEntityListViewModel: TableEntityListViewModel;
|
||||||
|
cassandraApiClient: CassandraAPIDataClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface EntityRowType {
|
||||||
|
property: string;
|
||||||
|
type: string;
|
||||||
|
value: string;
|
||||||
|
isPropertyTypeDisable: boolean;
|
||||||
|
isDeleteOptionVisible: boolean;
|
||||||
|
id: number;
|
||||||
|
entityValuePlaceholder: string;
|
||||||
|
isEntityTypeDate: boolean;
|
||||||
|
entityTimeValue?: string;
|
||||||
|
isEntityValueDisable?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const EditTableEntityPanel: FunctionComponent<EditTableEntityPanelProps> = ({
|
||||||
|
explorer,
|
||||||
|
closePanel,
|
||||||
|
queryTablesTab,
|
||||||
|
tableEntityListViewModel,
|
||||||
|
cassandraApiClient,
|
||||||
|
}: EditTableEntityPanelProps): JSX.Element => {
|
||||||
|
const [entities, setEntities] = useState<EntityRowType[]>([]);
|
||||||
|
const [selectedRow, setSelectedRow] = useState<number>(0);
|
||||||
|
const [entityAttributeValue, setEntityAttributeValue] = useState<string>("");
|
||||||
|
const [originalDocument, setOriginalDocument] = useState<Entities.ITableEntity>({});
|
||||||
|
const [entityAttributeProperty, setEntityAttributeProperty] = useState<string>("");
|
||||||
|
|
||||||
|
const [
|
||||||
|
isEntityValuePanelOpen,
|
||||||
|
{ setTrue: setIsEntityValuePanelTrue, setFalse: setIsEntityValuePanelFalse },
|
||||||
|
] = useBoolean(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
let originalDocument: { [key: string]: any } = {};
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const entityAttribute: any = tableEntityListViewModel.selected();
|
||||||
|
const entityFormattedAttribute = constructDisplayedAttributes(entityAttribute[0]);
|
||||||
|
setEntities(entityFormattedAttribute);
|
||||||
|
|
||||||
|
if (userContext.apiType === "Tables") {
|
||||||
|
originalDocument = TableEntityProcessor.convertEntitiesToDocuments(entityAttribute, queryTablesTab.collection)[0];
|
||||||
|
originalDocument.id = (): string => originalDocument.$id;
|
||||||
|
} else {
|
||||||
|
originalDocument = entityAttribute;
|
||||||
|
}
|
||||||
|
setOriginalDocument(originalDocument);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const constructDisplayedAttributes = (entity: Entities.ITableEntity): EntityRowType[] => {
|
||||||
|
const displayedAttributes: EntityRowType[] = [];
|
||||||
|
const keys = Object.keys(entity);
|
||||||
|
keys.length &&
|
||||||
|
keys.forEach((key: string) => {
|
||||||
|
if (
|
||||||
|
key !== TableEntityProcessor.keyProperties.attachments &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.etag &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.resourceId &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.self &&
|
||||||
|
(userContext.apiType !== "Cassandra" || key !== TableConstants.EntityKeyNames.RowKey)
|
||||||
|
) {
|
||||||
|
if (userContext.apiType === "Cassandra") {
|
||||||
|
const cassandraKeys = queryTablesTab.collection.cassandraKeys.partitionKeys
|
||||||
|
.concat(queryTablesTab.collection.cassandraKeys.clusteringKeys)
|
||||||
|
.map((key) => key.property);
|
||||||
|
const entityAttribute: Entities.ITableEntityAttribute = entity[key];
|
||||||
|
const entityAttributeType: string = entityAttribute.$;
|
||||||
|
const displayValue: string = getPropertyDisplayValue(entity, key, entityAttributeType);
|
||||||
|
const nonEditableType: boolean =
|
||||||
|
entityAttributeType === TableConstants.CassandraType.Blob ||
|
||||||
|
entityAttributeType === TableConstants.CassandraType.Inet;
|
||||||
|
const isDisable = !_.contains<string>(cassandraKeys, key) && !nonEditableType;
|
||||||
|
const time =
|
||||||
|
entityAttributeType === TableConstants.TableType.DateTime ? getFormattedTime(displayValue) : "";
|
||||||
|
displayedAttributes.push({
|
||||||
|
property: key,
|
||||||
|
type: entityAttributeType,
|
||||||
|
value: displayValue,
|
||||||
|
isPropertyTypeDisable: !nonEditableType,
|
||||||
|
isDeleteOptionVisible: isDisable,
|
||||||
|
id: displayedAttributes.length,
|
||||||
|
entityValuePlaceholder: defaultStringPlaceHolder,
|
||||||
|
isEntityTypeDate: entityAttributeType === "DateTime",
|
||||||
|
isEntityValueDisable: !isDisable,
|
||||||
|
entityTimeValue: time,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const entityAttribute: Entities.ITableEntityAttribute = entity[key];
|
||||||
|
const entityAttributeType: string = entityAttribute.$;
|
||||||
|
const displayValue: string = getPropertyDisplayValue(entity, key, entityAttributeType);
|
||||||
|
const editable: boolean = isAttributeEditable(key, entityAttributeType);
|
||||||
|
// As per VSO:189935, Binary properties are read-only, we still want to be able to remove them.
|
||||||
|
const removable: boolean = editable || entityAttributeType === TableConstants.TableType.Binary;
|
||||||
|
const time =
|
||||||
|
entityAttributeType === TableConstants.TableType.DateTime ? getFormattedTime(displayValue) : "";
|
||||||
|
displayedAttributes.push({
|
||||||
|
property: key,
|
||||||
|
type: entityAttributeType,
|
||||||
|
value: displayValue,
|
||||||
|
isPropertyTypeDisable: !editable,
|
||||||
|
isDeleteOptionVisible: removable,
|
||||||
|
id: displayedAttributes.length,
|
||||||
|
entityValuePlaceholder: defaultStringPlaceHolder,
|
||||||
|
isEntityTypeDate: entityAttributeType === "DateTime",
|
||||||
|
isEntityValueDisable: !editable,
|
||||||
|
entityTimeValue: time,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return displayedAttributes;
|
||||||
|
};
|
||||||
|
|
||||||
|
const isAttributeEditable = (attributeName: string, entityAttributeType: string) => {
|
||||||
|
return !(
|
||||||
|
attributeName === TableConstants.EntityKeyNames.PartitionKey ||
|
||||||
|
attributeName === TableConstants.EntityKeyNames.RowKey ||
|
||||||
|
attributeName === TableConstants.EntityKeyNames.Timestamp ||
|
||||||
|
// As per VSO:189935, Making Binary properties read-only in Edit Entity dialog until we have a full story for it.
|
||||||
|
entityAttributeType === TableConstants.TableType.Binary
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPropertyDisplayValue = (entity: Entities.ITableEntity, name: string, type: string): string => {
|
||||||
|
const attribute: Entities.ITableEntityAttribute = entity[name];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
let displayValue: any = attribute._;
|
||||||
|
const isBinary: boolean = type === TableConstants.TableType.Binary;
|
||||||
|
|
||||||
|
// Showing the value in base64 for binary properties since that is what the Azure Storage Client Library expects.
|
||||||
|
// This means that, even if the Azure Storage API returns a byte[] of binary content, it needs that same array
|
||||||
|
// *base64 - encoded * as the value for the updated property or the whole update operation will fail.
|
||||||
|
if (isBinary && displayValue && $.isArray(displayValue.data)) {
|
||||||
|
const bytes: number[] = displayValue.data;
|
||||||
|
displayValue = getBase64DisplayValue(bytes);
|
||||||
|
}
|
||||||
|
return displayValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getBase64DisplayValue = (bytes: number[]): string => {
|
||||||
|
let displayValue = "";
|
||||||
|
try {
|
||||||
|
const chars: string[] = bytes.map((byte: number) => String.fromCharCode(byte));
|
||||||
|
const toEncode: string = chars.join("");
|
||||||
|
displayValue = window.btoa(toEncode);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
return displayValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
const submit = async (event: React.FormEvent<HTMLInputElement>): Promise<void> => {
|
||||||
|
if (!isValidEntities(entities)) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
const entity: Entities.ITableEntity = entityFromAttributes(entities);
|
||||||
|
const tableDataClient = userContext.apiType === "Cassandra" ? cassandraApiClient : explorer.tableDataClient;
|
||||||
|
const originalDocumentData = userContext.apiType === "Cassandra" ? originalDocument[0] : originalDocument;
|
||||||
|
const newEntity: Entities.ITableEntity = await tableDataClient.updateDocument(
|
||||||
|
queryTablesTab.collection,
|
||||||
|
originalDocumentData,
|
||||||
|
entity
|
||||||
|
);
|
||||||
|
await tableEntityListViewModel.updateCachedEntity(newEntity);
|
||||||
|
if (!tryInsertNewHeaders(tableEntityListViewModel, newEntity)) {
|
||||||
|
tableEntityListViewModel.redrawTableThrottled();
|
||||||
|
}
|
||||||
|
tableEntityListViewModel.selected.removeAll();
|
||||||
|
tableEntityListViewModel.selected.push(newEntity);
|
||||||
|
closePanel();
|
||||||
|
};
|
||||||
|
|
||||||
|
const tryInsertNewHeaders = (viewModel: TableEntityListViewModel, newEntity: Entities.ITableEntity): boolean => {
|
||||||
|
let newHeaders: string[] = [];
|
||||||
|
const keys = Object.keys(newEntity);
|
||||||
|
keys &&
|
||||||
|
keys.forEach((key: string) => {
|
||||||
|
if (
|
||||||
|
!_.contains(viewModel.headers, key) &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.attachments &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.etag &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.resourceId &&
|
||||||
|
key !== TableEntityProcessor.keyProperties.self &&
|
||||||
|
(!(userContext.apiType === "Cassandra") || key !== TableConstants.EntityKeyNames.RowKey)
|
||||||
|
) {
|
||||||
|
newHeaders.push(key);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let newHeadersInserted = false;
|
||||||
|
if (newHeaders.length) {
|
||||||
|
if (!DataTableUtilities.checkForDefaultHeader(viewModel.headers)) {
|
||||||
|
newHeaders = viewModel.headers.concat(newHeaders);
|
||||||
|
}
|
||||||
|
viewModel.updateHeaders(newHeaders, /* notifyColumnChanges */ true, /* enablePrompt */ false);
|
||||||
|
newHeadersInserted = true;
|
||||||
|
}
|
||||||
|
return newHeadersInserted;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add new entity row
|
||||||
|
const addNewEntity = (): void => {
|
||||||
|
const cloneEntities = [...entities];
|
||||||
|
cloneEntities.splice(cloneEntities.length, 0, {
|
||||||
|
property: "",
|
||||||
|
type: TableConstants.TableType.String,
|
||||||
|
value: "",
|
||||||
|
isPropertyTypeDisable: false,
|
||||||
|
isDeleteOptionVisible: true,
|
||||||
|
id: cloneEntities.length + 1,
|
||||||
|
entityValuePlaceholder: "",
|
||||||
|
isEntityTypeDate: false,
|
||||||
|
});
|
||||||
|
setEntities(cloneEntities);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Delete entity row
|
||||||
|
const deleteEntityAtIndex = (indexToRemove: number): void => {
|
||||||
|
const cloneEntities = [...entities];
|
||||||
|
cloneEntities.splice(indexToRemove, 1);
|
||||||
|
setEntities(cloneEntities);
|
||||||
|
};
|
||||||
|
|
||||||
|
// handle Entity change
|
||||||
|
const entityChange = (value: string | Date, indexOfInput: number, key: string): void => {
|
||||||
|
const cloneEntities = [...entities];
|
||||||
|
if (key === "property") {
|
||||||
|
cloneEntities[indexOfInput].property = value.toString();
|
||||||
|
} else if (key === "time") {
|
||||||
|
cloneEntities[indexOfInput].entityTimeValue = value.toString();
|
||||||
|
} else {
|
||||||
|
cloneEntities[indexOfInput].value = value.toString();
|
||||||
|
}
|
||||||
|
setEntities(cloneEntities);
|
||||||
|
};
|
||||||
|
|
||||||
|
// handle Entity type
|
||||||
|
const entityTypeChange = (
|
||||||
|
_event: React.FormEvent<HTMLDivElement>,
|
||||||
|
selectedType: IDropdownOption,
|
||||||
|
indexOfEntity: number
|
||||||
|
): void => {
|
||||||
|
const entityValuePlaceholder = getEntityValuePlaceholder(selectedType.key);
|
||||||
|
const cloneEntities = [...entities];
|
||||||
|
cloneEntities[indexOfEntity].type = selectedType.key.toString();
|
||||||
|
cloneEntities[indexOfEntity].entityValuePlaceholder = entityValuePlaceholder;
|
||||||
|
cloneEntities[indexOfEntity].isEntityTypeDate = selectedType.key === TableConstants.TableType.DateTime;
|
||||||
|
setEntities(cloneEntities);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Open edit entity value modal
|
||||||
|
const editEntity = (rowEndex: number): void => {
|
||||||
|
const entityAttribute: EntityRowType = entities[rowEndex] && entities[rowEndex];
|
||||||
|
setEntityAttributeValue(entityAttribute.value);
|
||||||
|
setEntityAttributeProperty(entityAttribute.property);
|
||||||
|
setSelectedRow(rowEndex);
|
||||||
|
setIsEntityValuePanelTrue();
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderPanelContent = (): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<form className="panelFormWrapper">
|
||||||
|
<div className="panelFormWrapper">
|
||||||
|
<div className="panelMainContent">
|
||||||
|
{entities.map((entity, index) => {
|
||||||
|
return (
|
||||||
|
<TableEntity
|
||||||
|
key={"" + entity.id + index}
|
||||||
|
isDeleteOptionVisible={entity.isDeleteOptionVisible}
|
||||||
|
entityTypeLabel={index === 0 && dataTypeLabel}
|
||||||
|
entityPropertyLabel={index === 0 && attributeNameLabel}
|
||||||
|
entityValueLabel={index === 0 && attributeValueLabel}
|
||||||
|
options={userContext.apiType === "Cassandra" ? cassandraOptions : options}
|
||||||
|
isPropertyTypeDisable={entity.isPropertyTypeDisable}
|
||||||
|
entityProperty={entity.property}
|
||||||
|
selectedKey={entity.type}
|
||||||
|
entityPropertyPlaceHolder={detailedHelp}
|
||||||
|
entityValuePlaceholder={entity.entityValuePlaceholder}
|
||||||
|
entityValue={entity.value}
|
||||||
|
isEntityTypeDate={entity.isEntityTypeDate}
|
||||||
|
entityTimeValue={entity.entityTimeValue}
|
||||||
|
isEntityValueDisable={entity.isEntityValueDisable}
|
||||||
|
onEditEntity={() => editEntity(index)}
|
||||||
|
onSelectDate={(date: Date) => {
|
||||||
|
entityChange(date, index, "value");
|
||||||
|
}}
|
||||||
|
onDeleteEntity={() => deleteEntityAtIndex(index)}
|
||||||
|
onEntityPropertyChange={(event, newInput?: string) => {
|
||||||
|
entityChange(newInput, index, "property");
|
||||||
|
}}
|
||||||
|
onEntityTypeChange={(event: React.FormEvent<HTMLDivElement>, selectedParam: IDropdownOption) => {
|
||||||
|
entityTypeChange(event, selectedParam, index);
|
||||||
|
}}
|
||||||
|
onEntityValueChange={(event, newInput?: string) => {
|
||||||
|
entityChange(newInput, index, "value");
|
||||||
|
}}
|
||||||
|
onEntityTimeValueChange={(event, newInput?: string) => {
|
||||||
|
entityChange(newInput, index, "time");
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
{userContext.apiType !== "Cassandra" && (
|
||||||
|
<Stack horizontal onClick={addNewEntity} className="addButtonEntiy">
|
||||||
|
<Image {...imageProps} src={AddPropertyIcon} alt="Add Entity" />
|
||||||
|
<Text className="addNewParamStyle">{getAddButtonLabel(userContext.apiType)}</Text>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{renderPanelFooter()}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderPanelFooter = (): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<div className="paneFooter">
|
||||||
|
<div className="leftpanel-okbut">
|
||||||
|
<input type="submit" onClick={submit} className="genericPaneSubmitBtn" value="Update Entity" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onRenderNavigationContent: IRenderFunction<IPanelProps> = () => (
|
||||||
|
<Stack horizontal {...columnProps}>
|
||||||
|
<Image {...backImageProps} src={RevertBackIcon} alt="back" onClick={() => setIsEntityValuePanelFalse()} />
|
||||||
|
<Label>{entityAttributeProperty}</Label>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
if (isEntityValuePanelOpen) {
|
||||||
|
return (
|
||||||
|
<PanelContainerComponent
|
||||||
|
headerText=""
|
||||||
|
onRenderNavigationContent={onRenderNavigationContent}
|
||||||
|
panelWidth="700px"
|
||||||
|
isOpen={true}
|
||||||
|
panelContent={
|
||||||
|
<TextField
|
||||||
|
multiline
|
||||||
|
rows={5}
|
||||||
|
className="entityValueTextField"
|
||||||
|
value={entityAttributeValue}
|
||||||
|
onChange={(event, newInput?: string) => {
|
||||||
|
setEntityAttributeValue(newInput);
|
||||||
|
entityChange(newInput, selectedRow, "value");
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
closePanel={() => closePanel()}
|
||||||
|
isConsoleExpanded={false}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PanelContainerComponent
|
||||||
|
headerText="Edit Table Entity"
|
||||||
|
panelWidth="700px"
|
||||||
|
isOpen={true}
|
||||||
|
panelContent={renderPanelContent()}
|
||||||
|
closePanel={() => closePanel()}
|
||||||
|
isConsoleExpanded={false}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -5,28 +5,6 @@ import * as Entities from "../../../Tables/Entities";
|
|||||||
import * as Utilities from "../../../Tables/Utilities";
|
import * as Utilities from "../../../Tables/Utilities";
|
||||||
|
|
||||||
export const defaultStringPlaceHolder = "Enter identifier value.";
|
export const defaultStringPlaceHolder = "Enter identifier value.";
|
||||||
export const defaultEntities = [
|
|
||||||
{
|
|
||||||
property: "PartitionKey",
|
|
||||||
type: "String",
|
|
||||||
value: "",
|
|
||||||
isPropertyTypeDisable: true,
|
|
||||||
isDeleteOptionVisible: false,
|
|
||||||
id: 1,
|
|
||||||
entityValuePlaceholder: defaultStringPlaceHolder,
|
|
||||||
isEntityTypeDate: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: "RowKey",
|
|
||||||
type: "String",
|
|
||||||
value: "",
|
|
||||||
isPropertyTypeDisable: true,
|
|
||||||
isDeleteOptionVisible: false,
|
|
||||||
id: 2,
|
|
||||||
entityValuePlaceholder: defaultStringPlaceHolder,
|
|
||||||
isEntityTypeDate: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// Dropdown options
|
// Dropdown options
|
||||||
const { String, Boolean, Binary, DateTime, Double, Guid, Int32, Int64 } = TableConstants.TableType;
|
const { String, Boolean, Binary, DateTime, Double, Guid, Int32, Int64 } = TableConstants.TableType;
|
||||||
@@ -133,20 +111,21 @@ export const entityFromAttributes = (entities: EntityRowType[]): Entities.ITable
|
|||||||
|
|
||||||
// GetPlaceholder according to entity type
|
// GetPlaceholder according to entity type
|
||||||
export const getEntityValuePlaceholder = (entityType: string | number): string => {
|
export const getEntityValuePlaceholder = (entityType: string | number): string => {
|
||||||
|
const { String, Boolean, DateTime, Double, Guid, Int32, Int64 } = TableConstants.TableType;
|
||||||
switch (entityType) {
|
switch (entityType) {
|
||||||
case "String":
|
case String:
|
||||||
return stringPlaceholder;
|
return stringPlaceholder;
|
||||||
case "Boolean":
|
case Boolean:
|
||||||
return booleanPlaceHolder;
|
return booleanPlaceHolder;
|
||||||
case "DateTime":
|
case DateTime:
|
||||||
return datePlaceholder;
|
return datePlaceholder;
|
||||||
case "Double":
|
case Double:
|
||||||
return doublePlaceholder;
|
return doublePlaceholder;
|
||||||
case "Guid":
|
case Guid:
|
||||||
return guidPlaceholder;
|
return guidPlaceholder;
|
||||||
case "Int32":
|
case Int32:
|
||||||
return intPlaceholder;
|
return intPlaceholder;
|
||||||
case "Int64":
|
case Int64:
|
||||||
return int64Placeholder;
|
return int64Placeholder;
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
@@ -164,13 +143,13 @@ export const isValidEntities = (entities: EntityRowType[]): boolean => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isEntityPropertyTypeDisable = (header: string): boolean => {
|
const isEntityPropertyTypeDisable = (header: string): boolean => {
|
||||||
if (header === "PartitionKey" || header === "RowKey") {
|
if (header === TableConstants.EntityKeyNames.PartitionKey || header === TableConstants.EntityKeyNames.RowKey) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDefaultEntities = (headers: string[], entityTypes: { [key: string]: string }): EntityRowType[] => {
|
export const getDefaultEntities = (headers: string[], entityTypes: EntityType): EntityRowType[] => {
|
||||||
const defaultEntities: EntityRowType[] = [];
|
const defaultEntities: EntityRowType[] = [];
|
||||||
headers.forEach((header: string) => {
|
headers.forEach((header: string) => {
|
||||||
if (header !== "Timestamp") {
|
if (header !== "Timestamp") {
|
||||||
@@ -183,7 +162,7 @@ export const getDefaultEntities = (headers: string[], entityTypes: { [key: strin
|
|||||||
isDeleteOptionVisible: !isEntityPropertyTypeDisable(header),
|
isDeleteOptionVisible: !isEntityPropertyTypeDisable(header),
|
||||||
id: 1,
|
id: 1,
|
||||||
entityValuePlaceholder: defaultStringPlaceHolder,
|
entityValuePlaceholder: defaultStringPlaceHolder,
|
||||||
isEntityTypeDate: entityType === "DateTime",
|
isEntityTypeDate: entityType === TableConstants.TableType.DateTime,
|
||||||
};
|
};
|
||||||
defaultEntities.push(entityRow);
|
defaultEntities.push(entityRow);
|
||||||
}
|
}
|
||||||
@@ -212,6 +191,13 @@ export const getButtonLabel = (apiType: string): string => {
|
|||||||
return "Add Entity";
|
return "Add Entity";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getFormattedTime = (displayValue: string): string => {
|
||||||
|
const date = new Date(displayValue);
|
||||||
|
const minutes = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes();
|
||||||
|
const hours = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours();
|
||||||
|
return `${hours}:${minutes}`;
|
||||||
|
};
|
||||||
|
|
||||||
export const getCassandraDefaultEntities = (
|
export const getCassandraDefaultEntities = (
|
||||||
headers: string[],
|
headers: string[],
|
||||||
entityTypes: { [key: string]: string }
|
entityTypes: { [key: string]: string }
|
||||||
@@ -244,4 +230,9 @@ export interface EntityRowType {
|
|||||||
entityValuePlaceholder: string;
|
entityValuePlaceholder: string;
|
||||||
isEntityTypeDate: boolean;
|
isEntityTypeDate: boolean;
|
||||||
entityTimeValue?: string;
|
entityTimeValue?: string;
|
||||||
|
isEntityValueDisable?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EntityType {
|
||||||
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -153,40 +153,6 @@ exports[`Upload Items Pane should render Default properly 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -455,40 +421,6 @@ exports[`Upload Items Pane should render Default properly 1`] = `
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
|
|||||||
@@ -154,40 +154,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
CassandraAddCollectionPane {
|
CassandraAddCollectionPane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
"canConfigureThroughput": [Function],
|
"canConfigureThroughput": [Function],
|
||||||
@@ -456,40 +422,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
|
|||||||
"defaultExperience": [Function],
|
"defaultExperience": [Function],
|
||||||
"deleteCollectionText": [Function],
|
"deleteCollectionText": [Function],
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
|
||||||
"addButtonLabel": "Add Property",
|
|
||||||
"attributeNameLabel": "Property Name",
|
|
||||||
"attributeValueLabel": "Value",
|
|
||||||
"canAdd": [Function],
|
|
||||||
"canApply": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"dataTypeLabel": "Type",
|
|
||||||
"displayedAttributes": [Function],
|
|
||||||
"editAttribute": [Function],
|
|
||||||
"editButtonLabel": "Edit",
|
|
||||||
"editingProperty": [Function],
|
|
||||||
"edmTypes": [Function],
|
|
||||||
"finishEditingAttribute": [Function],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "edittableentitypane",
|
|
||||||
"insertAttribute": [Function],
|
|
||||||
"isEditing": [Function],
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onAddPropertyKeyDown": [Function],
|
|
||||||
"onBackButtonKeyDown": [Function],
|
|
||||||
"onDeletePropertyKeyDown": [Function],
|
|
||||||
"onEditPropertyKeyDown": [Function],
|
|
||||||
"onKeyUp": [Function],
|
|
||||||
"removeAttribute": [Function],
|
|
||||||
"removeButtonLabel": "Remove",
|
|
||||||
"scrollId": [Function],
|
|
||||||
"submitButtonText": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"graphStylingPane": GraphStylingPane {
|
"graphStylingPane": GraphStylingPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"firstFieldHasFocus": [Function],
|
"firstFieldHasFocus": [Function],
|
||||||
|
|||||||
@@ -58,10 +58,6 @@ export default class TableCommands {
|
|||||||
var entityToUpdate: Entities.ITableEntity = viewModel.selected()[0];
|
var entityToUpdate: Entities.ITableEntity = viewModel.selected()[0];
|
||||||
var originalNumberOfProperties = entityToUpdate ? 0 : Object.keys(entityToUpdate).length - 1; // .metadata is always a property for etag
|
var originalNumberOfProperties = entityToUpdate ? 0 : Object.keys(entityToUpdate).length - 1; // .metadata is always a property for etag
|
||||||
|
|
||||||
this._container.editTableEntityPane.originEntity = entityToUpdate;
|
|
||||||
this._container.editTableEntityPane.tableViewModel = viewModel;
|
|
||||||
this._container.editTableEntityPane.originalNumberOfProperties = originalNumberOfProperties;
|
|
||||||
this._container.editTableEntityPane.open();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +1,34 @@
|
|||||||
|
import { ConflictDefinition, FeedOptions, QueryIterator, Resource } from "@azure/cosmos";
|
||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import Q from "q";
|
import Q from "q";
|
||||||
|
import DeleteIcon from "../../../images/delete.svg";
|
||||||
|
import DiscardIcon from "../../../images/discard.svg";
|
||||||
|
import SaveIcon from "../../../images/save-cosmos.svg";
|
||||||
import * as Constants from "../../Common/Constants";
|
import * as Constants from "../../Common/Constants";
|
||||||
|
import { DocumentsGridMetrics, KeyCodes } from "../../Common/Constants";
|
||||||
|
import { createDocument } from "../../Common/dataAccess/createDocument";
|
||||||
|
import { deleteConflict } from "../../Common/dataAccess/deleteConflict";
|
||||||
|
import { deleteDocument } from "../../Common/dataAccess/deleteDocument";
|
||||||
|
import { queryConflicts } from "../../Common/dataAccess/queryConflicts";
|
||||||
|
import { updateDocument } from "../../Common/dataAccess/updateDocument";
|
||||||
|
import editable from "../../Common/EditableUtility";
|
||||||
|
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
||||||
|
import * as HeadersUtility from "../../Common/HeadersUtility";
|
||||||
|
import { MinimalQueryIterator } from "../../Common/IteratorUtilities";
|
||||||
|
import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter";
|
||||||
import * as DataModels from "../../Contracts/DataModels";
|
import * as DataModels from "../../Contracts/DataModels";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
import { AccessibleVerticalList } from "../Tree/AccessibleVerticalList";
|
|
||||||
import { KeyCodes } from "../../Common/Constants";
|
|
||||||
import ConflictId from "../Tree/ConflictId";
|
|
||||||
import editable from "../../Common/EditableUtility";
|
|
||||||
import * as HeadersUtility from "../../Common/HeadersUtility";
|
|
||||||
import TabsBase from "./TabsBase";
|
|
||||||
import { DocumentsGridMetrics } from "../../Common/Constants";
|
|
||||||
import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter";
|
|
||||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import SaveIcon from "../../../images/save-cosmos.svg";
|
|
||||||
import DiscardIcon from "../../../images/discard.svg";
|
|
||||||
import DeleteIcon from "../../../images/delete.svg";
|
|
||||||
import { QueryIterator, Resource, ConflictDefinition, FeedOptions } from "@azure/cosmos";
|
|
||||||
import { MinimalQueryIterator } from "../../Common/IteratorUtilities";
|
|
||||||
import Explorer from "../Explorer";
|
|
||||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||||
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
import Explorer from "../Explorer";
|
||||||
import { createDocument } from "../../Common/dataAccess/createDocument";
|
import { AccessibleVerticalList } from "../Tree/AccessibleVerticalList";
|
||||||
import { deleteDocument } from "../../Common/dataAccess/deleteDocument";
|
import ConflictId from "../Tree/ConflictId";
|
||||||
import { updateDocument } from "../../Common/dataAccess/updateDocument";
|
|
||||||
import { deleteConflict } from "../../Common/dataAccess/deleteConflict";
|
|
||||||
import { queryConflicts } from "../../Common/dataAccess/queryConflicts";
|
|
||||||
import template from "./ConflictsTab.html";
|
import template from "./ConflictsTab.html";
|
||||||
|
import TabsBase from "./TabsBase";
|
||||||
|
|
||||||
export default class ConflictsTab extends TabsBase {
|
export default class ConflictsTab extends TabsBase {
|
||||||
public static readonly component = { name: "conflicts-tab", template };
|
public readonly html = template;
|
||||||
public selectedConflictId: ko.Observable<ConflictId>;
|
public selectedConflictId: ko.Observable<ConflictId>;
|
||||||
public selectedConflictContent: ViewModels.Editable<string>;
|
public selectedConflictContent: ViewModels.Editable<string>;
|
||||||
public selectedConflictCurrent: ViewModels.Editable<string>;
|
public selectedConflictCurrent: ViewModels.Editable<string>;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import template from "./DocumentsTab.html";
|
|||||||
import TabsBase from "./TabsBase";
|
import TabsBase from "./TabsBase";
|
||||||
|
|
||||||
export default class DocumentsTab extends TabsBase {
|
export default class DocumentsTab extends TabsBase {
|
||||||
public static readonly component = { name: "documents-tab", template };
|
public readonly html = template;
|
||||||
public selectedDocumentId: ko.Observable<DocumentId>;
|
public selectedDocumentId: ko.Observable<DocumentId>;
|
||||||
public selectedDocumentContent: ViewModels.Editable<string>;
|
public selectedDocumentContent: ViewModels.Editable<string>;
|
||||||
public initialDocumentContent: ko.Observable<string>;
|
public initialDocumentContent: ko.Observable<string>;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div style="height: 100%" data-bind="react:galleryAndNotebookViewerComponentAdapter, setTemplateReady: true"></div>
|
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
|
import { DatabaseAccount } from "../../Contracts/DataModels";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
|
import { IGalleryItem, JunoClient } from "../../Juno/JunoClient";
|
||||||
import { GalleryAndNotebookViewerComponentProps } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponent";
|
import { GalleryAndNotebookViewerComponentProps } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponent";
|
||||||
import { GalleryAndNotebookViewerComponentAdapter } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponentAdapter";
|
import { GalleryAndNotebookViewerComponentAdapter } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponentAdapter";
|
||||||
import { GalleryTab as GalleryViewerTab, SortBy } from "../Controls/NotebookGallery/GalleryViewerComponent";
|
import { GalleryTab as GalleryViewerTab, SortBy } from "../Controls/NotebookGallery/GalleryViewerComponent";
|
||||||
import TabsBase from "./TabsBase";
|
|
||||||
import Explorer from "../Explorer";
|
import Explorer from "../Explorer";
|
||||||
import { DatabaseAccount } from "../../Contracts/DataModels";
|
import TabsBase from "./TabsBase";
|
||||||
import { JunoClient, IGalleryItem } from "../../Juno/JunoClient";
|
|
||||||
import template from "./GalleryTab.html";
|
|
||||||
|
|
||||||
interface GalleryTabOptions extends ViewModels.TabOptions {
|
export interface GalleryTabOptions extends ViewModels.TabOptions {
|
||||||
account: DatabaseAccount;
|
account: DatabaseAccount;
|
||||||
container: Explorer;
|
container: Explorer;
|
||||||
junoClient: JunoClient;
|
junoClient: JunoClient;
|
||||||
@@ -22,7 +21,7 @@ interface GalleryTabOptions extends ViewModels.TabOptions {
|
|||||||
* Notebook gallery tab
|
* Notebook gallery tab
|
||||||
*/
|
*/
|
||||||
export default class GalleryTab extends TabsBase {
|
export default class GalleryTab extends TabsBase {
|
||||||
public static readonly component = { name: "gallery-tab", template };
|
public readonly html = '<div style="height: 100%" data-bind="react:galleryAndNotebookViewerComponentAdapter"></div>';
|
||||||
private container: Explorer;
|
private container: Explorer;
|
||||||
private galleryAndNotebookViewerComponentProps: GalleryAndNotebookViewerComponentProps;
|
private galleryAndNotebookViewerComponentProps: GalleryAndNotebookViewerComponentProps;
|
||||||
public galleryAndNotebookViewerComponentAdapter: GalleryAndNotebookViewerComponentAdapter;
|
public galleryAndNotebookViewerComponentAdapter: GalleryAndNotebookViewerComponentAdapter;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div class="graphExplorerContainer" role="tabpanel" data-bind="react:graphExplorerAdapter, attr:{ id: tabId }"></div>
|
|
||||||
@@ -10,7 +10,6 @@ import { GraphExplorerAdapter } from "../Graph/GraphExplorerComponent/GraphExplo
|
|||||||
import { ContextualPaneBase } from "../Panes/ContextualPaneBase";
|
import { ContextualPaneBase } from "../Panes/ContextualPaneBase";
|
||||||
import GraphStylingPane from "../Panes/GraphStylingPane";
|
import GraphStylingPane from "../Panes/GraphStylingPane";
|
||||||
import { NewVertexPanel } from "../Panes/NewVertexPanel/NewVertexPanel";
|
import { NewVertexPanel } from "../Panes/NewVertexPanel/NewVertexPanel";
|
||||||
import template from "./GraphTab.html";
|
|
||||||
import TabsBase from "./TabsBase";
|
import TabsBase from "./TabsBase";
|
||||||
export interface GraphIconMap {
|
export interface GraphIconMap {
|
||||||
[key: string]: { data: string; format: string };
|
[key: string]: { data: string; format: string };
|
||||||
@@ -37,7 +36,8 @@ interface GraphTabOptions extends ViewModels.TabOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class GraphTab extends TabsBase {
|
export default class GraphTab extends TabsBase {
|
||||||
public static readonly component = { name: "graph-tab", template };
|
public readonly html =
|
||||||
|
'<div class="graphExplorerContainer" role="tabpanel" data-bind="react:graphExplorerAdapter, attr: {id: tabId}"></div>';
|
||||||
// Graph default configuration
|
// Graph default configuration
|
||||||
public static readonly DEFAULT_NODE_CAPTION = "id";
|
public static readonly DEFAULT_NODE_CAPTION = "id";
|
||||||
private static readonly LINK_COLOR = "#aaa";
|
private static readonly LINK_COLOR = "#aaa";
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import template from "./MongoShellTab.html";
|
|||||||
import TabsBase from "./TabsBase";
|
import TabsBase from "./TabsBase";
|
||||||
|
|
||||||
export default class MongoShellTab extends TabsBase {
|
export default class MongoShellTab extends TabsBase {
|
||||||
public static readonly component = { name: "mongo-shell-tab", template };
|
public readonly html = template;
|
||||||
public url: ko.Computed<string>;
|
public url: ko.Computed<string>;
|
||||||
private _container: Explorer;
|
private _container: Explorer;
|
||||||
private _runtimeEndpoint: string;
|
private _runtimeEndpoint: string;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div data-bind="react:notebookComponentAdapter" style="height: 100%"></div>
|
|
||||||
@@ -27,14 +27,13 @@ import { KernelSpecsDisplay } from "../Notebook/NotebookClientV2";
|
|||||||
import { NotebookComponentAdapter } from "../Notebook/NotebookComponent/NotebookComponentAdapter";
|
import { NotebookComponentAdapter } from "../Notebook/NotebookComponent/NotebookComponentAdapter";
|
||||||
import { NotebookContentItem } from "../Notebook/NotebookContentItem";
|
import { NotebookContentItem } from "../Notebook/NotebookContentItem";
|
||||||
import NotebookTabBase, { NotebookTabBaseOptions } from "./NotebookTabBase";
|
import NotebookTabBase, { NotebookTabBaseOptions } from "./NotebookTabBase";
|
||||||
import template from "./NotebookV2Tab.html";
|
|
||||||
|
|
||||||
export interface NotebookTabOptions extends NotebookTabBaseOptions {
|
export interface NotebookTabOptions extends NotebookTabBaseOptions {
|
||||||
notebookContentItem: NotebookContentItem;
|
notebookContentItem: NotebookContentItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class NotebookTabV2 extends NotebookTabBase {
|
export default class NotebookTabV2 extends NotebookTabBase {
|
||||||
public static readonly component = { name: "notebookv2-tab", template };
|
public readonly html = '<div data-bind="react:notebookComponentAdapter" style="height: 100%"></div>';
|
||||||
public notebookPath: ko.Observable<string>;
|
public notebookPath: ko.Observable<string>;
|
||||||
private selectedSparkPool: ko.Observable<string>;
|
private selectedSparkPool: ko.Observable<string>;
|
||||||
private notebookComponentAdapter: NotebookComponentAdapter;
|
private notebookComponentAdapter: NotebookComponentAdapter;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div style="height: 100%" data-bind="react:notebookViewerComponentAdapter, setTemplateReady: true"></div>
|
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
||||||
|
import { DatabaseAccount } from "../../Contracts/DataModels";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
|
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||||
import {
|
import {
|
||||||
NotebookViewerComponent,
|
NotebookViewerComponent,
|
||||||
NotebookViewerComponentProps,
|
NotebookViewerComponentProps,
|
||||||
} from "../Controls/NotebookViewer/NotebookViewerComponent";
|
} from "../Controls/NotebookViewer/NotebookViewerComponent";
|
||||||
import TabsBase from "./TabsBase";
|
|
||||||
import Explorer from "../Explorer";
|
import Explorer from "../Explorer";
|
||||||
import { DatabaseAccount } from "../../Contracts/DataModels";
|
import TabsBase from "./TabsBase";
|
||||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
|
||||||
import template from "./NotebookViewerTab.html";
|
|
||||||
|
|
||||||
interface NotebookViewerTabOptions extends ViewModels.TabOptions {
|
interface NotebookViewerTabOptions extends ViewModels.TabOptions {
|
||||||
account: DatabaseAccount;
|
account: DatabaseAccount;
|
||||||
@@ -39,7 +38,7 @@ class NotebookViewerComponentAdapter implements ReactAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class NotebookViewerTab extends TabsBase {
|
export default class NotebookViewerTab extends TabsBase {
|
||||||
public static readonly component = { name: "notebook-viewer-tab", template };
|
public readonly html = '<div style="height: 100%" data-bind="react:notebookViewerComponentAdapter"></div>';
|
||||||
private container: Explorer;
|
private container: Explorer;
|
||||||
public notebookUrl: string;
|
public notebookUrl: string;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
<div
|
<div class="tab-pane" data-bind="attr:{id: tabId}" role="tabpanel">
|
||||||
class="tab-pane"
|
|
||||||
data-bind="setTemplateReady: true,
|
|
||||||
attr:{
|
|
||||||
id: tabId
|
|
||||||
}"
|
|
||||||
role="tabpanel"
|
|
||||||
>
|
|
||||||
<div class="tabPaneContentContainer">
|
<div class="tabPaneContentContainer">
|
||||||
<div class="mongoQueryHelper" data-bind="visible: isPreferredApiMongoDB && sqlQueryEditorContent().length === 0">
|
<div class="mongoQueryHelper" data-bind="visible: isPreferredApiMongoDB && sqlQueryEditorContent().length === 0">
|
||||||
Start by writing a Mongo query, for example: <strong>{'id':'foo'}</strong> or <strong>{ }</strong> to get all the
|
Start by writing a Mongo query, for example: <strong>{'id':'foo'}</strong> or <strong>{ }</strong> to get all the
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ enum ToggleState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class QueryTab extends TabsBase implements ViewModels.WaitsForTemplate {
|
export default class QueryTab extends TabsBase implements ViewModels.WaitsForTemplate {
|
||||||
public static readonly component = { name: "query-tab", template };
|
public readonly html = template;
|
||||||
public queryEditorId: string;
|
public queryEditorId: string;
|
||||||
public executeQueryButton: ViewModels.Button;
|
public executeQueryButton: ViewModels.Button;
|
||||||
public fetchNextPageButton: ViewModels.Button;
|
public fetchNextPageButton: ViewModels.Button;
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
<div
|
<div class="tab-pane tableContainer" data-bind="attr:{id: tabId}" role="tabpanel">
|
||||||
class="tab-pane tableContainer"
|
|
||||||
data-bind="
|
|
||||||
attr:{
|
|
||||||
id: tabId
|
|
||||||
}"
|
|
||||||
role="tabpanel"
|
|
||||||
>
|
|
||||||
<!-- Tables Query Tab Query Builder - Start-->
|
<!-- Tables Query Tab Query Builder - Start-->
|
||||||
<div
|
<div
|
||||||
class="query-builder"
|
class="query-builder"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import TabsBase from "./TabsBase";
|
|||||||
|
|
||||||
// Will act as table explorer class
|
// Will act as table explorer class
|
||||||
export default class QueryTablesTab extends TabsBase {
|
export default class QueryTablesTab extends TabsBase {
|
||||||
public static readonly component = { name: "tables-query-tab", template };
|
public readonly html = template;
|
||||||
public collection: ViewModels.Collection;
|
public collection: ViewModels.Collection;
|
||||||
public tableEntityListViewModel = ko.observable<TableEntityListViewModel>();
|
public tableEntityListViewModel = ko.observable<TableEntityListViewModel>();
|
||||||
public queryViewModel = ko.observable<QueryViewModel>();
|
public queryViewModel = ko.observable<QueryViewModel>();
|
||||||
@@ -151,7 +151,7 @@ export default class QueryTablesTab extends TabsBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public onEditEntityClick = (): Q.Promise<any> => {
|
public onEditEntityClick = (): Q.Promise<any> => {
|
||||||
this.tableCommands.editEntityCommand(this.tableEntityListViewModel());
|
this.container.openEditTableEntityPanel(this, this.tableEntityListViewModel());
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div data-bind="react:schemaAnalyzerComponentAdapter" style="height: 100%"></div>
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
import { SchemaAnalyzerComponentAdapter } from "../Notebook/SchemaAnalyzerComponent/SchemaAnalyzerComponentAdapter";
|
import { SchemaAnalyzerComponentAdapter } from "../Notebook/SchemaAnalyzerComponent/SchemaAnalyzerComponentAdapter";
|
||||||
import NotebookTabBase, { NotebookTabBaseOptions } from "./NotebookTabBase";
|
import NotebookTabBase, { NotebookTabBaseOptions } from "./NotebookTabBase";
|
||||||
import template from "./SchemaAnalyzerTab.html";
|
|
||||||
|
|
||||||
export default class SchemaAnalyzerTab extends NotebookTabBase {
|
export default class SchemaAnalyzerTab extends NotebookTabBase {
|
||||||
public static readonly component = { name: "schema-analyzer-tab", template };
|
public readonly html = '<div data-bind="react:schemaAnalyzerComponentAdapter" style="height: 100%"></div>';
|
||||||
|
|
||||||
private schemaAnalyzerComponentAdapter: SchemaAnalyzerComponentAdapter;
|
private schemaAnalyzerComponentAdapter: SchemaAnalyzerComponentAdapter;
|
||||||
|
|
||||||
constructor(options: NotebookTabBaseOptions) {
|
constructor(options: NotebookTabBaseOptions) {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div style="height: 100%" data-bind="react:settingsComponentAdapter"></div>
|
|
||||||
@@ -1,18 +1,17 @@
|
|||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
|
||||||
import * as DataModels from "../../Contracts/DataModels";
|
|
||||||
import TabsBase from "./TabsBase";
|
|
||||||
import { SettingsComponentAdapter } from "../Controls/Settings/SettingsComponentAdapter";
|
|
||||||
import { SettingsComponentProps } from "../Controls/Settings/SettingsComponent";
|
|
||||||
import { traceFailure } from "../../Shared/Telemetry/TelemetryProcessor";
|
|
||||||
import ko from "knockout";
|
import ko from "knockout";
|
||||||
import * as Constants from "../../Common/Constants";
|
import * as Constants from "../../Common/Constants";
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
|
||||||
import { logConsoleError } from "../../Utils/NotificationConsoleUtils";
|
|
||||||
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
||||||
import template from "./SettingsTabV2.html";
|
import * as DataModels from "../../Contracts/DataModels";
|
||||||
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
|
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
|
import { traceFailure } from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
|
import { logConsoleError } from "../../Utils/NotificationConsoleUtils";
|
||||||
|
import { SettingsComponentProps } from "../Controls/Settings/SettingsComponent";
|
||||||
|
import { SettingsComponentAdapter } from "../Controls/Settings/SettingsComponentAdapter";
|
||||||
|
import TabsBase from "./TabsBase";
|
||||||
|
|
||||||
export class SettingsTabV2 extends TabsBase {
|
export class SettingsTabV2 extends TabsBase {
|
||||||
public static readonly component = { name: "collection-settings-tab-v2", template };
|
public readonly html = '<div style="height: 100%" data-bind="react:settingsComponentAdapter"></div>';
|
||||||
public settingsComponentAdapter: SettingsComponentAdapter;
|
public settingsComponentAdapter: SettingsComponentAdapter;
|
||||||
|
|
||||||
constructor(options: ViewModels.TabOptions) {
|
constructor(options: ViewModels.TabOptions) {
|
||||||
@@ -89,7 +88,6 @@ export class CollectionSettingsTabV2 extends SettingsTabV2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class DatabaseSettingsTabV2 extends SettingsTabV2 {
|
export class DatabaseSettingsTabV2 extends SettingsTabV2 {
|
||||||
public static readonly component = { name: "database-settings-tab-v2", template };
|
|
||||||
private notificationRead: ko.Observable<boolean>;
|
private notificationRead: ko.Observable<boolean>;
|
||||||
private notification: DataModels.Notification;
|
private notification: DataModels.Notification;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ enum ToggleState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class StoredProcedureTab extends ScriptTabBase {
|
export default class StoredProcedureTab extends ScriptTabBase {
|
||||||
public static readonly component = { name: "stored-procedure-tab", template };
|
public readonly html = template;
|
||||||
public collection: ViewModels.Collection;
|
public collection: ViewModels.Collection;
|
||||||
public node: StoredProcedure;
|
public node: StoredProcedure;
|
||||||
public executeResultsEditorId: string;
|
public executeResultsEditorId: string;
|
||||||
|
|||||||
@@ -103,11 +103,8 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) {
|
|||||||
ko.applyBindings(tab, element);
|
ko.applyBindings(tab, element);
|
||||||
const ctx = ko.contextFor(element).createChildContext(tab);
|
const ctx = ko.contextFor(element).createChildContext(tab);
|
||||||
ko.applyBindingsToDescendants(ctx, element);
|
ko.applyBindingsToDescendants(ctx, element);
|
||||||
return () => ko.cleanNode(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("render" in tab) {
|
|
||||||
tab.isTemplateReady(true);
|
tab.isTemplateReady(true);
|
||||||
|
return () => ko.cleanNode(element);
|
||||||
}
|
}
|
||||||
}, [ref, tab]);
|
}, [ref, tab]);
|
||||||
|
|
||||||
@@ -115,5 +112,5 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) {
|
|||||||
return <div {...attrs}>{tab.render()}</div>;
|
return <div {...attrs}>{tab.render()}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div {...attrs} ref={ref} data-bind="html: constructor.component.template" />;
|
return <div {...attrs} ref={ref} data-bind="html:html" />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { TabsManager } from "./TabsManager";
|
|||||||
// TODO: Use specific actions for logging telemetry data
|
// TODO: Use specific actions for logging telemetry data
|
||||||
export default class TabsBase extends WaitsForTemplateViewModel {
|
export default class TabsBase extends WaitsForTemplateViewModel {
|
||||||
private static id = 0;
|
private static id = 0;
|
||||||
public static readonly component = { name: "tab", template: "" };
|
|
||||||
public closeTabButton: ViewModels.Button;
|
public closeTabButton: ViewModels.Button;
|
||||||
public node: ViewModels.TreeNode;
|
public node: ViewModels.TreeNode;
|
||||||
public collection: ViewModels.CollectionBase;
|
public collection: ViewModels.CollectionBase;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div style="height: 100%" data-bind="react:notebookTerminalComponentAdapter, setTemplateReady: true"></div>
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
|
||||||
import * as DataModels from "../../Contracts/DataModels";
|
|
||||||
import TabsBase from "./TabsBase";
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
||||||
|
import * as DataModels from "../../Contracts/DataModels";
|
||||||
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
|
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||||
import { NotebookTerminalComponent } from "../Controls/Notebook/NotebookTerminalComponent";
|
import { NotebookTerminalComponent } from "../Controls/Notebook/NotebookTerminalComponent";
|
||||||
import Explorer from "../Explorer";
|
import Explorer from "../Explorer";
|
||||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
import TabsBase from "./TabsBase";
|
||||||
import template from "./TerminalTab.html";
|
|
||||||
|
|
||||||
export interface TerminalTabOptions extends ViewModels.TabOptions {
|
export interface TerminalTabOptions extends ViewModels.TabOptions {
|
||||||
account: DataModels.DatabaseAccount;
|
account: DataModels.DatabaseAccount;
|
||||||
@@ -39,7 +38,7 @@ class NotebookTerminalComponentAdapter implements ReactAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class TerminalTab extends TabsBase {
|
export default class TerminalTab extends TabsBase {
|
||||||
public static readonly component = { name: "terminal-tab", template };
|
public readonly html = '<div style="height: 100%" data-bind="react:notebookTerminalComponentAdapter"></div> ';
|
||||||
private container: Explorer;
|
private container: Explorer;
|
||||||
private notebookTerminalComponentAdapter: NotebookTerminalComponentAdapter;
|
private notebookTerminalComponentAdapter: NotebookTerminalComponentAdapter;
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ import * as Constants from "../../Common/Constants";
|
|||||||
import { createTrigger } from "../../Common/dataAccess/createTrigger";
|
import { createTrigger } from "../../Common/dataAccess/createTrigger";
|
||||||
import { updateTrigger } from "../../Common/dataAccess/updateTrigger";
|
import { updateTrigger } from "../../Common/dataAccess/updateTrigger";
|
||||||
import editable from "../../Common/EditableUtility";
|
import editable from "../../Common/EditableUtility";
|
||||||
|
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import Trigger from "../Tree/Trigger";
|
import Trigger from "../Tree/Trigger";
|
||||||
import ScriptTabBase from "./ScriptTabBase";
|
import ScriptTabBase from "./ScriptTabBase";
|
||||||
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
|
||||||
import template from "./TriggerTab.html";
|
import template from "./TriggerTab.html";
|
||||||
|
|
||||||
export default class TriggerTab extends ScriptTabBase {
|
export default class TriggerTab extends ScriptTabBase {
|
||||||
public static readonly component = { name: "trigger-tab", template };
|
public readonly html = template;
|
||||||
public collection: ViewModels.Collection;
|
public collection: ViewModels.Collection;
|
||||||
public node: Trigger;
|
public node: Trigger;
|
||||||
public triggerType: ViewModels.Editable<string>;
|
public triggerType: ViewModels.Editable<string>;
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
|||||||
import * as Constants from "../../Common/Constants";
|
import * as Constants from "../../Common/Constants";
|
||||||
import { createUserDefinedFunction } from "../../Common/dataAccess/createUserDefinedFunction";
|
import { createUserDefinedFunction } from "../../Common/dataAccess/createUserDefinedFunction";
|
||||||
import { updateUserDefinedFunction } from "../../Common/dataAccess/updateUserDefinedFunction";
|
import { updateUserDefinedFunction } from "../../Common/dataAccess/updateUserDefinedFunction";
|
||||||
|
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import UserDefinedFunction from "../Tree/UserDefinedFunction";
|
import UserDefinedFunction from "../Tree/UserDefinedFunction";
|
||||||
import ScriptTabBase from "./ScriptTabBase";
|
import ScriptTabBase from "./ScriptTabBase";
|
||||||
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
|
||||||
import template from "./UserDefinedFunctionTab.html";
|
import template from "./UserDefinedFunctionTab.html";
|
||||||
|
|
||||||
export default class UserDefinedFunctionTab extends ScriptTabBase {
|
export default class UserDefinedFunctionTab extends ScriptTabBase {
|
||||||
public static readonly component = { name: "user-defined-function-tab", template };
|
public readonly html = template;
|
||||||
public collection: ViewModels.Collection;
|
public collection: ViewModels.Collection;
|
||||||
public node: UserDefinedFunction;
|
public node: UserDefinedFunction;
|
||||||
constructor(options: ViewModels.ScriptTabOption) {
|
constructor(options: ViewModels.ScriptTabOption) {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import MongoQueryTab from "../Tabs/MongoQueryTab";
|
|||||||
import MongoShellTab from "../Tabs/MongoShellTab";
|
import MongoShellTab from "../Tabs/MongoShellTab";
|
||||||
import QueryTab from "../Tabs/QueryTab";
|
import QueryTab from "../Tabs/QueryTab";
|
||||||
import QueryTablesTab from "../Tabs/QueryTablesTab";
|
import QueryTablesTab from "../Tabs/QueryTablesTab";
|
||||||
import SchemaAnalyzerTab from "../Tabs/SchemaAnalyzerTab";
|
|
||||||
import { CollectionSettingsTabV2 } from "../Tabs/SettingsTabV2";
|
import { CollectionSettingsTabV2 } from "../Tabs/SettingsTabV2";
|
||||||
import ConflictId from "./ConflictId";
|
import ConflictId from "./ConflictId";
|
||||||
import DocumentId from "./DocumentId";
|
import DocumentId from "./DocumentId";
|
||||||
@@ -515,9 +514,10 @@ export default class Collection implements ViewModels.Collection {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public onSchemaAnalyzerClick = () => {
|
public onSchemaAnalyzerClick = async () => {
|
||||||
this.container.selectedNode(this);
|
this.container.selectedNode(this);
|
||||||
this.selectedSubnodeKind(ViewModels.CollectionTabKind.SchemaAnalyzer);
|
this.selectedSubnodeKind(ViewModels.CollectionTabKind.SchemaAnalyzer);
|
||||||
|
const SchemaAnalyzerTab = await (await import("../Tabs/SchemaAnalyzerTab")).default;
|
||||||
TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, {
|
||||||
description: "Mongo Schema node",
|
description: "Mongo Schema node",
|
||||||
databaseName: this.databaseId,
|
databaseName: this.databaseId,
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ const App: React.FunctionComponent = () => {
|
|||||||
<div data-bind='component: { name: "add-database-pane", params: {data: addDatabasePane} }' />
|
<div data-bind='component: { name: "add-database-pane", params: {data: addDatabasePane} }' />
|
||||||
<div data-bind='component: { name: "add-collection-pane", params: { data: addCollectionPane} }' />
|
<div data-bind='component: { name: "add-collection-pane", params: { data: addCollectionPane} }' />
|
||||||
<div data-bind='component: { name: "graph-styling-pane", params: { data: graphStylingPane} }' />
|
<div data-bind='component: { name: "graph-styling-pane", params: { data: graphStylingPane} }' />
|
||||||
<div data-bind='component: { name: "table-edit-entity-pane", params: { data: editTableEntityPane} }' />
|
|
||||||
<div data-bind='component: { name: "cassandra-add-collection-pane", params: { data: cassandraAddCollectionPane} }' />
|
<div data-bind='component: { name: "cassandra-add-collection-pane", params: { data: cassandraAddCollectionPane} }' />
|
||||||
<div data-bind='component: { name: "string-input-pane", params: { data: stringInputPane} }' />
|
<div data-bind='component: { name: "string-input-pane", params: { data: stringInputPane} }' />
|
||||||
<KOCommentIfStart if="isGitHubPaneEnabled" />
|
<KOCommentIfStart if="isGitHubPaneEnabled" />
|
||||||
|
|||||||
Reference in New Issue
Block a user