mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-24 19:31:36 +00:00
Compare commits
3 Commits
eslint/Not
...
resolve_es
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0897c75114 | ||
|
|
b9e06858c5 | ||
|
|
043541b0dc |
@@ -2,8 +2,6 @@
|
|||||||
src/**/__mocks__/**/*
|
src/**/__mocks__/**/*
|
||||||
dist/
|
dist/
|
||||||
Contracts/
|
Contracts/
|
||||||
src/Api/Apis.ts
|
|
||||||
src/AuthType.ts
|
|
||||||
src/Bindings/BindingHandlersRegisterer.ts
|
src/Bindings/BindingHandlersRegisterer.ts
|
||||||
src/Bindings/ReactBindingHandler.ts
|
src/Bindings/ReactBindingHandler.ts
|
||||||
src/Common/Constants.ts
|
src/Common/Constants.ts
|
||||||
@@ -37,7 +35,6 @@ src/Definitions/svg.d.ts
|
|||||||
src/Explorer/ComponentRegisterer.test.ts
|
src/Explorer/ComponentRegisterer.test.ts
|
||||||
src/Explorer/ComponentRegisterer.ts
|
src/Explorer/ComponentRegisterer.ts
|
||||||
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
|
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
|
||||||
|
|
||||||
src/Explorer/Controls/Editor/EditorComponent.ts
|
src/Explorer/Controls/Editor/EditorComponent.ts
|
||||||
src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts
|
src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts
|
||||||
src/Explorer/DataSamples/ContainerSampleGenerator.test.ts
|
src/Explorer/DataSamples/ContainerSampleGenerator.test.ts
|
||||||
@@ -93,7 +90,11 @@ src/Explorer/Tabs/DocumentsTab.test.ts
|
|||||||
src/Explorer/Tabs/DocumentsTab.ts
|
src/Explorer/Tabs/DocumentsTab.ts
|
||||||
src/Explorer/Tabs/GraphTab.ts
|
src/Explorer/Tabs/GraphTab.ts
|
||||||
src/Explorer/Tabs/MongoDocumentsTab.ts
|
src/Explorer/Tabs/MongoDocumentsTab.ts
|
||||||
|
src/Explorer/Tabs/NotebookV2Tab.ts
|
||||||
|
src/Explorer/Tabs/ScriptTabBase.ts
|
||||||
|
src/Explorer/Tabs/TabComponents.ts
|
||||||
src/Explorer/Tabs/TabsBase.ts
|
src/Explorer/Tabs/TabsBase.ts
|
||||||
|
src/Explorer/Tabs/TriggerTab.ts
|
||||||
src/Explorer/Tabs/UserDefinedFunctionTab.ts
|
src/Explorer/Tabs/UserDefinedFunctionTab.ts
|
||||||
src/Explorer/Tree/AccessibleVerticalList.ts
|
src/Explorer/Tree/AccessibleVerticalList.ts
|
||||||
src/Explorer/Tree/Collection.ts
|
src/Explorer/Tree/Collection.ts
|
||||||
@@ -112,12 +113,8 @@ src/ReactDevTools.ts
|
|||||||
src/Shared/Constants.ts
|
src/Shared/Constants.ts
|
||||||
src/Shared/DefaultExperienceUtility.test.ts
|
src/Shared/DefaultExperienceUtility.test.ts
|
||||||
src/Shared/DefaultExperienceUtility.ts
|
src/Shared/DefaultExperienceUtility.ts
|
||||||
src/Shared/appInsights.ts
|
|
||||||
src/SparkClusterManager/ArcadiaResourceManager.ts
|
|
||||||
src/SparkClusterManager/SparkClusterManager.ts
|
|
||||||
src/Terminal/JupyterLabAppFactory.ts
|
src/Terminal/JupyterLabAppFactory.ts
|
||||||
src/Terminal/NotebookAppContracts.d.ts
|
src/Terminal/NotebookAppContracts.d.ts
|
||||||
src/applyExplorerBindings.ts
|
|
||||||
src/global.d.ts
|
src/global.d.ts
|
||||||
src/setupTests.ts
|
src/setupTests.ts
|
||||||
src/Explorer/Controls/InputTypeahead/InputTypeaheadComponent.tsx
|
src/Explorer/Controls/InputTypeahead/InputTypeaheadComponent.tsx
|
||||||
@@ -127,8 +124,6 @@ src/Explorer/Controls/NotebookViewer/NotebookViewerComponent.tsx
|
|||||||
src/Explorer/Controls/TreeComponent/TreeComponent.tsx
|
src/Explorer/Controls/TreeComponent/TreeComponent.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.test.tsx
|
src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.test.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
|
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
||||||
@@ -137,7 +132,6 @@ src/Explorer/Notebook/NotebookRenderer/NotebookRenderer.tsx
|
|||||||
src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx
|
||||||
src/Explorer/Notebook/temp/inputs/connected-editors/codemirror.tsx
|
|
||||||
src/Explorer/Tree/ResourceTreeAdapter.tsx
|
src/Explorer/Tree/ResourceTreeAdapter.tsx
|
||||||
__mocks__/monaco-editor.ts
|
__mocks__/monaco-editor.ts
|
||||||
src/Explorer/Tree/ResourceTree.tsx
|
src/Explorer/Tree/ResourceTree.tsx
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* Data Explorer version {major.minor.patch}
|
* Data Explorer version {major.minor.patch}
|
||||||
*/
|
*/
|
||||||
export const DataExplorer: string = "1.0.1";
|
export const DataExplorer = "1.0.1";
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from "react";
|
|
||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
|
import React from "react";
|
||||||
import { GraphHighlightedNodeData } from "./GraphExplorer";
|
import { GraphHighlightedNodeData } from "./GraphExplorer";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ReadOnlyNodePropertiesComponent,
|
ReadOnlyNodePropertiesComponent,
|
||||||
ReadOnlyNodePropertiesComponentProps,
|
ReadOnlyNodePropertiesComponentProps,
|
||||||
@@ -44,7 +43,7 @@ describe("<ReadOnlyNodePropertiesComponent />", () => {
|
|||||||
const mockNode2 = {
|
const mockNode2 = {
|
||||||
...mockNode,
|
...mockNode,
|
||||||
properties: {
|
properties: {
|
||||||
key3: ["abcd", 1234, true, false, undefined, null],
|
key3: ["abcd", 1234, true, false, undefined],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const props: ReadOnlyNodePropertiesComponentProps = { node: mockNode2 };
|
const props: ReadOnlyNodePropertiesComponentProps = { node: mockNode2 };
|
||||||
|
|||||||
@@ -60,9 +60,7 @@ export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNod
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static singlePropertyValueToString(value: ViewModels.GremlinPropertyValueType): string {
|
public static singlePropertyValueToString(value: ViewModels.GremlinPropertyValueType): string {
|
||||||
if (value === null) {
|
if (typeof value === "undefined") {
|
||||||
return "null";
|
|
||||||
} else if (typeof value === "undefined") {
|
|
||||||
return "undefined";
|
return "undefined";
|
||||||
} else {
|
} else {
|
||||||
return value.toString();
|
return value.toString();
|
||||||
@@ -71,11 +69,8 @@ export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNod
|
|||||||
|
|
||||||
public static renderSinglePropertyValue(value: ViewModels.GremlinPropertyValueType): JSX.Element {
|
public static renderSinglePropertyValue(value: ViewModels.GremlinPropertyValueType): JSX.Element {
|
||||||
let singlePropValue = value;
|
let singlePropValue = value;
|
||||||
let className = "propertyValue";
|
const className = "propertyValue";
|
||||||
if (singlePropValue === null) {
|
if (typeof singlePropValue === "undefined") {
|
||||||
singlePropValue = "null";
|
|
||||||
className += " isNull";
|
|
||||||
} else if (typeof singlePropValue === "undefined") {
|
|
||||||
singlePropValue = "undefined";
|
singlePropValue = "undefined";
|
||||||
} else {
|
} else {
|
||||||
singlePropValue = value.toString();
|
singlePropValue = value.toString();
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ exports[`<ReadOnlyNodePropertiesComponent /> renders properties (with multiple v
|
|||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
className="valueCol"
|
className="valueCol"
|
||||||
title="abcd, 1234, true, false, undefined, null"
|
title="abcd, 1234, true, false, undefined"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="propertyValue"
|
className="propertyValue"
|
||||||
@@ -155,12 +155,6 @@ exports[`<ReadOnlyNodePropertiesComponent /> renders properties (with multiple v
|
|||||||
>
|
>
|
||||||
undefined
|
undefined
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
className="propertyValue isNull"
|
|
||||||
key="null"
|
|
||||||
>
|
|
||||||
null
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCloseTabButtonClick(): Q.Promise<void> {
|
public onCloseTabButtonClick(): Q.Promise<any> {
|
||||||
const cleanup = () => {
|
const cleanup = () => {
|
||||||
this.notebookComponentAdapter.notebookShutdown();
|
this.notebookComponentAdapter.notebookShutdown();
|
||||||
super.onCloseTabButtonClick();
|
super.onCloseTabButtonClick();
|
||||||
@@ -78,7 +78,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async reconfigureServiceEndpoints(): Promise<void> {
|
public async reconfigureServiceEndpoints() {
|
||||||
if (!this.notebookComponentAdapter) {
|
if (!this.notebookComponentAdapter) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
ariaLabel: publishLabel,
|
ariaLabel: publishLabel,
|
||||||
});
|
});
|
||||||
|
|
||||||
const buttons: CommandButtonComponentProps[] = [
|
let buttons: CommandButtonComponentProps[] = [
|
||||||
{
|
{
|
||||||
iconSrc: SaveIcon,
|
iconSrc: SaveIcon,
|
||||||
iconAlt: saveLabel,
|
iconAlt: saveLabel,
|
||||||
@@ -160,7 +160,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
{
|
{
|
||||||
iconSrc: null,
|
iconSrc: null,
|
||||||
iconAlt: kernelLabel,
|
iconAlt: kernelLabel,
|
||||||
onCommandClick: () => undefined,
|
onCommandClick: () => {},
|
||||||
commandButtonLabel: null,
|
commandButtonLabel: null,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
disabled: availableKernels.length < 1,
|
disabled: availableKernels.length < 1,
|
||||||
@@ -271,7 +271,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
{
|
{
|
||||||
iconSrc: null,
|
iconSrc: null,
|
||||||
iconAlt: null,
|
iconAlt: null,
|
||||||
onCommandClick: () => undefined,
|
onCommandClick: () => {},
|
||||||
commandButtonLabel: null,
|
commandButtonLabel: null,
|
||||||
ariaLabel: cellTypeLabel,
|
ariaLabel: cellTypeLabel,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
@@ -361,7 +361,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private onKernelUpdate = async () => {
|
private onKernelUpdate = async () => {
|
||||||
await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()).catch(() => {
|
await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()).catch((reason) => {
|
||||||
/* Erroring is ok here */
|
/* Erroring is ok here */
|
||||||
});
|
});
|
||||||
this.updateNavbarWithTabsButtons();
|
this.updateNavbarWithTabsButtons();
|
||||||
|
|||||||
@@ -25,12 +25,11 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
public errors: ko.ObservableArray<ViewModels.QueryError>;
|
public errors: ko.ObservableArray<ViewModels.QueryError>;
|
||||||
public statusMessge: ko.Observable<string>;
|
public statusMessge: ko.Observable<string>;
|
||||||
public statusIcon: ko.Observable<string>;
|
public statusIcon: ko.Observable<string>;
|
||||||
public formFields: ko.ObservableArray<ViewModels.Editable<unknown>>;
|
public formFields: ko.ObservableArray<ViewModels.Editable<any>>;
|
||||||
public formIsValid: ko.Computed<boolean>;
|
public formIsValid: ko.Computed<boolean>;
|
||||||
public formIsDirty: ko.Computed<boolean>;
|
public formIsDirty: ko.Computed<boolean>;
|
||||||
public isNew: ko.Observable<boolean>;
|
public isNew: ko.Observable<boolean>;
|
||||||
// TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct.
|
// TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
public resource: ko.Observable<any>;
|
public resource: ko.Observable<any>;
|
||||||
public isTemplateReady: ko.Observable<boolean>;
|
public isTemplateReady: ko.Observable<boolean>;
|
||||||
protected _partitionKey: DataModels.PartitionKey;
|
protected _partitionKey: DataModels.PartitionKey;
|
||||||
@@ -86,6 +85,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
this.editorState(ViewModels.ScriptEditorState.exisitingDirtyInvalid);
|
this.editorState(ViewModels.ScriptEditorState.exisitingDirtyInvalid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ViewModels.ScriptEditorState.exisitingDirtyValid:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
this.editorContent.setBaseline(resource.body);
|
this.editorContent.setBaseline(resource.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setBaselines(): void {
|
public setBaselines() {
|
||||||
this._setBaselines();
|
this._setBaselines();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,9 +194,9 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract onSaveClick: () => void;
|
public abstract onSaveClick: () => void;
|
||||||
public abstract onUpdateClick: () => Promise<void>;
|
public abstract onUpdateClick: () => Promise<any>;
|
||||||
|
|
||||||
public onDiscard = (): Q.Promise<void> => {
|
public onDiscard = (): Q.Promise<any> => {
|
||||||
this.setBaselines();
|
this.setBaselines();
|
||||||
const original = this.editorContent.getEditableOriginalValue();
|
const original = this.editorContent.getEditableOriginalValue();
|
||||||
const editorModel = this.editor() && this.editor().getModel();
|
const editorModel = this.editor() && this.editor().getModel();
|
||||||
@@ -289,7 +289,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
return !!value;
|
return !!value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async _createBodyEditor(): Promise<void> {
|
protected async _createBodyEditor() {
|
||||||
const id = this.editorId;
|
const id = this.editorId;
|
||||||
const container = document.getElementById(id);
|
const container = document.getElementById(id);
|
||||||
const options = {
|
const options = {
|
||||||
@@ -308,7 +308,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
editorModel.onDidChangeContent(this._onBodyContentChange.bind(this));
|
editorModel.onDidChangeContent(this._onBodyContentChange.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _onBodyContentChange() {
|
private _onBodyContentChange(e: monaco.editor.IModelContentChangedEvent) {
|
||||||
const editorModel = this.editor().getModel();
|
const editorModel = this.editor().getModel();
|
||||||
this.editorContent(editorModel.getValue());
|
this.editorContent(editorModel.getValue());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { BindingHandlersRegisterer } from "./Bindings/BindingHandlersRegisterer"
|
|||||||
import Explorer from "./Explorer/Explorer";
|
import Explorer from "./Explorer/Explorer";
|
||||||
|
|
||||||
export const applyExplorerBindings = (explorer: Explorer) => {
|
export const applyExplorerBindings = (explorer: Explorer) => {
|
||||||
if (!!explorer) {
|
if (explorer) {
|
||||||
window.dataExplorer = explorer;
|
window.dataExplorer = explorer;
|
||||||
BindingHandlersRegisterer.registerBindingHandlers();
|
BindingHandlersRegisterer.registerBindingHandlers();
|
||||||
ko.applyBindings(explorer);
|
ko.applyBindings(explorer);
|
||||||
|
|||||||
Reference in New Issue
Block a user