mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 03:57:31 +00:00
lint fix
This commit is contained in:
@@ -129,7 +129,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onlineCopyEnabled: {
|
onlineCopyEnabled: {
|
||||||
title: "Online copy enabled",
|
title: "Online copy enabled",
|
||||||
description: (accountName: string) => `"To enable the online copy feature on your ${accountName} account, proceed with the action below.`,
|
description: (accountName: string) =>
|
||||||
|
`"To enable the online copy feature on your ${accountName} account, proceed with the action below.`,
|
||||||
hrefText: "Learn more about online copy jobs",
|
hrefText: "Learn more about online copy jobs",
|
||||||
href: "https://learn.microsoft.com/en-us/azure/cosmos-db/container-copy?tabs=online-copy&pivots=api-nosql#enable-online-copy",
|
href: "https://learn.microsoft.com/en-us/azure/cosmos-db/container-copy?tabs=online-copy&pivots=api-nosql#enable-online-copy",
|
||||||
buttonText: "Enable Online Copy",
|
buttonText: "Enable Online Copy",
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const CopyJobContextProvider: React.FC<CopyJobContextProviderProps> = (props) =>
|
|||||||
flow,
|
flow,
|
||||||
setFlow,
|
setFlow,
|
||||||
resetCopyJobState,
|
resetCopyJobState,
|
||||||
explorer: props.explorer
|
explorer: props.explorer,
|
||||||
};
|
};
|
||||||
|
|
||||||
return <CopyJobContext.Provider value={contextValue}>{props.children}</CopyJobContext.Provider>;
|
return <CopyJobContext.Provider value={contextValue}>{props.children}</CopyJobContext.Provider>;
|
||||||
|
|||||||
@@ -32,42 +32,42 @@ type setCopyJobStateType = CopyJobContextProviderType["setCopyJobState"];
|
|||||||
|
|
||||||
export function useEventHandlers(setCopyJobState: setCopyJobStateType) {
|
export function useEventHandlers(setCopyJobState: setCopyJobStateType) {
|
||||||
const { setValidationCache } = useCopyJobPrerequisitesCache();
|
const { setValidationCache } = useCopyJobPrerequisitesCache();
|
||||||
const handleSelectSourceAccount = (type: "subscription" | "account", data: (Subscription & DatabaseAccount) | undefined) => {
|
const handleSelectSourceAccount = (
|
||||||
setCopyJobState((prevState: CopyJobContextState) => {
|
type: "subscription" | "account",
|
||||||
if (type === "subscription") {
|
data: (Subscription & DatabaseAccount) | undefined,
|
||||||
return {
|
) => {
|
||||||
...prevState,
|
setCopyJobState((prevState: CopyJobContextState) => {
|
||||||
source: {
|
if (type === "subscription") {
|
||||||
...prevState.source,
|
return {
|
||||||
subscription: data || null,
|
...prevState,
|
||||||
account: null,
|
source: {
|
||||||
},
|
...prevState.source,
|
||||||
};
|
subscription: data || null,
|
||||||
}
|
account: null,
|
||||||
if (type === "account") {
|
},
|
||||||
return {
|
};
|
||||||
...prevState,
|
}
|
||||||
source: {
|
if (type === "account") {
|
||||||
...prevState.source,
|
return {
|
||||||
account: data || null,
|
...prevState,
|
||||||
},
|
source: {
|
||||||
};
|
...prevState.source,
|
||||||
}
|
account: data || null,
|
||||||
return prevState;
|
},
|
||||||
});
|
};
|
||||||
setValidationCache(new Map<string, boolean>());
|
}
|
||||||
};
|
return prevState;
|
||||||
|
});
|
||||||
|
setValidationCache(new Map<string, boolean>());
|
||||||
|
};
|
||||||
|
|
||||||
const handleMigrationTypeChange = React.useCallback(
|
const handleMigrationTypeChange = React.useCallback((_ev?: React.FormEvent<HTMLElement>, checked?: boolean) => {
|
||||||
(_ev?: React.FormEvent<HTMLElement>, checked?: boolean) => {
|
setCopyJobState((prevState: CopyJobContextState) => ({
|
||||||
setCopyJobState((prevState: CopyJobContextState) => ({
|
...prevState,
|
||||||
...prevState,
|
migrationType: checked ? CopyJobMigrationType.Offline : CopyJobMigrationType.Online,
|
||||||
migrationType: checked ? CopyJobMigrationType.Offline : CopyJobMigrationType.Online,
|
}));
|
||||||
}));
|
setValidationCache(new Map<string, boolean>());
|
||||||
setValidationCache(new Map<string, boolean>());
|
}, []);
|
||||||
},
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
|
|
||||||
return { handleSelectSourceAccount, handleMigrationTypeChange };
|
return { handleSelectSourceAccount, handleMigrationTypeChange };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user