mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-12-02 02:17:01 +00:00
Fix typo and format
This commit is contained in:
parent
e9d713e65b
commit
0887998461
@ -160,7 +160,7 @@ const getSaveExistingDocumentButtonState = (editorState: ViewModels.DocumentExpl
|
|||||||
})(),
|
})(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const getDiscardExisitingDocumentChangesButtonState = (editorState: ViewModels.DocumentExplorerState) => ({
|
const getDiscardExistingDocumentChangesButtonState = (editorState: ViewModels.DocumentExplorerState) => ({
|
||||||
enabled: (() => {
|
enabled: (() => {
|
||||||
switch (editorState) {
|
switch (editorState) {
|
||||||
case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid:
|
case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid:
|
||||||
@ -183,7 +183,7 @@ const getDiscardExisitingDocumentChangesButtonState = (editorState: ViewModels.D
|
|||||||
})(),
|
})(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const getDeleteExisitingDocumentButtonState = (
|
const getDeleteExistingDocumentButtonState = (
|
||||||
editorState: ViewModels.DocumentExplorerState,
|
editorState: ViewModels.DocumentExplorerState,
|
||||||
selectedRows: Set<TableRowId>,
|
selectedRows: Set<TableRowId>,
|
||||||
) => ({
|
) => ({
|
||||||
@ -220,8 +220,8 @@ type ButtonsDependencies = {
|
|||||||
onSaveNewDocumentClick: UiKeyboardEvent;
|
onSaveNewDocumentClick: UiKeyboardEvent;
|
||||||
onRevertNewDocumentClick: UiKeyboardEvent;
|
onRevertNewDocumentClick: UiKeyboardEvent;
|
||||||
onSaveExistingDocumentClick: UiKeyboardEvent;
|
onSaveExistingDocumentClick: UiKeyboardEvent;
|
||||||
onRevertExisitingDocumentClick: UiKeyboardEvent;
|
onRevertExistingDocumentClick: UiKeyboardEvent;
|
||||||
onDeleteExisitingDocumentsClick: UiKeyboardEvent;
|
onDeleteExistingDocumentsClick: UiKeyboardEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTabsButtons = ({
|
const getTabsButtons = ({
|
||||||
@ -233,8 +233,8 @@ const getTabsButtons = ({
|
|||||||
onSaveNewDocumentClick,
|
onSaveNewDocumentClick,
|
||||||
onRevertNewDocumentClick,
|
onRevertNewDocumentClick,
|
||||||
onSaveExistingDocumentClick,
|
onSaveExistingDocumentClick,
|
||||||
onRevertExisitingDocumentClick,
|
onRevertExistingDocumentClick,
|
||||||
onDeleteExisitingDocumentsClick,
|
onDeleteExistingDocumentsClick,
|
||||||
}: ButtonsDependencies): CommandButtonComponentProps[] => {
|
}: ButtonsDependencies): CommandButtonComponentProps[] => {
|
||||||
if (configContext.platform === Platform.Fabric && userContext.fabricContext?.isReadOnly) {
|
if (configContext.platform === Platform.Fabric && userContext.fabricContext?.isReadOnly) {
|
||||||
// All the following buttons require write access
|
// All the following buttons require write access
|
||||||
@ -307,34 +307,34 @@ const getTabsButtons = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDiscardExisitingDocumentChangesButtonState(editorState).visible) {
|
if (getDiscardExistingDocumentChangesButtonState(editorState).visible) {
|
||||||
const label = "Discard";
|
const label = "Discard";
|
||||||
buttons.push({
|
buttons.push({
|
||||||
iconSrc: DiscardIcon,
|
iconSrc: DiscardIcon,
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
keyboardAction: KeyboardAction.CANCEL_OR_DISCARD,
|
keyboardAction: KeyboardAction.CANCEL_OR_DISCARD,
|
||||||
onCommandClick: onRevertExisitingDocumentClick,
|
onCommandClick: onRevertExistingDocumentClick,
|
||||||
commandButtonLabel: label,
|
commandButtonLabel: label,
|
||||||
ariaLabel: label,
|
ariaLabel: label,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
disabled:
|
disabled:
|
||||||
!getDiscardExisitingDocumentChangesButtonState(editorState).enabled ||
|
!getDiscardExistingDocumentChangesButtonState(editorState).enabled ||
|
||||||
useSelectedNode.getState().isQueryCopilotCollectionSelected(),
|
useSelectedNode.getState().isQueryCopilotCollectionSelected(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDeleteExisitingDocumentButtonState(editorState, selectedRows).visible) {
|
if (getDeleteExistingDocumentButtonState(editorState, selectedRows).visible) {
|
||||||
const label = "Delete";
|
const label = "Delete";
|
||||||
buttons.push({
|
buttons.push({
|
||||||
iconSrc: DeleteDocumentIcon,
|
iconSrc: DeleteDocumentIcon,
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
keyboardAction: KeyboardAction.DELETE_ITEM,
|
keyboardAction: KeyboardAction.DELETE_ITEM,
|
||||||
onCommandClick: onDeleteExisitingDocumentsClick,
|
onCommandClick: onDeleteExistingDocumentsClick,
|
||||||
commandButtonLabel: label,
|
commandButtonLabel: label,
|
||||||
ariaLabel: label,
|
ariaLabel: label,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
disabled:
|
disabled:
|
||||||
!getDeleteExisitingDocumentButtonState(editorState, selectedRows).enabled ||
|
!getDeleteExistingDocumentButtonState(editorState, selectedRows).enabled ||
|
||||||
useSelectedNode.getState().isQueryCopilotCollectionSelected(),
|
useSelectedNode.getState().isQueryCopilotCollectionSelected(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -523,8 +523,8 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
onSaveNewDocumentClick,
|
onSaveNewDocumentClick,
|
||||||
onRevertNewDocumentClick,
|
onRevertNewDocumentClick,
|
||||||
onSaveExistingDocumentClick,
|
onSaveExistingDocumentClick,
|
||||||
onRevertExisitingDocumentClick,
|
onRevertExistingDocumentClick,
|
||||||
onDeleteExisitingDocumentsClick,
|
onDeleteExistingDocumentsClick,
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -722,7 +722,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
.finally(() => setIsExecuting(false));
|
.finally(() => setIsExecuting(false));
|
||||||
}, [onExecutionErrorChange, tabTitle, selectedDocumentContent, _collection, partitionKey, documentIds, clickedRow]);
|
}, [onExecutionErrorChange, tabTitle, selectedDocumentContent, _collection, partitionKey, documentIds, clickedRow]);
|
||||||
|
|
||||||
const onRevertExisitingDocumentClick = useCallback((): void => {
|
const onRevertExistingDocumentClick = useCallback((): void => {
|
||||||
setSelectedDocumentContentBaseline(initialDocumentContent);
|
setSelectedDocumentContentBaseline(initialDocumentContent);
|
||||||
// this.initialDocumentContent.valueHasMutated();
|
// this.initialDocumentContent.valueHasMutated();
|
||||||
setSelectedDocumentContent(selectedDocumentContentBaseline);
|
setSelectedDocumentContent(selectedDocumentContentBaseline);
|
||||||
@ -810,7 +810,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
[onExecutionErrorChange, _deleteDocuments, documentIds],
|
[onExecutionErrorChange, _deleteDocuments, documentIds],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onDeleteExisitingDocumentsClick = useCallback(async (): Promise<void> => {
|
const onDeleteExistingDocumentsClick = useCallback(async (): Promise<void> => {
|
||||||
// const selectedDocumentId = this.selectedDocumentId();
|
// const selectedDocumentId = this.selectedDocumentId();
|
||||||
|
|
||||||
// TODO: Rework this for localization
|
// TODO: Rework this for localization
|
||||||
@ -848,8 +848,8 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
onSaveNewDocumentClick,
|
onSaveNewDocumentClick,
|
||||||
onRevertNewDocumentClick,
|
onRevertNewDocumentClick,
|
||||||
onSaveExistingDocumentClick,
|
onSaveExistingDocumentClick,
|
||||||
onRevertExisitingDocumentClick,
|
onRevertExistingDocumentClick: onRevertExistingDocumentClick,
|
||||||
onDeleteExisitingDocumentsClick,
|
onDeleteExistingDocumentsClick: onDeleteExistingDocumentsClick,
|
||||||
}),
|
}),
|
||||||
[
|
[
|
||||||
_collection,
|
_collection,
|
||||||
@ -860,8 +860,8 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
onSaveNewDocumentClick,
|
onSaveNewDocumentClick,
|
||||||
onRevertNewDocumentClick,
|
onRevertNewDocumentClick,
|
||||||
onSaveExistingDocumentClick,
|
onSaveExistingDocumentClick,
|
||||||
onRevertExisitingDocumentClick,
|
onRevertExistingDocumentClick,
|
||||||
onDeleteExisitingDocumentsClick,
|
onDeleteExistingDocumentsClick,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -209,22 +209,22 @@ export const appThemeFabric: Theme = createTheme({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const appThemeFabricTealBrandRamp: BrandVariants = {
|
export const appThemeFabricTealBrandRamp: BrandVariants = {
|
||||||
10: '#001919',
|
10: "#001919",
|
||||||
20: '#012826',
|
20: "#012826",
|
||||||
30: '#01322E',
|
30: "#01322E",
|
||||||
40: '#033f38',
|
40: "#033f38",
|
||||||
50: '#054d43',
|
50: "#054d43",
|
||||||
60: '#0a5c50',
|
60: "#0a5c50",
|
||||||
70: '#0c695a',
|
70: "#0c695a",
|
||||||
80: '#117865',
|
80: "#117865",
|
||||||
90: '#1f937e',
|
90: "#1f937e",
|
||||||
100: '#2aaC94',
|
100: "#2aaC94",
|
||||||
110: '#3abb9f',
|
110: "#3abb9f",
|
||||||
120: '#52c7aa',
|
120: "#52c7aa",
|
||||||
130: '#78d3b9',
|
130: "#78d3b9",
|
||||||
140: '#9ee0cb',
|
140: "#9ee0cb",
|
||||||
150: '#c0ecdd',
|
150: "#c0ecdd",
|
||||||
160: '#e3f7ef',
|
160: "#e3f7ef",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const appThemeFabricV9 = createLightTheme(appThemeFabricTealBrandRamp);
|
export const appThemeFabricV9 = createLightTheme(appThemeFabricTealBrandRamp);
|
Loading…
Reference in New Issue
Block a user