From cebf044803e58a56710adbecaf1bcf05587b8627 Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Wed, 29 May 2024 18:20:07 +0200 Subject: [PATCH] Fix typo (#1849) --- src/Contracts/ViewModels.ts | 12 ++--- src/Explorer/Tabs/ConflictsTab.ts | 46 +++++++++--------- .../DocumentsTabV2/DocumentsTabV2.test.tsx | 30 ++++++------ .../Tabs/DocumentsTabV2/DocumentsTabV2.tsx | 48 +++++++++---------- src/Explorer/Tabs/ScriptTabBase.ts | 12 ++--- .../StoredProcedureTabComponent.tsx | 2 +- src/Explorer/Tabs/TriggerTabContent.tsx | 2 +- .../Tabs/UserDefinedFunctionTabContent.tsx | 2 +- 8 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/Contracts/ViewModels.ts b/src/Contracts/ViewModels.ts index 66fd54ec4..e50ba6769 100644 --- a/src/Contracts/ViewModels.ts +++ b/src/Contracts/ViewModels.ts @@ -324,9 +324,9 @@ export enum DocumentExplorerState { noDocumentSelected, newDocumentValid, newDocumentInvalid, - exisitingDocumentNoEdits, - exisitingDocumentDirtyValid, - exisitingDocumentDirtyInvalid, + existingDocumentNoEdits, + existingDocumentDirtyValid, + existingDocumentDirtyInvalid, } export enum IndexingPolicyEditorState { @@ -339,9 +339,9 @@ export enum IndexingPolicyEditorState { export enum ScriptEditorState { newInvalid, newValid, - exisitingNoEdits, - exisitingDirtyValid, - exisitingDirtyInvalid, + existingNoEdits, + existingDirtyValid, + existingDirtyInvalid, } export enum CollectionTabKind { diff --git a/src/Explorer/Tabs/ConflictsTab.ts b/src/Explorer/Tabs/ConflictsTab.ts index c01c206c1..15355bd63 100644 --- a/src/Explorer/Tabs/ConflictsTab.ts +++ b/src/Explorer/Tabs/ConflictsTab.ts @@ -6,16 +6,16 @@ import DiscardIcon from "../../../images/discard.svg"; import SaveIcon from "../../../images/save-cosmos.svg"; 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 { 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 * as DataModels from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; @@ -117,15 +117,15 @@ export default class ConflictsTab extends TabsBase { this.isEditorDirty = ko.computed(() => { switch (this.editorState()) { case ViewModels.DocumentExplorerState.noDocumentSelected: - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: return false; case ViewModels.DocumentExplorerState.newDocumentValid: case ViewModels.DocumentExplorerState.newDocumentInvalid: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid: return true; - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: return ( this.selectedConflictCurrent.getEditableOriginalValue() !== this.selectedConflictCurrent.getEditableCurrentValue() @@ -139,8 +139,8 @@ export default class ConflictsTab extends TabsBase { this.acceptChangesButton = { enabled: ko.computed(() => { switch (this.editorState()) { - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: return true; } @@ -155,8 +155,8 @@ export default class ConflictsTab extends TabsBase { this.discardButton = { enabled: ko.computed(() => { switch (this.editorState()) { - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid: return true; } @@ -171,8 +171,8 @@ export default class ConflictsTab extends TabsBase { this.deleteButton = { enabled: ko.computed(() => { switch (this.editorState()) { - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: return true; } @@ -247,7 +247,7 @@ export default class ConflictsTab extends TabsBase { return Q(); } - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentNoEdits); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentNoEdits); return Q(); } @@ -407,22 +407,22 @@ export default class ConflictsTab extends TabsBase { public onDiscardClick = (): Q.Promise => { this.selectedConflictContent(this.selectedConflictContent.getEditableOriginalValue()); - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentNoEdits); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentNoEdits); return Q(); }; public onValidDocumentEdit(): Q.Promise { - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentDirtyValid); return Q(); } public onInvalidDocumentEdit(): Q.Promise { if ( - this.editorState() === ViewModels.DocumentExplorerState.exisitingDocumentNoEdits || - this.editorState() === ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid + this.editorState() === ViewModels.DocumentExplorerState.existingDocumentNoEdits || + this.editorState() === ViewModels.DocumentExplorerState.existingDocumentDirtyValid ) { - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid); return Q(); } @@ -555,7 +555,7 @@ export default class ConflictsTab extends TabsBase { let parsedConflictContent: any = JSON.parse(documentToInsert); const renderedConflictContent: string = this.renderObjectForEditor(parsedConflictContent, null, 4); this.selectedConflictContent.setBaseline(renderedConflictContent); - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentNoEdits); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentNoEdits); } return Q(); @@ -576,7 +576,7 @@ export default class ConflictsTab extends TabsBase { const renderedConflictContent: string = this.renderObjectForEditor(parsedConflictContent, null, 4); this.selectedConflictContent.setBaseline(renderedConflictContent); - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentNoEdits); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentNoEdits); } return Q(); @@ -588,7 +588,7 @@ export default class ConflictsTab extends TabsBase { parsedDocumentToDelete = ConflictsTab.removeSystemProperties(parsedDocumentToDelete); const renderedDocumentToDelete: string = this.renderObjectForEditor(parsedDocumentToDelete, null, 4); this.selectedConflictContent.setBaseline(renderedDocumentToDelete); - this.editorState(ViewModels.DocumentExplorerState.exisitingDocumentNoEdits); + this.editorState(ViewModels.DocumentExplorerState.existingDocumentNoEdits); } return Q(); diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.test.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.test.tsx index d224c2f9a..3d2b1e663 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.test.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.test.tsx @@ -179,17 +179,17 @@ describe("Documents tab (noSql API)", () => { testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentValid, enabled: true, visible: true }); testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentInvalid, enabled: false, visible: true }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentNoEdits, + state: ViewModels.DocumentExplorerState.existingDocumentNoEdits, enabled: false, visible: false, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyValid, enabled: false, visible: false, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid, enabled: false, visible: false, }); @@ -211,17 +211,17 @@ describe("Documents tab (noSql API)", () => { testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentValid, enabled: true, visible: true }); testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentInvalid, enabled: true, visible: true }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentNoEdits, + state: ViewModels.DocumentExplorerState.existingDocumentNoEdits, enabled: false, visible: false, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyValid, enabled: false, visible: false, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid, enabled: false, visible: false, }); @@ -243,17 +243,17 @@ describe("Documents tab (noSql API)", () => { testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentValid, enabled: false, visible: false }); testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentInvalid, enabled: false, visible: false }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentNoEdits, + state: ViewModels.DocumentExplorerState.existingDocumentNoEdits, enabled: false, visible: true, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyValid, enabled: true, visible: true, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid, enabled: false, visible: true, }); @@ -275,17 +275,17 @@ describe("Documents tab (noSql API)", () => { testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentValid, enabled: false, visible: false }); testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentInvalid, enabled: false, visible: false }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentNoEdits, + state: ViewModels.DocumentExplorerState.existingDocumentNoEdits, enabled: false, visible: true, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyValid, enabled: true, visible: true, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid, enabled: true, visible: true, }); @@ -306,14 +306,14 @@ describe("Documents tab (noSql API)", () => { testCases.add({ state: ViewModels.DocumentExplorerState.noDocumentSelected, enabled: false, visible: false }); testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentValid, enabled: false, visible: false }); testCases.add({ state: ViewModels.DocumentExplorerState.newDocumentInvalid, enabled: false, visible: false }); - testCases.add({ state: ViewModels.DocumentExplorerState.exisitingDocumentNoEdits, enabled: true, visible: true }); + testCases.add({ state: ViewModels.DocumentExplorerState.existingDocumentNoEdits, enabled: true, visible: true }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyValid, enabled: true, visible: true, }); testCases.add({ - state: ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid, + state: ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid, enabled: true, visible: true, }); diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx index 1fb6ed9db..06d472d5b 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx @@ -146,7 +146,7 @@ export const getDiscardNewDocumentChangesButtonState = (editorState: ViewModels. export const getSaveExistingDocumentButtonState = (editorState: ViewModels.DocumentExplorerState) => ({ enabled: (() => { switch (editorState) { - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: return true; default: return false; @@ -155,9 +155,9 @@ export const getSaveExistingDocumentButtonState = (editorState: ViewModels.Docum visible: (() => { switch (editorState) { - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: return true; default: return false; @@ -169,8 +169,8 @@ export const getSaveExistingDocumentButtonState = (editorState: ViewModels.Docum export const getDiscardExistingDocumentChangesButtonState = (editorState: ViewModels.DocumentExplorerState) => ({ enabled: (() => { switch (editorState) { - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: return true; default: return false; @@ -179,9 +179,9 @@ export const getDiscardExistingDocumentChangesButtonState = (editorState: ViewMo visible: (() => { switch (editorState) { - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: return true; default: return false; @@ -368,7 +368,7 @@ const getNewDocumentButtonState = (editorState: ViewModels.DocumentExplorerState enabled: (() => { switch (editorState) { case ViewModels.DocumentExplorerState.noDocumentSelected: - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: return true; default: return false; @@ -588,15 +588,15 @@ export const DocumentsTabComponent: React.FunctionComponent { switch (editorState) { case ViewModels.DocumentExplorerState.noDocumentSelected: - case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits: + case ViewModels.DocumentExplorerState.existingDocumentNoEdits: return false; case ViewModels.DocumentExplorerState.newDocumentValid: case ViewModels.DocumentExplorerState.newDocumentInvalid: - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyInvalid: return true; - case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid: + case ViewModels.DocumentExplorerState.existingDocumentDirtyValid: return true; default: @@ -685,7 +685,7 @@ export const DocumentsTabComponent: React.FunctionComponent { @@ -1234,10 +1234,10 @@ export const DocumentsTabComponent: React.FunctionComponent(); @@ -77,15 +77,15 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode this.editorState(ViewModels.ScriptEditorState.newInvalid); } break; - case ViewModels.ScriptEditorState.exisitingDirtyInvalid: - case ViewModels.ScriptEditorState.exisitingDirtyValid: + case ViewModels.ScriptEditorState.existingDirtyInvalid: + case ViewModels.ScriptEditorState.existingDirtyValid: if (isValid) { - this.editorState(ViewModels.ScriptEditorState.exisitingDirtyValid); + this.editorState(ViewModels.ScriptEditorState.existingDirtyValid); } else { - this.editorState(ViewModels.ScriptEditorState.exisitingDirtyInvalid); + this.editorState(ViewModels.ScriptEditorState.existingDirtyInvalid); } break; - case ViewModels.ScriptEditorState.exisitingDirtyValid: + case ViewModels.ScriptEditorState.existingDirtyValid: default: break; } diff --git a/src/Explorer/Tabs/StoredProcedureTab/StoredProcedureTabComponent.tsx b/src/Explorer/Tabs/StoredProcedureTab/StoredProcedureTabComponent.tsx index ce8c6ac45..1f230b305 100644 --- a/src/Explorer/Tabs/StoredProcedureTab/StoredProcedureTabComponent.tsx +++ b/src/Explorer/Tabs/StoredProcedureTab/StoredProcedureTabComponent.tsx @@ -404,7 +404,7 @@ export default class StoredProcedureTabComponent extends React.Component< this.node = this.collection.createStoredProcedureNode(createdResource); this.props.scriptTabBaseInstance.node = this.node; useTabs.getState().updateTab(this.props.scriptTabBaseInstance); - this.props.scriptTabBaseInstance.editorState(ViewModels.ScriptEditorState.exisitingNoEdits); + this.props.scriptTabBaseInstance.editorState(ViewModels.ScriptEditorState.existingNoEdits); this.setState({ executeButton: { diff --git a/src/Explorer/Tabs/TriggerTabContent.tsx b/src/Explorer/Tabs/TriggerTabContent.tsx index 5fd28502a..28e81ee38 100644 --- a/src/Explorer/Tabs/TriggerTabContent.tsx +++ b/src/Explorer/Tabs/TriggerTabContent.tsx @@ -114,7 +114,7 @@ export class TriggerTabContent extends Component