From 714f38a1be4cf73a5ea125788de2479721263d7f Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Mon, 28 Apr 2025 07:13:24 +0530 Subject: [PATCH 01/11] Mongo RU Schema Analyzer Deprecation (#2117) * remove menu item * remove unused import --- src/Explorer/Tree/ResourceTreeAdapter.tsx | 15 -------------- .../__snapshots__/treeNodeUtil.test.ts.snap | 20 ------------------- src/Explorer/Tree/treeNodeUtil.tsx | 18 ----------------- 3 files changed, 53 deletions(-) diff --git a/src/Explorer/Tree/ResourceTreeAdapter.tsx b/src/Explorer/Tree/ResourceTreeAdapter.tsx index 76d3e9308..819c73d6c 100644 --- a/src/Explorer/Tree/ResourceTreeAdapter.tsx +++ b/src/Explorer/Tree/ResourceTreeAdapter.tsx @@ -241,21 +241,6 @@ export class ResourceTreeAdapter implements ReactAdapter { contextMenu: ResourceTreeContextMenuButtonFactory.createCollectionContextMenuButton(this.container, collection), }); - if ( - useNotebook.getState().isNotebookEnabled && - userContext.apiType === "Mongo" && - isPublicInternetAccessAllowed() - ) { - children.push({ - label: "Schema (Preview)", - onClick: collection.onSchemaAnalyzerClick.bind(collection), - isSelected: () => - useSelectedNode - .getState() - .isDataNodeSelected(collection.databaseId, collection.id(), [ViewModels.CollectionTabKind.SchemaAnalyzer]), - }); - } - if (userContext.apiType !== "Cassandra" || !isServerlessAccount()) { children.push({ label: database.isDatabaseShared() || isServerlessAccount() ? "Settings" : "Scale & Settings", diff --git a/src/Explorer/Tree/__snapshots__/treeNodeUtil.test.ts.snap b/src/Explorer/Tree/__snapshots__/treeNodeUtil.test.ts.snap index 8b7336600..181f38f2f 100644 --- a/src/Explorer/Tree/__snapshots__/treeNodeUtil.test.ts.snap +++ b/src/Explorer/Tree/__snapshots__/treeNodeUtil.test.ts.snap @@ -338,11 +338,6 @@ exports[`createDatabaseTreeNodes generates the correct tree structure for the Mo "label": "Documents", "onClick": [Function], }, - { - "isSelected": [Function], - "label": "Schema (Preview)", - "onClick": [Function], - }, { "id": "", "isSelected": [Function], @@ -406,11 +401,6 @@ exports[`createDatabaseTreeNodes generates the correct tree structure for the Mo "label": "Documents", "onClick": [Function], }, - { - "isSelected": [Function], - "label": "Schema (Preview)", - "onClick": [Function], - }, { "id": "", "isSelected": [Function], @@ -515,11 +505,6 @@ exports[`createDatabaseTreeNodes generates the correct tree structure for the Mo "label": "Documents", "onClick": [Function], }, - { - "isSelected": [Function], - "label": "Schema (Preview)", - "onClick": [Function], - }, { "id": "sampleSettings", "isSelected": [Function], @@ -610,11 +595,6 @@ exports[`createDatabaseTreeNodes generates the correct tree structure for the Mo "label": "Documents", "onClick": [Function], }, - { - "isSelected": [Function], - "label": "Schema (Preview)", - "onClick": [Function], - }, { "id": "", "isSelected": [Function], diff --git a/src/Explorer/Tree/treeNodeUtil.tsx b/src/Explorer/Tree/treeNodeUtil.tsx index f7f7a764c..838d5c1f0 100644 --- a/src/Explorer/Tree/treeNodeUtil.tsx +++ b/src/Explorer/Tree/treeNodeUtil.tsx @@ -11,7 +11,6 @@ import { getItemName } from "Utils/APITypeUtils"; import { isServerlessAccount } from "Utils/CapabilityUtils"; import { useTabs } from "hooks/useTabs"; import React from "react"; -import { isPublicInternetAccessAllowed } from "../../Common/DatabaseAccountUtility"; import { Platform, configContext } from "../../ConfigContext"; import * as DataModels from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; @@ -19,7 +18,6 @@ import { userContext } from "../../UserContext"; import * as ResourceTreeContextMenuButtonFactory from "../ContextMenuButtonFactory"; import Explorer from "../Explorer"; import { useCommandBar } from "../Menus/CommandBar/CommandBarComponentAdapter"; -import { useNotebook } from "../Notebook/useNotebook"; import { useSelectedNode } from "../useSelectedNode"; export const shouldShowScriptNodes = (): boolean => { @@ -294,22 +292,6 @@ const buildCollectionNodeChildren = ( contextMenu: ResourceTreeContextMenuButtonFactory.createCollectionContextMenuButton(container, collection), }); - if ( - isNotebookEnabled && - userContext.apiType === "Mongo" && - isPublicInternetAccessAllowed() && - useNotebook.getState().isPhoenixFeatures - ) { - children.push({ - label: "Schema (Preview)", - onClick: collection.onSchemaAnalyzerClick.bind(collection), - isSelected: () => - useSelectedNode - .getState() - .isDataNodeSelected(collection.databaseId, collection.id(), [ViewModels.CollectionTabKind.SchemaAnalyzer]), - }); - } - if (userContext.apiType !== "Cassandra" || !isServerlessAccount()) { let id = ""; if (collection.isSampleCollection) { From 6db2536a61478259fde0ffda4065a3ea2f96c4f1 Mon Sep 17 00:00:00 2001 From: Nishtha Ahuja <45535788+nishthaAhujaa@users.noreply.github.com> Date: Mon, 28 Apr 2025 21:11:27 +0530 Subject: [PATCH 02/11] fixed quickstart tab in emulator (#2115) Co-authored-by: nishthaAhujaa --- images/dotnet.png | Bin 7074 -> 2140 bytes images/golang.svg | 8 ++ images/springboot.svg | 10 ++ src/quickstart.html | 253 ++++++++++++++---------------------------- 4 files changed, 101 insertions(+), 170 deletions(-) create mode 100644 images/golang.svg create mode 100644 images/springboot.svg diff --git a/images/dotnet.png b/images/dotnet.png index c8972efdc3611383ed914f525c120e5e64d858e4..fb00ecf91e4b78804c636194bb323bf3710fa1c6 100644 GIT binary patch literal 2140 zcmeHIX;4#F6iz}QBp3(*v25~!F*qzP0ojoU1Wja7KpD}12oa>Xrfece2to*M4{<@1 zP%%ms&>BGn2e5_86S0m&0z?*tFd77$B7y>vzNa&tPJedV>7UNLH{U(qJ@=gNJNL&G zZwy{XCYg~i7z~-iW`$xfSQ!0vwGifWRzWuc0UHB1`G?p&M?Q^4^TQdnylqlFJQMHV zlMy}8cyoMm;xpH^t5o#5@y2-k+Mdkle$k#mS^4OrhKW<@s@vsbjW^%%!+QI>rn#<) z{_bgV=B_HFEH)`LIBec*h>(fF5SlnFpG|4X(PvmP2D6~~`@Sai?5+nm4-!M>!#e`& z78+VFVXe(SMlq!^eg7xWd6boUvM4P&8=5T0wgi! zp<$6Qus?iG)+d;(0n8C!5))oCLL24Oym*Gn(Wz_qt3FCV776EaQ0@8?Z;*X?j^|Sm zn!Z?CE$Z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H{{9{!e_shj7E)s;jgMp=#Dupc z@J`Sox?=HV{_Tf?MN|5F>%?dmzoqS^{$Q6hy%prdgUR~Dw3KdTAByj>4rcf%p7#-% z&1e2W2-}O>F+A1N06#^uCzVW}IVXNhkq?q5cyE_m#A{#X!$k4M^UIFI3pbvaQ9cs8 zyauh#_f%}}NXV7iLGc@#IIw-j!;u$ofF;M!hvdgJ%q%)^re>)*u!zA;K24;$g0Eq4 z#CJg3+GqVTVJsl`wZEqY;EQx4!SJVO%9zkEJ?pQD!;6dEg|w;W>w<(^bV6#8sRf~r z6k;_1t=$3v_21QBq|_p>XQTb~vWEVpw3c!{YXBi*$@K5f|7Ly50()iL_7;LUD{puRwD&8SyyA)vEpHKcbq`k<#?|e z9I=N|vZj9O{Qk2Ee`}Jm=bpiqjg4Jics+3pwR-BFP9H}*P(XOGAW2@Jr{=(+Q{s%n z-?GuKh(Fxu04z1!wCr#Z5HKjvq!1*IgiOb(E|3Ct7zJUU$5Od(n#9A5oOuZn}I!!)~abZ z%melOIvx&l8m`MW@1^lZR#uimQ(x}(HaTE-DHpI~FCE)urg9S|U&Ua#z!3o!%J5FJedA_Y@im_pC&r7PZ|hLvTGiboyTj?#&D;!uI1j_+U8k}* zIbc*WY^US*rwYS?kEPtscNfwIOzTiS_RiI?+2G*KY`pcKZNxK#hh5vk65y2Hp#^+r z!8p8oH~Uj8a~Yve3M@03syo^<|12WDEe;uQ2_1*;Tkf)G;=1Elp*l28TLbCEOk1(l z({C9E0{F0ZC`kkdRK|KZPQ#0=m roq}m2%| + + + + + + + \ No newline at end of file diff --git a/images/springboot.svg b/images/springboot.svg new file mode 100644 index 000000000..ee451deaa --- /dev/null +++ b/images/springboot.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/quickstart.html b/src/quickstart.html index e369724e6..fc89be86f 100644 --- a/src/quickstart.html +++ b/src/quickstart.html @@ -42,29 +42,30 @@ - -
-
2
-
- Learn more about Azure Cosmos DB - -
-
- -
-
-
1
-
- Open and run a sample .NET Core app -

- We created a sample .NET Core app connected to your Azure Cosmos DB Emulator instance. Download, - extract, build and run the app. -

- -
-
- -
-
2
-
- Learn more about Azure Cosmos DB. - -
-
+
-
+
1
@@ -171,33 +102,10 @@

- -
-
2
-
- Learn more about Azure Cosmos DB. - -
-
+
-
+
1
@@ -215,41 +123,14 @@

- -
-
2
-
- Learn more about Azure Cosmos DB. - -
-
+
-
+
1
- Create a new Python app. + Create a new Python app

Follow this tutorial @@ -257,42 +138,74 @@

+
+
+ +
-
2
+
1
- Learn more about Azure Cosmos DB. - + Create a new Go app +

+ Follow this + tutorial + to create a new Go app connected to Azure Cosmos DB. +

+
+
+ +
+
+
1
+
+ Create a new Spring Boot app +

+ Follow this + tutorial + to create a new Spring Boot app connected to Azure Cosmos DB. +

+
+
+
+ + + + From d9436be61b583a25e2847a5dce3115c27ef86af2 Mon Sep 17 00:00:00 2001 From: asier-isayas Date: Mon, 28 Apr 2025 13:29:27 -0400 Subject: [PATCH 03/11] Remove references to old Portal Backend (#2109) * remove old portal backend endpoints * format * fix tests * remove Materialized Views from createResourceTokenTreeNodes * add portal FE back to defaultAllowedBackendEndpoints --------- Co-authored-by: Asier Isayas --- src/Utils/EndpointUtils.ts | 20 -------------------- src/Utils/MessageValidation.test.ts | 1 - 2 files changed, 21 deletions(-) diff --git a/src/Utils/EndpointUtils.ts b/src/Utils/EndpointUtils.ts index 885e7f0ff..7e09c923d 100644 --- a/src/Utils/EndpointUtils.ts +++ b/src/Utils/EndpointUtils.ts @@ -52,22 +52,10 @@ export const allowedAadEndpoints: ReadonlyArray = [ ]; export const defaultAllowedBackendEndpoints: ReadonlyArray = [ - "https://main.documentdb.ext.azure.com", - "https://main.documentdb.ext.azure.cn", - "https://main.documentdb.ext.azure.us", - "https://main.cosmos.ext.azure", "https://localhost:12901", "https://localhost:1234", ]; -export const PortalBackendIPs: { [key: string]: string[] } = { - "https://main.documentdb.ext.azure.com": ["104.42.195.92", "40.76.54.131"], - // DE doesn't talk to prod2 (main2) but it might be added - //"https://main2.documentdb.ext.azure.com": ["104.42.196.69"], - "https://main.documentdb.ext.azure.cn": ["139.217.8.252"], - "https://main.documentdb.ext.azure.us": ["52.244.48.71"], -}; - export const PortalBackendOutboundIPs: { [key: string]: string[] } = { [PortalBackendEndpoints.Mpac]: ["13.91.105.215", "4.210.172.107"], [PortalBackendEndpoints.Prod]: ["13.88.56.148", "40.91.218.243"], @@ -98,14 +86,6 @@ export const defaultAllowedCassandraProxyEndpoints: ReadonlyArray = [ CassandraProxyEndpoints.Mooncake, ]; -export const allowedCassandraProxyEndpoints_ToBeDeprecated: ReadonlyArray = [ - "https://main.documentdb.ext.azure.com", - "https://main.documentdb.ext.azure.cn", - "https://main.documentdb.ext.azure.us", - "https://main.cosmos.ext.azure", - "https://localhost:12901", -]; - export const CassandraProxyOutboundIPs: { [key: string]: string[] } = { [CassandraProxyEndpoints.Mpac]: ["40.113.96.14", "104.42.11.145"], [CassandraProxyEndpoints.Prod]: ["137.117.230.240", "168.61.72.237"], diff --git a/src/Utils/MessageValidation.test.ts b/src/Utils/MessageValidation.test.ts index f62396a87..b18860f1f 100644 --- a/src/Utils/MessageValidation.test.ts +++ b/src/Utils/MessageValidation.test.ts @@ -17,7 +17,6 @@ describe("isInvalidParentFrameOrigin", () => { ${"https://cdb-ff-prod-pbe.cosmos.azure.us"} | ${false} ${"https://cdb-mc-prod-pbe.cosmos.azure.cn"} | ${false} ${"https://cosmos-db-dataexplorer-germanycentral.azurewebsites.de"} | ${false} - ${"https://main.documentdb.ext.microsoftazure.de"} | ${false} ${"https://random.domain"} | ${true} ${"https://malicious.cloudapp.azure.com"} | ${true} ${"https://malicious.germanycentral.cloudapp.microsoftazure.de"} | ${true} From 274c85d2deb8d21cc650f0292fed55e76b8c83e2 Mon Sep 17 00:00:00 2001 From: sunghyunkang1111 <114709653+sunghyunkang1111@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:42:18 -0500 Subject: [PATCH 04/11] Added document test skips (#2120) --- test/mongo/document.spec.ts | 1 + test/sql/document.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/test/mongo/document.spec.ts b/test/mongo/document.spec.ts index 3030d5259..34d27ee21 100644 --- a/test/mongo/document.spec.ts +++ b/test/mongo/document.spec.ts @@ -9,6 +9,7 @@ let documentsTab: DocumentsTab = null!; for (const { name, databaseId, containerId, documents } of documentTestCases) { test.describe(`Test MongoRU Documents with ${name}`, () => { + test.skip(true, "Temporarily disabling all tests in this spec file"); test.beforeEach("Open documents tab", async ({ page }) => { explorer = await DataExplorer.open(page, TestAccount.MongoReadonly); diff --git a/test/sql/document.spec.ts b/test/sql/document.spec.ts index 74e3f5da1..095b47c6a 100644 --- a/test/sql/document.spec.ts +++ b/test/sql/document.spec.ts @@ -9,6 +9,7 @@ let documentsTab: DocumentsTab = null!; for (const { name, databaseId, containerId, documents } of documentTestCases) { test.describe(`Test SQL Documents with ${name}`, () => { + test.skip(true, "Temporarily disabling all tests in this spec file"); test.beforeEach("Open documents tab", async ({ page }) => { explorer = await DataExplorer.open(page, TestAccount.SQLReadOnly); From 2f858ecf9b5544e4f25136320fc1e9b48c076f64 Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Tue, 29 Apr 2025 17:50:20 +0200 Subject: [PATCH 05/11] Fabric native improvements: Settings pane, Partition Key settings tab, sample data and message contract (#2119) * Hide entire Accordion of options in Settings Pane * In PartitionKeyComponent hide "Change partition key" label when read-only. * Create sample data container with correct pkey * Add unit tests to PartitionKeyComponent * Fix format * fix unit test snapshot * Add Fabric message to open Settings to given tab id * Improve syntax on message contract * Remove "(preview)" in partition key tab title in Settings Tab --- src/Contracts/DataExplorerMessagesContract.ts | 9 +- src/Contracts/FabricMessageTypes.ts | 1 + .../PartitionKeyComponent.test.tsx | 41 + .../PartitionKeyComponent.tsx | 2 +- .../PartitionKeyComponent.test.tsx.snap | 196 ++++ .../Controls/Settings/SettingsUtils.tsx | 3 +- .../Panes/SettingsPane/SettingsPane.tsx | 838 +++++++++--------- src/Explorer/SplashScreen/SampleUtil.ts | 8 + 8 files changed, 677 insertions(+), 421 deletions(-) create mode 100644 src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx create mode 100644 src/Explorer/Controls/Settings/SettingsSubComponents/__snapshots__/PartitionKeyComponent.test.tsx.snap diff --git a/src/Contracts/DataExplorerMessagesContract.ts b/src/Contracts/DataExplorerMessagesContract.ts index a38940120..c017bffa8 100644 --- a/src/Contracts/DataExplorerMessagesContract.ts +++ b/src/Contracts/DataExplorerMessagesContract.ts @@ -18,10 +18,13 @@ export type DataExploreMessageV3 = | { type: FabricMessageTypes.GetAllResourceTokens; id: string; + } + | { + type: FabricMessageTypes.OpenSettings; + settingsId: string; }; - -export type GetCosmosTokenMessageOptions = { +export interface GetCosmosTokenMessageOptions { verb: "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace"; resourceType: "" | "dbs" | "colls" | "docs" | "sprocs" | "pkranges"; resourceId: string; -}; +} diff --git a/src/Contracts/FabricMessageTypes.ts b/src/Contracts/FabricMessageTypes.ts index 1d4576391..02871ca47 100644 --- a/src/Contracts/FabricMessageTypes.ts +++ b/src/Contracts/FabricMessageTypes.ts @@ -6,6 +6,7 @@ export enum FabricMessageTypes { GetAllResourceTokens = "GetAllResourceTokens", GetAccessToken = "GetAccessToken", Ready = "Ready", + OpenSettings = "OpenSettings", } export interface AuthorizationToken { diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx new file mode 100644 index 000000000..dfde4ec78 --- /dev/null +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx @@ -0,0 +1,41 @@ +import { shallow } from "enzyme"; +import { + PartitionKeyComponent, + PartitionKeyComponentProps, +} from "Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent"; +import Explorer from "Explorer/Explorer"; +import React from "react"; + +describe("PartitionKeyComponent", () => { + // Create a test setup function to get fresh instances for each test + const setupTest = () => { + // Create an instance of the mocked Explorer + const explorer = new Explorer(); + // Create minimal mock objects for database and collection + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const mockDatabase = {} as any as import("../../../../Contracts/ViewModels").Database; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const mockCollection = {} as any as import("../../../../Contracts/ViewModels").Collection; + + // Create props with the mocked Explorer instance + const props: PartitionKeyComponentProps = { + database: mockDatabase, + collection: mockCollection, + explorer, + }; + + return { explorer, props }; + }; + + it("renders default component and matches snapshot", () => { + const { props } = setupTest(); + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); + + it("renders read-only component and matches snapshot", () => { + const { props } = setupTest(); + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.tsx index c6a1bd9d1..89810bcb6 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.tsx @@ -161,7 +161,7 @@ export const PartitionKeyComponent: React.FC = ({ return ( - Change {partitionKeyName.toLowerCase()} + {!isReadOnly && Change {partitionKeyName.toLowerCase()}} Current {partitionKeyName.toLowerCase()} diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/__snapshots__/PartitionKeyComponent.test.tsx.snap b/src/Explorer/Controls/Settings/SettingsSubComponents/__snapshots__/PartitionKeyComponent.test.tsx.snap new file mode 100644 index 000000000..95d87da3d --- /dev/null +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/__snapshots__/PartitionKeyComponent.test.tsx.snap @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PartitionKeyComponent renders default component and matches snapshot 1`] = ` + + + + Change + partition key + + + + + Current + partition key + + + Partitioning + + + + + + Non-hierarchical + + + + + + To safeguard the integrity of the data being copied to the new container, ensure that no updates are made to the source container for the entire duration of the partition key change process. + + Learn more + + + + To change the partition key, a new destination container must be created or an existing destination container selected. Data will then be copied to the destination container. + + + +`; + +exports[`PartitionKeyComponent renders read-only component and matches snapshot 1`] = ` + + + + + + Current + partition key + + + Partitioning + + + + + + Non-hierarchical + + + + + +`; diff --git a/src/Explorer/Controls/Settings/SettingsUtils.tsx b/src/Explorer/Controls/Settings/SettingsUtils.tsx index 448b59370..2617af6ac 100644 --- a/src/Explorer/Controls/Settings/SettingsUtils.tsx +++ b/src/Explorer/Controls/Settings/SettingsUtils.tsx @@ -1,6 +1,7 @@ import * as Constants from "../../../Common/Constants"; import * as DataModels from "../../../Contracts/DataModels"; import * as ViewModels from "../../../Contracts/ViewModels"; +import { isFabricNative } from "../../../Platform/Fabric/FabricUtil"; import { MongoIndex } from "../../../Utils/arm/generatedClients/cosmos/types"; const zeroValue = 0; @@ -165,7 +166,7 @@ export const getTabTitle = (tab: SettingsV2TabTypes): string => { case SettingsV2TabTypes.IndexingPolicyTab: return "Indexing Policy"; case SettingsV2TabTypes.PartitionKeyTab: - return "Partition Keys (preview)"; + return isFabricNative() ? "Partition Keys" : "Partition Keys (preview)"; case SettingsV2TabTypes.ComputedPropertiesTab: return "Computed Properties"; case SettingsV2TabTypes.ContainerVectorPolicyTab: diff --git a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx index a40f4da99..ca92b59ed 100644 --- a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx +++ b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx @@ -23,7 +23,7 @@ import { InfoTooltip } from "Common/Tooltip/InfoTooltip"; import { Platform, configContext } from "ConfigContext"; import { useDialog } from "Explorer/Controls/Dialog"; import { useDatabases } from "Explorer/useDatabases"; -import { isFabric } from "Platform/Fabric/FabricUtil"; +import { isFabric, isFabricNative } from "Platform/Fabric/FabricUtil"; import { AppStateComponentNames, deleteAllStates, @@ -607,441 +607,447 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ return (
- - {shouldShowQueryPageOptions && ( - - -
Page Options
-
- -
-
- Choose Custom to specify a fixed amount of query results to show, or choose Unlimited to show as - many query results per page. -
- -
-
- {isCustomPageOptionSelected() && ( -
-
- Query results per page{" "} - - Enter the number of query results that should be shown per page. - -
- - { - setCustomItemPerPage(parseInt(newValue) + 1 || customItemPerPage); - }} - onDecrement={(newValue) => setCustomItemPerPage(parseInt(newValue) - 1 || customItemPerPage)} - onValidate={(newValue) => setCustomItemPerPage(parseInt(newValue) || customItemPerPage)} - min={1} - step={1} - className="textfontclr" - incrementButtonAriaLabel="Increase value by 1" - decrementButtonAriaLabel="Decrease value by 1" - /> -
- )} -
-
-
- )} - {showEnableEntraIdRbac && ( - - -
Enable Entra ID RBAC
-
- -
-
- Choose Automatic to enable Entra ID RBAC automatically. True/False to force enable/disable Entra ID - RBAC. - - {" "} - Learn more{" "} - -
- -
-
-
- )} - {userContext.apiType === "SQL" && userContext.authType === AuthType.AAD && !isFabric() && ( - - -
Region Selection
-
- -
-
- Changes region the Cosmos Client uses to access account. -
-
- Select Region - - Changes the account endpoint used to perform client operations. - -
- option.key === selectedRegionalEndpoint)?.text - : regionOptions[0]?.text - } - onChange={handleOnSelectedRegionOptionChange} - options={regionOptions} - styles={{ root: { marginBottom: "10px" } }} - /> -
-
-
- )} - {userContext.apiType === "SQL" && !isEmulator && ( - <> - + {!isFabricNative() && ( + + {shouldShowQueryPageOptions && ( + -
Query Timeout
+
Page Options
- When a query reaches a specified time limit, a popup with an option to cancel the query will show - unless automatic cancellation has been enabled. -
- -
- {queryTimeoutEnabled && ( -
- - -
- )} -
-
- - - -
RU Limit
-
- -
-
- If a query exceeds a configured RU limit, the query will be aborted. -
- -
- {ruThresholdEnabled && ( -
- -
- )} -
-
- - - -
Default Query Results View
-
- -
-
- Select the default view to use when displaying query results. + Choose Custom to specify a fixed amount of query results to show, or choose Unlimited to show as + many query results per page.
+
+
+ {isCustomPageOptionSelected() && ( +
+
+ Query results per page{" "} + + Enter the number of query results that should be shown per page. + +
+ + { + setCustomItemPerPage(parseInt(newValue) + 1 || customItemPerPage); + }} + onDecrement={(newValue) => setCustomItemPerPage(parseInt(newValue) - 1 || customItemPerPage)} + onValidate={(newValue) => setCustomItemPerPage(parseInt(newValue) || customItemPerPage)} + min={1} + step={1} + className="textfontclr" + incrementButtonAriaLabel="Increase value by 1" + decrementButtonAriaLabel="Decrease value by 1" + /> +
+ )} +
+
+
+ )} + {showEnableEntraIdRbac && ( + + +
Enable Entra ID RBAC
+
+ +
+
+ Choose Automatic to enable Entra ID RBAC automatically. True/False to force enable/disable Entra + ID RBAC. + + {" "} + Learn more{" "} + +
+
- - )} + )} + {userContext.apiType === "SQL" && userContext.authType === AuthType.AAD && !isFabric() && ( + + +
Region Selection
+
+ +
+
+ Changes region the Cosmos Client uses to access account. +
+
+ Select Region + + Changes the account endpoint used to perform client operations. + +
+ option.key === selectedRegionalEndpoint)?.text + : regionOptions[0]?.text + } + onChange={handleOnSelectedRegionOptionChange} + options={regionOptions} + styles={{ root: { marginBottom: "10px" } }} + /> +
+
+
+ )} + {userContext.apiType === "SQL" && !isEmulator && ( + <> + + +
Query Timeout
+
+ +
+
+ When a query reaches a specified time limit, a popup with an option to cancel the query will + show unless automatic cancellation has been enabled. +
+ +
+ {queryTimeoutEnabled && ( +
+ + +
+ )} +
+
- {showRetrySettings && ( - - -
Retry Settings
-
- -
-
- Retry policy associated with throttled requests during CosmosDB queries. + + +
RU Limit
+
+ +
+
+ If a query exceeds a configured RU limit, the query will be aborted. +
+ +
+ {ruThresholdEnabled && ( +
+ +
+ )} +
+
+ + + +
Default Query Results View
+
+ +
+
+ Select the default view to use when displaying query results. +
+ +
+
+
+ + )} + + {showRetrySettings && ( + + +
Retry Settings
+
+ +
+
+ Retry policy associated with throttled requests during CosmosDB queries. +
+
+ Max retry attempts + + Max number of retries to be performed for a request. Default value 9. + +
+ setRetryAttempts(parseInt(newValue) + 1 || retryAttempts)} + onDecrement={(newValue) => setRetryAttempts(parseInt(newValue) - 1 || retryAttempts)} + onValidate={(newValue) => setRetryAttempts(parseInt(newValue) || retryAttempts)} + styles={spinButtonStyles} + /> +
+ Fixed retry interval (ms) + + Fixed retry interval in milliseconds to wait between each retry ignoring the retryAfter returned + as part of the response. Default value is 0 milliseconds. + +
+ setRetryInterval(parseInt(newValue) + 1000 || retryInterval)} + onDecrement={(newValue) => setRetryInterval(parseInt(newValue) - 1000 || retryInterval)} + onValidate={(newValue) => setRetryInterval(parseInt(newValue) || retryInterval)} + styles={spinButtonStyles} + /> +
+ Max wait time (s) + + Max wait time in seconds to wait for a request while the retries are happening. Default value 30 + seconds. + +
+ + setMaxWaitTimeInSeconds(parseInt(newValue) + 1 || MaxWaitTimeInSeconds) + } + onDecrement={(newValue) => + setMaxWaitTimeInSeconds(parseInt(newValue) - 1 || MaxWaitTimeInSeconds) + } + onValidate={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) || MaxWaitTimeInSeconds)} + styles={spinButtonStyles} + />
-
- Max retry attempts - - Max number of retries to be performed for a request. Default value 9. - + + + )} + {!isEmulator && ( + + +
Enable container pagination
+
+ +
+
+ Load 50 containers at a time. Currently, containers are not pulled in alphanumeric order. +
+ setContainerPaginationEnabled(!containerPaginationEnabled)} + label="Enable container pagination" + />
- setRetryAttempts(parseInt(newValue) + 1 || retryAttempts)} - onDecrement={(newValue) => setRetryAttempts(parseInt(newValue) - 1 || retryAttempts)} - onValidate={(newValue) => setRetryAttempts(parseInt(newValue) || retryAttempts)} - styles={spinButtonStyles} - /> -
- Fixed retry interval (ms) - - Fixed retry interval in milliseconds to wait between each retry ignoring the retryAfter returned - as part of the response. Default value is 0 milliseconds. - + + + )} + {shouldShowCrossPartitionOption && ( + + +
Enable cross-partition query
+
+ +
+
+ Send more than one request while executing a query. More than one request is necessary if the + query is not scoped to single partition key value. +
+ setCrossPartitionQueryEnabled(!crossPartitionQueryEnabled)} + label="Enable cross-partition query" + />
- setRetryInterval(parseInt(newValue) + 1000 || retryInterval)} - onDecrement={(newValue) => setRetryInterval(parseInt(newValue) - 1000 || retryInterval)} - onValidate={(newValue) => setRetryInterval(parseInt(newValue) || retryInterval)} - styles={spinButtonStyles} - /> -
- Max wait time (s) - - Max wait time in seconds to wait for a request while the retries are happening. Default value 30 - seconds. - + + + )} + {shouldShowParallelismOption && ( + + +
Max degree of parallelism
+
+ +
+
+ Gets or sets the number of concurrent operations run client side during parallel query execution. + A positive property value limits the number of concurrent operations to the set value. If it is + set to less than 0, the system automatically decides the number of concurrent operations to run. +
+ + setMaxDegreeOfParallelism(parseInt(newValue) + 1 || maxDegreeOfParallelism) + } + onDecrement={(newValue) => + setMaxDegreeOfParallelism(parseInt(newValue) - 1 || maxDegreeOfParallelism) + } + onValidate={(newValue) => setMaxDegreeOfParallelism(parseInt(newValue) || maxDegreeOfParallelism)} + ariaLabel="Max degree of parallelism" + label="Max degree of parallelism" + />
- setMaxWaitTimeInSeconds(parseInt(newValue) + 1 || MaxWaitTimeInSeconds)} - onDecrement={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) - 1 || MaxWaitTimeInSeconds)} - onValidate={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) || MaxWaitTimeInSeconds)} - styles={spinButtonStyles} - /> -
-
-
- )} - {!isEmulator && ( - - -
Enable container pagination
-
- -
-
- Load 50 containers at a time. Currently, containers are not pulled in alphanumeric order. + + + )} + {shouldShowPriorityLevelOption && ( + + +
Priority Level
+
+ +
+
+ Sets the priority level for data-plane requests from Data Explorer when using Priority-Based + Execution. If "None" is selected, Data Explorer will not specify priority level, and the + server-side default priority level will be used. +
+
- setContainerPaginationEnabled(!containerPaginationEnabled)} - label="Enable container pagination" - /> -
- - - )} - {shouldShowCrossPartitionOption && ( - - -
Enable cross-partition query
-
- -
-
- Send more than one request while executing a query. More than one request is necessary if the query - is not scoped to single partition key value. + + + )} + {shouldShowGraphAutoVizOption && ( + + +
Display Gremlin query results as: 
+
+ +
+
+ Select Graph to automatically visualize the query results as a Graph or JSON to display the + results as JSON. +
+
- setCrossPartitionQueryEnabled(!crossPartitionQueryEnabled)} - label="Enable cross-partition query" - /> -
- - - )} - {shouldShowParallelismOption && ( - - -
Max degree of parallelism
-
- -
-
- Gets or sets the number of concurrent operations run client side during parallel query execution. A - positive property value limits the number of concurrent operations to the set value. If it is set to - less than 0, the system automatically decides the number of concurrent operations to run. + + + )} + {shouldShowCopilotSampleDBOption && ( + + +
Enable sample database
+
+ +
+
+ This is a sample database and collection with synthetic product data you can use to explore using + NoSQL queries and Query Advisor. This will appear as another database in the Data Explorer UI, and + is created by, and maintained by Microsoft at no cost to you. +
+
- - setMaxDegreeOfParallelism(parseInt(newValue) + 1 || maxDegreeOfParallelism) - } - onDecrement={(newValue) => - setMaxDegreeOfParallelism(parseInt(newValue) - 1 || maxDegreeOfParallelism) - } - onValidate={(newValue) => setMaxDegreeOfParallelism(parseInt(newValue) || maxDegreeOfParallelism)} - ariaLabel="Max degree of parallelism" - label="Max degree of parallelism" - /> -
- - - )} - {shouldShowPriorityLevelOption && ( - - -
Priority Level
-
- -
-
- Sets the priority level for data-plane requests from Data Explorer when using Priority-Based - Execution. If "None" is selected, Data Explorer will not specify priority level, and the - server-side default priority level will be used. -
- -
-
-
- )} - {shouldShowGraphAutoVizOption && ( - - -
Display Gremlin query results as: 
-
- -
-
- Select Graph to automatically visualize the query results as a Graph or JSON to display the results - as JSON. -
- -
-
-
- )} - {shouldShowCopilotSampleDBOption && ( - - -
Enable sample database
-
- -
-
- This is a sample database and collection with synthetic product data you can use to explore using - NoSQL queries and Query Advisor. This will appear as another database in the Data Explorer UI, and - is created by, and maintained by Microsoft at no cost to you. -
- -
-
-
- )} - + + + )} + + )}
diff --git a/src/Explorer/SplashScreen/SampleUtil.ts b/src/Explorer/SplashScreen/SampleUtil.ts index 837227c8f..4072eb011 100644 --- a/src/Explorer/SplashScreen/SampleUtil.ts +++ b/src/Explorer/SplashScreen/SampleUtil.ts @@ -1,3 +1,4 @@ +import { BackendDefaults } from "Common/Constants"; import { createCollection } from "Common/dataAccess/createCollection"; import Explorer from "Explorer/Explorer"; import { useDatabases } from "Explorer/useDatabases"; @@ -35,6 +36,11 @@ export const createContainer = async ( collectionId: containerName, databaseId: databaseName, databaseLevelThroughput: false, + partitionKey: { + paths: [`/${SAMPLE_DATA_PARTITION_KEY}`], + kind: "Hash", + version: BackendDefaults.partitionKeyVersion, + }, }; await createCollection(createRequest); await explorer.refreshAllDatabases(); @@ -47,6 +53,8 @@ export const createContainer = async ( return newCollection; }; +const SAMPLE_DATA_PARTITION_KEY = "category"; // This pkey is specifically set for queryCopilotSampleData.json below + export const importData = async (collection: ViewModels.Collection): Promise => { // TODO: keep same chunk as ContainerSampleGenerator const dataFileContent = await import( From 9f3236c29ca38c44ec9314345b0be24f1858dcfb Mon Sep 17 00:00:00 2001 From: SATYA SB <107645008+satya07sb@users.noreply.github.com> Date: Wed, 30 Apr 2025 11:35:58 +0530 Subject: [PATCH 06/11] [accessibility-3560183]:[Screen reader - Cosmos DB Query Copilot - Query Faster with Copilot>Enable Query Advisor]: Screen reader does not announce the dialog information on invoking 'Clear editor' button. (#2068) Co-authored-by: Satyapriya Bai --- src/Explorer/QueryCopilot/Popup/DeletePopup.tsx | 11 ++++++++--- .../Popup/__snapshots__/DeletePopup.test.tsx.snap | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Explorer/QueryCopilot/Popup/DeletePopup.tsx b/src/Explorer/QueryCopilot/Popup/DeletePopup.tsx index 2a4e29641..6e2fbed54 100644 --- a/src/Explorer/QueryCopilot/Popup/DeletePopup.tsx +++ b/src/Explorer/QueryCopilot/Popup/DeletePopup.tsx @@ -22,12 +22,17 @@ export const DeletePopup = ({ }; return ( - + - + Delete code? - + This will clear the query from the query builder pane along with all comments and also reset the prompt pane diff --git a/src/Explorer/QueryCopilot/Popup/__snapshots__/DeletePopup.test.tsx.snap b/src/Explorer/QueryCopilot/Popup/__snapshots__/DeletePopup.test.tsx.snap index 698138f5a..988fd88db 100644 --- a/src/Explorer/QueryCopilot/Popup/__snapshots__/DeletePopup.test.tsx.snap +++ b/src/Explorer/QueryCopilot/Popup/__snapshots__/DeletePopup.test.tsx.snap @@ -11,6 +11,8 @@ exports[`Delete Popup snapshot test should not render when showDeletePopup is fa }, } } + subtitleAriaId="deleteDialogSubTitle" + titleAriaId="deleteDialogTitle" > Date: Wed, 30 Apr 2025 13:32:53 +0530 Subject: [PATCH 07/11] Emulator Quickstart Tutorials (#2121) * updated all outdated sample apps Co-authored-by: nishthaAhujaa --- less/quickstart.less | 1322 +++++++++++++++++++++--------------------- src/quickstart.html | 62 +- 2 files changed, 688 insertions(+), 696 deletions(-) diff --git a/less/quickstart.less b/less/quickstart.less index dd9b2e33a..539d63448 100644 --- a/less/quickstart.less +++ b/less/quickstart.less @@ -1,927 +1,923 @@ @import "./Common/Constants"; html { - font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; - padding: 0px; - margin: 0px; - overflow: hidden; + font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; + padding: 0px; + margin: 0px; + overflow: hidden; } body { - font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; - font-size: 12px; + font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; + font-size: 12px; } .fixedleftpane { - background: #2f2d2d; - height: 100vh; - width: 80px; - float: left; + background: #2f2d2d; + height: 100vh; + width: 80px; + float: left; } #divQuickStart, #divExplorer { - display: inline-block; - width: 100%; - white-space: nowrap; + display: inline-block; + width: 100%; + white-space: nowrap; } #imgiconwidth1 { - width: 72%; + width: 72%; } #Quickstart { - text-align: center; - width: 80px; - height: 60px; - margin: 0 auto; - padding-top: 5px; - position: relative; + text-align: center; + width: 80px; + height: 60px; + margin: 0 auto; + padding-top: 5px; + position: relative; } .collectionheading { - text-transform: uppercase; - font-size: 10px; + text-transform: uppercase; + font-size: 10px; } #Quickstart #imgiconwidth1 { - width: 24px; - height: 24px; - position: absolute; - right: 27px; + width: 24px; + height: 24px; + position: absolute; + right: 27px; } .topSelected { - border-left: 4px solid @AccentMediumHigh; - background: #666666; + border-left: 4px solid @AccentMediumHigh; + background: #666666; } .topSelected:hover { - border-left: 4px solid @AccentMediumHigh; - background: #666666!important; - cursor: default!important; + border-left: 4px solid @AccentMediumHigh; + background: #666666 !important; + cursor: default !important; } #Quickstart:hover span.activemenu, #Quickstart:active span.activemenu { - color: #fff; + color: #fff; } #Explorer:hover span.menuExplorer, #Explorer:active span.menuExplorer { - color: #fff; + color: #fff; } menuQuickStart { - margin-left: 0; - padding-left: 0; - display: block; - right: 12px; - top: 30px; - position: absolute; + margin-left: 0; + padding-left: 0; + display: block; + right: 12px; + top: 30px; + position: absolute; } #Explorer { - text-align: center; - display: inline-block; - width: 80px; - height: 60px; - margin: 0 auto; - padding-top: 9px; - position: relative; + text-align: center; + display: inline-block; + width: 80px; + height: 60px; + margin: 0 auto; + padding-top: 9px; + position: relative; } #Explorer #imgiconwidth1, .feedbackstyle #imgiconwidth1, .settingstyle #imgiconwidth1 { - width: 24px; - height: 24px; - position: absolute; - right: 30px; + width: 24px; + height: 24px; + position: absolute; + right: 30px; } #Explorer span.menuExplorer { - margin-left: 0; - padding-left: 0; - display: block; - right: 19px; - top: 33px; - position: absolute; + margin-left: 0; + padding-left: 0; + display: block; + right: 19px; + top: 33px; + position: absolute; } .feedbackstyle span.menuExplorer { - margin-left: 0; - padding-left: 0; - display: block; - right: 19px; - top: 33px; - position: absolute; + margin-left: 0; + padding-left: 0; + display: block; + right: 19px; + top: 33px; + position: absolute; } .settingstyle span.menuExplorer { - margin-left: 0; - padding-left: 0; - display: block; - right: 19px; - top: 33px; - position: absolute; + margin-left: 0; + padding-left: 0; + display: block; + right: 19px; + top: 33px; + position: absolute; } .content { - display: inline-block; - width: 100%; - transition: all .4s ease-in-out; - -ms-transition: all .4s ease-in-out; - -webkit-transition: all .4s ease-in-out; - -moz-transition: all .4s ease-in-out; - height: 100vh; + display: inline-block; + width: 100%; + transition: all 0.4s ease-in-out; + -ms-transition: all 0.4s ease-in-out; + -webkit-transition: all 0.4s ease-in-out; + -moz-transition: all 0.4s ease-in-out; + height: 100vh; } .mini { - width: 0%; - float: left; - transition: all .4s ease-in-out; - -webkit-transition: all .4s ease-in-out; - -moz-transition: all .4s ease-in-out; - height: 100vh; - background-color: white; + width: 0%; + float: left; + transition: all 0.4s ease-in-out; + -webkit-transition: all 0.4s ease-in-out; + -moz-transition: all 0.4s ease-in-out; + height: 100vh; + background-color: white; } #sidebar-wrapper { - z-index: 1000; - position: fixed; - left: 250px; - width: 0; - height: 100%; - margin-left: -250px; - overflow-y: auto; - background: white; - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - transition: all 0.5s ease; + z-index: 1000; + position: fixed; + left: 250px; + width: 0; + height: 100%; + margin-left: -250px; + overflow-y: auto; + background: white; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; + transition: all 0.5s ease; } .toggle-left { - width: 0%; - overflow: hidden; + width: 0%; + overflow: hidden; } .toggle-minicontent { - width: 100%; + width: 100%; } .toggle-maincontent { - width: 100%; + width: 100%; } .toggle-mini { - width: 50px; + width: 50px; } .toggle-main { - width: 100%; + width: 100%; } .activepartitionmode { - background-color: @AccentMediumHigh; + background-color: @AccentMediumHigh; } .paddingpartition { - color: white; - padding-left: 15px; - padding-top: 25px; + color: white; + padding-left: 15px; + padding-top: 25px; } .paddingspan2 { - padding-top: 20px; - color: #000; - padding-left: 15px; + padding-top: 20px; + color: #000; + padding-left: 15px; } .paddingspan4 { - padding-top: 20px; - padding-bottom: 20px; - color: white; - padding-left: 15px; + padding-top: 20px; + padding-bottom: 20px; + color: white; + padding-left: 15px; } .whitegroove { - width: 344px; - border: groove; + width: 344px; + border: groove; } .dropdownbtn { - color: white; - width: 340px; - background: #262626; + color: white; + width: 340px; + background: #262626; } .queryclr { - color: white; - background: #262626; + color: white; + background: #262626; } .pointer { - cursor: pointer; + cursor: pointer; } -#tbodycontent>tr>td { - border-bottom: 1px solid #cccccc; +#tbodycontent > tr > td { + border-bottom: 1px solid #cccccc; } -#tbodycontent>tr:last-child>td { - border-bottom: 1px solid #ddd; +#tbodycontent > tr:last-child > td { + border-bottom: 1px solid #ddd; } .gridRowSelected { - background-color: #DEF; + background-color: #def; } .gridRowSelected:hover { - background-color: #DEF!important; - cursor: initial; + background-color: #def !important; + cursor: initial; } .collectionNodeSelected { - background-color: #DEF; + background-color: #def; } .collectionNodeSelected:hover { - background-color: #DEF!important; - cursor: default!important; + background-color: #def !important; + cursor: default !important; } .databaseNodeSelected { - background-color: #DEF; + background-color: #def; } .databaseNodeSelected:hover { - background-color: #DEF!important; - cursor: default!important; + background-color: #def !important; + cursor: default !important; } .leftsidepanle-hr { - margin: 16px 0px; - border-top: 1px solid #eee; - margin-left: -17px; - width: 100%; - color: 1px solid #53575B; + margin: 16px 0px; + border-top: 1px solid #eee; + margin-left: -17px; + width: 100%; + color: 1px solid #53575b; } .partitioning-btn { - padding-bottom: 16px; + padding-bottom: 16px; } .btncreatecoll1 { - border: 1px solid @AccentMediumHigh; - background-color: @AccentMediumHigh; - color: #fff; - padding: 2px 30px; - cursor: pointer; - font-size: 12px; + border: 1px solid @AccentMediumHigh; + background-color: @AccentMediumHigh; + color: #fff; + padding: 2px 30px; + cursor: pointer; + font-size: 12px; } .btncreatecoll1:hover { - background: @AccentMediumHigh; - color: #fff; - border-color: @AccentMediumHigh; - cursor: pointer; - font-size: 12px; + background: @AccentMediumHigh; + color: #fff; + border-color: @AccentMediumHigh; + cursor: pointer; + font-size: 12px; } .btncreatecoll1:active { - border: 1px solid #0072c6; - background-color: #0072c6; - color: white; - padding: 2px 30px; - cursor: pointer; - font-size: 12px; + border: 1px solid #0072c6; + background-color: #0072c6; + color: white; + padding: 2px 30px; + cursor: pointer; + font-size: 12px; } .btncreatecoll1-off { - border: 1px solid #969696; - background-color: #000; - color: white; - padding: 2px 30px; - cursor: pointer; - font-size: 12px; - margin-left: -5px; + border: 1px solid #969696; + background-color: #000; + color: white; + padding: 2px 30px; + cursor: pointer; + font-size: 12px; + margin-left: -5px; } .leftpanel-okbut { - padding: 20px 0px 24px 30px; + padding: 20px 0px 24px 30px; } .btnpricepad { - margin-left: 24px; + margin-left: 24px; } .collid { - background: #fff; - width: calc(~"100% - 80px"); + background: #fff; + width: calc(~"100% - 80px"); } .textfontclr { - color: #000; + color: #000; } .collid-white { - width: 100%; - border: solid 1px #DDD; + width: 100%; + border: solid 1px #ddd; } .plusimg-but { - background-image: url(../images/plus_normal.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/plus_normal.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .plusimg-but:hover { - background-image: url(../images/plus_hover.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/plus_hover.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .plusimg-but:active { - background-image: url(../images/plus_pressed.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/plus_pressed.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .plusimg-but:disabled { - background-image: url(../images/plus_disabled.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/plus_disabled.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .minusimg-but { - background-image: url(../images/minus_normal.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/minus_normal.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .minusimg-but:hover { - background-image: url(../images/minus_hover.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/minus_hover.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .minusimg-but:active { - background-image: url(../images/minus_pressed.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/minus_pressed.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .minusimg-but:disabled { - background-image: url(../images/minus_disabled.svg); - background-repeat: no-repeat; - padding: 6px 16px; - position: static; - padding-top: 4px; + background-image: url(../images/minus_disabled.svg); + background-repeat: no-repeat; + padding: 6px 16px; + position: static; + padding-top: 4px; } .firstdivbg { - padding: @MediumSpace 0px @DefaultSpace (2 * @LargeSpace); - background-color: @BaseLight; + padding: @MediumSpace 0px @DefaultSpace (2 * @LargeSpace); + background-color: @BaseLight; } p { - margin: 0 0 4px; - color: #000; + margin: 0 0 4px; + color: #000; } .closeImg { - float: right; - margin: 0px 20px 0px 0px; - cursor: pointer; - padding: 6px 20px 20px 6px; - width: 20px; - height: 20px; + float: right; + margin: 0px 20px 0px 0px; + cursor: pointer; + padding: 6px 20px 20px 6px; + width: 20px; + height: 20px; } .seconddivpadding { - padding-top: 16px; + padding-top: 16px; } .seconddivbg { - height: 100vh; - padding-left: 32px; - padding-top: 16px; + height: 100vh; + padding-left: 32px; + padding-top: 16px; } .pkPadding { - padding-top: 12px; + padding-top: 12px; } .mandatoryStar { - color: #ff0707; - font-size: 14px; - font-weight: bold; + color: #ff0707; + font-size: 14px; + font-weight: bold; } .pricingtierimg { - padding-left: 20px; - padding-top: 10px; - padding-bottom: 20px; + padding-left: 20px; + padding-top: 10px; + padding-bottom: 20px; } .headerline { - color: @BaseDark; - font-size: 16px; - border-bottom: 1px solid @BaseMedium; + color: @BaseDark; + font-size: 16px; + border-bottom: 1px solid @BaseMedium; } .partitionkeystyle { - font-size: 10px; + font-size: 10px; } .arrowprice { - margin-left: 230px; + margin-left: 230px; } .paddingspan { - padding: 20px; - color: white; - font-size: 14px; + padding: 20px; + color: white; + font-size: 14px; } input::-webkit-calendar-picker-indicator { - opacity: 100; + opacity: 100; } .paddingspan3 { - color: white; - font-size: 14px; - position: absolute; - width: 100%; - height: 100px; - bottom: 150px; + color: white; + font-size: 14px; + position: absolute; + width: 100%; + height: 100px; + bottom: 150px; } .paddingspan4 { - padding-top: 20px; - padding-left: 20px; - color: white; - font-size: 14px; + padding-top: 20px; + padding-left: 20px; + color: white; + font-size: 14px; } .closebtnn { - float: right; - padding: 0 10px; - cursor: pointer; + float: right; + padding: 0 10px; + cursor: pointer; } label { - white-space: nowrap; - font: 12px "Segoe UI"; + white-space: nowrap; + font: 12px "Segoe UI"; } .Introlines { - padding-top: 27px; - padding-left: 25px; + padding-top: 27px; + padding-left: 25px; } .Introline1 { - font-size: 16px; + font-size: 16px; } .Introline2 { - font-size: 14px; - padding-top: 10px; + font-size: 14px; + padding-top: 10px; } .datalist-arrow { - position: relative; + position: relative; } .datalist-arrow:hover:after { - background: #969696; + background: #969696; } .datalist-arrow:focus:after, .datalist-arrow:active:after { - background: #1EBBEE; + background: #1ebbee; } input::-webkit-calendar-picker-indicator::after { - content: '\276F'; - right: 0; - top: -8%; - display: block; - width: 27px; - height: 25px; - line-height: 25px; - color: #fff; - text-align: center; - pointer-events: none; - transform: rotate(90deg); + content: "\276F"; + right: 0; + top: -8%; + display: block; + width: 27px; + height: 25px; + line-height: 25px; + color: #fff; + text-align: center; + pointer-events: none; + transform: rotate(90deg); } .datalist-arrow:after:hover { - content: '\276F'; - position: absolute; - right: 1px; - top: 6%; - transform: rotate(90deg); - display: block; - width: 27px; - height: 25px; - line-height: 25px; - color: #fff; - text-align: center; - pointer-events: none; - background-color: #1EBBEE; + content: "\276F"; + position: absolute; + right: 1px; + top: 6%; + transform: rotate(90deg); + display: block; + width: 27px; + height: 25px; + line-height: 25px; + color: #fff; + text-align: center; + pointer-events: none; + background-color: #1ebbee; } .Introline3 { - padding-top: 10px; - font-size: 14px; - font-weight: 1000; + padding-top: 10px; + font-size: 14px; + font-weight: 1000; } .collectionCollapsed { - color: black; - font-weight: 400; - font-size: 14px; - position: relative; - display: block; - padding: 8px 15px; - cursor: pointer; - margin-right: 13px; - border: 1px solid #fff; + color: black; + font-weight: 400; + font-size: 14px; + position: relative; + display: block; + padding: 8px 15px; + cursor: pointer; + margin-right: 13px; + border: 1px solid #fff; } .collectionCollapsed:hover { - background: #EEEEEE; + background: #eeeeee; } .collectionCollapsed:active { - border: solid 1px @AccentMediumHigh; + border: solid 1px @AccentMediumHigh; } .collectionCollapsed:focus { - border: Solid 1px @AccentMediumHigh; + border: Solid 1px @AccentMediumHigh; } .arrowCollapsed { - cursor: pointer; - width: 16px; - height: 16px; - transform: rotate(-90deg) translateX(-100%); - -webkit-transform: rotate(-90deg) translateX(-100%); - -ms-transform: rotate(-90deg) translateX(-100%); - margin: -30px 3px 0px 2px; + cursor: pointer; + width: 16px; + height: 16px; + transform: rotate(-90deg) translateX(-100%); + -webkit-transform: rotate(-90deg) translateX(-100%); + -ms-transform: rotate(-90deg) translateX(-100%); + margin: -30px 3px 0px 2px; } .leftarrowCollapsed { - padding: 2px 4px 4px 5px; - border: solid 1px #FFF; - margin: 6px 4px 0px -11px; + padding: 2px 4px 4px 5px; + border: solid 1px #fff; + margin: 6px 4px 0px -11px; } .leftarrowCollapsed:hover { - background-color: #EEEEEE; + background-color: #eeeeee; } .leftarrowCollapsed:active { - border: solid 1px @AccentMediumHigh; + border: solid 1px @AccentMediumHigh; } .leftarrowCollapsed:focus { - border: Solid 1px @AccentMediumHigh; + border: Solid 1px @AccentMediumHigh; } .qslevel { - padding-top: 10px; - padding-left: 10px; - width: 60%; - min-width: 960px; + padding-top: 10px; + padding-left: 10px; + width: 60%; + min-width: 960px; } .nav-tabs-margin { - margin-top: 20px; + margin-top: 20px; } .numbersize { - font-size: 30px; - display: inline; - font-weight: 600; + font-size: 30px; + display: inline; + font-weight: 600; } .numbersizePadding { - padding-right: 5px; + padding-right: 5px; } .numberheading { - display: inline; - position: absolute; - padding-top: 10px; - font-size: 16px; - padding-left: 15px; + display: inline; + position: absolute; + padding-top: 10px; + font-size: 16px; + padding-left: 15px; } -.numberheading>p { - padding-top: 10px; - font-size: 12px; +.numberheading > p { + padding-top: 10px; + font-size: 12px; } -.numberheading>ul { - padding-top: 10px; - padding-left: 0px; - list-style-type: none; +.numberheading > ul { + padding-top: 10px; + padding-left: 0px; + list-style-type: none; } .numberheading ul li { - padding-bottom: 5px; + padding-bottom: 5px; } -.numberheading>ul>li>a { - font-size: 12px; - color: #0058ad; +.numberheading > ul > li > a { + font-size: 12px; + color: #0058ad; } -.netApp { - padding-bottom: 80px; -} - -.pythonApp { - padding-bottom: 45px; +.sampleApp { + padding-bottom: 45px; } .step1 { - padding-bottom: 110px; + padding-bottom: 110px; } -.step1>input { - font-size: 12px; +.step1 > input { + font-size: 12px; } .btncreatecoll { - background: #0058ad; - color: #fff; - padding: 5px 20px; - cursor: pointer; - font-size: 12px; - border: 1px solid #0058ad; + background: #0058ad; + color: #fff; + padding: 5px 20px; + cursor: pointer; + font-size: 12px; + border: 1px solid #0058ad; } .btncreatecoll:hover { - background-color: #0074e0; + background-color: #0074e0; } .atags:focus { - color: @AccentMediumHigh; + color: @AccentMediumHigh; } .atags { - color: @AccentMediumHigh; - font-weight: 400; - cursor: pointer + color: @AccentMediumHigh; + font-weight: 400; + cursor: pointer; } .qsmenuicons { - width: 25px; - height: 25px; - margin-right: 5px; + width: 25px; + height: 25px; + margin-right: 5px; } .HeaderBg { - background-color: #202428; - height: 60px; + background-color: #202428; + height: 60px; } .title { - color: @AccentMediumHigh; - font-size: 20px; - padding-left: 10px; + color: @AccentMediumHigh; + font-size: 20px; + padding-left: 10px; } .items { - padding-left: 24px; - padding-top: 15px; + padding-left: 24px; + padding-top: 15px; } .divmenuquickstartpadding { - padding-left: 24px; - padding-bottom: 8px; + padding-left: 24px; + padding-bottom: 8px; } .menuQuickStart { - font-size: 12px; - color: white; - padding-left: 10px; + font-size: 12px; + color: white; + padding-left: 10px; } .menuExplorer { - font-size: 12px; - color: white; - padding-left: 20px; + font-size: 12px; + color: white; + padding-left: 20px; } .activemenu { - color: #fff; + color: #fff; } .rightarrowimg { - padding-left: 5px; - padding-bottom: 2px; + padding-left: 5px; + padding-bottom: 2px; } a:hover, a:visited, a:active, a:link { - text-decoration: none; + text-decoration: none; } .command { - padding: 8px; + padding: 8px; } .command:hover { - background-color: #E6E6E6; - cursor: pointer; - padding-bottom: 12px; + background-color: #e6e6e6; + cursor: pointer; + padding-bottom: 12px; } .command:active { - background-color: #CCCCCC; - border: solid 1px @AccentMediumHigh; + background-color: #cccccc; + border: solid 1px @AccentMediumHigh; } .command:focus { - padding: 7px 8px 11px 8px; - border: solid 1px @AccentMediumHigh; - outline: none; + padding: 7px 8px 11px 8px; + border: solid 1px @AccentMediumHigh; + outline: none; } -.nav>li>a:focus { - background-color: white; +.nav > li > a:focus { + background-color: white; } .commandIcon { - margin: 0 5px 0 0; - vertical-align: text-top; - width: 18px; - height: 18px; + margin: 0 5px 0 0; + vertical-align: text-top; + width: 18px; + height: 18px; } .iconpadclick { - background-color: #e6e6e6; - cursor: pointer; - border: 1px solid #1ebbee; - padding: 5px; + background-color: #e6e6e6; + cursor: pointer; + border: 1px solid #1ebbee; + padding: 5px; } .divimgleftarrow { - display: inline-block; - margin-top: 16px; - margin-right: 10px; + display: inline-block; + margin-top: 16px; + margin-right: 10px; } .divimgleftarrow:hover { - background-color: #e6e6e6; - cursor: pointer; - border: 1px solid #1ebbee; + background-color: #e6e6e6; + cursor: pointer; + border: 1px solid #1ebbee; } .adddeliconspan { - display: none; - float: right; - padding: 5px; + display: none; + float: right; + padding: 5px; } .spanparent:hover .adddeliconspan { - display: inline; + display: inline; } .spanchild:hover .adddeliconspan { - display: inline; + display: inline; } .collectiontitle { - font-size: 14px; - text-transform: uppercase; + font-size: 14px; + text-transform: uppercase; } .titlepadcol { - padding-left: 20px; - font-weight: 500; - height: 28px; - display: inline-block; - padding-top: 5px; + padding-left: 20px; + font-weight: 500; + height: 28px; + display: inline-block; + padding-top: 5px; } .btnmainslide { - height: 14px; - margin-top: 14px; - cursor: pointer; + height: 14px; + margin-top: 14px; + cursor: pointer; } .well { - padding: 19px 0px; - padding-top: 0px; - margin-bottom: 20px; - border: 0px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0); - background: white; + padding: 19px 0px; + padding-top: 0px; + margin-bottom: 20px; + border: 0px; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0); + background: white; } .splitter { - z-index: 1; - border-left: 5px solid white; - width: 8px; - border-right: 1px solid #cccccc; - float: left; - height: 100%; - position: absolute; - margin-left: 240px; - padding: 0px; - background-color: white; + z-index: 1; + border-left: 5px solid white; + width: 8px; + border-right: 1px solid #cccccc; + float: left; + height: 100%; + position: absolute; + margin-left: 240px; + padding: 0px; + background-color: white; } .testClass { - padding-left: 30px; + padding-left: 30px; } .level { - padding-left: 16px; - padding-top: 0px; + padding-left: 16px; + padding-top: 0px; } .imgiconwidth { - margin-right: 5px; + margin-right: 5px; } .id { - padding-left: 8px; - color: #000; - font-weight: bold; - margin-left: 6px; + padding-left: 8px; + color: #000; + font-weight: bold; + margin-left: 6px; } .documentsGridHeaderContainer { - padding-left: 5px; - padding-right: 15px; - width: 200px; + padding-left: 5px; + padding-right: 15px; + width: 200px; } .documentsGridHeader { - padding: 8px; - color: #000; - font-weight: bold; + padding: 8px; + color: #000; + font-weight: bold; } .fixedWidthHeader { - width: 82px; + width: 82px; } .tabdocuments { - padding: 4px 4px -1px 0px; + padding: 4px 4px -1px 0px; } -#divcontent>.mongoDocumentEditor .monaco-editor.vs .redsquiggly { - display: none !important; +#divcontent > .mongoDocumentEditor .monaco-editor.vs .redsquiggly { + display: none !important; } td a { - color: #393939; + color: #393939; } td a:hover { - color: #393939; + color: #393939; } .loadMore { - padding-left: 32%; - cursor: pointer; + padding-left: 32%; + cursor: pointer; } .table-fixed thead { - width: 97%; - padding-left: 18px; + width: 97%; + padding-left: 18px; } .table-fixed tbody { - height: 510px; - overflow-y: auto; - width: 100%; - overflow-x: hidden; + height: 510px; + overflow-y: auto; + width: 100%; + overflow-x: hidden; } .table-fixed thead, @@ -929,383 +925,383 @@ td a:hover { .table-fixed tr, .table-fixed td, .table-fixed th { - display: block; + display: block; } .table-fixed tbody td, -.table-fixed thead>tr>th { - float: left; - border-bottom-width: 0; +.table-fixed thead > tr > th { + float: left; + border-bottom-width: 0; } a:hover, a:visited, a:active, a:link { - text-decoration: none; + text-decoration: none; } .tabs { - position: relative; - clear: both; - margin: 15px 0 25px 0; - display: table; - width: 100%; + position: relative; + clear: both; + margin: 15px 0 25px 0; + display: table; + width: 100%; } .tab { - float: left; + float: left; } .tab label { - padding: 10px; - border: 1px solid #bbbbbb; - margin-left: -1px; - position: inherit; - left: 1px; - color: #393939; + padding: 10px; + border: 1px solid #bbbbbb; + margin-left: -1px; + position: inherit; + left: 1px; + color: #393939; } -.tab [type=radio] { - display: none; +.tab [type="radio"] { + display: none; } .tabcontent { - position: absolute; - top: 30px; - left: 0; - right: 0; - bottom: 0; - padding: 15px 0px 20px 0; + position: absolute; + top: 30px; + left: 0; + right: 0; + bottom: 0; + padding: 15px 0px 20px 0; } -.tab [type=radio]:checked~label { - border: 1px solid #0072c6; - background-color: @AccentMediumHigh; - color: white; - z-index: 2; +.tab [type="radio"]:checked ~ label { + border: 1px solid #0072c6; + background-color: @AccentMediumHigh; + color: white; + z-index: 2; } -.tab [type=radio]:checked~label:hover { - border: 1px solid @AccentMediumHigh; - background-color: @AccentMediumHigh; - color: white; - z-index: 2; +.tab [type="radio"]:checked ~ label:hover { + border: 1px solid @AccentMediumHigh; + background-color: @AccentMediumHigh; + color: white; + z-index: 2; } -.tab [type=radio]:checked~label:active { - border: 1px solid #0072c6; - background-color: #0072c6; - color: white; - z-index: 2; +.tab [type="radio"]:checked ~ label:active { + border: 1px solid #0072c6; + background-color: #0072c6; + color: white; + z-index: 2; } -.tab [type=radio]:checked~label~.tabcontent { - z-index: 1; - display: initial; +.tab [type="radio"]:checked ~ label ~ .tabcontent { + z-index: 1; + display: initial; } -.tab [type=radio]:not(:checked)~label:hover { - border: 1px solid #969696; - background-color: #969696; - color: white; - cursor: pointer; +.tab [type="radio"]:not(:checked) ~ label:hover { + border: 1px solid #969696; + background-color: #969696; + color: white; + cursor: pointer; } -.tab [type=radio]:not(:checked)~label~.tabcontent { - display: none; +.tab [type="radio"]:not(:checked) ~ label ~ .tabcontent { + display: none; } ::-webkit-input-placeholder { - color: #969696; + color: #969696; } ::-moz-placeholder { - color: #969696; + color: #969696; } :-ms-input-placeholder { - color: #969696; + color: #969696; } :-moz-placeholder { - color: #969696; + color: #969696; } ::-ms-expand { - color: #969696; + color: #969696; } .form-errors { - color: white; - padding-left: 12px; + color: white; + padding-left: 12px; } .atagdetails { - padding-left: 55px!important; + padding-left: 55px !important; } .path { - color: lightgray; - font-style: italic; - padding-top: 12px; - padding-left: 20px; + color: lightgray; + font-style: italic; + padding-top: 12px; + padding-left: 20px; } .queryPath { - line-height: 16px; - padding-left: 33px; - padding-bottom: 12px; + line-height: 16px; + padding-left: 33px; + padding-bottom: 12px; } .filterDocCollapsed { - padding-left: 20px; + padding-left: 20px; } .filterDocCollapsed.active { - display: block; + display: block; } .filterDocExpanded { - padding-left: 20px; + padding-left: 20px; } .filterDocExpanded.active { - display: block; + display: block; } .filterbuttonpad { - padding-top: 10px; + padding-top: 10px; } .filterbtnstyle { - background: @AccentMediumHigh; - width: 90px; - height: 25px; - color: white; - border: none; - margin-left: 16px !important; + background: @AccentMediumHigh; + width: 90px; + height: 25px; + color: white; + border: none; + margin-left: 16px !important; } .filterbtnstyle:hover { - background: @AccentMediumHigh; - width: 90px; - height: 25px; - color: white; - border: none; - margin-left: 16px; + background: @AccentMediumHigh; + width: 90px; + height: 25px; + color: white; + border: none; + margin-left: 16px; } .filterbtnstyle:active { - background: #0072c6; - width: 90px; - height: 25px; - color: white; - border: none; - margin-left: 16px; + background: #0072c6; + width: 90px; + height: 25px; + color: white; + border: none; + margin-left: 16px; } .filterbtnstyle:focus { - background: #0072c6; - width: 90px; - height: 25px; - color: white; - border: none; - margin-left: 16px; - border: 1px solid #0072c6; + background: #0072c6; + width: 90px; + height: 25px; + color: white; + border: none; + margin-left: 16px; + border: 1px solid #0072c6; } .filterbtnstyle:not(:enabled) { - background: lightgray; - width: 90px; - height: 25px; - color: white; - border: none; + background: lightgray; + width: 90px; + height: 25px; + color: white; + border: none; } .hrline1 { - color: #d6d7d8; - margin-left: -20px; + color: #d6d7d8; + margin-left: -20px; } .filtdocheader { - font-size: 18px; + font-size: 18px; } .editFilter { - margin-left: 20px; + margin-left: 20px; } .filterdivs { - padding-top: 24px; - height: 45px; - margin-bottom: 20px; + padding-top: 24px; + height: 45px; + margin-bottom: 20px; } .filterclose { - padding: 0 10px; - cursor: pointer; + padding: 0 10px; + cursor: pointer; } .queryResultpreviousImg { - height: 14px; - width: 14px; - margin-right: 2px; + height: 14px; + width: 14px; + margin-right: 2px; } .queryResultnextImg { - height: 14px; - width: 14px; - margin-left: 2px; + height: 14px; + width: 14px; + margin-left: 2px; } .rowoverride { - margin-left: 7px; - margin-top: 20px; + margin-left: 7px; + margin-top: 20px; } .tab-content-override { - padding-left: 5px; - padding-top: 20px; + padding-left: 5px; + padding-top: 20px; } .paddingspan4 { - padding-top: 20px; - color: white; - padding-left: 25px; - padding-right: 25px; + padding-top: 20px; + color: white; + padding-left: 25px; + padding-right: 25px; } .colResizePointer { - cursor: col-resize; + cursor: col-resize; } -.nav-tabs>li>a { - border-radius: 2px 2px 0 0; - padding: 8px 0px 4px 0px; - color: #393939; - width: 130px; - text-align: center; - margin-right: 0px; - position: relative; +.nav-tabs > li > a { + border-radius: 2px 2px 0 0; + padding: 8px 0px 4px 0px; + color: #393939; + width: 130px; + text-align: center; + margin-right: 0px; + position: relative; } -.nav-tabs>li.active>a, -.nav-tabs>li.active>a:focus, -.nav-tabs>li.active>a:hover { - border-bottom-color: #FFF; +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:focus, +.nav-tabs > li.active > a:hover { + border-bottom-color: #fff; } .tabList { - float: left; - margin-bottom: -15px !important; + float: left; + margin-bottom: -15px !important; } .tab_Content { - width: 130px; - border-right: 1px solid #e0e0e0; - padding: 0px 22px 0px 17px; - margin-left: -1px; + width: 130px; + border-right: 1px solid #e0e0e0; + padding: 0px 22px 0px 17px; + margin-left: -1px; } .tab_Content:hover { - width: 130px; - border-right: 1px solid #e0e0e0; - padding: 0px 22px 0px 17px; - margin-left: -1px; + width: 130px; + border-right: 1px solid #e0e0e0; + padding: 0px 22px 0px 17px; + margin-left: -1px; } .tab_Content:active { - width: 130px; - border-right: 1px; - padding: 0px 22px 0px 17px; - margin-left: -1px; + width: 130px; + border-right: 1px; + padding: 0px 22px 0px 17px; + margin-left: -1px; } .tabtext-center { - max-width: 110px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - padding-left: 2px; + max-width: 110px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding-left: 2px; } .tabIconSection { - width: 30px; - float: right; - top: -16px; - position: relative; - padding: 2px 12px 0 13px; + width: 30px; + float: right; + top: -16px; + position: relative; + padding: 2px 12px 0 13px; } -.nav-tabs>li>a:active { - background-color: #e0e0e0; - border-color: @AccentMediumHigh; +.nav-tabs > li > a:active { + background-color: #e0e0e0; + border-color: @AccentMediumHigh; } -.nav-tabs>li>a:active .tab_Content { - border: transparent; - width: 130px; +.nav-tabs > li > a:active .tab_Content { + border: transparent; + width: 130px; } .close-Icon { - background-image: url(../images/close-black.svg); - background-repeat: no-repeat; - padding: 0px 0px 0px 11px; + background-image: url(../images/close-black.svg); + background-repeat: no-repeat; + padding: 0px 0px 0px 11px; } .close-Icon:hover { - background-image: url(../images/close-black-hover.svg); - background-repeat: no-repeat; - padding: 0px 0px 0px 11px; + background-image: url(../images/close-black-hover.svg); + background-repeat: no-repeat; + padding: 0px 0px 0px 11px; } .clickableLink { - color: @AccentMediumHigh; - font-family: 'Segoe UI'; - font-size: 12px; - cursor: pointer; + color: @AccentMediumHigh; + font-family: "Segoe UI"; + font-size: 12px; + cursor: pointer; } .clickableLink:hover { - background-color: #e7f6fc; + background-color: #e7f6fc; } .clickableLink:active { - background-color: #e6f8fe; + background-color: #e6f8fe; } .clickableLink:focus { - outline: 1px dashed #000000; - outline-offset: 0px; + outline: 1px dashed #000000; + outline-offset: 0px; } .paneselect { - height: 23px; + height: 23px; } .headerWithoutPartitionKey { - width: 172px; + width: 172px; } .headerWithPartitionKey { - width: 86px; + width: 86px; } -input.codeblock{ - background-color: @BaseMediumLow; - color: #252525; - border: 1px solid @BaseMediumHigh; - box-sizing: border-box; - font-size: @mediumFontSize; - height: 23px; - outline: 0; - padding: 2px 8px 4px; - width: 60%; - min-width: 960px; - cursor: text; +input.codeblock { + background-color: @BaseMediumLow; + color: #252525; + border: 1px solid @BaseMediumHigh; + box-sizing: border-box; + font-size: @mediumFontSize; + height: 23px; + outline: 0; + padding: 2px 8px 4px; + width: 60%; + min-width: 960px; + cursor: text; } -#divQuickStartConnections{ - padding-bottom: 10px; -} \ No newline at end of file +#divQuickStartConnections { + padding-bottom: 10px; +} diff --git a/src/quickstart.html b/src/quickstart.html index fc89be86f..b082231a8 100644 --- a/src/quickstart.html +++ b/src/quickstart.html @@ -64,41 +64,40 @@
  • - Spring Boot Springboot + Spring Boot Spring Boot
  • -
    + +
    -
    +
    1
    - Open and run a sample .NET app + Create a new .NET app

    - We created a sample .NET app connected to your Azure Cosmos DB Emulator instance. Download, extract, - build and run the app. + Follow this + tutorial + + to create a new .NET app connected to Azure Cosmos DB.

    -
    -
    +
    1
    - Open and run a sample Java app + Create a new Java app

    - We created a sample Java app connected to your Azure Cosmos DB Emulator instance. Download, extract, - build and run the app. -

    - -

    - Follow instructions in the readme.md to setup prerequisites needed to run Java web apps, if you - haven’t already. + Follow this + tutorial + + to create a new Java app connected to Azure Cosmos DB.

    @@ -106,20 +105,18 @@
    -
    +
    1
    - Open and run a sample Node.js app + Create a new Node.js app

    - We created a sample Node.js app connected to your Azure Cosmos DB Emulator instance. Download, - extract, build and run the app. -

    - -

    - Run npm install and npm start, and navigate to - http://localhost:3000. + Follow this + tutorial + + to create a new Node.js app connected to Azure Cosmos DB.

    @@ -127,7 +124,7 @@
    -
    +
    1
    Create a new Python app @@ -141,9 +138,8 @@
    -
    -
    +
    1
    Create a new Go app @@ -158,7 +154,7 @@
    -
    +
    1
    Create a new Spring Boot app From e90e1fc581a34e866e99c013515de78b114b67b2 Mon Sep 17 00:00:00 2001 From: sakshigupta12feb Date: Wed, 30 Apr 2025 17:48:15 +0530 Subject: [PATCH 08/11] Updated the Migrate data link (#2122) * updated the Migrate data link * updated the Migrate data link (removed en-us) --------- Co-authored-by: Sakshi Gupta --- src/Explorer/SplashScreen/SplashScreen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 495bc03ee..2c7f778a4 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -817,7 +817,7 @@ export class SplashScreen extends React.Component { private vcoreMongoNextStepItems: { link: string; title: string; description: string }[] = [ { - link: "https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/how-to-migrate-native-tools?tabs=export-import", + link: "https://learn.microsoft.com/azure/cosmos-db/mongodb/vcore/migration-options", title: "Migrate Data", description: "", }, From fe73d0a1c63ba92e8c3e76dfcdcd0af60fa4e4df Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Wed, 30 Apr 2025 17:37:54 +0200 Subject: [PATCH 09/11] Fix Fabric Native ReadOnly mode (#2123) * Add FabricNativeReadOnly mode * Hide Settings for Fabric native readonly * Fix strict compil --- src/Explorer/Sidebar.tsx | 3 ++- src/Explorer/SplashScreen/FabricHome.tsx | 19 ++++++++++++++++--- src/Explorer/Tree/treeNodeUtil.tsx | 4 ++-- src/Platform/Fabric/FabricUtil.ts | 1 + 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Explorer/Sidebar.tsx b/src/Explorer/Sidebar.tsx index f3db58d8a..ce111dab3 100644 --- a/src/Explorer/Sidebar.tsx +++ b/src/Explorer/Sidebar.tsx @@ -27,7 +27,7 @@ import { CosmosFluentProvider, cosmosShorthands, tokens } from "Explorer/Theme/T import { ResourceTree } from "Explorer/Tree/ResourceTree"; import { useDatabases } from "Explorer/useDatabases"; import { KeyboardAction, KeyboardActionGroup, KeyboardActionHandler, useKeyboardActionGroup } from "KeyboardShortcuts"; -import { isFabric, isFabricMirrored, isFabricNative } from "Platform/Fabric/FabricUtil"; +import { isFabric, isFabricMirrored, isFabricNative, isFabricNativeReadOnly } from "Platform/Fabric/FabricUtil"; import { userContext } from "UserContext"; import { getCollectionName, getDatabaseName } from "Utils/APITypeUtils"; import { Allotment, AllotmentHandle } from "allotment"; @@ -318,6 +318,7 @@ export const SidebarContainer: React.FC = ({ explorer }) => { const hasGlobalCommands = !( isFabricMirrored() || + isFabricNativeReadOnly() || userContext.apiType === "Postgres" || userContext.apiType === "VCoreMongo" ); diff --git a/src/Explorer/SplashScreen/FabricHome.tsx b/src/Explorer/SplashScreen/FabricHome.tsx index c235604d4..7db6ee041 100644 --- a/src/Explorer/SplashScreen/FabricHome.tsx +++ b/src/Explorer/SplashScreen/FabricHome.tsx @@ -5,7 +5,7 @@ import { Link, makeStyles, tokens } from "@fluentui/react-components"; import { DocumentAddRegular, LinkMultipleRegular } from "@fluentui/react-icons"; import { SampleDataImportDialog } from "Explorer/SplashScreen/SampleDataImportDialog"; import { CosmosFluentProvider } from "Explorer/Theme/ThemeUtil"; -import { isFabricNative } from "Platform/Fabric/FabricUtil"; +import { isFabricNative, isFabricNativeReadOnly } from "Platform/Fabric/FabricUtil"; import * as React from "react"; import { userContext } from "UserContext"; import CosmosDbBlackIcon from "../../../images/CosmosDB_black.svg"; @@ -62,6 +62,15 @@ const useStyles = makeStyles({ margin: "auto", }, }, + single: { + gridColumn: "1 / 4", + gridRow: "1 / 3", + "& svg": { + width: "64px", + height: "64px", + margin: "auto", + }, + }, buttonContainer: { height: "100%", display: "flex", @@ -150,7 +159,11 @@ export const FabricHomeScreen: React.FC = (props: SplashScree }, ]; - return ( + return isFabricNativeReadOnly() ? ( +
    + +
    + ) : (
    @@ -159,7 +172,7 @@ export const FabricHomeScreen: React.FC = (props: SplashScree ); }; - const title = "Build your database"; + const title = isFabricNativeReadOnly() ? "Use your database" : "Build your database"; return ( <> diff --git a/src/Explorer/Tree/treeNodeUtil.tsx b/src/Explorer/Tree/treeNodeUtil.tsx index 838d5c1f0..04eafed3f 100644 --- a/src/Explorer/Tree/treeNodeUtil.tsx +++ b/src/Explorer/Tree/treeNodeUtil.tsx @@ -6,7 +6,7 @@ import StoredProcedure from "Explorer/Tree/StoredProcedure"; import Trigger from "Explorer/Tree/Trigger"; import UserDefinedFunction from "Explorer/Tree/UserDefinedFunction"; import { useDatabases } from "Explorer/useDatabases"; -import { isFabric, isFabricMirrored, isFabricNative } from "Platform/Fabric/FabricUtil"; +import { isFabric, isFabricMirrored, isFabricNative, isFabricNativeReadOnly } from "Platform/Fabric/FabricUtil"; import { getItemName } from "Utils/APITypeUtils"; import { isServerlessAccount } from "Utils/CapabilityUtils"; import { useTabs } from "hooks/useTabs"; @@ -292,7 +292,7 @@ const buildCollectionNodeChildren = ( contextMenu: ResourceTreeContextMenuButtonFactory.createCollectionContextMenuButton(container, collection), }); - if (userContext.apiType !== "Cassandra" || !isServerlessAccount()) { + if ((userContext.apiType !== "Cassandra" || !isServerlessAccount()) && !isFabricNativeReadOnly()) { let id = ""; if (collection.isSampleCollection) { id = database.isDatabaseShared() ? "sampleSettings" : "sampleScaleSettings"; diff --git a/src/Platform/Fabric/FabricUtil.ts b/src/Platform/Fabric/FabricUtil.ts index a9a653dd7..c2332e4bc 100644 --- a/src/Platform/Fabric/FabricUtil.ts +++ b/src/Platform/Fabric/FabricUtil.ts @@ -136,3 +136,4 @@ export const isFabricMirroredAAD = (): boolean => export const isFabricMirrored = (): boolean => isFabricMirroredKey() || isFabricMirroredAAD(); export const isFabricNative = (): boolean => isFabric() && userContext.fabricContext?.artifactType === CosmosDbArtifactType.NATIVE; +export const isFabricNativeReadOnly = (): boolean => isFabricNative() && !!userContext.fabricContext?.isReadOnly; From bb66deb3a46cdb07677a3fb9d0057c71f5ed7e57 Mon Sep 17 00:00:00 2001 From: sunghyunkang1111 <114709653+sunghyunkang1111@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:18:11 -0500 Subject: [PATCH 10/11] Added more test cases and fix system partition key load issue (#2126) * Added more test cases and fix system partition key load issue * Fix unit tests and fix ci * Updated test snapsho --- .github/workflows/ci.yml | 18 ++++---- playwright.config.ts | 41 ++++++++++++++++--- .../Controls/InputDataList/InputDataList.tsx | 1 + .../Tabs/DocumentsTabV2/DocumentsTabV2.tsx | 9 +++- .../DocumentsTabV2.test.tsx.snap | 1 + test/CORSBypass.ts | 23 +++++++++++ test/fx.ts | 16 ++++++-- test/mongo/document.spec.ts | 11 ++++- test/sql/document.spec.ts | 17 ++++---- test/sql/testCases.ts | 19 ++++++++- test/testData.ts | 11 +++-- 11 files changed, 136 insertions(+), 31 deletions(-) create mode 100644 test/CORSBypass.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56ed46edc..228470f72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,24 +164,24 @@ jobs: strategy: fail-fast: false matrix: - shardIndex: [1, 2, 3, 4, 5, 6, 7, 8] - shardTotal: [8] + shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] + shardTotal: [16] steps: - uses: actions/checkout@v4 - - name: "Az CLI login" - uses: azure/login@v1 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Use Node.js 18.x uses: actions/setup-node@v4 with: node-version: 18.x - run: npm ci - run: npx playwright install --with-deps + - name: "Az CLI login" + uses: Azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Run test shard ${{ matrix['shardIndex'] }} of ${{ matrix['shardTotal']}} - run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=3 - name: Upload blob report to GitHub Actions Artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 diff --git a/playwright.config.ts b/playwright.config.ts index 80ba367bf..b1f6a622d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -37,20 +37,51 @@ export default defineConfig({ }, { name: "firefox", - use: { ...devices["Desktop Firefox"] }, + use: { + ...devices["Desktop Firefox"], + launchOptions: { + firefoxUserPrefs: { + "security.fileuri.strict_origin_policy": false, + "network.http.referer.XOriginPolicy": 0, + "network.http.referer.trimmingPolicy": 0, + "privacy.file_unique_origin": false, + "security.csp.enable": false, + "network.cors_preflight.allow_client_cert": true, + "dom.security.https_first": false, + "network.http.cross-origin-embedder-policy": false, + "network.http.cross-origin-opener-policy": false, + "browser.tabs.remote.useCrossOriginPolicy": false, + "browser.tabs.remote.useCORP": false, + }, + args: ["--disable-web-security"], + }, + }, }, { name: "webkit", - use: { ...devices["Desktop Safari"] }, + use: { + ...devices["Desktop Safari"], + }, }, - /* Test against branded browsers. */ { name: "Google Chrome", - use: { ...devices["Desktop Chrome"], channel: "chrome" }, // or 'chrome-beta' + use: { + ...devices["Desktop Chrome"], + channel: "chrome", + launchOptions: { + args: ["--disable-web-security", "--disable-features=IsolateOrigins,site-per-process"], + }, + }, }, { name: "Microsoft Edge", - use: { ...devices["Desktop Edge"], channel: "msedge" }, // or 'msedge-dev' + use: { + ...devices["Desktop Edge"], + channel: "msedge", + launchOptions: { + args: ["--disable-web-security", "--disable-features=IsolateOrigins,site-per-process"], + }, + }, }, ], diff --git a/src/Explorer/Controls/InputDataList/InputDataList.tsx b/src/Explorer/Controls/InputDataList/InputDataList.tsx index cd31db53b..2f483d362 100644 --- a/src/Explorer/Controls/InputDataList/InputDataList.tsx +++ b/src/Explorer/Controls/InputDataList/InputDataList.tsx @@ -193,6 +193,7 @@ export const InputDataList: FC = ({ <> (partitionKey?.systemKey ? [] : _collection?.partitionKeyPropertyHeaders || partitionKey?.paths), - [_collection?.partitionKeyPropertyHeaders, partitionKey?.paths, partitionKey?.systemKey], + () => + isPreferredApiMongoDB && partitionKey?.systemKey + ? [] + : _collection?.partitionKeyPropertyHeaders || partitionKey?.paths, + [_collection?.partitionKeyPropertyHeaders, partitionKey?.paths, partitionKey?.systemKey, isPreferredApiMongoDB], ); let partitionKeyProperties = useMemo(() => { return partitionKeyPropertyHeaders?.map((partitionKeyPropertyHeader) => @@ -2116,6 +2119,7 @@ export const DocumentsTabComponent: React.FunctionComponent