mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-06 03:00:23 +00:00
When opening scale and settings, refresh databases
This commit is contained in:
@@ -437,13 +437,14 @@ export default class Explorer {
|
|||||||
public onRefreshResourcesClick = async (): Promise<void> => {
|
public onRefreshResourcesClick = async (): Promise<void> => {
|
||||||
if (isFabricMirroredKey()) {
|
if (isFabricMirroredKey()) {
|
||||||
scheduleRefreshFabricToken(true).then(() => this.refreshAllDatabases());
|
scheduleRefreshFabricToken(true).then(() => this.refreshAllDatabases());
|
||||||
return;
|
} else {
|
||||||
|
await (userContext.authType === AuthType.ResourceToken
|
||||||
|
? this.refreshDatabaseForResourceToken()
|
||||||
|
: this.refreshAllDatabases());
|
||||||
|
await this.refreshNotebookList();
|
||||||
}
|
}
|
||||||
|
|
||||||
await (userContext.authType === AuthType.ResourceToken
|
logConsoleInfo("Successfully refreshed databases");
|
||||||
? this.refreshDatabaseForResourceToken()
|
|
||||||
: this.refreshAllDatabases());
|
|
||||||
await this.refreshNotebookList();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Facade
|
// Facade
|
||||||
|
|||||||
@@ -599,6 +599,16 @@ export default class Collection implements ViewModels.Collection {
|
|||||||
useSelectedNode.getState().setSelectedNode(this);
|
useSelectedNode.getState().setSelectedNode(this);
|
||||||
const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit;
|
const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit;
|
||||||
throughputCap && throughputCap !== -1 ? await useDatabases.getState().loadAllOffers() : await this.loadOffer();
|
throughputCap && throughputCap !== -1 ? await useDatabases.getState().loadAllOffers() : await this.loadOffer();
|
||||||
|
// if (throughputCap && throughputCap !== -1) {
|
||||||
|
// try {
|
||||||
|
// await useDatabases.getState().loadAllOffers();
|
||||||
|
// } catch {
|
||||||
|
// console.log("Fail quietly");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// await this.loadOffer();
|
||||||
|
// }
|
||||||
this.selectedSubnodeKind(ViewModels.CollectionTabKind.Settings);
|
this.selectedSubnodeKind(ViewModels.CollectionTabKind.Settings);
|
||||||
TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, {
|
||||||
description: "Settings node",
|
description: "Settings node",
|
||||||
|
|||||||
@@ -457,12 +457,15 @@ export class DataExplorer {
|
|||||||
|
|
||||||
/** Opens the Scale & Settings panel for the specified container */
|
/** Opens the Scale & Settings panel for the specified container */
|
||||||
async openScaleAndSettings(context: TestContainerContext): Promise<void> {
|
async openScaleAndSettings(context: TestContainerContext): Promise<void> {
|
||||||
|
const containerNode = await this.waitForContainerNode(context.database.id, context.container.id);
|
||||||
|
await containerNode.expand();
|
||||||
|
|
||||||
// refresh tree to remove deleted database
|
// refresh tree to remove deleted database
|
||||||
const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton");
|
const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton");
|
||||||
await refreshButton.click();
|
await refreshButton.click();
|
||||||
|
await expect(this.getConsoleMessage()).toContainText("Successfully refreshed databases", {
|
||||||
const containerNode = await this.waitForContainerNode(context.database.id, context.container.id);
|
timeout: ONE_MINUTE_MS,
|
||||||
await containerNode.expand();
|
});
|
||||||
|
|
||||||
const scaleAndSettingsButton = this.frame.getByTestId(
|
const scaleAndSettingsButton = this.frame.getByTestId(
|
||||||
`TreeNode:${context.database.id}/${context.container.id}/Scale & Settings`,
|
`TreeNode:${context.database.id}/${context.container.id}/Scale & Settings`,
|
||||||
|
|||||||
@@ -123,4 +123,4 @@ test.describe("Autoscale and Manual throughput", () => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
getAzureCLICredentials,
|
getAzureCLICredentials,
|
||||||
resourceGroupName,
|
resourceGroupName,
|
||||||
subscriptionId,
|
subscriptionId,
|
||||||
TestAccount
|
TestAccount,
|
||||||
} from "./fx";
|
} from "./fx";
|
||||||
|
|
||||||
export interface TestItem {
|
export interface TestItem {
|
||||||
|
|||||||
Reference in New Issue
Block a user