mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-05 01:01:46 +00:00
Migrate Copilot local persistence (toggle and prompt history) to new local storage infrastructure (#1948)
* Migrate copilot persistence to AppState * Migrate persistence of toggle and history to new infra * Save toggle value as boolean * Fix compile bug * Fix unit tests
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { LocalStorageUtility, StorageKey } from "Shared/StorageUtility";
|
||||
|
||||
// The component name whose state is being saved. Component name must not include special characters.
|
||||
export type ComponentName = "DocumentsTab";
|
||||
export enum AppStateComponentNames {
|
||||
DocumentsTab = "DocumentsTab",
|
||||
QueryCopilot = "QueryCopilot",
|
||||
}
|
||||
|
||||
export const PATH_SEPARATOR = "/"; // export for testing purposes
|
||||
const SCHEMA_VERSION = 1;
|
||||
|
||||
@@ -14,8 +18,9 @@ export interface StateData {
|
||||
data: unknown;
|
||||
}
|
||||
|
||||
type StorePath = {
|
||||
componentName: string;
|
||||
// Export for testing purposes
|
||||
export type StorePath = {
|
||||
componentName: AppStateComponentNames;
|
||||
subComponentName?: string;
|
||||
globalAccountName?: string;
|
||||
databaseName?: string;
|
||||
|
||||
Reference in New Issue
Block a user