mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-01 23:32:02 +00:00
* Persist query multiple query texts * Save multiple query tab histories * Save and restore states for QueryTab and DocumentsTab for SQL and Mongo * Enable Collection Scale/Settings restore * Persist documents tab current filter * Fix DocumentsTab conflict resolve mistake * Remove unused variable * Fix e2e test * Fix e2e localStorage reference * Try clearing local storage via playwright page * Clear local storage after opening page * Move restore flag behind feature flag. Whitelist restorable tabs in for Fabric. Restore e2e tests. * Fix typo * Fix: avoid setting undefined for preferredSize for the <Allotment.Pane> * Add comments * Move restore tabs after knockout configure step from Explorer constructor (which could be called multiple times)
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { ActionType, OpenCollectionTab, TabKind } from "Contracts/ActionContracts";
|
|
import React from "react";
|
|
import * as ViewModels from "../../Contracts/ViewModels";
|
|
import { SettingsComponent } from "../Controls/Settings/SettingsComponent";
|
|
import TabsBase from "./TabsBase";
|
|
|
|
export class SettingsTabV2 extends TabsBase {
|
|
public render(): JSX.Element {
|
|
return <SettingsComponent settingsTab={this} />;
|
|
}
|
|
}
|
|
|
|
export class CollectionSettingsTabV2 extends SettingsTabV2 {
|
|
protected persistedState: OpenCollectionTab;
|
|
|
|
constructor(options: ViewModels.TabOptions) {
|
|
super(options);
|
|
this.persistedState = {
|
|
actionType: ActionType.OpenCollectionTab,
|
|
tabKind: TabKind.ScaleSettings,
|
|
databaseResourceId: options.collection.databaseId,
|
|
collectionResourceId: options.collection.id(),
|
|
};
|
|
}
|
|
|
|
public onActivate(): void {
|
|
super.onActivate();
|
|
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.CollectionSettingsV2);
|
|
}
|
|
}
|
|
|
|
export class DatabaseSettingsTabV2 extends SettingsTabV2 {
|
|
public onActivate(): void {
|
|
super.onActivate();
|
|
this.database.selectedSubnodeKind(ViewModels.CollectionTabKind.DatabaseSettingsV2);
|
|
}
|
|
}
|