mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-11 23:17:38 +01:00
fix playwright tests
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
import {
|
import {
|
||||||
ActionButton,
|
ActionButton,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
DefaultButton,
|
DefaultButton,
|
||||||
DirectionalHint,
|
DirectionalHint,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Icon,
|
Icon,
|
||||||
IconButton,
|
IconButton,
|
||||||
IDropdownOption,
|
IDropdownOption,
|
||||||
Link,
|
Link,
|
||||||
ProgressIndicator,
|
ProgressIndicator,
|
||||||
Separator,
|
Separator,
|
||||||
Stack,
|
Stack,
|
||||||
TeachingBubble,
|
TeachingBubble,
|
||||||
Text,
|
Text,
|
||||||
TooltipHost,
|
TooltipHost,
|
||||||
} from "@fluentui/react";
|
} from "@fluentui/react";
|
||||||
import * as Constants from "Common/Constants";
|
import * as Constants from "Common/Constants";
|
||||||
import { createCollection } from "Common/dataAccess/createCollection";
|
import { createCollection } from "Common/dataAccess/createCollection";
|
||||||
@@ -24,21 +24,21 @@ import { AccountOverride } from "Contracts/DataModels";
|
|||||||
import { FullTextPoliciesComponent } from "Explorer/Controls/FullTextSeach/FullTextPoliciesComponent";
|
import { FullTextPoliciesComponent } from "Explorer/Controls/FullTextSeach/FullTextPoliciesComponent";
|
||||||
import { VectorEmbeddingPoliciesComponent } from "Explorer/Controls/VectorSearch/VectorEmbeddingPoliciesComponent";
|
import { VectorEmbeddingPoliciesComponent } from "Explorer/Controls/VectorSearch/VectorEmbeddingPoliciesComponent";
|
||||||
import {
|
import {
|
||||||
AllPropertiesIndexed,
|
AllPropertiesIndexed,
|
||||||
AnalyticalStoreHeader,
|
AnalyticalStoreHeader,
|
||||||
ContainerVectorPolicyTooltipContent,
|
ContainerVectorPolicyTooltipContent,
|
||||||
FullTextPolicyDefault,
|
FullTextPolicyDefault,
|
||||||
getPartitionKey,
|
getPartitionKey,
|
||||||
getPartitionKeyName,
|
getPartitionKeyName,
|
||||||
getPartitionKeyPlaceHolder,
|
getPartitionKeyPlaceHolder,
|
||||||
getPartitionKeyTooltipText,
|
getPartitionKeyTooltipText,
|
||||||
isFreeTierAccount,
|
isFreeTierAccount,
|
||||||
isSynapseLinkEnabled,
|
isSynapseLinkEnabled,
|
||||||
parseUniqueKeys,
|
parseUniqueKeys,
|
||||||
scrollToSection,
|
scrollToSection,
|
||||||
SharedDatabaseDefault,
|
SharedDatabaseDefault,
|
||||||
shouldShowAnalyticalStoreOptions,
|
shouldShowAnalyticalStoreOptions,
|
||||||
UniqueKeysHeader,
|
UniqueKeysHeader,
|
||||||
} from "Explorer/Panes/AddCollectionPanel/AddCollectionPanelUtility";
|
} from "Explorer/Panes/AddCollectionPanel/AddCollectionPanelUtility";
|
||||||
import { useSidePanel } from "hooks/useSidePanel";
|
import { useSidePanel } from "hooks/useSidePanel";
|
||||||
import { useTeachingBubble } from "hooks/useTeachingBubble";
|
import { useTeachingBubble } from "hooks/useTeachingBubble";
|
||||||
@@ -155,6 +155,19 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
if (this.state.errorMessage && this.state.errorMessage !== prevState.errorMessage) {
|
if (this.state.errorMessage && this.state.errorMessage !== prevState.errorMessage) {
|
||||||
scrollToSection("panelContainer");
|
scrollToSection("panelContainer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When the user selects a different "Use existing" database, lazily load its offer so
|
||||||
|
// the "Provision dedicated throughput" checkbox can appear even if the initial
|
||||||
|
// loadDatabaseOffers() call could not load this database's offer (e.g. due to a
|
||||||
|
// transient ARM error shortly after the database was created).
|
||||||
|
if (!this.state.createNewDatabase && this.state.selectedDatabaseId !== prevState.selectedDatabaseId) {
|
||||||
|
const selectedDatabase = useDatabases
|
||||||
|
.getState()
|
||||||
|
.databases?.find((database) => database.id() === this.state.selectedDatabaseId);
|
||||||
|
if (selectedDatabase && !selectedDatabase.offer()) {
|
||||||
|
selectedDatabase.loadOffer().then(() => this.forceUpdate()).catch(console.error);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): JSX.Element {
|
render(): JSX.Element {
|
||||||
|
|||||||
@@ -144,11 +144,7 @@ function TabNav({ tab, active, tabKind }: { tab?: Tab; active: boolean; tabKind?
|
|||||||
)}
|
)}
|
||||||
{isQueryErrorThrown(tab, tabKind) && (
|
{isQueryErrorThrown(tab, tabKind) && (
|
||||||
<TooltipHost content="Error">
|
<TooltipHost content="Error">
|
||||||
<img
|
<img src={errorQuery} alt="Error" style={{ marginTop: 4, marginLeft: 4, width: 10, height: 11 }} />
|
||||||
src={errorQuery}
|
|
||||||
alt="Error"
|
|
||||||
style={{ marginTop: 4, marginLeft: 4, width: 10, height: 11 }}
|
|
||||||
/>
|
|
||||||
</TooltipHost>
|
</TooltipHost>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -256,8 +256,12 @@ export default class Database implements ViewModels.Database {
|
|||||||
databaseId: this.id(),
|
databaseId: this.id(),
|
||||||
databaseResourceId: this.self,
|
databaseResourceId: this.self,
|
||||||
};
|
};
|
||||||
this.offer(await readDatabaseOffer(params));
|
try {
|
||||||
this.isOfferRead = true;
|
this.offer(await readDatabaseOffer(params));
|
||||||
|
this.isOfferRead = true;
|
||||||
|
} catch {
|
||||||
|
// Don't propagate - leave isOfferRead false so it can be retried
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -438,7 +438,16 @@ export class DataExplorer {
|
|||||||
* There's only a single "primary" button, but we still require you to pass the label to confirm you're selecting the right button.
|
* There's only a single "primary" button, but we still require you to pass the label to confirm you're selecting the right button.
|
||||||
*/
|
*/
|
||||||
async globalCommandButton(label: string): Promise<Locator> {
|
async globalCommandButton(label: string): Promise<Locator> {
|
||||||
await this.frame.getByTestId("GlobalCommands").click();
|
const globalCommands = this.frame.getByTestId("GlobalCommands");
|
||||||
|
// Prefer the explicit dropdown trigger so we always open the menu rather than
|
||||||
|
// triggering a primary action directly. The SplitButton (wide sidebar) exposes
|
||||||
|
// "More commands" and the MenuButton (narrow sidebar) is labelled "New…".
|
||||||
|
const dropdownTrigger = globalCommands.getByRole("button", { name: "More commands" });
|
||||||
|
if (await dropdownTrigger.isVisible()) {
|
||||||
|
await dropdownTrigger.click();
|
||||||
|
} else {
|
||||||
|
await globalCommands.click();
|
||||||
|
}
|
||||||
return this.frame.getByRole("menuitem", { name: label });
|
return this.frame.getByRole("menuitem", { name: label });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user