mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-29 05:41:40 +00:00
Compare commits
87 Commits
v-yiqcao/n
...
languy-com
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8141799ffd | ||
|
|
732d7ce8fa | ||
|
|
254c551999 | ||
|
|
f86883de6c | ||
|
|
62550f8d6a | ||
|
|
184910ee6c | ||
|
|
9253ab1876 | ||
|
|
920c95b614 | ||
|
|
1d98c83be5 | ||
|
|
b85a20cbea | ||
|
|
d0f6923d24 | ||
|
|
ecdc41ada9 | ||
|
|
c1b74266eb | ||
|
|
ef6ecf0a5f | ||
|
|
b241771e69 | ||
|
|
9d63a346e4 | ||
|
|
2e7c7440d3 | ||
|
|
641dae30a1 | ||
|
|
f192310697 | ||
|
|
588c1d3ec3 | ||
|
|
7eb2817acc | ||
|
|
9c28b7f9c5 | ||
|
|
4807169b0c | ||
|
|
d85b6285ac | ||
|
|
9617b80b56 | ||
|
|
1af44fb207 | ||
|
|
9d30dd5d0a | ||
|
|
4eb0dedddb | ||
|
|
c844986c34 | ||
|
|
4e702716bd | ||
|
|
1d2995ef32 | ||
|
|
ee919a68a5 | ||
|
|
2ec9df52aa | ||
|
|
0ed9fe029d | ||
|
|
45af1d7cf9 | ||
|
|
69975cd0e8 | ||
|
|
c1141406ff | ||
|
|
acb284eac7 | ||
|
|
498c39c877 | ||
|
|
87e016f03c | ||
|
|
3a1841ad3c | ||
|
|
d314a20b81 | ||
|
|
7188e8d8c2 | ||
|
|
3cd2ec93f2 | ||
|
|
b8e9903287 | ||
|
|
4127d0f522 | ||
|
|
56b5a9861b | ||
|
|
10664162c7 | ||
|
|
cf01ffa957 | ||
|
|
3cc1945140 | ||
|
|
864d9393f2 | ||
|
|
8629bcbe2d | ||
|
|
6c90ef2e62 | ||
|
|
2d2d8b6efe | ||
|
|
7cbf7202b0 | ||
|
|
e8e5eb55cb | ||
|
|
f0c82a430b | ||
|
|
3777b6922e | ||
|
|
aec951694a | ||
|
|
07474b8271 | ||
|
|
e092e5140f | ||
|
|
1f4074f3e8 | ||
|
|
1ec0d9a0be | ||
|
|
eddc334cb5 | ||
|
|
22d8a7a1be | ||
|
|
4210e0752b | ||
|
|
b217d4be1b | ||
|
|
81fd442fad | ||
|
|
87f7dd2230 | ||
|
|
9926fd97a2 | ||
|
|
2a7546e0de | ||
|
|
4b442dd869 | ||
|
|
f0b4737313 | ||
|
|
8dc5ed590a | ||
|
|
afaa844d28 | ||
|
|
3e5a876ef2 | ||
|
|
51abf1560a | ||
|
|
1c0fed88c0 | ||
|
|
93cfd52e36 | ||
|
|
3fd014ddad | ||
|
|
3b6fda4fa5 | ||
|
|
db7c45c9b8 | ||
|
|
4f6b75fe79 | ||
|
|
5038a01079 | ||
|
|
e0063c76d9 | ||
|
|
9278654479 | ||
|
|
59113d7bbf |
@@ -4,6 +4,8 @@ PORTAL_RUNNER_SUBSCRIPTION=
|
|||||||
PORTAL_RUNNER_RESOURCE_GROUP=
|
PORTAL_RUNNER_RESOURCE_GROUP=
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT=
|
PORTAL_RUNNER_DATABASE_ACCOUNT=
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY=
|
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY=
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT=
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT_KEY=
|
||||||
PORTAL_RUNNER_CONNECTION_STRING=
|
PORTAL_RUNNER_CONNECTION_STRING=
|
||||||
NOTEBOOKS_TEST_RUNNER_TENANT_ID=
|
NOTEBOOKS_TEST_RUNNER_TENANT_ID=
|
||||||
NOTEBOOKS_TEST_RUNNER_CLIENT_ID=
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID=
|
||||||
|
|||||||
@@ -11,15 +11,9 @@ src/Common/CosmosClient.test.ts
|
|||||||
src/Common/CosmosClient.ts
|
src/Common/CosmosClient.ts
|
||||||
src/Common/DataAccessUtilityBase.test.ts
|
src/Common/DataAccessUtilityBase.test.ts
|
||||||
src/Common/DataAccessUtilityBase.ts
|
src/Common/DataAccessUtilityBase.ts
|
||||||
src/Common/DeleteFeedback.ts
|
|
||||||
src/Common/DocumentClientUtilityBase.ts
|
|
||||||
src/Common/EditableUtility.ts
|
src/Common/EditableUtility.ts
|
||||||
src/Common/HashMap.test.ts
|
src/Common/HashMap.test.ts
|
||||||
src/Common/HashMap.ts
|
src/Common/HashMap.ts
|
||||||
src/Common/HeadersUtility.test.ts
|
|
||||||
src/Common/HeadersUtility.ts
|
|
||||||
src/Common/IteratorUtilities.test.ts
|
|
||||||
src/Common/IteratorUtilities.ts
|
|
||||||
src/Common/Logger.test.ts
|
src/Common/Logger.test.ts
|
||||||
src/Common/MessageHandler.test.ts
|
src/Common/MessageHandler.test.ts
|
||||||
src/Common/MessageHandler.ts
|
src/Common/MessageHandler.ts
|
||||||
@@ -30,7 +24,6 @@ src/Common/ObjectCache.test.ts
|
|||||||
src/Common/ObjectCache.ts
|
src/Common/ObjectCache.ts
|
||||||
src/Common/QueriesClient.ts
|
src/Common/QueriesClient.ts
|
||||||
src/Common/Splitter.ts
|
src/Common/Splitter.ts
|
||||||
src/Common/ThemeUtility.ts
|
|
||||||
src/Common/UrlUtility.ts
|
src/Common/UrlUtility.ts
|
||||||
src/Config.ts
|
src/Config.ts
|
||||||
src/Contracts/ActionContracts.ts
|
src/Contracts/ActionContracts.ts
|
||||||
@@ -58,8 +51,6 @@ src/Explorer/ComponentRegisterer.test.ts
|
|||||||
src/Explorer/ComponentRegisterer.ts
|
src/Explorer/ComponentRegisterer.ts
|
||||||
src/Explorer/ContextMenuButtonFactory.ts
|
src/Explorer/ContextMenuButtonFactory.ts
|
||||||
src/Explorer/Controls/CollapsiblePanel/CollapsiblePanelComponent.ts
|
src/Explorer/Controls/CollapsiblePanel/CollapsiblePanelComponent.ts
|
||||||
src/Explorer/Controls/CommandButton/CommandButton.test.ts
|
|
||||||
src/Explorer/Controls/CommandButton/CommandButton.ts
|
|
||||||
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
|
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
|
||||||
src/Explorer/Controls/DynamicList/DynamicList.test.ts
|
src/Explorer/Controls/DynamicList/DynamicList.test.ts
|
||||||
src/Explorer/Controls/DynamicList/DynamicListComponent.ts
|
src/Explorer/Controls/DynamicList/DynamicListComponent.ts
|
||||||
@@ -87,7 +78,7 @@ src/Explorer/DataSamples/ContainerSampleGenerator.test.ts
|
|||||||
src/Explorer/DataSamples/ContainerSampleGenerator.ts
|
src/Explorer/DataSamples/ContainerSampleGenerator.ts
|
||||||
src/Explorer/DataSamples/DataSamplesUtil.test.ts
|
src/Explorer/DataSamples/DataSamplesUtil.test.ts
|
||||||
src/Explorer/DataSamples/DataSamplesUtil.ts
|
src/Explorer/DataSamples/DataSamplesUtil.ts
|
||||||
src/Explorer/Explorer.ts
|
src/Explorer/Explorer.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts
|
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.test.ts
|
||||||
@@ -95,8 +86,6 @@ src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.ts
|
|||||||
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphData.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/GraphData.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphData.ts
|
src/Explorer/Graph/GraphExplorerComponent/GraphData.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphUtil.test.ts
|
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphUtil.ts
|
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.ts
|
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.test.ts
|
||||||
@@ -110,7 +99,6 @@ src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts
|
|||||||
src/Explorer/Menus/ContextMenu.ts
|
src/Explorer/Menus/ContextMenu.ts
|
||||||
src/Explorer/MostRecentActivity/MostRecentActivity.ts
|
src/Explorer/MostRecentActivity/MostRecentActivity.ts
|
||||||
src/Explorer/Notebook/FileSystemUtil.ts
|
src/Explorer/Notebook/FileSystemUtil.ts
|
||||||
src/Explorer/Notebook/NTeractUtil.ts
|
|
||||||
src/Explorer/Notebook/NotebookClientV2.ts
|
src/Explorer/Notebook/NotebookClientV2.ts
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookContentProvider.ts
|
src/Explorer/Notebook/NotebookComponent/NotebookContentProvider.ts
|
||||||
src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts
|
src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts
|
||||||
@@ -162,7 +150,7 @@ src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts
|
|||||||
src/Explorer/Panes/Tables/Validators/EntityPropertyValueValidator.ts
|
src/Explorer/Panes/Tables/Validators/EntityPropertyValueValidator.ts
|
||||||
src/Explorer/Panes/UploadFilePane.ts
|
src/Explorer/Panes/UploadFilePane.ts
|
||||||
src/Explorer/Panes/UploadItemsPane.ts
|
src/Explorer/Panes/UploadItemsPane.ts
|
||||||
src/Explorer/SplashScreen/SplashScreenComponentAdapter.test.ts
|
src/Explorer/SplashScreen/SplashScreen.test.ts
|
||||||
src/Explorer/Tables/Constants.ts
|
src/Explorer/Tables/Constants.ts
|
||||||
src/Explorer/Tables/DataTable/CacheBase.ts
|
src/Explorer/Tables/DataTable/CacheBase.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableBindingManager.ts
|
src/Explorer/Tables/DataTable/DataTableBindingManager.ts
|
||||||
@@ -170,7 +158,6 @@ src/Explorer/Tables/DataTable/DataTableBuilder.ts
|
|||||||
src/Explorer/Tables/DataTable/DataTableContextMenu.ts
|
src/Explorer/Tables/DataTable/DataTableContextMenu.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableOperationManager.ts
|
src/Explorer/Tables/DataTable/DataTableOperationManager.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableOperations.ts
|
src/Explorer/Tables/DataTable/DataTableOperations.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableUtilities.ts
|
|
||||||
src/Explorer/Tables/DataTable/DataTableViewModel.ts
|
src/Explorer/Tables/DataTable/DataTableViewModel.ts
|
||||||
src/Explorer/Tables/DataTable/TableCommands.ts
|
src/Explorer/Tables/DataTable/TableCommands.ts
|
||||||
src/Explorer/Tables/DataTable/TableEntityCache.ts
|
src/Explorer/Tables/DataTable/TableEntityCache.ts
|
||||||
@@ -179,8 +166,6 @@ src/Explorer/Tables/Entities.ts
|
|||||||
src/Explorer/Tables/QueryBuilder/ClauseGroup.ts
|
src/Explorer/Tables/QueryBuilder/ClauseGroup.ts
|
||||||
src/Explorer/Tables/QueryBuilder/ClauseGroupViewModel.ts
|
src/Explorer/Tables/QueryBuilder/ClauseGroupViewModel.ts
|
||||||
src/Explorer/Tables/QueryBuilder/CustomTimestampHelper.ts
|
src/Explorer/Tables/QueryBuilder/CustomTimestampHelper.ts
|
||||||
src/Explorer/Tables/QueryBuilder/DateTimeUtilities.test.ts
|
|
||||||
src/Explorer/Tables/QueryBuilder/DateTimeUtilities.ts
|
|
||||||
src/Explorer/Tables/QueryBuilder/QueryBuilderViewModel.ts
|
src/Explorer/Tables/QueryBuilder/QueryBuilderViewModel.ts
|
||||||
src/Explorer/Tables/QueryBuilder/QueryClauseViewModel.ts
|
src/Explorer/Tables/QueryBuilder/QueryClauseViewModel.ts
|
||||||
src/Explorer/Tables/QueryBuilder/QueryViewModel.ts
|
src/Explorer/Tables/QueryBuilder/QueryViewModel.ts
|
||||||
@@ -200,7 +185,6 @@ src/Explorer/Tabs/QueryTab.test.ts
|
|||||||
src/Explorer/Tabs/QueryTab.ts
|
src/Explorer/Tabs/QueryTab.ts
|
||||||
src/Explorer/Tabs/QueryTablesTab.ts
|
src/Explorer/Tabs/QueryTablesTab.ts
|
||||||
src/Explorer/Tabs/ScriptTabBase.ts
|
src/Explorer/Tabs/ScriptTabBase.ts
|
||||||
src/Explorer/Tabs/SparkMasterTab.ts
|
|
||||||
src/Explorer/Tabs/StoredProcedureTab.ts
|
src/Explorer/Tabs/StoredProcedureTab.ts
|
||||||
src/Explorer/Tabs/TabComponents.ts
|
src/Explorer/Tabs/TabComponents.ts
|
||||||
src/Explorer/Tabs/TabsBase.ts
|
src/Explorer/Tabs/TabsBase.ts
|
||||||
@@ -264,8 +248,6 @@ src/Shared/ExplorerSettings.ts
|
|||||||
src/Shared/PriceEstimateCalculator.ts
|
src/Shared/PriceEstimateCalculator.ts
|
||||||
src/Shared/StorageUtility.test.ts
|
src/Shared/StorageUtility.test.ts
|
||||||
src/Shared/StorageUtility.ts
|
src/Shared/StorageUtility.ts
|
||||||
src/Shared/StringUtility.test.ts
|
|
||||||
src/Shared/StringUtility.ts
|
|
||||||
src/Shared/appInsights.ts
|
src/Shared/appInsights.ts
|
||||||
src/SparkClusterManager/ArcadiaResourceManager.ts
|
src/SparkClusterManager/ArcadiaResourceManager.ts
|
||||||
src/SparkClusterManager/SparkClusterManager.ts
|
src/SparkClusterManager/SparkClusterManager.ts
|
||||||
@@ -274,25 +256,14 @@ src/Terminal/NotebookAppContracts.d.ts
|
|||||||
src/Terminal/index.ts
|
src/Terminal/index.ts
|
||||||
src/TokenProviders/PortalTokenProvider.ts
|
src/TokenProviders/PortalTokenProvider.ts
|
||||||
src/TokenProviders/TokenProviderFactory.ts
|
src/TokenProviders/TokenProviderFactory.ts
|
||||||
src/Utils/AuthorizationUtils.test.ts
|
|
||||||
src/Utils/AuthorizationUtils.ts
|
|
||||||
src/Utils/AutoPilotUtils.test.ts
|
|
||||||
src/Utils/AutoPilotUtils.ts
|
|
||||||
src/Utils/DatabaseAccountUtils.test.ts
|
src/Utils/DatabaseAccountUtils.test.ts
|
||||||
src/Utils/DatabaseAccountUtils.ts
|
src/Utils/DatabaseAccountUtils.ts
|
||||||
src/Utils/JunoUtils.ts
|
|
||||||
src/Utils/MessageValidation.ts
|
|
||||||
src/Utils/NotebookConfigurationUtils.ts
|
|
||||||
src/Utils/PricingUtils.test.ts
|
src/Utils/PricingUtils.test.ts
|
||||||
src/Utils/QueryUtils.test.ts
|
src/Utils/QueryUtils.test.ts
|
||||||
src/Utils/QueryUtils.ts
|
src/Utils/QueryUtils.ts
|
||||||
src/Utils/StringUtils.test.ts
|
|
||||||
src/Utils/StringUtils.ts
|
|
||||||
src/applyExplorerBindings.ts
|
src/applyExplorerBindings.ts
|
||||||
src/global.d.ts
|
src/global.d.ts
|
||||||
src/quickstart.ts
|
|
||||||
src/setupTests.ts
|
src/setupTests.ts
|
||||||
src/workers/upload/definitions.ts
|
|
||||||
src/workers/upload/index.ts
|
src/workers/upload/index.ts
|
||||||
src/Explorer/Controls/AccessibleElement/AccessibleElement.tsx
|
src/Explorer/Controls/AccessibleElement/AccessibleElement.tsx
|
||||||
src/Explorer/Controls/Accordion/AccordionComponent.tsx
|
src/Explorer/Controls/Accordion/AccordionComponent.tsx
|
||||||
@@ -339,15 +310,7 @@ src/Explorer/Graph/GraphExplorerComponent/QueryContainerComponent.tsx
|
|||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNeighborsComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNeighborsComponent.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
||||||
src/Explorer/Menus/CommandBar/CommandBarComponentAdapter.tsx
|
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx
|
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
||||||
src/Explorer/Menus/CommandBar/MemoryTrackerComponent.tsx
|
|
||||||
src/Explorer/Menus/NavBar/ControlBarComponent.tsx
|
|
||||||
src/Explorer/Menus/NavBar/ControlBarComponentAdapter.tsx
|
|
||||||
src/Explorer/Menus/NavBar/MeControlComponent.test.tsx
|
|
||||||
src/Explorer/Menus/NavBar/MeControlComponent.tsx
|
|
||||||
src/Explorer/Menus/NavBar/MeControlComponentAdapter.tsx
|
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponentAdapter.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponentAdapter.tsx
|
||||||
@@ -377,8 +340,7 @@ src/Explorer/Notebook/temp/inputs/editor.tsx
|
|||||||
src/Explorer/Notebook/temp/markdown-cell.tsx
|
src/Explorer/Notebook/temp/markdown-cell.tsx
|
||||||
src/Explorer/Notebook/temp/source.tsx
|
src/Explorer/Notebook/temp/source.tsx
|
||||||
src/Explorer/Notebook/temp/syntax-highlighter/index.tsx
|
src/Explorer/Notebook/temp/syntax-highlighter/index.tsx
|
||||||
src/Explorer/SplashScreen/SplashScreenComponent.tsx
|
src/Explorer/SplashScreen/SplashScreen.tsx
|
||||||
src/Explorer/SplashScreen/SplashScreenComponentApdapter.tsx
|
|
||||||
src/Explorer/Tabs/GalleryTab.tsx
|
src/Explorer/Tabs/GalleryTab.tsx
|
||||||
src/Explorer/Tabs/NotebookViewerTab.tsx
|
src/Explorer/Tabs/NotebookViewerTab.tsx
|
||||||
src/Explorer/Tabs/TerminalTab.tsx
|
src/Explorer/Tabs/TerminalTab.tsx
|
||||||
|
|||||||
118
.github/workflows/ci.yml
vendored
118
.github/workflows/ci.yml
vendored
@@ -15,10 +15,10 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: node utils/codeMetrics.js
|
- run: node utils/codeMetrics.js
|
||||||
env:
|
env:
|
||||||
@@ -28,10 +28,10 @@ jobs:
|
|||||||
name: "Compile TypeScript"
|
name: "Compile TypeScript"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run compile
|
- run: npm run compile
|
||||||
- run: npm run compile:strict
|
- run: npm run compile:strict
|
||||||
@@ -40,10 +40,10 @@ jobs:
|
|||||||
name: "Check Format"
|
name: "Check Format"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run format:check
|
- run: npm run format:check
|
||||||
lint:
|
lint:
|
||||||
@@ -51,10 +51,10 @@ jobs:
|
|||||||
name: "Lint"
|
name: "Lint"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
unittest:
|
unittest:
|
||||||
@@ -62,10 +62,10 @@ jobs:
|
|||||||
name: "Unit Tests"
|
name: "Unit Tests"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run test
|
- run: npm run test
|
||||||
build:
|
build:
|
||||||
@@ -74,10 +74,10 @@ jobs:
|
|||||||
name: "Build"
|
name: "Build"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build:contracts
|
- run: npm run build:contracts
|
||||||
- name: Restore Build Cache
|
- name: Restore Build Cache
|
||||||
@@ -94,14 +94,14 @@ jobs:
|
|||||||
path: dist/
|
path: dist/
|
||||||
endtoendemulator:
|
endtoendemulator:
|
||||||
name: "End To End Emulator Tests"
|
name: "End To End Emulator Tests"
|
||||||
needs: [lint, format, compile, unittest]
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- uses: southpolesteve/cosmos-emulator-github-action@v1
|
- uses: southpolesteve/cosmos-emulator-github-action@v1
|
||||||
- name: End to End Tests
|
- name: End to End Tests
|
||||||
run: |
|
run: |
|
||||||
@@ -125,10 +125,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- name: Accessibility Check
|
- name: Accessibility Check
|
||||||
run: |
|
run: |
|
||||||
# Ubuntu gets mad when webpack runs too many files watchers
|
# Ubuntu gets mad when webpack runs too many files watchers
|
||||||
@@ -143,46 +143,72 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||||
endtoendhosted:
|
endtoendhosted:
|
||||||
name: "End to End Hosted Tests"
|
name: "End to End Tests"
|
||||||
needs: [lint, format, compile, unittest]
|
needs: [cleanupaccounts]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||||
|
PORTAL_RUNNER_SUBSCRIPTION: ${{ secrets.PORTAL_RUNNER_SUBSCRIPTION }}
|
||||||
|
PORTAL_RUNNER_RESOURCE_GROUP: ${{ secrets.PORTAL_RUNNER_RESOURCE_GROUP }}
|
||||||
|
PORTAL_RUNNER_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT }}
|
||||||
|
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT_KEY }}
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT }}
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT_KEY }}
|
||||||
|
NOTEBOOKS_TEST_RUNNER_TENANT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_TENANT_ID }}
|
||||||
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
||||||
|
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
||||||
|
PORTAL_RUNNER_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
|
||||||
|
MONGO_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_MONGO }}
|
||||||
|
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
|
||||||
|
TABLES_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_TABLE }}
|
||||||
|
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/hostedExplorer.html"
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
test-file:
|
||||||
|
- ./test/cassandra/container.spec.ts
|
||||||
|
- ./test/mongo/mongoIndexPolicy.spec.ts
|
||||||
|
- ./test/notebooks/uploadAndOpenNotebook.spec.ts
|
||||||
|
- ./test/selfServe/selfServeExample.spec.ts
|
||||||
|
- ./test/sql/container.spec.ts
|
||||||
|
- ./test/sql/resourceToken.spec.ts
|
||||||
|
- ./test/tables/container.spec.ts
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- name: End to End Hosted Tests
|
- run: npm ci
|
||||||
run: |
|
- run: npm start &
|
||||||
npm ci
|
- run: node utils/cleanupDBs.js
|
||||||
npm start &
|
- run: npm run wait-for-server
|
||||||
node utils/cleanupDBs.js
|
- name: ${{ matrix['test-file'] }}
|
||||||
npm run wait-for-server
|
run: npx jest -c ./jest.config.e2e.js --detectOpenHandles ${{ matrix['test-file'] }}
|
||||||
npm run test:e2e
|
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
|
||||||
PORTAL_RUNNER_SUBSCRIPTION: ${{ secrets.PORTAL_RUNNER_SUBSCRIPTION }}
|
|
||||||
PORTAL_RUNNER_RESOURCE_GROUP: ${{ secrets.PORTAL_RUNNER_RESOURCE_GROUP }}
|
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT }}
|
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT_KEY }}
|
|
||||||
NOTEBOOKS_TEST_RUNNER_TENANT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_TENANT_ID }}
|
|
||||||
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
|
||||||
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
|
||||||
PORTAL_RUNNER_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
|
|
||||||
MONGO_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_MONGO }}
|
|
||||||
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
|
|
||||||
TABLES_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_TABLE }}
|
|
||||||
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/hostedExplorer.html"
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: screenshots
|
name: screenshots
|
||||||
path: failed-*
|
path: failed-*
|
||||||
|
cleanupaccounts:
|
||||||
|
name: "Cleanup Test Database Accounts"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
||||||
|
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 14.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- run: npm ci
|
||||||
|
- run: node utils/cleanupDBs.js
|
||||||
nuget:
|
nuget:
|
||||||
name: Publish Nuget
|
name: Publish Nuget
|
||||||
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
||||||
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendhosted, accessibility]
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
||||||
@@ -198,7 +224,7 @@ jobs:
|
|||||||
- run: cp ./configs/prod.json config.json
|
- run: cp ./configs/prod.json config.json
|
||||||
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
||||||
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
||||||
- run: nuget push -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
- run: nuget push -SkipDuplicate -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
name: packages
|
name: packages
|
||||||
with:
|
with:
|
||||||
@@ -206,7 +232,7 @@ jobs:
|
|||||||
nugetmpac:
|
nugetmpac:
|
||||||
name: Publish Nuget MPAC
|
name: Publish Nuget MPAC
|
||||||
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
||||||
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendhosted, accessibility]
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
||||||
@@ -223,7 +249,7 @@ jobs:
|
|||||||
- run: sed -i 's/Azure.Cosmos.DB.Data.Explorer/Azure.Cosmos.DB.Data.Explorer.MPAC/g' DataExplorer.nuspec
|
- run: sed -i 's/Azure.Cosmos.DB.Data.Explorer/Azure.Cosmos.DB.Data.Explorer.MPAC/g' DataExplorer.nuspec
|
||||||
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
||||||
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
||||||
- run: nuget push -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
- run: nuget push -SkipDuplicate -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
name: packages
|
name: packages
|
||||||
with:
|
with:
|
||||||
|
|||||||
43
.vscode/settings.json
vendored
43
.vscode/settings.json
vendored
@@ -1,21 +1,26 @@
|
|||||||
// Place your settings in this file to overwrite default and user settings.
|
// Place your settings in this file to overwrite default and user settings.
|
||||||
{
|
{
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
".vs": true,
|
".vs": true,
|
||||||
".vscode/**": true,
|
".vscode/**": true,
|
||||||
"*.trx": true,
|
"*.trx": true,
|
||||||
"**/.DS_Store": true,
|
"**/.DS_Store": true,
|
||||||
"**/.git": true,
|
"**/.git": true,
|
||||||
"**/.hg": true,
|
"**/.hg": true,
|
||||||
"**/.svn": true,
|
"**/.svn": true,
|
||||||
"built/**": true,
|
"built/**": true,
|
||||||
"coverage/**": true,
|
"coverage/**": true,
|
||||||
"libs/**": true,
|
"libs/**": true,
|
||||||
"node_modules/**": true,
|
"node_modules/**": true,
|
||||||
"package-lock.json": true,
|
"package-lock.json": true,
|
||||||
"quickstart/**": true,
|
"quickstart/**": true,
|
||||||
"test/out/**": true,
|
"test/out/**": true,
|
||||||
"workers/libs/**": true
|
"workers/libs/**": true
|
||||||
},
|
},
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
}
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true,
|
||||||
|
"source.organizeImports": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
194
CODING_GUIDELINES.md
Normal file
194
CODING_GUIDELINES.md
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
# Coding Guidelines and Recommendations
|
||||||
|
|
||||||
|
Cosmos Explorer has been under constant development for over 5 years. As a result, there are many different patterns and practices in the codebase. This document serves as a guide to how we write code and helps avoid propagating practices which are no longer preferred. Each requirement in this document is labeled and color-coded to show the relative importance. In order from highest to lowest importance:
|
||||||
|
|
||||||
|
✅ DO this. If you feel you need an exception, engage with the project owners _prior_ to implementation.
|
||||||
|
|
||||||
|
⛔️ DO NOT do this. If you feel you need an exception, engage with the project owners _prior_ to implementation.
|
||||||
|
|
||||||
|
☑️ YOU SHOULD strongly consider this but it is not a requirement. If not following this advice, please comment code with why and proactively begin a discussion as part of the PR process.
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT strongly consider not doing this. If not following this advice, please comment code with why and proactively begin a discussion as part of the PR process.
|
||||||
|
|
||||||
|
💭 YOU MAY consider this advice if appropriate to your situation. Other team members may comment on this as part of PR review, but there is no need to be proactive.
|
||||||
|
|
||||||
|
## Development Environment
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Use VSCode and install the following extensions. This setup will catch most linting/formatting/type errors as you develop:
|
||||||
|
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
||||||
|
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
||||||
|
|
||||||
|
💭 YOU MAY
|
||||||
|
|
||||||
|
- Use the [GitHub CLI](https://cli.github.com/). It has helpful workflows for submitting PRs as well as for checking out other team member's PRs.
|
||||||
|
- Use Windows, Linux (including WSL), or OSX. We have team members developing on all three environments.
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Maintain cross-platform compatibility when modifying any engineering or build systems
|
||||||
|
|
||||||
|
## Code Formatting
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use [Prettier](https://prettier.io/) to format your code
|
||||||
|
- This will occur automatically if using the recommended editor setup
|
||||||
|
- `npm run format` will also format code
|
||||||
|
|
||||||
|
## Linting
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use [ESLint](https://eslint.org/) to check for code errors.
|
||||||
|
- This will occur automatically if using the recommended editor setup
|
||||||
|
- `npm run lint` will also check for linting errors
|
||||||
|
|
||||||
|
💭 YOU MAY
|
||||||
|
|
||||||
|
- Consider adding new lint rules.
|
||||||
|
- If you find yourself performing "nits" as part of PR review, consider adding a lint rule that will automatically catch the error in the future
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT
|
||||||
|
|
||||||
|
- Disable lint rules
|
||||||
|
- Lint rules exist as guidance and to catch common mistakes
|
||||||
|
- You will find places we disable specific lint rules however it should be exceptional.
|
||||||
|
- If a rule does need to be disabled, prefer disabling a specific line instead of the entire file.
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Add [TSLint](https://palantir.github.io/tslint/) rules
|
||||||
|
- TSLint has been deprecated and is on track to be removed
|
||||||
|
- Always prefer ESLint rules
|
||||||
|
|
||||||
|
## UI Components
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write new components using [React](https://reactjs.org/). We are actively migrating Cosmos Explorer off of [Knockout](https://knockoutjs.com/).
|
||||||
|
- Use [Fluent](https://developer.microsoft.com/en-us/fluentui#/) components.
|
||||||
|
- Fluent components are designed to be highly accessible and composable
|
||||||
|
- Using Fluent allows us to build upon the work of the Fluent team and leads to a lower total cost of ownership for UI code
|
||||||
|
|
||||||
|
### React
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Use pure functional components when no state is required
|
||||||
|
|
||||||
|
💭 YOU MAY
|
||||||
|
|
||||||
|
- Use functional (hooks) or class components
|
||||||
|
- The project contains examples of both
|
||||||
|
- Neither is strongly preferred at this time
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Use inheritance for sharing component behavior.
|
||||||
|
- React documentation covers this topic in detail https://reactjs.org/docs/composition-vs-inheritance.html
|
||||||
|
- Suffix your file or component name with "Component"
|
||||||
|
- Even though the code has examples of it, we are ending the practice.
|
||||||
|
|
||||||
|
## Libraries
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT
|
||||||
|
|
||||||
|
- Add new libraries to package.json.
|
||||||
|
- Adding libraries may bring in code that explodes the bundled size or attempts to run NodeJS code in the browser
|
||||||
|
- Consult with project owners for help with library selection if one is needed
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Use underscore.js
|
||||||
|
- Much of this library is now native to JS and will be automatically transpiled
|
||||||
|
- Use jQuery
|
||||||
|
- Much of this library is not native to the DOM.
|
||||||
|
- We are planning to remove it
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Decrease test coverage
|
||||||
|
- Unit/Functional test coverage is checked as part of the CI process
|
||||||
|
|
||||||
|
### Unit Tests
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Write unit tests for non-UI and utility code.
|
||||||
|
- Write your tests using [Jest](https://jestjs.io/)
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Abstract non-UI and utility code so it can run either the NodeJS or Browser environment
|
||||||
|
|
||||||
|
### Functional(Component) Tests
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Write tests for UI components
|
||||||
|
- Write your tests using [Jest](https://jestjs.io/)
|
||||||
|
- Use either Enzyme or React Testing Library to perform component tests.
|
||||||
|
|
||||||
|
### Mocking
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use Jest's built-in mocking helpers
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write code that does not require mocking
|
||||||
|
- Build components that do not require mocking extremely large or difficult to mock objects (like Explorer.ts). Pass _only_ what you need.
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Use sinon.js for mocking
|
||||||
|
- Sinon has been deprecated and planned for removal
|
||||||
|
|
||||||
|
### End to End Tests
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use [Puppeteer](https://developers.google.com/web/tools/puppeteer) and [Jest](https://jestjs.io/)
|
||||||
|
- Write or modify an existing E2E test that covers the primary use case of any major feature.
|
||||||
|
- Use caution. Do not try to cover every case. End to End tests can be slow and brittle.
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write tests that use accessible attributes to perform actions. Role, Title, Label, etc
|
||||||
|
- More information https://testing-library.com/docs/queries/about#priority
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT
|
||||||
|
|
||||||
|
- Add test specfic `data-*` attributes to dom elements
|
||||||
|
- This is a common current practice, but one we would like to avoid in the future
|
||||||
|
- End to end tests need to use semantic HTML and accesible attributes to be truely end to end
|
||||||
|
- No user or screen reader actually navigates an app using `data-*` attributes
|
||||||
|
- Add arbitrary time delays to wait for page to render or element to be ready.
|
||||||
|
- All the time delays add up and slow down testing.
|
||||||
|
- Prefer using the framework's "wait for..." functionality.
|
||||||
|
|
||||||
|
### Migrating Knockout to React
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Consult other team members before beginning migration work. There is a significant amount of flux in patterns we are using and it is important we do not propagate incorrect patterns.
|
||||||
|
- Start by converting HTML to JSX: https://magic.reactjs.net/htmltojsx.htm. Add functionality as a second step.
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write React components that require no dependency on Knockout or observables to trigger rendering.
|
||||||
|
|
||||||
|
## Browser Support
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Support all [browsers supported by the Azure Portal](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-supported-browsers-devices)
|
||||||
|
- Support IE11
|
||||||
|
- In practice, this should not need to be considered as part of a normal development workflow
|
||||||
|
- Polyfills and transpilation are already provided by our engineering systems.
|
||||||
|
- This requirement will be removed on March 30th, 2021 when Azure drops IE11 support.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Contribution guidelines to Data Explorer
|
# Contribution guidelines to Data Explorer
|
||||||
|
|
||||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
||||||
the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
|
|||||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||||
|
|
||||||
## Microsoft Open Source Code of Conduct
|
## Microsoft Open Source Code of Conduct
|
||||||
|
|
||||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
@@ -20,33 +21,3 @@ Resources:
|
|||||||
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
||||||
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
||||||
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
|
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
|
||||||
|
|
||||||
## Browser support
|
|
||||||
Please make sure to support all modern browsers as well as Internet Explorer 11.
|
|
||||||
For IE support, polyfill is preferred over new usage of lodash or underscore. We already polyfill almost everything by importing babel-polyfill at the top of entry points.
|
|
||||||
|
|
||||||
|
|
||||||
## Coding guidelines, conventions and recommendations
|
|
||||||
### Typescript
|
|
||||||
* Follow this [typescript style guide](https://github.com/excelmicro/typescript) which is based on [airbnb's style guide](https://github.com/airbnb/javascript).
|
|
||||||
* Conventions speficic to this project:
|
|
||||||
- Use double-quotes for string
|
|
||||||
- Don't use `null`, use `undefined`
|
|
||||||
- Pascal case for private static readonly fields
|
|
||||||
- Camel case for classnames in markup
|
|
||||||
* Don't use class unless necessary
|
|
||||||
* Code related to notebooks should be dynamically imported so that it is loaded from a separate bundle only if the account is notebook-enabled. There are already top-level notebook components which are dynamically imported and their dependencies can be statically imported from these files.
|
|
||||||
* Prefer using [Fluent UI controls](https://developer.microsoft.com/en-us/fluentui#/controls/web) over creating your own, in order to maintain consistency and support a11y.
|
|
||||||
|
|
||||||
### React
|
|
||||||
* Prefer using React class components over function components and hooks unless you have a simple component and require no nested functions:
|
|
||||||
* Nested functions may be harder to test independently
|
|
||||||
* Switching from function component to class component later mayb be painful
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
Any PR should not decrease testing coverage.
|
|
||||||
|
|
||||||
## Recommended Tools and VS Code extensions
|
|
||||||
* [Bookmarks](https://github.com/alefragnani/vscode-bookmarks)
|
|
||||||
* [Bracket pair colorizer](https://github.com/CoenraadS/Bracket-Pair-Colorizer-2)
|
|
||||||
* [GitHub Pull Requests and Issues](https://github.com/Microsoft/vscode-pull-request-github)
|
|
||||||
4
config.json
Normal file
4
config.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"GITHUB_CLIENT_ID": "167ea4b09801db1de03d",
|
||||||
|
"GITHUB_CLIENT_SECRET": "e7bb10a3a8da428815805c6fc483560a035a73c1"
|
||||||
|
}
|
||||||
3
images/notebook/publish_content.svg
Normal file
3
images/notebook/publish_content.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M7.31449 2.01439L4.00103 5.31963L3.26105 4.57965L7.8407 0L12.4203 4.57965L11.6804 5.31963L8.36691 2.01439V12.8428H7.31449V2.01439ZM13.629 12.8428H14.6814V16H1V12.8428H2.05242V14.9476H13.629V12.8428Z" fill="#0078D4"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 329 B |
@@ -57,6 +57,13 @@
|
|||||||
|
|
||||||
@FocusColor: #605e5c;
|
@FocusColor: #605e5c;
|
||||||
|
|
||||||
|
@GalleryBackgroundColor: #fdfdfd;
|
||||||
|
|
||||||
|
//Icons
|
||||||
|
@InfoIconColor: #0072c6;
|
||||||
|
@WarningIconColor: #db7500;
|
||||||
|
@ErrorIconColor: #b91f26;
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
METRICS
|
METRICS
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|||||||
@@ -1523,6 +1523,21 @@ p {
|
|||||||
.tooltipVisible();
|
.tooltipVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inputTooltip {
|
||||||
|
.inputTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTooltip .inputTooltipText {
|
||||||
|
top: -68px;
|
||||||
|
.inputTooltipText();
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTooltip .inputTooltipText::after {
|
||||||
|
border-width: @MediumSpace @MediumSpace 0 @MediumSpace;
|
||||||
|
top: 55px;
|
||||||
|
.inputTooltipTextAfter();
|
||||||
|
}
|
||||||
|
|
||||||
.infoTooltip a {
|
.infoTooltip a {
|
||||||
color: @AccentHigh;
|
color: @AccentHigh;
|
||||||
}
|
}
|
||||||
@@ -3028,3 +3043,45 @@ settings-pane {
|
|||||||
.collapsibleSection :hover {
|
.collapsibleSection :hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.messageBarInfoIcon {
|
||||||
|
color: @InfoIconColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.messageBarWarningIcon {
|
||||||
|
color: @WarningIconColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierInfoBanner {
|
||||||
|
background-color: @BaseLow;
|
||||||
|
display: inline-flex;
|
||||||
|
padding: @DefaultSpace;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.freeTierInfoIcon img {
|
||||||
|
height: 28px;
|
||||||
|
width: 28px;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierInfoMessage {
|
||||||
|
margin: auto 0;
|
||||||
|
padding-left: @MediumSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierInlineWarning {
|
||||||
|
display: inline-flex;
|
||||||
|
padding: 8px 8px 8px 0;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.freeTierWarningIcon img {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierWarningMessage {
|
||||||
|
margin: auto 0;
|
||||||
|
padding-left: @SmallSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
133
package-lock.json
generated
133
package-lock.json
generated
@@ -218,6 +218,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@azure/ms-rest-azure-env": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw=="
|
||||||
|
},
|
||||||
"@azure/ms-rest-azure-js": {
|
"@azure/ms-rest-azure-js": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/ms-rest-azure-js/-/ms-rest-azure-js-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/ms-rest-azure-js/-/ms-rest-azure-js-2.1.0.tgz",
|
||||||
@@ -246,6 +251,16 @@
|
|||||||
"xml2js": "^0.4.19"
|
"xml2js": "^0.4.19"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@azure/ms-rest-nodeauth": {
|
||||||
|
"version": "3.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-3.0.7.tgz",
|
||||||
|
"integrity": "sha512-7Q1MyMB+eqUQy8JO+virSIzAjqR2UbKXE/YQZe+53gC8yakm8WOQ5OzGfPP+eyHqeRs6bQESyw2IC5feLWlT2A==",
|
||||||
|
"requires": {
|
||||||
|
"@azure/ms-rest-azure-env": "^2.0.0",
|
||||||
|
"@azure/ms-rest-js": "^2.0.4",
|
||||||
|
"adal-node": "^0.1.28"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@azure/msal-common": {
|
"@azure/msal-common": {
|
||||||
"version": "1.7.2",
|
"version": "1.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-1.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-1.7.2.tgz",
|
||||||
@@ -698,12 +713,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-syntax-class-properties": {
|
"@babel/plugin-syntax-class-properties": {
|
||||||
"version": "7.12.1",
|
"version": "7.12.13",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz",
|
||||||
"integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==",
|
"integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/helper-plugin-utils": "^7.10.4"
|
"@babel/helper-plugin-utils": "^7.12.13"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/helper-plugin-utils": {
|
||||||
|
"version": "7.13.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz",
|
||||||
|
"integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-syntax-decorators": {
|
"@babel/plugin-syntax-decorators": {
|
||||||
@@ -1672,9 +1695,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@istanbuljs/schema": {
|
"@istanbuljs/schema": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
|
||||||
"integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==",
|
"integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@jest/console": {
|
"@jest/console": {
|
||||||
@@ -1814,9 +1837,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/yargs": {
|
"@types/yargs": {
|
||||||
"version": "15.0.12",
|
"version": "15.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz",
|
||||||
"integrity": "sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw==",
|
"integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/yargs-parser": "*"
|
"@types/yargs-parser": "*"
|
||||||
@@ -4431,9 +4454,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/graceful-fs": {
|
"@types/graceful-fs": {
|
||||||
"version": "4.1.4",
|
"version": "4.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
|
||||||
"integrity": "sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg==",
|
"integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
@@ -5641,6 +5664,38 @@
|
|||||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz",
|
||||||
"integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA=="
|
"integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA=="
|
||||||
},
|
},
|
||||||
|
"adal-node": {
|
||||||
|
"version": "0.1.28",
|
||||||
|
"resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz",
|
||||||
|
"integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "^8.0.47",
|
||||||
|
"async": ">=0.6.0",
|
||||||
|
"date-utils": "*",
|
||||||
|
"jws": "3.x.x",
|
||||||
|
"request": ">= 2.52.0",
|
||||||
|
"underscore": ">= 1.3.1",
|
||||||
|
"uuid": "^3.1.0",
|
||||||
|
"xmldom": ">= 0.1.x",
|
||||||
|
"xpath.js": "~1.1.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": {
|
||||||
|
"version": "8.10.66",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz",
|
||||||
|
"integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw=="
|
||||||
|
},
|
||||||
|
"jws": {
|
||||||
|
"version": "3.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
|
||||||
|
"integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
|
||||||
|
"requires": {
|
||||||
|
"jwa": "^1.4.1",
|
||||||
|
"safe-buffer": "^5.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"agent-base": {
|
"agent-base": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||||
@@ -6059,7 +6114,6 @@
|
|||||||
"version": "2.6.3",
|
"version": "2.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
|
||||||
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
|
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"lodash": "^4.17.14"
|
"lodash": "^4.17.14"
|
||||||
}
|
}
|
||||||
@@ -7288,6 +7342,11 @@
|
|||||||
"tiny-emitter": "^2.0.0"
|
"tiny-emitter": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"clipboard-copy": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/clipboard-copy/-/clipboard-copy-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-wOlqdqziE/NNTUJsfSgXmBMIrYmfd5V0HCGsR8uAKHcg+h9NENWINcfRjtWGU77wDHC8B8ijV4hMTGYbrKovng=="
|
||||||
|
},
|
||||||
"cliui": {
|
"cliui": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
||||||
@@ -8520,6 +8579,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz",
|
||||||
"integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw=="
|
"integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw=="
|
||||||
},
|
},
|
||||||
|
"date-utils": {
|
||||||
|
"version": "1.2.21",
|
||||||
|
"resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz",
|
||||||
|
"integrity": "sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q="
|
||||||
|
},
|
||||||
"dayjs": {
|
"dayjs": {
|
||||||
"version": "1.8.19",
|
"version": "1.8.19",
|
||||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.8.19.tgz",
|
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.8.19.tgz",
|
||||||
@@ -8536,6 +8600,13 @@
|
|||||||
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
|
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.1.2"
|
"ms": "2.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"decamelize": {
|
"decamelize": {
|
||||||
@@ -12843,9 +12914,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/yargs": {
|
"@types/yargs": {
|
||||||
"version": "15.0.12",
|
"version": "15.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz",
|
||||||
"integrity": "sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw==",
|
"integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/yargs-parser": "*"
|
"@types/yargs-parser": "*"
|
||||||
@@ -13098,9 +13169,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fsevents": {
|
"fsevents": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
"integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==",
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
@@ -13886,9 +13957,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
|
||||||
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
|
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"emoji-regex": "^8.0.0",
|
"emoji-regex": "^8.0.0",
|
||||||
@@ -16025,9 +16096,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
},
|
},
|
||||||
"msal": {
|
"msal": {
|
||||||
"version": "1.4.4",
|
"version": "1.4.4",
|
||||||
@@ -22579,6 +22650,16 @@
|
|||||||
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
|
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"xmldom": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-2E93k08T30Ugs+34HBSTQLVtpi6mCddaY8uO+pMNk1pqSjV5vElzn4mmh6KLxN3hki8rNcHSYzILoh3TEWORvA=="
|
||||||
|
},
|
||||||
|
"xpath.js": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xpath.js/-/xpath.js-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-jg+qkfS4K8E7965sqaUl8mRngXiKb3WZGfONgE18pr03FUQiuSV6G+Ej4tS55B+rIQSFEIw3phdVAQ4pPqNWfQ=="
|
||||||
|
},
|
||||||
"xregexp": {
|
"xregexp": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.4.1.tgz",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"@azure/cosmos": "3.9.0",
|
"@azure/cosmos": "3.9.0",
|
||||||
"@azure/cosmos-language-service": "0.0.5",
|
"@azure/cosmos-language-service": "0.0.5",
|
||||||
"@azure/identity": "1.2.1",
|
"@azure/identity": "1.2.1",
|
||||||
|
"@azure/ms-rest-nodeauth": "3.0.7",
|
||||||
"@babel/plugin-proposal-class-properties": "7.12.1",
|
"@babel/plugin-proposal-class-properties": "7.12.1",
|
||||||
"@babel/plugin-proposal-decorators": "7.12.12",
|
"@babel/plugin-proposal-decorators": "7.12.12",
|
||||||
"@jupyterlab/services": "6.0.2",
|
"@jupyterlab/services": "6.0.2",
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
"bootstrap": "3.4.1",
|
"bootstrap": "3.4.1",
|
||||||
"canvas": "file:./canvas",
|
"canvas": "file:./canvas",
|
||||||
"clean-webpack-plugin": "0.1.19",
|
"clean-webpack-plugin": "0.1.19",
|
||||||
|
"clipboard-copy": "4.0.1",
|
||||||
"copy-webpack-plugin": "6.0.2",
|
"copy-webpack-plugin": "6.0.2",
|
||||||
"crossroads": "0.12.2",
|
"crossroads": "0.12.2",
|
||||||
"css-element-queries": "1.1.1",
|
"css-element-queries": "1.1.1",
|
||||||
@@ -75,6 +77,7 @@
|
|||||||
"knockout": "3.5.1",
|
"knockout": "3.5.1",
|
||||||
"mkdirp": "1.0.4",
|
"mkdirp": "1.0.4",
|
||||||
"monaco-editor": "0.18.1",
|
"monaco-editor": "0.18.1",
|
||||||
|
"ms": "2.1.3",
|
||||||
"msal": "1.4.4",
|
"msal": "1.4.4",
|
||||||
"object.entries": "1.1.0",
|
"object.entries": "1.1.0",
|
||||||
"office-ui-fabric-react": "7.134.1",
|
"office-ui-fabric-react": "7.134.1",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"offerThroughput": 400,
|
"offerThroughput": 400,
|
||||||
"databaseLevelThroughput": false,
|
"databaseLevelThroughput": false,
|
||||||
"collectionId": "Persons",
|
"collectionId": "Persons",
|
||||||
|
"createNewDatabase": true,
|
||||||
"partitionKey": { "kind": "Hash", "paths": ["/name"] },
|
"partitionKey": { "kind": "Hash", "paths": ["/name"] },
|
||||||
"data": [
|
"data": [
|
||||||
"g.addV('person').property(id, '1').property('name', 'Eva').property('age', 44)",
|
"g.addV('person').property(id, '1').property('name', 'Eva').property('age', 44)",
|
||||||
|
|||||||
@@ -105,8 +105,6 @@ export class Features {
|
|||||||
public static readonly hostedDataExplorer = "hosteddataexplorerenabled";
|
public static readonly hostedDataExplorer = "hosteddataexplorerenabled";
|
||||||
public static readonly enableTtl = "enablettl";
|
public static readonly enableTtl = "enablettl";
|
||||||
public static readonly enableNotebooks = "enablenotebooks";
|
public static readonly enableNotebooks = "enablenotebooks";
|
||||||
public static readonly enableGalleryPublish = "enablegallerypublish";
|
|
||||||
public static readonly enableLinkInjection = "enablelinkinjection";
|
|
||||||
public static readonly enableSpark = "enablespark";
|
public static readonly enableSpark = "enablespark";
|
||||||
public static readonly livyEndpoint = "livyendpoint";
|
public static readonly livyEndpoint = "livyendpoint";
|
||||||
public static readonly notebookServerUrl = "notebookserverurl";
|
public static readonly notebookServerUrl = "notebookserverurl";
|
||||||
@@ -119,7 +117,9 @@ export class Features {
|
|||||||
public static readonly enableSchema = "enableschema";
|
public static readonly enableSchema = "enableschema";
|
||||||
public static readonly enableSDKoperations = "enablesdkoperations";
|
public static readonly enableSDKoperations = "enablesdkoperations";
|
||||||
public static readonly showMinRUSurvey = "showminrusurvey";
|
public static readonly showMinRUSurvey = "showminrusurvey";
|
||||||
|
public static readonly enableDatabaseSettingsTabV1 = "enabledbsettingsv1";
|
||||||
public static readonly selfServeType = "selfservetype";
|
public static readonly selfServeType = "selfservetype";
|
||||||
|
public static readonly enableKOPanel = "enablekopanel";
|
||||||
}
|
}
|
||||||
|
|
||||||
// flight names returned from the portal are always lowercase
|
// flight names returned from the portal are always lowercase
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as Cosmos from "@azure/cosmos";
|
import * as Cosmos from "@azure/cosmos";
|
||||||
import { RequestInfo, setAuthorizationTokenHeaderUsingMasterKey } from "@azure/cosmos";
|
import { RequestInfo, setAuthorizationTokenHeaderUsingMasterKey } from "@azure/cosmos";
|
||||||
import { configContext, Platform } from "../ConfigContext";
|
import { configContext, Platform } from "../ConfigContext";
|
||||||
import { getErrorMessage } from "./ErrorHandlingUtils";
|
import { userContext } from "../UserContext";
|
||||||
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
||||||
import { EmulatorMasterKey, HttpHeaders } from "./Constants";
|
import { EmulatorMasterKey, HttpHeaders } from "./Constants";
|
||||||
import { userContext } from "../UserContext";
|
import { getErrorMessage } from "./ErrorHandlingUtils";
|
||||||
|
|
||||||
const _global = typeof self === "undefined" ? window : self;
|
const _global = typeof self === "undefined" ? window : self;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { ARMError } from "../Utils/arm/request";
|
|
||||||
import { HttpStatusCodes } from "./Constants";
|
|
||||||
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
||||||
import { SubscriptionType } from "../Contracts/SubscriptionType";
|
import { SubscriptionType } from "../Contracts/SubscriptionType";
|
||||||
|
import { userContext } from "../UserContext";
|
||||||
|
import { ARMError } from "../Utils/arm/request";
|
||||||
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
||||||
|
import { HttpStatusCodes } from "./Constants";
|
||||||
import { logError } from "./Logger";
|
import { logError } from "./Logger";
|
||||||
import { sendMessage } from "./MessageHandler";
|
import { sendMessage } from "./MessageHandler";
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ const sendNotificationForError = (errorMessage: string, errorCode: number | stri
|
|||||||
|
|
||||||
const replaceKnownError = (errorMessage: string): string => {
|
const replaceKnownError = (errorMessage: string): string => {
|
||||||
if (
|
if (
|
||||||
window.dataExplorer?.subscriptionType() === SubscriptionType.Internal &&
|
userContext.subscriptionType === SubscriptionType.Internal &&
|
||||||
errorMessage?.indexOf("SharedOffer is Disabled for your account") >= 0
|
errorMessage?.indexOf("SharedOffer is Disabled for your account") >= 0
|
||||||
) {
|
) {
|
||||||
return "Database throughput is not supported for internal subscriptions.";
|
return "Database throughput is not supported for internal subscriptions.";
|
||||||
|
|||||||
@@ -1,28 +1,5 @@
|
|||||||
import * as Constants from "./Constants";
|
|
||||||
|
|
||||||
import { LocalStorageUtility, StorageKey } from "../Shared/StorageUtility";
|
import { LocalStorageUtility, StorageKey } from "../Shared/StorageUtility";
|
||||||
|
|
||||||
// x-ms-resource-quota: databases = 100; collections = 5000; users = 500000; permissions = 2000000;
|
|
||||||
export function getQuota(responseHeaders: any): any {
|
|
||||||
return responseHeaders && responseHeaders[Constants.HttpHeaders.resourceQuota]
|
|
||||||
? parseStringIntoObject(responseHeaders[Constants.HttpHeaders.resourceQuota])
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function shouldEnableCrossPartitionKey(): boolean {
|
export function shouldEnableCrossPartitionKey(): boolean {
|
||||||
return LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true";
|
return LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStringIntoObject(resourceString: string) {
|
|
||||||
var entityObject: any = {};
|
|
||||||
|
|
||||||
if (resourceString) {
|
|
||||||
var entitiesArray: string[] = resourceString.split(";");
|
|
||||||
for (var i: any = 0; i < entitiesArray.length; i++) {
|
|
||||||
var entity: string[] = entitiesArray[i].split("=");
|
|
||||||
entityObject[entity[0]] = entity[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return entityObject;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { QueryResults } from "../Contracts/ViewModels";
|
import { QueryResults } from "../Contracts/ViewModels";
|
||||||
|
|
||||||
interface QueryResponse {
|
interface QueryResponse {
|
||||||
|
// [Todo] remove any
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
resources: any[];
|
resources: any[];
|
||||||
hasMoreResults: boolean;
|
hasMoreResults: boolean;
|
||||||
activityId: string;
|
activityId: string;
|
||||||
@@ -16,6 +18,7 @@ export interface MinimalQueryIterator {
|
|||||||
export function nextPage(documentsIterator: MinimalQueryIterator, firstItemIndex: number): Promise<QueryResults> {
|
export function nextPage(documentsIterator: MinimalQueryIterator, firstItemIndex: number): Promise<QueryResults> {
|
||||||
return documentsIterator.fetchNext().then((response) => {
|
return documentsIterator.fetchNext().then((response) => {
|
||||||
const documents = response.resources;
|
const documents = response.resources;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const headers = (response as any).headers || {}; // TODO this is a private key. Remove any
|
const headers = (response as any).headers || {}; // TODO this is a private key. Remove any
|
||||||
const itemCount = (documents && documents.length) || 0;
|
const itemCount = (documents && documents.length) || 0;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ describe("MongoProxyClient", () => {
|
|||||||
describe("getEndpoint", () => {
|
describe("getEndpoint", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
delete window.authType;
|
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount,
|
databaseAccount,
|
||||||
});
|
});
|
||||||
@@ -241,7 +240,9 @@ describe("MongoProxyClient", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("returns a guest endpoint", () => {
|
it("returns a guest endpoint", () => {
|
||||||
window.authType = AuthType.EncryptedToken;
|
updateUserContext({
|
||||||
|
authType: AuthType.EncryptedToken,
|
||||||
|
});
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
expect(endpoint).toEqual("https://main.documentdb.ext.azure.com/api/guest/mongo/explorer");
|
expect(endpoint).toEqual("https://main.documentdb.ext.azure.com/api/guest/mongo/explorer");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const defaultHeaders = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function authHeaders() {
|
function authHeaders() {
|
||||||
if (window.authType === AuthType.EncryptedToken) {
|
if (userContext.authType === AuthType.EncryptedToken) {
|
||||||
return { [HttpHeaders.guestAccessToken]: userContext.accessToken };
|
return { [HttpHeaders.guestAccessToken]: userContext.accessToken };
|
||||||
} else {
|
} else {
|
||||||
return { [HttpHeaders.authorization]: userContext.authorizationToken };
|
return { [HttpHeaders.authorization]: userContext.authorizationToken };
|
||||||
@@ -337,7 +337,7 @@ export function createMongoCollectionWithProxy(
|
|||||||
export function getEndpoint(): string {
|
export function getEndpoint(): string {
|
||||||
let url = (configContext.MONGO_BACKEND_ENDPOINT || configContext.BACKEND_ENDPOINT) + "/api/mongo/explorer";
|
let url = (configContext.MONGO_BACKEND_ENDPOINT || configContext.BACKEND_ENDPOINT) + "/api/mongo/explorer";
|
||||||
|
|
||||||
if (window.authType === AuthType.EncryptedToken) {
|
if (userContext.authType === AuthType.EncryptedToken) {
|
||||||
url = url.replace("api/mongo", "api/guest/mongo");
|
url = url.replace("api/mongo", "api/guest/mongo");
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
|
|||||||
@@ -2,18 +2,16 @@
|
|||||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
export default class ThemeUtility {
|
export function getMonacoTheme(theme: string): string {
|
||||||
public static getMonacoTheme(theme: string): string {
|
switch (theme) {
|
||||||
switch (theme) {
|
case "default":
|
||||||
case "default":
|
case "hc-white":
|
||||||
case "hc-white":
|
return "vs";
|
||||||
return "vs";
|
case "dark":
|
||||||
case "dark":
|
return "vs-dark";
|
||||||
return "vs-dark";
|
case "hc-black":
|
||||||
case "hc-black":
|
return "hc-black";
|
||||||
return "hc-black";
|
default:
|
||||||
default:
|
return "vs";
|
||||||
return "vs";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,17 @@ describe("createCollection", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await createCollection(createCollectionParams);
|
await createCollection(createCollectionParams);
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
databases: {
|
databases: {
|
||||||
createIfNotExists: () => {
|
createIfNotExists: () => {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const createCollection = async (params: DataModels.CreateCollectionParams
|
|||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
let collection: DataModels.Collection;
|
let collection: DataModels.Collection;
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
if (params.createNewDatabase) {
|
if (params.createNewDatabase) {
|
||||||
const createDatabaseParams: DataModels.CreateDatabaseParams = {
|
const createDatabaseParams: DataModels.CreateDatabaseParams = {
|
||||||
autoPilotMaxThroughput: params.autoPilotMaxThroughput,
|
autoPilotMaxThroughput: params.autoPilotMaxThroughput,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export async function createDatabase(params: DataModels.CreateDatabaseParams): P
|
|||||||
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||||
throw new Error("Creating database resources is not allowed for tables accounts");
|
throw new Error("Creating database resources is not allowed for tables accounts");
|
||||||
}
|
}
|
||||||
const database: DataModels.Database = await (window.authType === AuthType.AAD && !userContext.useSDKOperations
|
const database: DataModels.Database = await (userContext.authType === AuthType.AAD && !userContext.useSDKOperations
|
||||||
? createDatabaseWithARM(params)
|
? createDatabaseWithARM(params)
|
||||||
: createDatabaseWithSDK(params));
|
: createDatabaseWithSDK(params));
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export async function createStoredProcedure(
|
|||||||
const clearMessage = logConsoleProgress(`Creating stored procedure ${storedProcedure.id}`);
|
const clearMessage = logConsoleProgress(`Creating stored procedure ${storedProcedure.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export async function createTrigger(
|
|||||||
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
|
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export async function createUserDefinedFunction(
|
|||||||
const clearMessage = logConsoleProgress(`Creating user defined function ${userDefinedFunction.id}`);
|
const clearMessage = logConsoleProgress(`Creating user defined function ${userDefinedFunction.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -20,13 +20,17 @@ describe("deleteCollection", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await deleteCollection("database", "collection");
|
await deleteCollection("database", "collection");
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { client } from "../CosmosClient";
|
|||||||
export async function deleteCollection(databaseId: string, collectionId: string): Promise<void> {
|
export async function deleteCollection(databaseId: string, collectionId: string): Promise<void> {
|
||||||
const clearMessage = logConsoleProgress(`Deleting container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Deleting container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
await deleteCollectionWithARM(databaseId, collectionId);
|
await deleteCollectionWithARM(databaseId, collectionId);
|
||||||
} else {
|
} else {
|
||||||
await client().database(databaseId).container(collectionId).delete();
|
await client().database(databaseId).container(collectionId).delete();
|
||||||
|
|||||||
@@ -20,13 +20,17 @@ describe("deleteDatabase", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await deleteDatabase("database");
|
await deleteDatabase("database");
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export async function deleteDatabase(databaseId: string): Promise<void> {
|
|||||||
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||||
throw new Error("Deleting database resources is not allowed for tables accounts");
|
throw new Error("Deleting database resources is not allowed for tables accounts");
|
||||||
}
|
}
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
await deleteDatabaseWithARM(databaseId);
|
await deleteDatabaseWithARM(databaseId);
|
||||||
} else {
|
} else {
|
||||||
await client().database(databaseId).delete();
|
await client().database(databaseId).delete();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function deleteStoredProcedure(
|
|||||||
const clearMessage = logConsoleProgress(`Deleting stored procedure ${storedProcedureId}`);
|
const clearMessage = logConsoleProgress(`Deleting stored procedure ${storedProcedureId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export async function deleteTrigger(databaseId: string, collectionId: string, tr
|
|||||||
const clearMessage = logConsoleProgress(`Deleting trigger ${triggerId}`);
|
const clearMessage = logConsoleProgress(`Deleting trigger ${triggerId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export async function deleteUserDefinedFunction(databaseId: string, collectionId
|
|||||||
const clearMessage = logConsoleProgress(`Deleting user defined function ${id}`);
|
const clearMessage = logConsoleProgress(`Deleting user defined function ${id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ interface MetricsResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getCollectionUsageSizeInKB = async (databaseName: string, containerName: string): Promise<number> => {
|
export const getCollectionUsageSizeInKB = async (databaseName: string, containerName: string): Promise<number> => {
|
||||||
if (window.authType !== AuthType.AAD) {
|
if (userContext.authType !== AuthType.AAD) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ export const getCollectionUsageSizeInKB = async (databaseName: string, container
|
|||||||
return dataUsageSizeInKb + indexUsageSizeInKb;
|
return dataUsageSizeInKb + indexUsageSizeInKb;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "getCollectionUsageSize");
|
handleError(error, "getCollectionUsageSize");
|
||||||
throw error;
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ import { handleError } from "../ErrorHandlingUtils";
|
|||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import * as Constants from "../Constants";
|
import * as Constants from "../Constants";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
|
import { userContext } from "../../UserContext";
|
||||||
|
|
||||||
export async function getIndexTransformationProgress(databaseId: string, collectionId: string): Promise<number> {
|
export async function getIndexTransformationProgress(databaseId: string, collectionId: string): Promise<number> {
|
||||||
if (window.authType !== AuthType.AAD) {
|
if (userContext.authType !== AuthType.AAD) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
let indexTransformationPercentage: number;
|
let indexTransformationPercentage: number;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { updateUserContext } from "../../UserContext";
|
|||||||
describe("readCollection", () => {
|
describe("readCollection", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
|
authType: AuthType.ResourceToken,
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test",
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
@@ -17,7 +18,6 @@ describe("readCollection", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if logged in with resource token", async () => {
|
it("should call SDK if logged in with resource token", async () => {
|
||||||
window.authType = AuthType.ResourceToken;
|
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const readCollectionOffer = async (params: ReadCollectionOfferParams): Pr
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -19,13 +19,17 @@ describe("readCollections", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await readCollections("database");
|
await readCollections("database");
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export async function readCollections(databaseId: string): Promise<DataModels.Co
|
|||||||
const clearMessage = logConsoleProgress(`Querying containers for database ${databaseId}`);
|
const clearMessage = logConsoleProgress(`Querying containers for database ${databaseId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const readDatabaseOffer = async (params: ReadDatabaseOfferParams): Promis
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -19,13 +19,17 @@ describe("readDatabases", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await readDatabases();
|
await readDatabases();
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
databases: {
|
databases: {
|
||||||
readAll: () => {
|
readAll: () => {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export async function readDatabases(): Promise<DataModels.Database[]> {
|
|||||||
const clearMessage = logConsoleProgress(`Querying databases`);
|
const clearMessage = logConsoleProgress(`Querying databases`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export async function readMongoDBCollectionThroughRP(
|
|||||||
databaseId: string,
|
databaseId: string,
|
||||||
collectionId: string
|
collectionId: string
|
||||||
): Promise<MongoDBCollectionResource> {
|
): Promise<MongoDBCollectionResource> {
|
||||||
if (window.authType !== AuthType.AAD) {
|
if (userContext.authType !== AuthType.AAD) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
let collection: MongoDBCollectionResource;
|
let collection: MongoDBCollectionResource;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function readStoredProcedures(
|
|||||||
const clearMessage = logConsoleProgress(`Querying stored procedures for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying stored procedures for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function readTriggers(
|
|||||||
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function readUserDefinedFunctions(
|
|||||||
const clearMessage = logConsoleProgress(`Querying user defined functions for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying user defined functions for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export async function updateCollection(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export const updateOffer = async (params: UpdateOfferParams): Promise<Offer> =>
|
|||||||
const clearMessage = logConsoleProgress(`Updating offer for ${offerResourceText}`);
|
const clearMessage = logConsoleProgress(`Updating offer for ${offerResourceText}`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
if (params.collectionId) {
|
if (params.collectionId) {
|
||||||
updatedOffer = await updateCollectionOfferWithARM(params);
|
updatedOffer = await updateCollectionOfferWithARM(params);
|
||||||
} else if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
} else if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export async function updateStoredProcedure(
|
|||||||
const clearMessage = logConsoleProgress(`Updating stored procedure ${storedProcedure.id}`);
|
const clearMessage = logConsoleProgress(`Updating stored procedure ${storedProcedure.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export async function updateTrigger(
|
|||||||
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
|
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export async function updateUserDefinedFunction(
|
|||||||
const clearMessage = logConsoleProgress(`Updating user defined function ${userDefinedFunction.id}`);
|
const clearMessage = logConsoleProgress(`Updating user defined function ${userDefinedFunction.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ if (process.env.NODE_ENV === "development") {
|
|||||||
|
|
||||||
export async function initializeConfiguration(): Promise<ConfigContext> {
|
export async function initializeConfiguration(): Promise<ConfigContext> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch("./config.json");
|
const response = await fetch("./config.json", {
|
||||||
|
headers: {
|
||||||
|
"If-None-Match": "", // disable client side cache
|
||||||
|
},
|
||||||
|
});
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
try {
|
try {
|
||||||
const { allowedParentFrameOrigins, ...externalConfig } = await response.json();
|
const { allowedParentFrameOrigins, ...externalConfig } = await response.json();
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ export interface DatabaseAccount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DatabaseAccountExtendedProperties {
|
export interface DatabaseAccountExtendedProperties {
|
||||||
documentEndpoint: string;
|
documentEndpoint?: string;
|
||||||
tableEndpoint: string;
|
tableEndpoint?: string;
|
||||||
gremlinEndpoint: string;
|
gremlinEndpoint?: string;
|
||||||
cassandraEndpoint: string;
|
cassandraEndpoint?: string;
|
||||||
configurationOverrides?: ConfigurationOverrides;
|
configurationOverrides?: ConfigurationOverrides;
|
||||||
capabilities?: Capability[];
|
capabilities?: Capability[];
|
||||||
enableMultipleWriteLocations?: boolean;
|
enableMultipleWriteLocations?: boolean;
|
||||||
|
|||||||
9
src/Contracts/SelfServeContracts.ts
Normal file
9
src/Contracts/SelfServeContracts.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Messaging types used with SelfServe Component <-> Portal communication
|
||||||
|
* and Hosted <-> SelfServe Component communication
|
||||||
|
*/
|
||||||
|
|
||||||
|
export enum SelfServeMessageTypes {
|
||||||
|
TelemetryInfo = "TelemetryInfo",
|
||||||
|
Notification = "Notification",
|
||||||
|
}
|
||||||
@@ -91,6 +91,7 @@ export interface Database extends TreeNode {
|
|||||||
onDeleteDatabaseContextMenuClick(source: Database, event: MouseEvent | KeyboardEvent): void;
|
onDeleteDatabaseContextMenuClick(source: Database, event: MouseEvent | KeyboardEvent): void;
|
||||||
onSettingsClick: () => void;
|
onSettingsClick: () => void;
|
||||||
loadOffer(): Promise<void>;
|
loadOffer(): Promise<void>;
|
||||||
|
getPendingThroughputSplitNotification(): Promise<DataModels.Notification>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CollectionBase extends TreeNode {
|
export interface CollectionBase extends TreeNode {
|
||||||
@@ -107,7 +108,7 @@ export interface CollectionBase extends TreeNode {
|
|||||||
isCollectionExpanded: ko.Observable<boolean>;
|
isCollectionExpanded: ko.Observable<boolean>;
|
||||||
|
|
||||||
onDocumentDBDocumentsClick(): void;
|
onDocumentDBDocumentsClick(): void;
|
||||||
onNewQueryClick(source: any, event: MouseEvent, queryText?: string): void;
|
onNewQueryClick(source: any, event?: MouseEvent, queryText?: string): void;
|
||||||
expandCollection(): void;
|
expandCollection(): void;
|
||||||
collapseCollection(): void;
|
collapseCollection(): void;
|
||||||
getDatabase(): Database;
|
getDatabase(): Database;
|
||||||
@@ -137,14 +138,13 @@ export interface Collection extends CollectionBase {
|
|||||||
openTab(): void;
|
openTab(): void;
|
||||||
|
|
||||||
onSettingsClick: () => Promise<void>;
|
onSettingsClick: () => Promise<void>;
|
||||||
onDeleteCollectionContextMenuClick(source: Collection, event: MouseEvent): void;
|
|
||||||
|
|
||||||
onNewGraphClick(): void;
|
onNewGraphClick(): void;
|
||||||
onNewMongoQueryClick(source: any, event: MouseEvent, queryText?: string): void;
|
onNewMongoQueryClick(source: any, event?: MouseEvent, queryText?: string): void;
|
||||||
onNewMongoShellClick(): void;
|
onNewMongoShellClick(): void;
|
||||||
onNewStoredProcedureClick(source: Collection, event: MouseEvent): void;
|
onNewStoredProcedureClick(source: Collection, event?: MouseEvent): void;
|
||||||
onNewUserDefinedFunctionClick(source: Collection, event: MouseEvent): void;
|
onNewUserDefinedFunctionClick(source: Collection, event?: MouseEvent): void;
|
||||||
onNewTriggerClick(source: Collection, event: MouseEvent): void;
|
onNewTriggerClick(source: Collection, event?: MouseEvent): void;
|
||||||
storedProcedures: ko.Computed<StoredProcedure[]>;
|
storedProcedures: ko.Computed<StoredProcedure[]>;
|
||||||
userDefinedFunctions: ko.Computed<UserDefinedFunction[]>;
|
userDefinedFunctions: ko.Computed<UserDefinedFunction[]>;
|
||||||
triggers: ko.Computed<Trigger[]>;
|
triggers: ko.Computed<Trigger[]>;
|
||||||
@@ -178,6 +178,7 @@ export interface Collection extends CollectionBase {
|
|||||||
uploadFiles(fileList: FileList): Promise<UploadDetails>;
|
uploadFiles(fileList: FileList): Promise<UploadDetails>;
|
||||||
|
|
||||||
getLabel(): string;
|
getLabel(): string;
|
||||||
|
getPendingThroughputSplitNotification(): Promise<DataModels.Notification>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,10 +293,6 @@ export interface DocumentsTabOptions extends TabOptions {
|
|||||||
resourceTokenPartitionKey?: string;
|
resourceTokenPartitionKey?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingsTabV2Options extends TabOptions {
|
|
||||||
getPendingNotification: Promise<DataModels.Notification>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConflictsTabOptions extends TabOptions {
|
export interface ConflictsTabOptions extends TabOptions {
|
||||||
partitionKey: DataModels.PartitionKey;
|
partitionKey: DataModels.PartitionKey;
|
||||||
conflictIds: ko.ObservableArray<ConflictId>;
|
conflictIds: ko.ObservableArray<ConflictId>;
|
||||||
@@ -358,11 +355,12 @@ export enum CollectionTabKind {
|
|||||||
Notebook = 13 /* Deprecated */,
|
Notebook = 13 /* Deprecated */,
|
||||||
Terminal = 14,
|
Terminal = 14,
|
||||||
NotebookV2 = 15,
|
NotebookV2 = 15,
|
||||||
SparkMasterTab = 16,
|
SparkMasterTab = 16 /* Deprecated */,
|
||||||
Gallery = 17,
|
Gallery = 17,
|
||||||
NotebookViewer = 18,
|
NotebookViewer = 18,
|
||||||
Schema = 19,
|
Schema = 19,
|
||||||
SettingsV2 = 20,
|
CollectionSettingsV2 = 20,
|
||||||
|
DatabaseSettingsV2 = 21,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum TerminalKind {
|
export enum TerminalKind {
|
||||||
@@ -373,20 +371,20 @@ export enum TerminalKind {
|
|||||||
|
|
||||||
export interface DataExplorerInputsFrame {
|
export interface DataExplorerInputsFrame {
|
||||||
databaseAccount: any;
|
databaseAccount: any;
|
||||||
subscriptionId: string;
|
subscriptionId?: string;
|
||||||
resourceGroup: string;
|
resourceGroup?: string;
|
||||||
masterKey: string;
|
masterKey?: string;
|
||||||
hasWriteAccess: boolean;
|
hasWriteAccess?: boolean;
|
||||||
authorizationToken: string;
|
authorizationToken?: string;
|
||||||
features: any;
|
features: { [key: string]: string };
|
||||||
csmEndpoint: string;
|
csmEndpoint?: string;
|
||||||
dnsSuffix: string;
|
dnsSuffix?: string;
|
||||||
serverId: string;
|
serverId?: string;
|
||||||
extensionEndpoint: string;
|
extensionEndpoint?: string;
|
||||||
subscriptionType: SubscriptionType;
|
subscriptionType?: SubscriptionType;
|
||||||
quotaId: string;
|
quotaId?: string;
|
||||||
addCollectionDefaultFlight: string;
|
addCollectionDefaultFlight?: string;
|
||||||
isTryCosmosDBSubscription: boolean;
|
isTryCosmosDBSubscription?: boolean;
|
||||||
loadDatabaseAccountTimestamp?: number;
|
loadDatabaseAccountTimestamp?: number;
|
||||||
sharedThroughputMinimum?: number;
|
sharedThroughputMinimum?: number;
|
||||||
sharedThroughputMaximum?: number;
|
sharedThroughputMaximum?: number;
|
||||||
@@ -395,7 +393,16 @@ export interface DataExplorerInputsFrame {
|
|||||||
isAuthWithresourceToken?: boolean;
|
isAuthWithresourceToken?: boolean;
|
||||||
defaultCollectionThroughput?: CollectionCreationDefaults;
|
defaultCollectionThroughput?: CollectionCreationDefaults;
|
||||||
flights?: readonly string[];
|
flights?: readonly string[];
|
||||||
selfServeType?: SelfServeType;
|
}
|
||||||
|
|
||||||
|
export interface SelfServeFrameInputs {
|
||||||
|
selfServeType: SelfServeType;
|
||||||
|
databaseAccount: any;
|
||||||
|
subscriptionId: string;
|
||||||
|
resourceGroup: string;
|
||||||
|
authorizationToken: string;
|
||||||
|
csmEndpoint: string;
|
||||||
|
flights?: readonly string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CollectionCreationDefaults {
|
export interface CollectionCreationDefaults {
|
||||||
|
|||||||
@@ -20,10 +20,6 @@ describe("Component Registerer", () => {
|
|||||||
expect(ko.components.isRegistered("graph-style")).toBe(true);
|
expect(ko.components.isRegistered("graph-style")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should register collapsible-panel component", () => {
|
|
||||||
expect(ko.components.isRegistered("collapsible-panel")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register json-editor component", () => {
|
it("should register json-editor component", () => {
|
||||||
expect(ko.components.isRegistered("json-editor")).toBe(true);
|
expect(ko.components.isRegistered("json-editor")).toBe(true);
|
||||||
});
|
});
|
||||||
@@ -45,7 +41,8 @@ describe("Component Registerer", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should register settings-tab-v2 component", () => {
|
it("should register settings-tab-v2 component", () => {
|
||||||
expect(ko.components.isRegistered("settings-tab-v2")).toBe(true);
|
expect(ko.components.isRegistered("database-settings-tab-v2")).toBe(true);
|
||||||
|
expect(ko.components.isRegistered("collection-settings-tab-v2")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should register query-tab component", () => {
|
it("should register query-tab component", () => {
|
||||||
@@ -68,10 +65,6 @@ describe("Component Registerer", () => {
|
|||||||
expect(ko.components.isRegistered("terminal-tab")).toBe(true);
|
expect(ko.components.isRegistered("terminal-tab")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should register spark-master-tab component", () => {
|
|
||||||
expect(ko.components.isRegistered("spark-master-tab")).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should register mongo-shell-tab component", () => {
|
it("should register mongo-shell-tab component", () => {
|
||||||
expect(ko.components.isRegistered("mongo-shell-tab")).toBe(true);
|
expect(ko.components.isRegistered("mongo-shell-tab")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import * as PaneComponents from "./Panes/PaneComponents";
|
import * as PaneComponents from "./Panes/PaneComponents";
|
||||||
import * as TabComponents from "./Tabs/TabComponents";
|
import * as TabComponents from "./Tabs/TabComponents";
|
||||||
import { CollapsiblePanelComponent } from "./Controls/CollapsiblePanel/CollapsiblePanelComponent";
|
|
||||||
import { DiffEditorComponent } from "./Controls/DiffEditor/DiffEditorComponent";
|
import { DiffEditorComponent } from "./Controls/DiffEditor/DiffEditorComponent";
|
||||||
import { DynamicListComponent } from "./Controls/DynamicList/DynamicListComponent";
|
import { DynamicListComponent } from "./Controls/DynamicList/DynamicListComponent";
|
||||||
import { EditorComponent } from "./Controls/Editor/EditorComponent";
|
import { EditorComponent } from "./Controls/Editor/EditorComponent";
|
||||||
@@ -17,7 +16,6 @@ ko.components.register("input-typeahead", new InputTypeaheadComponent());
|
|||||||
ko.components.register("new-vertex-form", NewVertexComponent);
|
ko.components.register("new-vertex-form", NewVertexComponent);
|
||||||
ko.components.register("error-display", new ErrorDisplayComponent());
|
ko.components.register("error-display", new ErrorDisplayComponent());
|
||||||
ko.components.register("graph-style", GraphStyleComponent);
|
ko.components.register("graph-style", GraphStyleComponent);
|
||||||
ko.components.register("collapsible-panel", new CollapsiblePanelComponent());
|
|
||||||
ko.components.register("editor", new EditorComponent());
|
ko.components.register("editor", new EditorComponent());
|
||||||
ko.components.register("json-editor", new JsonEditorComponent());
|
ko.components.register("json-editor", new JsonEditorComponent());
|
||||||
ko.components.register("diff-editor", new DiffEditorComponent());
|
ko.components.register("diff-editor", new DiffEditorComponent());
|
||||||
@@ -31,7 +29,7 @@ ko.components.register("mongo-documents-tab", new TabComponents.MongoDocumentsTa
|
|||||||
ko.components.register("stored-procedure-tab", new TabComponents.StoredProcedureTab());
|
ko.components.register("stored-procedure-tab", new TabComponents.StoredProcedureTab());
|
||||||
ko.components.register("trigger-tab", new TabComponents.TriggerTab());
|
ko.components.register("trigger-tab", new TabComponents.TriggerTab());
|
||||||
ko.components.register("user-defined-function-tab", new TabComponents.UserDefinedFunctionTab());
|
ko.components.register("user-defined-function-tab", new TabComponents.UserDefinedFunctionTab());
|
||||||
ko.components.register("settings-tab-v2", new TabComponents.SettingsTabV2());
|
ko.components.register("collection-settings-tab-v2", new TabComponents.SettingsTabV2());
|
||||||
ko.components.register("query-tab", new TabComponents.QueryTab());
|
ko.components.register("query-tab", new TabComponents.QueryTab());
|
||||||
ko.components.register("tables-query-tab", new TabComponents.QueryTablesTab());
|
ko.components.register("tables-query-tab", new TabComponents.QueryTablesTab());
|
||||||
ko.components.register("graph-tab", new TabComponents.GraphTab());
|
ko.components.register("graph-tab", new TabComponents.GraphTab());
|
||||||
@@ -39,12 +37,12 @@ ko.components.register("mongo-shell-tab", new TabComponents.MongoShellTab());
|
|||||||
ko.components.register("conflicts-tab", new TabComponents.ConflictsTab());
|
ko.components.register("conflicts-tab", new TabComponents.ConflictsTab());
|
||||||
ko.components.register("notebookv2-tab", new TabComponents.NotebookV2Tab());
|
ko.components.register("notebookv2-tab", new TabComponents.NotebookV2Tab());
|
||||||
ko.components.register("terminal-tab", new TabComponents.TerminalTab());
|
ko.components.register("terminal-tab", new TabComponents.TerminalTab());
|
||||||
ko.components.register("spark-master-tab", new TabComponents.SparkMasterTab());
|
|
||||||
ko.components.register("gallery-tab", new TabComponents.GalleryTab());
|
ko.components.register("gallery-tab", new TabComponents.GalleryTab());
|
||||||
ko.components.register("notebook-viewer-tab", new TabComponents.NotebookViewerTab());
|
ko.components.register("notebook-viewer-tab", new TabComponents.NotebookViewerTab());
|
||||||
|
|
||||||
// Database Tabs
|
// Database Tabs
|
||||||
ko.components.register("database-settings-tab", new TabComponents.DatabaseSettingsTab());
|
ko.components.register("database-settings-tab", new TabComponents.DatabaseSettingsTab());
|
||||||
|
ko.components.register("database-settings-tab-v2", new TabComponents.SettingsTabV2());
|
||||||
|
|
||||||
// Panes
|
// Panes
|
||||||
ko.components.register("add-database-pane", new PaneComponents.AddDatabasePaneComponent());
|
ko.components.register("add-database-pane", new PaneComponents.AddDatabasePaneComponent());
|
||||||
@@ -66,7 +64,6 @@ ko.components.register("table-query-select-pane", new PaneComponents.TableQueryS
|
|||||||
ko.components.register("cassandra-add-collection-pane", new PaneComponents.CassandraAddCollectionPaneComponent());
|
ko.components.register("cassandra-add-collection-pane", new PaneComponents.CassandraAddCollectionPaneComponent());
|
||||||
ko.components.register("settings-pane", new PaneComponents.SettingsPaneComponent());
|
ko.components.register("settings-pane", new PaneComponents.SettingsPaneComponent());
|
||||||
ko.components.register("execute-sproc-params-pane", new PaneComponents.ExecuteSprocParamsComponent());
|
ko.components.register("execute-sproc-params-pane", new PaneComponents.ExecuteSprocParamsComponent());
|
||||||
ko.components.register("renew-adhoc-access-pane", new PaneComponents.RenewAdHocAccessPane());
|
|
||||||
ko.components.register("upload-items-pane", new PaneComponents.UploadItemsPaneComponent());
|
ko.components.register("upload-items-pane", new PaneComponents.UploadItemsPaneComponent());
|
||||||
ko.components.register("load-query-pane", new PaneComponents.LoadQueryPaneComponent());
|
ko.components.register("load-query-pane", new PaneComponents.LoadQueryPaneComponent());
|
||||||
ko.components.register("save-query-pane", new PaneComponents.SaveQueryPaneComponent());
|
ko.components.register("save-query-pane", new PaneComponents.SaveQueryPaneComponent());
|
||||||
|
|||||||
@@ -112,10 +112,7 @@ export class ResourceTreeContextMenuButtonFactory {
|
|||||||
|
|
||||||
items.push({
|
items.push({
|
||||||
iconSrc: DeleteCollectionIcon,
|
iconSrc: DeleteCollectionIcon,
|
||||||
onClick: () => {
|
onClick: () => container.openDeleteCollectionConfirmationPane(),
|
||||||
const selectedCollection: ViewModels.Collection = container.findSelectedCollection();
|
|
||||||
selectedCollection && selectedCollection.onDeleteCollectionContextMenuClick(selectedCollection, null);
|
|
||||||
},
|
|
||||||
label: container.deleteCollectionText(),
|
label: container.deleteCollectionText(),
|
||||||
styleClass: "deleteCollectionMenuItem",
|
styleClass: "deleteCollectionMenuItem",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
import * as ko from "knockout";
|
|
||||||
import template from "./collapsible-panel-component.html";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper class for ko component registration
|
|
||||||
*/
|
|
||||||
export class CollapsiblePanelComponent {
|
|
||||||
constructor() {
|
|
||||||
return {
|
|
||||||
viewModel: CollapsiblePanelViewModel,
|
|
||||||
template,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parameters for this component
|
|
||||||
*/
|
|
||||||
interface CollapsiblePanelParams {
|
|
||||||
collapsedTitle: ko.Observable<string>;
|
|
||||||
expandedTitle: ko.Observable<string>;
|
|
||||||
isCollapsed?: ko.Observable<boolean>;
|
|
||||||
collapseToLeft?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Collapsible panel:
|
|
||||||
* Contains a header with [>] button to collapse and an title ("expandedTitle").
|
|
||||||
* Collapsing the panel:
|
|
||||||
* - shrinks width to narrow amount
|
|
||||||
* - hides children
|
|
||||||
* - shows [<]
|
|
||||||
* - shows vertical title ("collapsedTitle")
|
|
||||||
* - the default behavior is to collapse to the right (ie, place this component on the right or use "collapseToLeft" parameter)
|
|
||||||
*
|
|
||||||
* How to use in your markup:
|
|
||||||
* <collapsible-panel params="{ collapsedTitle:'Properties', expandedTitle:'Expanded properties' }">
|
|
||||||
* <!-- add your markup here: the ko context is the same as outside of collapsible-panel (ie $data) -->
|
|
||||||
* </collapsible-panel>
|
|
||||||
*
|
|
||||||
* Use the optional "isCollapsed" parameter to programmatically collapse/expand the pane from outside the component.
|
|
||||||
* Use the optional "collapseToLeft" parameter to collapse to the left.
|
|
||||||
*/
|
|
||||||
class CollapsiblePanelViewModel {
|
|
||||||
public params: CollapsiblePanelParams;
|
|
||||||
private isCollapsed: ko.Observable<boolean>;
|
|
||||||
|
|
||||||
public constructor(params: CollapsiblePanelParams) {
|
|
||||||
this.params = params;
|
|
||||||
this.isCollapsed = params.isCollapsed || ko.observable(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public toggleCollapse(): void {
|
|
||||||
this.isCollapsed(!this.isCollapsed());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
<div class="collapsiblePanel" data-bind="css: { paneCollapsed:isCollapsed() }">
|
|
||||||
<div class="panelHeader" data-bind="visible: !isCollapsed()">
|
|
||||||
<span
|
|
||||||
class="collapsedIconContainer collapseExpandButton"
|
|
||||||
data-bind="click:toggleCollapse, css: { 'pull-right':params.collapseToLeft }"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
class="collapsedIcon imgVerticalAlignment"
|
|
||||||
src="/imgarrowlefticon.svg"
|
|
||||||
alt="Collapse"
|
|
||||||
data-bind="css: { expanded:!isCollapsed(), iconMirror:params.collapseToLeft }"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="expandedTitle"
|
|
||||||
data-bind="text: params.expandedTitle, css:{ iconSpacer:!params.collapseToLeft }"
|
|
||||||
></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="collapsibleNav nav" data-bind="visible:isCollapsed">
|
|
||||||
<ul class="nav">
|
|
||||||
<li class="collapsedBtn collapseExpandButton">
|
|
||||||
<span class="collapsedIconContainer" data-bind="click: toggleCollapse">
|
|
||||||
<img
|
|
||||||
class="collapsedIcon"
|
|
||||||
src="/imgarrowlefticon.svg"
|
|
||||||
data-bind="css: { expanded:!isCollapsed(), iconMirror:params.collapseToLeft }"
|
|
||||||
alt="Expand"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span class="rotatedInner" data-bind="click: toggleCollapse">
|
|
||||||
<span data-bind="text: params.collapsedTitle"></span>
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panelContent" data-bind="visible:!isCollapsed()">
|
|
||||||
<!-- ko with:$parent -->
|
|
||||||
<!-- ko template: { nodes: $componentTemplateNodes } -->
|
|
||||||
<!-- /ko -->
|
|
||||||
<!-- /ko -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { StringUtils } from "../../../Utils/StringUtils";
|
import * as StringUtils from "../../../Utils/StringUtils";
|
||||||
import { KeyCodes } from "../../../Common/Constants";
|
import { KeyCodes } from "../../../Common/Constants";
|
||||||
import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
|
import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Dialog, DialogType, DialogFooter, IDialogProps } from "office-ui-fabric-react/lib/Dialog";
|
import { Dialog as FluentDialog, DialogType, DialogFooter, IDialogProps } from "office-ui-fabric-react/lib/Dialog";
|
||||||
import { IButtonProps, PrimaryButton, DefaultButton } from "office-ui-fabric-react/lib/Button";
|
import { IButtonProps, PrimaryButton, DefaultButton } from "office-ui-fabric-react/lib/Button";
|
||||||
import { ITextFieldProps, TextField } from "office-ui-fabric-react/lib/TextField";
|
import { ITextFieldProps, TextField } from "office-ui-fabric-react/lib/TextField";
|
||||||
import { Link } from "office-ui-fabric-react/lib/Link";
|
import { Link } from "office-ui-fabric-react/lib/Link";
|
||||||
import { ChoiceGroup, FontIcon, IChoiceGroupProps } from "office-ui-fabric-react";
|
import {
|
||||||
|
ChoiceGroup,
|
||||||
|
FontIcon,
|
||||||
|
IChoiceGroupProps,
|
||||||
|
IProgressIndicatorProps,
|
||||||
|
ProgressIndicator,
|
||||||
|
} from "office-ui-fabric-react";
|
||||||
|
|
||||||
export interface TextFieldProps extends ITextFieldProps {
|
export interface TextFieldProps extends ITextFieldProps {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -27,6 +33,7 @@ export interface DialogProps {
|
|||||||
choiceGroupProps?: IChoiceGroupProps;
|
choiceGroupProps?: IChoiceGroupProps;
|
||||||
textFieldProps?: TextFieldProps;
|
textFieldProps?: TextFieldProps;
|
||||||
linkProps?: LinkProps;
|
linkProps?: LinkProps;
|
||||||
|
progressIndicatorProps?: IProgressIndicatorProps;
|
||||||
primaryButtonText: string;
|
primaryButtonText: string;
|
||||||
secondaryButtonText: string;
|
secondaryButtonText: string;
|
||||||
onPrimaryButtonClick: () => void;
|
onPrimaryButtonClick: () => void;
|
||||||
@@ -43,7 +50,7 @@ const DIALOG_TITLE_FONT_SIZE = "17px";
|
|||||||
const DIALOG_TITLE_FONT_WEIGHT = 400;
|
const DIALOG_TITLE_FONT_WEIGHT = 400;
|
||||||
const DIALOG_SUBTEXT_FONT_SIZE = "15px";
|
const DIALOG_SUBTEXT_FONT_SIZE = "15px";
|
||||||
|
|
||||||
export class DialogComponent extends React.Component<DialogProps, {}> {
|
export class Dialog extends React.Component<DialogProps> {
|
||||||
constructor(props: DialogProps) {
|
constructor(props: DialogProps) {
|
||||||
super(props);
|
super(props);
|
||||||
}
|
}
|
||||||
@@ -62,13 +69,14 @@ export class DialogComponent extends React.Component<DialogProps, {}> {
|
|||||||
showCloseButton: this.props.showCloseButton || false,
|
showCloseButton: this.props.showCloseButton || false,
|
||||||
onDismiss: this.props.onDismiss,
|
onDismiss: this.props.onDismiss,
|
||||||
},
|
},
|
||||||
modalProps: { isBlocking: this.props.isModal },
|
modalProps: { isBlocking: this.props.isModal, isDarkOverlay: false },
|
||||||
minWidth: DIALOG_MIN_WIDTH,
|
minWidth: DIALOG_MIN_WIDTH,
|
||||||
maxWidth: DIALOG_MAX_WIDTH,
|
maxWidth: DIALOG_MAX_WIDTH,
|
||||||
};
|
};
|
||||||
const choiceGroupProps: IChoiceGroupProps = this.props.choiceGroupProps;
|
const choiceGroupProps: IChoiceGroupProps = this.props.choiceGroupProps;
|
||||||
const textFieldProps: ITextFieldProps = this.props.textFieldProps;
|
const textFieldProps: ITextFieldProps = this.props.textFieldProps;
|
||||||
const linkProps: LinkProps = this.props.linkProps;
|
const linkProps: LinkProps = this.props.linkProps;
|
||||||
|
const progressIndicatorProps: IProgressIndicatorProps = this.props.progressIndicatorProps;
|
||||||
const primaryButtonProps: IButtonProps = {
|
const primaryButtonProps: IButtonProps = {
|
||||||
text: this.props.primaryButtonText,
|
text: this.props.primaryButtonText,
|
||||||
disabled: this.props.primaryButtonDisabled || false,
|
disabled: this.props.primaryButtonDisabled || false,
|
||||||
@@ -83,7 +91,7 @@ export class DialogComponent extends React.Component<DialogProps, {}> {
|
|||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog {...dialogProps}>
|
<FluentDialog {...dialogProps}>
|
||||||
{choiceGroupProps && <ChoiceGroup {...choiceGroupProps} />}
|
{choiceGroupProps && <ChoiceGroup {...choiceGroupProps} />}
|
||||||
{textFieldProps && <TextField {...textFieldProps} />}
|
{textFieldProps && <TextField {...textFieldProps} />}
|
||||||
{linkProps && (
|
{linkProps && (
|
||||||
@@ -91,11 +99,12 @@ export class DialogComponent extends React.Component<DialogProps, {}> {
|
|||||||
{linkProps.linkText} <FontIcon iconName="NavigateExternalInline" />
|
{linkProps.linkText} <FontIcon iconName="NavigateExternalInline" />
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
{progressIndicatorProps && <ProgressIndicator {...progressIndicatorProps} />}
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<PrimaryButton {...primaryButtonProps} />
|
<PrimaryButton {...primaryButtonProps} />
|
||||||
{secondaryButtonProps && <DefaultButton {...secondaryButtonProps} />}
|
{secondaryButtonProps && <DefaultButton {...secondaryButtonProps} />}
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</Dialog>
|
</FluentDialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
/**
|
|
||||||
* This adapter is responsible to render the Dialog React component
|
|
||||||
* If the component signals a change through the callback passed in the properties, it must render the React component when appropriate
|
|
||||||
* and update any knockout observables passed from the parent.
|
|
||||||
*/
|
|
||||||
import * as React from "react";
|
|
||||||
import { DialogComponent, DialogProps } from "./DialogComponent";
|
|
||||||
import { ReactAdapter } from "../../../Bindings/ReactBindingHandler";
|
|
||||||
|
|
||||||
export class DialogComponentAdapter implements ReactAdapter {
|
|
||||||
public parameters: ko.Observable<DialogProps>;
|
|
||||||
|
|
||||||
public renderComponent(): JSX.Element {
|
|
||||||
return <DialogComponent {...this.parameters()} />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -47,13 +47,7 @@ export const FeaturePanelComponent: React.FunctionComponent = () => {
|
|||||||
{ key: "feature.dataexplorerexecutesproc", label: "Execute stored procedure", value: "true" },
|
{ key: "feature.dataexplorerexecutesproc", label: "Execute stored procedure", value: "true" },
|
||||||
{ key: "feature.hosteddataexplorerenabled", label: "Hosted Data Explorer (deprecated?)", value: "true" },
|
{ key: "feature.hosteddataexplorerenabled", label: "Hosted Data Explorer (deprecated?)", value: "true" },
|
||||||
{ key: "feature.enablettl", label: "Enable TTL", value: "true" },
|
{ key: "feature.enablettl", label: "Enable TTL", value: "true" },
|
||||||
{ key: "feature.enablegallerypublish", label: "Enable Notebook Gallery Publishing", value: "true" },
|
|
||||||
{ key: "feature.selfServeType", label: "Self serve feature", value: "sample" },
|
{ key: "feature.selfServeType", label: "Self serve feature", value: "sample" },
|
||||||
{
|
|
||||||
key: "feature.enableLinkInjection",
|
|
||||||
label: "Enable Injecting Notebook Viewer Link into the first cell",
|
|
||||||
value: "true",
|
|
||||||
},
|
|
||||||
{ key: "feature.canexceedmaximumvalue", label: "Can exceed max value", value: "true" },
|
{ key: "feature.canexceedmaximumvalue", label: "Can exceed max value", value: "true" },
|
||||||
{
|
{
|
||||||
key: "feature.enablefixedcollectionwithsharedthroughput",
|
key: "feature.enablefixedcollectionwithsharedthroughput",
|
||||||
|
|||||||
@@ -149,12 +149,6 @@ exports[`Feature panel renders all flags 1`] = `
|
|||||||
label="Enable TTL"
|
label="Enable TTL"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
/>
|
/>
|
||||||
<StyledCheckboxBase
|
|
||||||
checked={false}
|
|
||||||
key="feature.enablegallerypublish"
|
|
||||||
label="Enable Notebook Gallery Publishing"
|
|
||||||
onChange={[Function]}
|
|
||||||
/>
|
|
||||||
<StyledCheckboxBase
|
<StyledCheckboxBase
|
||||||
checked={false}
|
checked={false}
|
||||||
key="feature.selfServeType"
|
key="feature.selfServeType"
|
||||||
@@ -163,8 +157,8 @@ exports[`Feature panel renders all flags 1`] = `
|
|||||||
/>
|
/>
|
||||||
<StyledCheckboxBase
|
<StyledCheckboxBase
|
||||||
checked={false}
|
checked={false}
|
||||||
key="feature.enableLinkInjection"
|
key="feature.canexceedmaximumvalue"
|
||||||
label="Enable Injecting Notebook Viewer Link into the first cell"
|
label="Can exceed max value"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -172,12 +166,6 @@ exports[`Feature panel renders all flags 1`] = `
|
|||||||
className="checkboxRow"
|
className="checkboxRow"
|
||||||
horizontalAlign="space-between"
|
horizontalAlign="space-between"
|
||||||
>
|
>
|
||||||
<StyledCheckboxBase
|
|
||||||
checked={false}
|
|
||||||
key="feature.canexceedmaximumvalue"
|
|
||||||
label="Can exceed max value"
|
|
||||||
onChange={[Function]}
|
|
||||||
/>
|
|
||||||
<StyledCheckboxBase
|
<StyledCheckboxBase
|
||||||
checked={false}
|
checked={false}
|
||||||
key="feature.enablefixedcollectionwithsharedthroughput"
|
key="feature.enablefixedcollectionwithsharedthroughput"
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
|
|||||||
|
|
||||||
private onAddRepoButtonClick = async (): Promise<void> => {
|
private onAddRepoButtonClick = async (): Promise<void> => {
|
||||||
const startKey: number = TelemetryProcessor.traceStart(Action.NotebooksGitHubManualRepoAdd, {
|
const startKey: number = TelemetryProcessor.traceStart(Action.NotebooksGitHubManualRepoAdd, {
|
||||||
databaseAccountName: this.props.container.databaseAccount() && this.props.container.databaseAccount().name,
|
|
||||||
defaultExperience: this.props.container.defaultExperience && this.props.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Notebook,
|
dataExplorerArea: Constants.Areas.Notebook,
|
||||||
});
|
});
|
||||||
let enteredUrl = this.state.textFieldValue;
|
let enteredUrl = this.state.textFieldValue;
|
||||||
@@ -105,8 +103,6 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
|
|||||||
TelemetryProcessor.traceSuccess(
|
TelemetryProcessor.traceSuccess(
|
||||||
Action.NotebooksGitHubManualRepoAdd,
|
Action.NotebooksGitHubManualRepoAdd,
|
||||||
{
|
{
|
||||||
databaseAccountName: this.props.container.databaseAccount() && this.props.container.databaseAccount().name,
|
|
||||||
defaultExperience: this.props.container.defaultExperience && this.props.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Notebook,
|
dataExplorerArea: Constants.Areas.Notebook,
|
||||||
},
|
},
|
||||||
startKey
|
startKey
|
||||||
@@ -121,8 +117,6 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
|
|||||||
TelemetryProcessor.traceFailure(
|
TelemetryProcessor.traceFailure(
|
||||||
Action.NotebooksGitHubManualRepoAdd,
|
Action.NotebooksGitHubManualRepoAdd,
|
||||||
{
|
{
|
||||||
databaseAccountName: this.props.container.databaseAccount() && this.props.container.databaseAccount().name,
|
|
||||||
defaultExperience: this.props.container.defaultExperience && this.props.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Notebook,
|
dataExplorerArea: Constants.Areas.Notebook,
|
||||||
error: AddRepoComponent.TextFieldErrorMessage,
|
error: AddRepoComponent.TextFieldErrorMessage,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as DataModels from "../../../Contracts/DataModels";
|
import * as DataModels from "../../../Contracts/DataModels";
|
||||||
import { StringUtils } from "../../../Utils/StringUtils";
|
import * as StringUtils from "../../../Utils/StringUtils";
|
||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
import { TerminalQueryParams } from "../../../Common/Constants";
|
import { TerminalQueryParams } from "../../../Common/Constants";
|
||||||
import { handleError } from "../../../Common/ErrorHandlingUtils";
|
import { handleError } from "../../../Common/ErrorHandlingUtils";
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ import {
|
|||||||
LinkBase,
|
LinkBase,
|
||||||
Separator,
|
Separator,
|
||||||
TooltipHost,
|
TooltipHost,
|
||||||
|
Spinner,
|
||||||
|
SpinnerSize,
|
||||||
} from "office-ui-fabric-react";
|
} from "office-ui-fabric-react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { IGalleryItem } from "../../../../Juno/JunoClient";
|
import { IGalleryItem } from "../../../../Juno/JunoClient";
|
||||||
import { FileSystemUtil } from "../../../Notebook/FileSystemUtil";
|
import { FileSystemUtil } from "../../../Notebook/FileSystemUtil";
|
||||||
import CosmosDBLogo from "../../../../../images/CosmosDB-logo.svg";
|
import CosmosDBLogo from "../../../../../images/CosmosDB-logo.svg";
|
||||||
import { StyleConstants } from "../../../../Common/Constants";
|
|
||||||
|
|
||||||
export interface GalleryCardComponentProps {
|
export interface GalleryCardComponentProps {
|
||||||
data: IGalleryItem;
|
data: IGalleryItem;
|
||||||
@@ -30,17 +31,29 @@ export interface GalleryCardComponentProps {
|
|||||||
onFavoriteClick: () => void;
|
onFavoriteClick: () => void;
|
||||||
onUnfavoriteClick: () => void;
|
onUnfavoriteClick: () => void;
|
||||||
onDownloadClick: () => void;
|
onDownloadClick: () => void;
|
||||||
onDeleteClick: () => void;
|
onDeleteClick: (beforeDelete: () => void, afterDelete: () => void) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GalleryCardComponent extends React.Component<GalleryCardComponentProps> {
|
interface GalleryCardComponentState {
|
||||||
|
isDeletingPublishedNotebook: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GalleryCardComponent extends React.Component<GalleryCardComponentProps, GalleryCardComponentState> {
|
||||||
public static readonly CARD_WIDTH = 256;
|
public static readonly CARD_WIDTH = 256;
|
||||||
private static readonly cardImageHeight = 144;
|
private static readonly cardImageHeight = 144;
|
||||||
public static readonly cardHeightToWidthRatio =
|
public static readonly cardHeightToWidthRatio =
|
||||||
GalleryCardComponent.cardImageHeight / GalleryCardComponent.CARD_WIDTH;
|
GalleryCardComponent.cardImageHeight / GalleryCardComponent.CARD_WIDTH;
|
||||||
private static readonly cardDescriptionMaxChars = 88;
|
private static readonly cardDescriptionMaxChars = 80;
|
||||||
private static readonly cardItemGapBig = 10;
|
private static readonly cardItemGapBig = 10;
|
||||||
private static readonly cardItemGapSmall = 8;
|
private static readonly cardItemGapSmall = 8;
|
||||||
|
private static readonly cardDeleteSpinnerHeight = 360;
|
||||||
|
|
||||||
|
constructor(props: GalleryCardComponentProps) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
isDeletingPublishedNotebook: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const cardButtonsVisible = this.props.isFavorite !== undefined || this.props.showDownload || this.props.showDelete;
|
const cardButtonsVisible = this.props.isFavorite !== undefined || this.props.showDownload || this.props.showDelete;
|
||||||
@@ -54,102 +67,132 @@ export class GalleryCardComponent extends React.Component<GalleryCardComponentPr
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
style={{ background: "white" }}
|
||||||
aria-label={cardTitle}
|
aria-label={cardTitle}
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
tokens={{ width: GalleryCardComponent.CARD_WIDTH, childrenGap: 0 }}
|
tokens={{ width: GalleryCardComponent.CARD_WIDTH, childrenGap: 0 }}
|
||||||
onClick={(event) => this.onClick(event, this.props.onClick)}
|
onClick={(event) => this.onClick(event, this.props.onClick)}
|
||||||
>
|
>
|
||||||
<Card.Item tokens={{ padding: GalleryCardComponent.cardItemGapBig }}>
|
{this.state.isDeletingPublishedNotebook && (
|
||||||
<Persona
|
<Card.Item tokens={{ padding: GalleryCardComponent.cardItemGapBig }}>
|
||||||
imageUrl={this.props.data.isSample && CosmosDBLogo}
|
<Spinner
|
||||||
text={this.props.data.author}
|
size={SpinnerSize.large}
|
||||||
secondaryText={dateString}
|
label={`Deleting '${cardTitle}'`}
|
||||||
/>
|
styles={{ root: { height: GalleryCardComponent.cardDeleteSpinnerHeight } }}
|
||||||
</Card.Item>
|
/>
|
||||||
|
</Card.Item>
|
||||||
|
)}
|
||||||
|
{!this.state.isDeletingPublishedNotebook && (
|
||||||
|
<>
|
||||||
|
<Card.Item tokens={{ padding: GalleryCardComponent.cardItemGapBig }}>
|
||||||
|
<Persona
|
||||||
|
imageUrl={this.props.data.isSample && CosmosDBLogo}
|
||||||
|
text={this.props.data.author}
|
||||||
|
secondaryText={dateString}
|
||||||
|
/>
|
||||||
|
</Card.Item>
|
||||||
|
|
||||||
<Card.Item>
|
<Card.Item>
|
||||||
<Image
|
<Image
|
||||||
src={this.props.data.thumbnailUrl}
|
src={this.props.data.thumbnailUrl}
|
||||||
width={GalleryCardComponent.CARD_WIDTH}
|
width={GalleryCardComponent.CARD_WIDTH}
|
||||||
height={GalleryCardComponent.cardImageHeight}
|
height={GalleryCardComponent.cardImageHeight}
|
||||||
imageFit={ImageFit.cover}
|
imageFit={ImageFit.cover}
|
||||||
alt={`${cardTitle} cover image`}
|
alt={`${cardTitle} cover image`}
|
||||||
/>
|
/>
|
||||||
</Card.Item>
|
</Card.Item>
|
||||||
|
|
||||||
<Card.Section styles={{ root: { padding: GalleryCardComponent.cardItemGapBig } }}>
|
<Card.Section styles={{ root: { padding: GalleryCardComponent.cardItemGapBig } }}>
|
||||||
<Text variant="small" nowrap>
|
<Text variant="small" nowrap>
|
||||||
{this.props.data.tags?.map((tag, index, array) => (
|
{this.props.data.tags ? (
|
||||||
<span key={tag}>
|
this.props.data.tags.map((tag, index, array) => (
|
||||||
<Link onClick={(event) => this.onClick(event, () => this.props.onTagClick(tag))}>{tag}</Link>
|
<span key={tag}>
|
||||||
{index === array.length - 1 ? <></> : ", "}
|
<Link onClick={(event) => this.onClick(event, () => this.props.onTagClick(tag))}>{tag}</Link>
|
||||||
</span>
|
{index === array.length - 1 ? <></> : ", "}
|
||||||
))}
|
</span>
|
||||||
</Text>
|
))
|
||||||
|
) : (
|
||||||
<Text
|
<br />
|
||||||
styles={{
|
|
||||||
root: {
|
|
||||||
fontWeight: FontWeights.semibold,
|
|
||||||
paddingTop: GalleryCardComponent.cardItemGapSmall,
|
|
||||||
paddingBottom: GalleryCardComponent.cardItemGapSmall,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
nowrap
|
|
||||||
>
|
|
||||||
{cardTitle}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text variant="small" styles={{ root: { height: 36 } }}>
|
|
||||||
{this.props.data.description.substr(0, GalleryCardComponent.cardDescriptionMaxChars)}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<span>
|
|
||||||
{this.generateIconText("RedEye", this.props.data.views.toString())}
|
|
||||||
{this.generateIconText("Download", this.props.data.downloads.toString())}
|
|
||||||
{this.props.isFavorite !== undefined &&
|
|
||||||
this.generateIconText("Heart", this.props.data.favorites.toString())}
|
|
||||||
</span>
|
|
||||||
</Card.Section>
|
|
||||||
|
|
||||||
{cardButtonsVisible && (
|
|
||||||
<Card.Section
|
|
||||||
styles={{
|
|
||||||
root: {
|
|
||||||
marginLeft: GalleryCardComponent.cardItemGapBig,
|
|
||||||
marginRight: GalleryCardComponent.cardItemGapBig,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Separator styles={{ root: { padding: 0, height: 1 } }} />
|
|
||||||
|
|
||||||
<span>
|
|
||||||
{this.props.isFavorite !== undefined &&
|
|
||||||
this.generateIconButtonWithTooltip(
|
|
||||||
this.props.isFavorite ? "HeartFill" : "Heart",
|
|
||||||
this.props.isFavorite ? "Unlike" : "Like",
|
|
||||||
"left",
|
|
||||||
this.props.isFavorite ? this.props.onUnfavoriteClick : this.props.onFavoriteClick
|
|
||||||
)}
|
)}
|
||||||
|
</Text>
|
||||||
|
|
||||||
{this.props.showDownload &&
|
<Text
|
||||||
this.generateIconButtonWithTooltip("Download", "Download", "left", this.props.onDownloadClick)}
|
styles={{
|
||||||
|
root: {
|
||||||
|
fontWeight: FontWeights.semibold,
|
||||||
|
paddingTop: GalleryCardComponent.cardItemGapSmall,
|
||||||
|
paddingBottom: GalleryCardComponent.cardItemGapSmall,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
nowrap
|
||||||
|
>
|
||||||
|
{cardTitle}
|
||||||
|
</Text>
|
||||||
|
|
||||||
{this.props.showDelete &&
|
<Text variant="small" styles={{ root: { height: 36 } }}>
|
||||||
this.generateIconButtonWithTooltip("Delete", "Remove", "right", this.props.onDeleteClick)}
|
{this.renderTruncatedDescription()}
|
||||||
</span>
|
</Text>
|
||||||
</Card.Section>
|
|
||||||
|
<span>
|
||||||
|
{this.props.data.views !== undefined &&
|
||||||
|
this.generateIconText("RedEye", this.props.data.views.toString())}
|
||||||
|
{this.props.data.downloads !== undefined &&
|
||||||
|
this.generateIconText("Download", this.props.data.downloads.toString())}
|
||||||
|
{this.props.data.favorites !== undefined &&
|
||||||
|
this.generateIconText("Heart", this.props.data.favorites.toString())}
|
||||||
|
</span>
|
||||||
|
</Card.Section>
|
||||||
|
|
||||||
|
{cardButtonsVisible && (
|
||||||
|
<Card.Section
|
||||||
|
styles={{
|
||||||
|
root: {
|
||||||
|
marginLeft: GalleryCardComponent.cardItemGapBig,
|
||||||
|
marginRight: GalleryCardComponent.cardItemGapBig,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Separator styles={{ root: { padding: 0, height: 1 } }} />
|
||||||
|
|
||||||
|
<span>
|
||||||
|
{this.props.isFavorite !== undefined &&
|
||||||
|
this.generateIconButtonWithTooltip(
|
||||||
|
this.props.isFavorite ? "HeartFill" : "Heart",
|
||||||
|
this.props.isFavorite ? "Unfavorite" : "Favorite",
|
||||||
|
"left",
|
||||||
|
this.props.isFavorite ? this.props.onUnfavoriteClick : this.props.onFavoriteClick
|
||||||
|
)}
|
||||||
|
|
||||||
|
{this.props.showDownload &&
|
||||||
|
this.generateIconButtonWithTooltip("Download", "Download", "left", this.props.onDownloadClick)}
|
||||||
|
|
||||||
|
{this.props.showDelete &&
|
||||||
|
this.generateIconButtonWithTooltip("Delete", "Remove", "right", () =>
|
||||||
|
this.props.onDeleteClick(
|
||||||
|
() => this.setState({ isDeletingPublishedNotebook: true }),
|
||||||
|
() => this.setState({ isDeletingPublishedNotebook: false })
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</Card.Section>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private renderTruncatedDescription = (): string => {
|
||||||
|
let truncatedDescription = this.props.data.description.substr(0, GalleryCardComponent.cardDescriptionMaxChars);
|
||||||
|
if (this.props.data.description.length > GalleryCardComponent.cardDescriptionMaxChars) {
|
||||||
|
truncatedDescription = `${truncatedDescription} ...`;
|
||||||
|
}
|
||||||
|
return truncatedDescription;
|
||||||
|
};
|
||||||
|
|
||||||
private generateIconText = (iconName: string, text: string): JSX.Element => {
|
private generateIconText = (iconName: string, text: string): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<Text
|
<Text variant="tiny" styles={{ root: { color: "#605E5C", paddingRight: GalleryCardComponent.cardItemGapSmall } }}>
|
||||||
variant="tiny"
|
|
||||||
styles={{ root: { color: StyleConstants.BaseMedium, paddingRight: GalleryCardComponent.cardItemGapSmall } }}
|
|
||||||
>
|
|
||||||
<Icon iconName={iconName} styles={{ root: { verticalAlign: "middle" } }} /> {text}
|
<Icon iconName={iconName} styles={{ root: { verticalAlign: "middle" } }} /> {text}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
aria-label="name"
|
aria-label="name"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
|
style={
|
||||||
|
Object {
|
||||||
|
"background": "white",
|
||||||
|
}
|
||||||
|
}
|
||||||
tokens={
|
tokens={
|
||||||
Object {
|
Object {
|
||||||
"childrenGap": 0,
|
"childrenGap": 0,
|
||||||
@@ -88,7 +93,7 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
"root": Object {
|
"root": Object {
|
||||||
"color": undefined,
|
"color": "#605E5C",
|
||||||
"paddingRight": 8,
|
"paddingRight": 8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -112,7 +117,7 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
"root": Object {
|
"root": Object {
|
||||||
"color": undefined,
|
"color": "#605E5C",
|
||||||
"paddingRight": 8,
|
"paddingRight": 8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -136,7 +141,7 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
"root": Object {
|
"root": Object {
|
||||||
"color": undefined,
|
"color": "#605E5C",
|
||||||
"paddingRight": 8,
|
"paddingRight": 8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -185,7 +190,7 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
"gapSpace": 0,
|
"gapSpace": 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
content="Like"
|
content="Favorite"
|
||||||
id="TooltipHost-IconButton-Heart"
|
id="TooltipHost-IconButton-Heart"
|
||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
@@ -197,14 +202,14 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<CustomizedIconButton
|
<CustomizedIconButton
|
||||||
ariaLabel="Like"
|
ariaLabel="Favorite"
|
||||||
iconProps={
|
iconProps={
|
||||||
Object {
|
Object {
|
||||||
"iconName": "Heart",
|
"iconName": "Heart",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
title="Like"
|
title="Favorite"
|
||||||
/>
|
/>
|
||||||
</StyledTooltipHostBase>
|
</StyledTooltipHostBase>
|
||||||
<StyledTooltipHostBase
|
<StyledTooltipHostBase
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import * as React from "react";
|
|||||||
import { JunoClient } from "../../../Juno/JunoClient";
|
import { JunoClient } from "../../../Juno/JunoClient";
|
||||||
import { HttpStatusCodes, CodeOfConductEndpoints } from "../../../Common/Constants";
|
import { HttpStatusCodes, CodeOfConductEndpoints } from "../../../Common/Constants";
|
||||||
import { Stack, Text, Checkbox, PrimaryButton, Link } from "office-ui-fabric-react";
|
import { Stack, Text, Checkbox, PrimaryButton, Link } from "office-ui-fabric-react";
|
||||||
import { handleError } from "../../../Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack, handleError } from "../../../Common/ErrorHandlingUtils";
|
||||||
|
import { trace, traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
|
import { Action } from "../../../Shared/Telemetry/TelemetryConstants";
|
||||||
|
|
||||||
export interface CodeOfConductComponentProps {
|
export interface CodeOfConductComponentProps {
|
||||||
junoClient: JunoClient;
|
junoClient: JunoClient;
|
||||||
@@ -14,11 +16,11 @@ interface CodeOfConductComponentState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class CodeOfConductComponent extends React.Component<CodeOfConductComponentProps, CodeOfConductComponentState> {
|
export class CodeOfConductComponent extends React.Component<CodeOfConductComponentProps, CodeOfConductComponentState> {
|
||||||
|
private viewCodeOfConductTraced: boolean;
|
||||||
private descriptionPara1: string;
|
private descriptionPara1: string;
|
||||||
private descriptionPara2: string;
|
private descriptionPara2: string;
|
||||||
private descriptionPara3: string;
|
private descriptionPara3: string;
|
||||||
private link1: { label: string; url: string };
|
private link1: { label: string; url: string };
|
||||||
private link2: { label: string; url: string };
|
|
||||||
|
|
||||||
constructor(props: CodeOfConductComponentProps) {
|
constructor(props: CodeOfConductComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -27,23 +29,34 @@ export class CodeOfConductComponent extends React.Component<CodeOfConductCompone
|
|||||||
readCodeOfConduct: false,
|
readCodeOfConduct: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.descriptionPara1 = "Azure CosmosDB Notebook Gallery - Code of Conduct and Privacy Statement";
|
this.descriptionPara1 = "Azure Cosmos DB Notebook Gallery - Code of Conduct";
|
||||||
this.descriptionPara2 =
|
this.descriptionPara2 = "The notebook public gallery contains notebook samples shared by users of Azure Cosmos DB.";
|
||||||
"Azure Cosmos DB Notebook Public Gallery contains notebook samples shared by users of Cosmos DB.";
|
this.descriptionPara3 = "In order to view and publish your samples to the gallery, you must accept the ";
|
||||||
this.descriptionPara3 = "In order to access Azure Cosmos DB Notebook Gallery resources, you must accept the ";
|
this.link1 = { label: "code of conduct.", url: CodeOfConductEndpoints.codeOfConduct };
|
||||||
this.link1 = { label: "code of conduct", url: CodeOfConductEndpoints.codeOfConduct };
|
|
||||||
this.link2 = { label: "privacy statement", url: CodeOfConductEndpoints.privacyStatement };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async acceptCodeOfConduct(): Promise<void> {
|
private async acceptCodeOfConduct(): Promise<void> {
|
||||||
|
const startKey = traceStart(Action.NotebooksGalleryAcceptCodeOfConduct);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await this.props.junoClient.acceptCodeOfConduct();
|
const response = await this.props.junoClient.acceptCodeOfConduct();
|
||||||
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
||||||
throw new Error(`Received HTTP ${response.status} when accepting code of conduct`);
|
throw new Error(`Received HTTP ${response.status} when accepting code of conduct`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceSuccess(Action.NotebooksGalleryAcceptCodeOfConduct, {}, startKey);
|
||||||
|
|
||||||
this.props.onAcceptCodeOfConduct(response.data);
|
this.props.onAcceptCodeOfConduct(response.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
traceFailure(
|
||||||
|
Action.NotebooksGalleryAcceptCodeOfConduct,
|
||||||
|
{
|
||||||
|
error: getErrorMessage(error),
|
||||||
|
errorStack: getErrorStack(error),
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
|
||||||
handleError(error, "CodeOfConductComponent/acceptCodeOfConduct", "Failed to accept code of conduct");
|
handleError(error, "CodeOfConductComponent/acceptCodeOfConduct", "Failed to accept code of conduct");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,6 +66,11 @@ export class CodeOfConductComponent extends React.Component<CodeOfConductCompone
|
|||||||
};
|
};
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
if (!this.viewCodeOfConductTraced) {
|
||||||
|
this.viewCodeOfConductTraced = true;
|
||||||
|
trace(Action.NotebooksGalleryViewCodeOfConduct);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack tokens={{ childrenGap: 20 }}>
|
<Stack tokens={{ childrenGap: 20 }}>
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
@@ -69,10 +87,6 @@ export class CodeOfConductComponent extends React.Component<CodeOfConductCompone
|
|||||||
<Link href={this.link1.url} target="_blank">
|
<Link href={this.link1.url} target="_blank">
|
||||||
{this.link1.label}
|
{this.link1.label}
|
||||||
</Link>
|
</Link>
|
||||||
{" and "}
|
|
||||||
<Link href={this.link2.url} target="_blank">
|
|
||||||
{this.link2.label}
|
|
||||||
</Link>
|
|
||||||
</Text>
|
</Text>
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
|
|
||||||
@@ -87,7 +101,7 @@ export class CodeOfConductComponent extends React.Component<CodeOfConductCompone
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
label="I have read and accepted the code of conduct and privacy statement"
|
label="I have read and accept the code of conduct."
|
||||||
onChange={this.onChangeCheckbox}
|
onChange={this.onChangeCheckbox}
|
||||||
/>
|
/>
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
|
|||||||
@@ -7,14 +7,20 @@ import {
|
|||||||
} from "./GalleryAndNotebookViewerComponent";
|
} from "./GalleryAndNotebookViewerComponent";
|
||||||
|
|
||||||
export class GalleryAndNotebookViewerComponentAdapter implements ReactAdapter {
|
export class GalleryAndNotebookViewerComponentAdapter implements ReactAdapter {
|
||||||
|
private key: string;
|
||||||
public parameters: ko.Observable<number>;
|
public parameters: ko.Observable<number>;
|
||||||
|
|
||||||
constructor(private props: GalleryAndNotebookViewerComponentProps) {
|
constructor(private props: GalleryAndNotebookViewerComponentProps) {
|
||||||
|
this.reset();
|
||||||
this.parameters = ko.observable<number>(Date.now());
|
this.parameters = ko.observable<number>(Date.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
public renderComponent(): JSX.Element {
|
public renderComponent(): JSX.Element {
|
||||||
return <GalleryAndNotebookViewerComponent {...this.props} />;
|
return <GalleryAndNotebookViewerComponent key={this.key} {...this.props} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
public reset(): void {
|
||||||
|
this.key = `GalleryAndNotebookViewerComponent-${Date.now()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public triggerRender(): void {
|
public triggerRender(): void {
|
||||||
|
|||||||
@@ -6,4 +6,16 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: @DataExplorerFont;
|
font-family: @DataExplorerFont;
|
||||||
|
background: @GalleryBackgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publicGalleryTabContainer {
|
||||||
|
position: relative;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publicGalleryTabOverlayContent {
|
||||||
|
background: white;
|
||||||
|
padding: 20px;
|
||||||
|
margin: 10%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,21 @@ import {
|
|||||||
IPivotProps,
|
IPivotProps,
|
||||||
IRectangle,
|
IRectangle,
|
||||||
Label,
|
Label,
|
||||||
|
Link,
|
||||||
List,
|
List,
|
||||||
|
Overlay,
|
||||||
Pivot,
|
Pivot,
|
||||||
PivotItem,
|
PivotItem,
|
||||||
SearchBox,
|
SearchBox,
|
||||||
|
Spinner,
|
||||||
|
SpinnerSize,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
} from "office-ui-fabric-react";
|
} from "office-ui-fabric-react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { IGalleryItem, IJunoResponse, IPublicGalleryData, JunoClient } from "../../../Juno/JunoClient";
|
import { IGalleryItem, IJunoResponse, IPublicGalleryData, JunoClient } from "../../../Juno/JunoClient";
|
||||||
import * as GalleryUtils from "../../../Utils/GalleryUtils";
|
import * as GalleryUtils from "../../../Utils/GalleryUtils";
|
||||||
import { DialogComponent, DialogProps } from "../DialogReactComponent/DialogComponent";
|
import { Dialog, DialogProps } from "../Dialog";
|
||||||
import { GalleryCardComponent, GalleryCardComponentProps } from "./Cards/GalleryCardComponent";
|
import { GalleryCardComponent, GalleryCardComponentProps } from "./Cards/GalleryCardComponent";
|
||||||
import "./GalleryViewerComponent.less";
|
import "./GalleryViewerComponent.less";
|
||||||
import { HttpStatusCodes } from "../../../Common/Constants";
|
import { HttpStatusCodes } from "../../../Common/Constants";
|
||||||
@@ -27,6 +31,8 @@ import Explorer from "../../Explorer";
|
|||||||
import { CodeOfConductComponent } from "./CodeOfConductComponent";
|
import { CodeOfConductComponent } from "./CodeOfConductComponent";
|
||||||
import { InfoComponent } from "./InfoComponent/InfoComponent";
|
import { InfoComponent } from "./InfoComponent/InfoComponent";
|
||||||
import { handleError } from "../../../Common/ErrorHandlingUtils";
|
import { handleError } from "../../../Common/ErrorHandlingUtils";
|
||||||
|
import { trace } from "../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
|
import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
|
||||||
|
|
||||||
export interface GalleryViewerComponentProps {
|
export interface GalleryViewerComponentProps {
|
||||||
container?: Explorer;
|
container?: Explorer;
|
||||||
@@ -41,8 +47,8 @@ export interface GalleryViewerComponentProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum GalleryTab {
|
export enum GalleryTab {
|
||||||
OfficialSamples,
|
|
||||||
PublicGallery,
|
PublicGallery,
|
||||||
|
OfficialSamples,
|
||||||
Favorites,
|
Favorites,
|
||||||
Published,
|
Published,
|
||||||
}
|
}
|
||||||
@@ -64,6 +70,8 @@ interface GalleryViewerComponentState {
|
|||||||
searchText: string;
|
searchText: string;
|
||||||
dialogProps: DialogProps;
|
dialogProps: DialogProps;
|
||||||
isCodeOfConductAccepted: boolean;
|
isCodeOfConductAccepted: boolean;
|
||||||
|
isFetchingPublishedNotebooks: boolean;
|
||||||
|
isFetchingFavouriteNotebooks: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GalleryTabInfo {
|
interface GalleryTabInfo {
|
||||||
@@ -74,18 +82,24 @@ interface GalleryTabInfo {
|
|||||||
export class GalleryViewerComponent extends React.Component<GalleryViewerComponentProps, GalleryViewerComponentState> {
|
export class GalleryViewerComponent extends React.Component<GalleryViewerComponentProps, GalleryViewerComponentState> {
|
||||||
public static readonly OfficialSamplesTitle = "Official samples";
|
public static readonly OfficialSamplesTitle = "Official samples";
|
||||||
public static readonly PublicGalleryTitle = "Public gallery";
|
public static readonly PublicGalleryTitle = "Public gallery";
|
||||||
public static readonly FavoritesTitle = "Liked";
|
public static readonly FavoritesTitle = "My favorites";
|
||||||
public static readonly PublishedTitle = "Your published work";
|
public static readonly PublishedTitle = "My published work";
|
||||||
|
|
||||||
private static readonly rowsPerPage = 5;
|
private static readonly rowsPerPage = 5;
|
||||||
|
|
||||||
private static readonly mostViewedText = "Most viewed";
|
private static readonly mostViewedText = "Most viewed";
|
||||||
private static readonly mostDownloadedText = "Most downloaded";
|
private static readonly mostDownloadedText = "Most downloaded";
|
||||||
private static readonly mostFavoritedText = "Most liked";
|
private static readonly mostFavoritedText = "Most favorited";
|
||||||
private static readonly mostRecentText = "Most recent";
|
private static readonly mostRecentText = "Most recent";
|
||||||
|
|
||||||
private readonly sortingOptions: IDropdownOption[];
|
private readonly sortingOptions: IDropdownOption[];
|
||||||
|
|
||||||
|
private viewGalleryTraced: boolean;
|
||||||
|
private viewOfficialSamplesTraced: boolean;
|
||||||
|
private viewPublicGalleryTraced: boolean;
|
||||||
|
private viewFavoritesTraced: boolean;
|
||||||
|
private viewPublishedNotebooksTraced: boolean;
|
||||||
|
|
||||||
private sampleNotebooks: IGalleryItem[];
|
private sampleNotebooks: IGalleryItem[];
|
||||||
private publicNotebooks: IGalleryItem[];
|
private publicNotebooks: IGalleryItem[];
|
||||||
private favoriteNotebooks: IGalleryItem[];
|
private favoriteNotebooks: IGalleryItem[];
|
||||||
@@ -107,6 +121,8 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
searchText: props.searchText,
|
searchText: props.searchText,
|
||||||
dialogProps: undefined,
|
dialogProps: undefined,
|
||||||
isCodeOfConductAccepted: undefined,
|
isCodeOfConductAccepted: undefined,
|
||||||
|
isFetchingFavouriteNotebooks: true,
|
||||||
|
isFetchingPublishedNotebooks: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sortingOptions = [
|
this.sortingOptions = [
|
||||||
@@ -123,37 +139,30 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
text: GalleryViewerComponent.mostRecentText,
|
text: GalleryViewerComponent.mostRecentText,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (this.props.container?.isGalleryPublishEnabled()) {
|
this.sortingOptions.push({
|
||||||
this.sortingOptions.push({
|
key: SortBy.MostFavorited,
|
||||||
key: SortBy.MostFavorited,
|
text: GalleryViewerComponent.mostFavoritedText,
|
||||||
text: GalleryViewerComponent.mostFavoritedText,
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loadTabContent(this.state.selectedTab, this.state.searchText, this.state.sortBy, false);
|
this.loadTabContent(this.state.selectedTab, this.state.searchText, this.state.sortBy, false);
|
||||||
if (this.props.container?.isGalleryPublishEnabled()) {
|
this.loadFavoriteNotebooks(this.state.searchText, this.state.sortBy, false); // Need this to show correct favorite button state
|
||||||
this.loadFavoriteNotebooks(this.state.searchText, this.state.sortBy, false); // Need this to show correct favorite button state
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const tabs: GalleryTabInfo[] = [this.createSamplesTab(GalleryTab.OfficialSamples, this.state.sampleNotebooks)];
|
this.traceViewGallery();
|
||||||
|
|
||||||
if (this.props.container?.isGalleryPublishEnabled()) {
|
const tabs: GalleryTabInfo[] = [
|
||||||
tabs.push(
|
this.createPublicGalleryTab(
|
||||||
this.createPublicGalleryTab(
|
GalleryTab.PublicGallery,
|
||||||
GalleryTab.PublicGallery,
|
this.state.publicNotebooks,
|
||||||
this.state.publicNotebooks,
|
this.state.isCodeOfConductAccepted
|
||||||
this.state.isCodeOfConductAccepted
|
),
|
||||||
)
|
this.createSamplesTab(GalleryTab.OfficialSamples, this.state.sampleNotebooks),
|
||||||
);
|
];
|
||||||
|
|
||||||
|
if (this.props.container) {
|
||||||
tabs.push(this.createFavoritesTab(GalleryTab.Favorites, this.state.favoriteNotebooks));
|
tabs.push(this.createFavoritesTab(GalleryTab.Favorites, this.state.favoriteNotebooks));
|
||||||
|
tabs.push(this.createPublishedNotebooksTab(GalleryTab.Published, this.state.publishedNotebooks));
|
||||||
// explicitly checking if isCodeOfConductAccepted is not false, as it is initially undefined.
|
|
||||||
// Displaying code of conduct component on gallery load should not be the default behavior.
|
|
||||||
if (this.state.isCodeOfConductAccepted !== false) {
|
|
||||||
tabs.push(this.createPublishedNotebooksTab(GalleryTab.Published, this.state.publishedNotebooks));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const pivotProps: IPivotProps = {
|
const pivotProps: IPivotProps = {
|
||||||
@@ -179,16 +188,63 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
<div className="galleryContainer">
|
<div className="galleryContainer">
|
||||||
<Pivot {...pivotProps}>{pivotItems}</Pivot>
|
<Pivot {...pivotProps}>{pivotItems}</Pivot>
|
||||||
|
|
||||||
{this.state.dialogProps && <DialogComponent {...this.state.dialogProps} />}
|
{this.state.dialogProps && <Dialog {...this.state.dialogProps} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private traceViewGallery = (): void => {
|
||||||
|
if (!this.viewGalleryTraced) {
|
||||||
|
this.viewGalleryTraced = true;
|
||||||
|
trace(Action.NotebooksGalleryViewGallery);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (this.state.selectedTab) {
|
||||||
|
case GalleryTab.PublicGallery:
|
||||||
|
if (!this.viewPublicGalleryTraced) {
|
||||||
|
this.resetViewGalleryTabTracedFlags();
|
||||||
|
this.viewPublicGalleryTraced = true;
|
||||||
|
trace(Action.NotebooksGalleryViewPublicGallery);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GalleryTab.OfficialSamples:
|
||||||
|
if (!this.viewOfficialSamplesTraced) {
|
||||||
|
this.resetViewGalleryTabTracedFlags();
|
||||||
|
this.viewOfficialSamplesTraced = true;
|
||||||
|
trace(Action.NotebooksGalleryViewOfficialSamples);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GalleryTab.Favorites:
|
||||||
|
if (!this.viewFavoritesTraced) {
|
||||||
|
this.resetViewGalleryTabTracedFlags();
|
||||||
|
this.viewFavoritesTraced = true;
|
||||||
|
trace(Action.NotebooksGalleryViewFavorites);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GalleryTab.Published:
|
||||||
|
if (!this.viewPublishedNotebooksTraced) {
|
||||||
|
this.resetViewGalleryTabTracedFlags();
|
||||||
|
this.viewPublishedNotebooksTraced = true;
|
||||||
|
trace(Action.NotebooksGalleryViewPublishedNotebooks);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(`Unknown selected tab ${this.state.selectedTab}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private resetViewGalleryTabTracedFlags = (): void => {
|
||||||
|
this.viewOfficialSamplesTraced = false;
|
||||||
|
this.viewPublicGalleryTraced = false;
|
||||||
|
this.viewFavoritesTraced = false;
|
||||||
|
this.viewPublishedNotebooksTraced = false;
|
||||||
|
};
|
||||||
|
|
||||||
private isEmptyData = (data: IGalleryItem[]): boolean => {
|
private isEmptyData = (data: IGalleryItem[]): boolean => {
|
||||||
return !data || data.length === 0;
|
return !data || data.length === 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
private createEmptyTabContent = (iconName: string, line1: string, line2: string): JSX.Element => {
|
private createEmptyTabContent = (iconName: string, line1: JSX.Element, line2: JSX.Element): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<Stack horizontalAlign="center" tokens={{ childrenGap: 10 }}>
|
<Stack horizontalAlign="center" tokens={{ childrenGap: 10 }}>
|
||||||
<FontIcon iconName={iconName} style={{ fontSize: 100, color: "lightgray", marginTop: 20 }} />
|
<FontIcon iconName={iconName} style={{ fontSize: 100, color: "lightgray", marginTop: 20 }} />
|
||||||
@@ -216,40 +272,63 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getFavouriteNotebooksTabContent = (data: IGalleryItem[]) => {
|
||||||
|
if (this.isEmptyData(data)) {
|
||||||
|
if (this.state.isFetchingFavouriteNotebooks) {
|
||||||
|
return <Spinner size={SpinnerSize.large} />;
|
||||||
|
}
|
||||||
|
return this.createEmptyTabContent(
|
||||||
|
"ContactHeart",
|
||||||
|
<>You don't have any favorites yet</>,
|
||||||
|
<>
|
||||||
|
Favorite any notebook from the{" "}
|
||||||
|
<Link onClick={() => this.setState({ selectedTab: GalleryTab.OfficialSamples })}>official samples</Link> or{" "}
|
||||||
|
<Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return this.createSearchBarHeader(this.createCardsTabContent(data));
|
||||||
|
};
|
||||||
|
|
||||||
private createFavoritesTab(tab: GalleryTab, data: IGalleryItem[]): GalleryTabInfo {
|
private createFavoritesTab(tab: GalleryTab, data: IGalleryItem[]): GalleryTabInfo {
|
||||||
return {
|
return {
|
||||||
tab,
|
tab,
|
||||||
content: this.isEmptyData(data)
|
content: this.getFavouriteNotebooksTabContent(data),
|
||||||
? this.createEmptyTabContent(
|
|
||||||
"ContactHeart",
|
|
||||||
"You have not liked anything",
|
|
||||||
"Like any notebook from Official Samples or Public gallery"
|
|
||||||
)
|
|
||||||
: this.createSearchBarHeader(this.createCardsTabContent(data)),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getPublishedNotebooksTabContent = (data: IGalleryItem[]) => {
|
||||||
|
if (this.isEmptyData(data)) {
|
||||||
|
if (this.state.isFetchingPublishedNotebooks) {
|
||||||
|
return <Spinner size={SpinnerSize.large} />;
|
||||||
|
}
|
||||||
|
return this.createEmptyTabContent(
|
||||||
|
"Contact",
|
||||||
|
<>
|
||||||
|
You have not published anything to the{" "}
|
||||||
|
<Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link> yet
|
||||||
|
</>,
|
||||||
|
<>Publish your notebooks to share your work with other users</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return this.createPublishedNotebooksTabContent(data);
|
||||||
|
};
|
||||||
|
|
||||||
private createPublishedNotebooksTab = (tab: GalleryTab, data: IGalleryItem[]): GalleryTabInfo => {
|
private createPublishedNotebooksTab = (tab: GalleryTab, data: IGalleryItem[]): GalleryTabInfo => {
|
||||||
return {
|
return {
|
||||||
tab,
|
tab,
|
||||||
content: this.isEmptyData(data)
|
content: this.getPublishedNotebooksTabContent(data),
|
||||||
? this.createEmptyTabContent(
|
|
||||||
"Contact",
|
|
||||||
"You have not published anything",
|
|
||||||
"Publish your sample notebooks to share your published work with others"
|
|
||||||
)
|
|
||||||
: this.createPublishedNotebooksTabContent(data),
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
private createPublishedNotebooksTabContent = (data: IGalleryItem[]): JSX.Element => {
|
private createPublishedNotebooksTabContent = (data: IGalleryItem[]): JSX.Element => {
|
||||||
const { published, underReview, removed } = GalleryUtils.filterPublishedNotebooks(data);
|
const { published, underReview, removed } = GalleryUtils.filterPublishedNotebooks(data);
|
||||||
const content = (
|
const content = (
|
||||||
<Stack tokens={{ childrenGap: 10 }}>
|
<Stack tokens={{ childrenGap: 20 }}>
|
||||||
{published?.length > 0 &&
|
{published?.length > 0 &&
|
||||||
this.createPublishedNotebooksSectionContent(
|
this.createPublishedNotebooksSectionContent(
|
||||||
undefined,
|
undefined,
|
||||||
"You have successfully published the following notebook(s) to public gallery and shared with other Azure Cosmos DB users.",
|
"You have successfully published and shared the following notebook(s) to the public gallery.",
|
||||||
this.createCardsTabContent(published)
|
this.createCardsTabContent(published)
|
||||||
)}
|
)}
|
||||||
{underReview?.length > 0 &&
|
{underReview?.length > 0 &&
|
||||||
@@ -276,31 +355,40 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
content: JSX.Element
|
content: JSX.Element
|
||||||
): JSX.Element => {
|
): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<Stack tokens={{ childrenGap: 5 }}>
|
<Stack tokens={{ childrenGap: 10 }}>
|
||||||
{title && <Text styles={{ root: { fontWeight: FontWeights.semibold } }}>{title}</Text>}
|
{title && (
|
||||||
{description && <Text>{description}</Text>}
|
<Text styles={{ root: { fontWeight: FontWeights.semibold, marginLeft: 10, marginRight: 10 } }}>{title}</Text>
|
||||||
|
)}
|
||||||
|
{description && <Text styles={{ root: { marginLeft: 10, marginRight: 10 } }}>{description}</Text>}
|
||||||
{content}
|
{content}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
private createPublicGalleryTabContent(data: IGalleryItem[], acceptedCodeOfConduct: boolean): JSX.Element {
|
private createPublicGalleryTabContent(data: IGalleryItem[], acceptedCodeOfConduct: boolean): JSX.Element {
|
||||||
return acceptedCodeOfConduct === false ? (
|
return (
|
||||||
<CodeOfConductComponent
|
<div className="publicGalleryTabContainer">
|
||||||
junoClient={this.props.junoClient}
|
{this.createSearchBarHeader(this.createCardsTabContent(data))}
|
||||||
onAcceptCodeOfConduct={(result: boolean) => {
|
{acceptedCodeOfConduct === false && (
|
||||||
this.setState({ isCodeOfConductAccepted: result });
|
<Overlay isDarkThemed>
|
||||||
}}
|
<div className="publicGalleryTabOverlayContent">
|
||||||
/>
|
<CodeOfConductComponent
|
||||||
) : (
|
junoClient={this.props.junoClient}
|
||||||
this.createSearchBarHeader(this.createCardsTabContent(data))
|
onAcceptCodeOfConduct={(result: boolean) => {
|
||||||
|
this.setState({ isCodeOfConductAccepted: result });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Overlay>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private createSearchBarHeader(content: JSX.Element): JSX.Element {
|
private createSearchBarHeader(content: JSX.Element): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Stack tokens={{ childrenGap: 10 }}>
|
<Stack tokens={{ childrenGap: 10 }}>
|
||||||
<Stack horizontal tokens={{ childrenGap: 20, padding: 10 }}>
|
<Stack horizontal wrap tokens={{ childrenGap: 20, padding: 10 }}>
|
||||||
<Stack.Item grow>
|
<Stack.Item grow>
|
||||||
<SearchBox value={this.state.searchText} placeholder="Search" onChange={this.onSearchBoxChange} />
|
<SearchBox value={this.state.searchText} placeholder="Search" onChange={this.onSearchBoxChange} />
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
@@ -310,11 +398,9 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
<Stack.Item styles={{ root: { minWidth: 200 } }}>
|
<Stack.Item styles={{ root: { minWidth: 200 } }}>
|
||||||
<Dropdown options={this.sortingOptions} selectedKey={this.state.sortBy} onChange={this.onDropdownChange} />
|
<Dropdown options={this.sortingOptions} selectedKey={this.state.sortBy} onChange={this.onDropdownChange} />
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
{(!this.props.container || this.props.container.isGalleryPublishEnabled()) && (
|
<Stack.Item>
|
||||||
<Stack.Item>
|
<InfoComponent />
|
||||||
<InfoComponent />
|
</Stack.Item>
|
||||||
</Stack.Item>
|
|
||||||
)}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack.Item>{content}</Stack.Item>
|
<Stack.Item>{content}</Stack.Item>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -322,7 +408,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createCardsTabContent(data: IGalleryItem[]): JSX.Element {
|
private createCardsTabContent(data: IGalleryItem[]): JSX.Element {
|
||||||
return (
|
return data ? (
|
||||||
<FocusZone>
|
<FocusZone>
|
||||||
<List
|
<List
|
||||||
items={data}
|
items={data}
|
||||||
@@ -331,12 +417,14 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
onRenderCell={this.onRenderCell}
|
onRenderCell={this.onRenderCell}
|
||||||
/>
|
/>
|
||||||
</FocusZone>
|
</FocusZone>
|
||||||
|
) : (
|
||||||
|
<Spinner size={SpinnerSize.large} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private createPolicyViolationsListContent(data: IGalleryItem[]): JSX.Element {
|
private createPolicyViolationsListContent(data: IGalleryItem[]): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<table>
|
<table style={{ margin: 10 }}>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
@@ -355,14 +443,14 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
|
|
||||||
private loadTabContent(tab: GalleryTab, searchText: string, sortBy: SortBy, offline: boolean): void {
|
private loadTabContent(tab: GalleryTab, searchText: string, sortBy: SortBy, offline: boolean): void {
|
||||||
switch (tab) {
|
switch (tab) {
|
||||||
case GalleryTab.OfficialSamples:
|
|
||||||
this.loadSampleNotebooks(searchText, sortBy, offline);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GalleryTab.PublicGallery:
|
case GalleryTab.PublicGallery:
|
||||||
this.loadPublicNotebooks(searchText, sortBy, offline);
|
this.loadPublicNotebooks(searchText, sortBy, offline);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GalleryTab.OfficialSamples:
|
||||||
|
this.loadSampleNotebooks(searchText, sortBy, offline);
|
||||||
|
break;
|
||||||
|
|
||||||
case GalleryTab.Favorites:
|
case GalleryTab.Favorites:
|
||||||
this.loadFavoriteNotebooks(searchText, sortBy, offline);
|
this.loadFavoriteNotebooks(searchText, sortBy, offline);
|
||||||
break;
|
break;
|
||||||
@@ -385,6 +473,10 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.sampleNotebooks = response.data;
|
this.sampleNotebooks = response.data;
|
||||||
|
|
||||||
|
trace(Action.NotebooksGalleryOfficialSamplesCount, ActionModifiers.Mark, {
|
||||||
|
count: this.sampleNotebooks?.length,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "GalleryViewerComponent/loadSampleNotebooks", "Failed to load sample notebooks");
|
handleError(error, "GalleryViewerComponent/loadSampleNotebooks", "Failed to load sample notebooks");
|
||||||
}
|
}
|
||||||
@@ -411,6 +503,8 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
||||||
throw new Error(`Received HTTP ${response.status} when loading public notebooks`);
|
throw new Error(`Received HTTP ${response.status} when loading public notebooks`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace(Action.NotebooksGalleryPublicGalleryCount, ActionModifiers.Mark, { count: this.publicNotebooks?.length });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "GalleryViewerComponent/loadPublicNotebooks", "Failed to load public notebooks");
|
handleError(error, "GalleryViewerComponent/loadPublicNotebooks", "Failed to load public notebooks");
|
||||||
}
|
}
|
||||||
@@ -425,14 +519,19 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
private async loadFavoriteNotebooks(searchText: string, sortBy: SortBy, offline: boolean): Promise<void> {
|
private async loadFavoriteNotebooks(searchText: string, sortBy: SortBy, offline: boolean): Promise<void> {
|
||||||
if (!offline) {
|
if (!offline) {
|
||||||
try {
|
try {
|
||||||
|
this.setState({ isFetchingFavouriteNotebooks: true });
|
||||||
const response = await this.props.junoClient.getFavoriteNotebooks();
|
const response = await this.props.junoClient.getFavoriteNotebooks();
|
||||||
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
||||||
throw new Error(`Received HTTP ${response.status} when loading favorite notebooks`);
|
throw new Error(`Received HTTP ${response.status} when loading favorite notebooks`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.favoriteNotebooks = response.data;
|
this.favoriteNotebooks = response.data;
|
||||||
|
|
||||||
|
trace(Action.NotebooksGalleryFavoritesCount, ActionModifiers.Mark, { count: this.favoriteNotebooks?.length });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "GalleryViewerComponent/loadFavoriteNotebooks", "Failed to load favorite notebooks");
|
handleError(error, "GalleryViewerComponent/loadFavoriteNotebooks", "Failed to load favorite notebooks");
|
||||||
|
} finally {
|
||||||
|
this.setState({ isFetchingFavouriteNotebooks: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,14 +550,25 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
private async loadPublishedNotebooks(searchText: string, sortBy: SortBy, offline: boolean): Promise<void> {
|
private async loadPublishedNotebooks(searchText: string, sortBy: SortBy, offline: boolean): Promise<void> {
|
||||||
if (!offline) {
|
if (!offline) {
|
||||||
try {
|
try {
|
||||||
|
this.setState({ isFetchingPublishedNotebooks: true });
|
||||||
const response = await this.props.junoClient.getPublishedNotebooks();
|
const response = await this.props.junoClient.getPublishedNotebooks();
|
||||||
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
|
||||||
throw new Error(`Received HTTP ${response.status} when loading published notebooks`);
|
throw new Error(`Received HTTP ${response.status} when loading published notebooks`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.publishedNotebooks = response.data;
|
this.publishedNotebooks = response.data;
|
||||||
|
|
||||||
|
const { published, underReview, removed } = GalleryUtils.filterPublishedNotebooks(this.publishedNotebooks);
|
||||||
|
trace(Action.NotebooksGalleryPublishedCount, ActionModifiers.Mark, {
|
||||||
|
count: this.publishedNotebooks?.length,
|
||||||
|
publishedCount: published.length,
|
||||||
|
underReviewCount: underReview.length,
|
||||||
|
removedCount: removed.length,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "GalleryViewerComponent/loadPublishedNotebooks", "Failed to load published notebooks");
|
handleError(error, "GalleryViewerComponent/loadPublishedNotebooks", "Failed to load published notebooks");
|
||||||
|
} finally {
|
||||||
|
this.setState({ isFetchingPublishedNotebooks: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -544,10 +654,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
};
|
};
|
||||||
|
|
||||||
private onRenderCell = (data?: IGalleryItem): JSX.Element => {
|
private onRenderCell = (data?: IGalleryItem): JSX.Element => {
|
||||||
let isFavorite: boolean;
|
const isFavorite = this.favoriteNotebooks?.find((item) => item.id === data.id) !== undefined;
|
||||||
if (this.props.container?.isGalleryPublishEnabled()) {
|
|
||||||
isFavorite = this.favoriteNotebooks?.find((item) => item.id === data.id) !== undefined;
|
|
||||||
}
|
|
||||||
const props: GalleryCardComponentProps = {
|
const props: GalleryCardComponentProps = {
|
||||||
data,
|
data,
|
||||||
isFavorite,
|
isFavorite,
|
||||||
@@ -558,7 +665,8 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
onFavoriteClick: () => this.favoriteItem(data),
|
onFavoriteClick: () => this.favoriteItem(data),
|
||||||
onUnfavoriteClick: () => this.unfavoriteItem(data),
|
onUnfavoriteClick: () => this.unfavoriteItem(data),
|
||||||
onDownloadClick: () => this.downloadItem(data),
|
onDownloadClick: () => this.downloadItem(data),
|
||||||
onDeleteClick: () => this.deleteItem(data),
|
onDeleteClick: (beforeDelete: () => void, afterDelete: () => void) =>
|
||||||
|
this.deleteItem(data, beforeDelete, afterDelete),
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -602,11 +710,18 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
private deleteItem = async (data: IGalleryItem): Promise<void> => {
|
private deleteItem = async (data: IGalleryItem, beforeDelete: () => void, afterDelete: () => void): Promise<void> => {
|
||||||
GalleryUtils.deleteItem(this.props.container, this.props.junoClient, data, (item) => {
|
GalleryUtils.deleteItem(
|
||||||
this.publishedNotebooks = this.publishedNotebooks?.filter((notebook) => item.id !== notebook.id);
|
this.props.container,
|
||||||
this.refreshSelectedTab(item);
|
this.props.junoClient,
|
||||||
});
|
data,
|
||||||
|
(item) => {
|
||||||
|
this.publishedNotebooks = this.publishedNotebooks?.filter((notebook) => item.id !== notebook.id);
|
||||||
|
this.refreshSelectedTab(item);
|
||||||
|
},
|
||||||
|
beforeDelete,
|
||||||
|
afterDelete
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
private onPivotChange = (item: PivotItem): void => {
|
private onPivotChange = (item: PivotItem): void => {
|
||||||
|
|||||||
@@ -17,35 +17,28 @@ exports[`CodeOfConductComponent renders 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Azure CosmosDB Notebook Gallery - Code of Conduct and Privacy Statement
|
Azure Cosmos DB Notebook Gallery - Code of Conduct
|
||||||
</Text>
|
</Text>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<Text>
|
<Text>
|
||||||
Azure Cosmos DB Notebook Public Gallery contains notebook samples shared by users of Cosmos DB.
|
The notebook public gallery contains notebook samples shared by users of Azure Cosmos DB.
|
||||||
</Text>
|
</Text>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<Text>
|
<Text>
|
||||||
In order to access Azure Cosmos DB Notebook Gallery resources, you must accept the
|
In order to view and publish your samples to the gallery, you must accept the
|
||||||
<StyledLinkBase
|
<StyledLinkBase
|
||||||
href="https://aka.ms/cosmos-code-of-conduct"
|
href="https://aka.ms/cosmos-code-of-conduct"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
code of conduct
|
code of conduct.
|
||||||
</StyledLinkBase>
|
|
||||||
and
|
|
||||||
<StyledLinkBase
|
|
||||||
href="https://aka.ms/ms-privacy-policy"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
privacy statement
|
|
||||||
</StyledLinkBase>
|
</StyledLinkBase>
|
||||||
</Text>
|
</Text>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<StyledCheckboxBase
|
<StyledCheckboxBase
|
||||||
label="I have read and accepted the code of conduct and privacy statement"
|
label="I have read and accept the code of conduct."
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
|
|||||||
@@ -8,6 +8,95 @@ exports[`GalleryViewerComponent renders 1`] = `
|
|||||||
onLinkClick={[Function]}
|
onLinkClick={[Function]}
|
||||||
selectedKey="OfficialSamples"
|
selectedKey="OfficialSamples"
|
||||||
>
|
>
|
||||||
|
<PivotItem
|
||||||
|
headerText="Public gallery"
|
||||||
|
itemKey="PublicGallery"
|
||||||
|
key="PublicGallery"
|
||||||
|
style={
|
||||||
|
Object {
|
||||||
|
"marginTop": 20,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="publicGalleryTabContainer"
|
||||||
|
>
|
||||||
|
<Stack
|
||||||
|
tokens={
|
||||||
|
Object {
|
||||||
|
"childrenGap": 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Stack
|
||||||
|
horizontal={true}
|
||||||
|
tokens={
|
||||||
|
Object {
|
||||||
|
"childrenGap": 20,
|
||||||
|
"padding": 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wrap={true}
|
||||||
|
>
|
||||||
|
<StackItem
|
||||||
|
grow={true}
|
||||||
|
>
|
||||||
|
<StyledSearchBoxBase
|
||||||
|
onChange={[Function]}
|
||||||
|
placeholder="Search"
|
||||||
|
/>
|
||||||
|
</StackItem>
|
||||||
|
<StackItem>
|
||||||
|
<StyledLabelBase>
|
||||||
|
Sort by
|
||||||
|
</StyledLabelBase>
|
||||||
|
</StackItem>
|
||||||
|
<StackItem
|
||||||
|
styles={
|
||||||
|
Object {
|
||||||
|
"root": Object {
|
||||||
|
"minWidth": 200,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<StyledWithResponsiveMode
|
||||||
|
onChange={[Function]}
|
||||||
|
options={
|
||||||
|
Array [
|
||||||
|
Object {
|
||||||
|
"key": 0,
|
||||||
|
"text": "Most viewed",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"key": 1,
|
||||||
|
"text": "Most downloaded",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"key": 3,
|
||||||
|
"text": "Most recent",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"key": 2,
|
||||||
|
"text": "Most favorited",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
selectedKey={0}
|
||||||
|
/>
|
||||||
|
</StackItem>
|
||||||
|
<StackItem>
|
||||||
|
<InfoComponent />
|
||||||
|
</StackItem>
|
||||||
|
</Stack>
|
||||||
|
<StackItem>
|
||||||
|
<StyledSpinnerBase
|
||||||
|
size={3}
|
||||||
|
/>
|
||||||
|
</StackItem>
|
||||||
|
</Stack>
|
||||||
|
</div>
|
||||||
|
</PivotItem>
|
||||||
<PivotItem
|
<PivotItem
|
||||||
headerText="Official samples"
|
headerText="Official samples"
|
||||||
itemKey="OfficialSamples"
|
itemKey="OfficialSamples"
|
||||||
@@ -33,6 +122,7 @@ exports[`GalleryViewerComponent renders 1`] = `
|
|||||||
"padding": 10,
|
"padding": 10,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wrap={true}
|
||||||
>
|
>
|
||||||
<StackItem
|
<StackItem
|
||||||
grow={true}
|
grow={true}
|
||||||
@@ -72,6 +162,10 @@ exports[`GalleryViewerComponent renders 1`] = `
|
|||||||
"key": 3,
|
"key": 3,
|
||||||
"text": "Most recent",
|
"text": "Most recent",
|
||||||
},
|
},
|
||||||
|
Object {
|
||||||
|
"key": 2,
|
||||||
|
"text": "Most favorited",
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
selectedKey={0}
|
selectedKey={0}
|
||||||
@@ -82,19 +176,9 @@ exports[`GalleryViewerComponent renders 1`] = `
|
|||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<FocusZone
|
<StyledSpinnerBase
|
||||||
direction={2}
|
size={3}
|
||||||
isCircularNavigation={false}
|
/>
|
||||||
shouldRaiseClicks={true}
|
|
||||||
>
|
|
||||||
<List
|
|
||||||
getPageSpecification={[Function]}
|
|
||||||
onRenderCell={[Function]}
|
|
||||||
renderedWindowsAhead={3}
|
|
||||||
renderedWindowsBehind={2}
|
|
||||||
startIndex={0}
|
|
||||||
/>
|
|
||||||
</FocusZone>
|
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
|
|||||||
@@ -31,6 +31,26 @@ export interface NotebookMetadataComponentProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class NotebookMetadataComponent extends React.Component<NotebookMetadataComponentProps> {
|
export class NotebookMetadataComponent extends React.Component<NotebookMetadataComponentProps> {
|
||||||
|
private renderFavouriteButton = (): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<Text>
|
||||||
|
{this.props.isFavorite !== undefined ? (
|
||||||
|
<>
|
||||||
|
<IconButton
|
||||||
|
iconProps={{ iconName: this.props.isFavorite ? "HeartFill" : "Heart" }}
|
||||||
|
onClick={this.props.isFavorite ? this.props.onUnfavoriteClick : this.props.onFavoriteClick}
|
||||||
|
/>
|
||||||
|
{this.props.data.favorites} likes
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Icon iconName="Heart" /> {this.props.data.favorites} likes
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const options: Intl.DateTimeFormatOptions = {
|
const options: Intl.DateTimeFormatOptions = {
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
@@ -49,19 +69,7 @@ export class NotebookMetadataComponent extends React.Component<NotebookMetadataC
|
|||||||
</Text>
|
</Text>
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
|
|
||||||
<Stack.Item>
|
<Stack.Item>{this.renderFavouriteButton()}</Stack.Item>
|
||||||
<Text>
|
|
||||||
{this.props.isFavorite !== undefined && (
|
|
||||||
<>
|
|
||||||
<IconButton
|
|
||||||
iconProps={{ iconName: this.props.isFavorite ? "HeartFill" : "Heart" }}
|
|
||||||
onClick={this.props.isFavorite ? this.props.onUnfavoriteClick : this.props.onFavoriteClick}
|
|
||||||
/>
|
|
||||||
{this.props.data.favorites} likes
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
</Stack.Item>
|
|
||||||
|
|
||||||
{this.props.downloadButtonText && (
|
{this.props.downloadButtonText && (
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
|
|||||||
@@ -3,25 +3,23 @@
|
|||||||
*/
|
*/
|
||||||
import { Notebook } from "@nteract/commutable";
|
import { Notebook } from "@nteract/commutable";
|
||||||
import { createContentRef } from "@nteract/core";
|
import { createContentRef } from "@nteract/core";
|
||||||
import { IChoiceGroupProps, Icon, Link, ProgressIndicator } from "office-ui-fabric-react";
|
import { IChoiceGroupProps, Icon, IProgressIndicatorProps, Link, ProgressIndicator } from "office-ui-fabric-react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { contents } from "rx-jupyter";
|
import { contents } from "rx-jupyter";
|
||||||
import * as Logger from "../../../Common/Logger";
|
|
||||||
import { IGalleryItem, JunoClient } from "../../../Juno/JunoClient";
|
import { IGalleryItem, JunoClient } from "../../../Juno/JunoClient";
|
||||||
import * as GalleryUtils from "../../../Utils/GalleryUtils";
|
import * as GalleryUtils from "../../../Utils/GalleryUtils";
|
||||||
import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils";
|
|
||||||
import { ConsoleDataType } from "../../Menus/NotificationConsole/NotificationConsoleComponent";
|
|
||||||
import { NotebookClientV2 } from "../../Notebook/NotebookClientV2";
|
import { NotebookClientV2 } from "../../Notebook/NotebookClientV2";
|
||||||
import { NotebookComponentBootstrapper } from "../../Notebook/NotebookComponent/NotebookComponentBootstrapper";
|
import { NotebookComponentBootstrapper } from "../../Notebook/NotebookComponent/NotebookComponentBootstrapper";
|
||||||
import NotebookReadOnlyRenderer from "../../Notebook/NotebookRenderer/NotebookReadOnlyRenderer";
|
import NotebookReadOnlyRenderer from "../../Notebook/NotebookRenderer/NotebookReadOnlyRenderer";
|
||||||
import { DialogComponent, DialogProps, TextFieldProps } from "../DialogReactComponent/DialogComponent";
|
import { Dialog, DialogProps, TextFieldProps } from "../Dialog";
|
||||||
import { NotebookMetadataComponent } from "./NotebookMetadataComponent";
|
import { NotebookMetadataComponent } from "./NotebookMetadataComponent";
|
||||||
import "./NotebookViewerComponent.less";
|
import "./NotebookViewerComponent.less";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { NotebookV4 } from "@nteract/commutable/lib/v4";
|
|
||||||
import { SessionStorageUtility } from "../../../Shared/StorageUtility";
|
import { SessionStorageUtility } from "../../../Shared/StorageUtility";
|
||||||
import { DialogHost } from "../../../Utils/GalleryUtils";
|
import { DialogHost } from "../../../Utils/GalleryUtils";
|
||||||
import { getErrorMessage, handleError } from "../../../Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack, handleError } from "../../../Common/ErrorHandlingUtils";
|
||||||
|
import { traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
|
import { Action } from "../../../Shared/Telemetry/TelemetryConstants";
|
||||||
|
|
||||||
export interface NotebookViewerComponentProps {
|
export interface NotebookViewerComponentProps {
|
||||||
container?: Explorer;
|
container?: Explorer;
|
||||||
@@ -80,6 +78,12 @@ export class NotebookViewerComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async loadNotebookContent(): Promise<void> {
|
private async loadNotebookContent(): Promise<void> {
|
||||||
|
const startKey = traceStart(Action.NotebooksGalleryViewNotebook, {
|
||||||
|
notebookUrl: this.props.notebookUrl,
|
||||||
|
notebookId: this.props.galleryItem?.id,
|
||||||
|
isSample: this.props.galleryItem?.isSample,
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(this.props.notebookUrl);
|
const response = await fetch(this.props.notebookUrl);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
@@ -87,8 +91,18 @@ export class NotebookViewerComponent
|
|||||||
throw new Error(`Received HTTP ${response.status} while fetching ${this.props.notebookUrl}`);
|
throw new Error(`Received HTTP ${response.status} while fetching ${this.props.notebookUrl}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceSuccess(
|
||||||
|
Action.NotebooksGalleryViewNotebook,
|
||||||
|
{
|
||||||
|
notebookUrl: this.props.notebookUrl,
|
||||||
|
notebookId: this.props.galleryItem?.id,
|
||||||
|
isSample: this.props.galleryItem?.isSample,
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
|
||||||
const notebook: Notebook = await response.json();
|
const notebook: Notebook = await response.json();
|
||||||
this.removeNotebookViewerLink(notebook, this.props.galleryItem?.newCellId);
|
GalleryUtils.removeNotebookViewerLink(notebook, this.props.galleryItem?.newCellId);
|
||||||
this.notebookComponentBootstrapper.setContent("json", notebook);
|
this.notebookComponentBootstrapper.setContent("json", notebook);
|
||||||
this.setState({ content: notebook, showProgressBar: false });
|
this.setState({ content: notebook, showProgressBar: false });
|
||||||
|
|
||||||
@@ -101,22 +115,23 @@ export class NotebookViewerComponent
|
|||||||
SessionStorageUtility.setEntry(this.props.galleryItem?.id, "true");
|
SessionStorageUtility.setEntry(this.props.galleryItem?.id, "true");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
traceFailure(
|
||||||
|
Action.NotebooksGalleryViewNotebook,
|
||||||
|
{
|
||||||
|
notebookUrl: this.props.notebookUrl,
|
||||||
|
notebookId: this.props.galleryItem?.id,
|
||||||
|
isSample: this.props.galleryItem?.isSample,
|
||||||
|
error: getErrorMessage(error),
|
||||||
|
errorStack: getErrorStack(error),
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
|
||||||
this.setState({ showProgressBar: false });
|
this.setState({ showProgressBar: false });
|
||||||
handleError(error, "NotebookViewerComponent/loadNotebookContent", "Failed to load notebook content");
|
handleError(error, "NotebookViewerComponent/loadNotebookContent", "Failed to load notebook content");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private removeNotebookViewerLink = (notebook: Notebook, newCellId: string): void => {
|
|
||||||
if (!newCellId) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const notebookV4 = notebook as NotebookV4;
|
|
||||||
if (notebookV4 && notebookV4.cells[0].source[0].search(newCellId)) {
|
|
||||||
delete notebookV4.cells[0];
|
|
||||||
notebook = notebookV4;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div className="notebookViewerContainer">
|
<div className="notebookViewerContainer">
|
||||||
@@ -152,7 +167,7 @@ export class NotebookViewerComponent
|
|||||||
hidePrompts: this.props.hidePrompts,
|
hidePrompts: this.props.hidePrompts,
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{this.state.dialogProps && <DialogComponent {...this.state.dialogProps} />}
|
{this.state.dialogProps && <Dialog {...this.state.dialogProps} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -178,6 +193,32 @@ export class NotebookViewerComponent
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DialogHost
|
||||||
|
showOkModalDialog(
|
||||||
|
title: string,
|
||||||
|
msg: string,
|
||||||
|
okLabel: string,
|
||||||
|
onOk: () => void,
|
||||||
|
progressIndicatorProps?: IProgressIndicatorProps
|
||||||
|
): void {
|
||||||
|
this.setState({
|
||||||
|
dialogProps: {
|
||||||
|
isModal: true,
|
||||||
|
visible: true,
|
||||||
|
title,
|
||||||
|
subText: msg,
|
||||||
|
primaryButtonText: okLabel,
|
||||||
|
onPrimaryButtonClick: () => {
|
||||||
|
this.setState({ dialogProps: undefined });
|
||||||
|
onOk && onOk();
|
||||||
|
},
|
||||||
|
secondaryButtonText: undefined,
|
||||||
|
onSecondaryButtonClick: undefined,
|
||||||
|
progressIndicatorProps,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// DialogHost
|
// DialogHost
|
||||||
showOkCancelModalDialog(
|
showOkCancelModalDialog(
|
||||||
title: string,
|
title: string,
|
||||||
@@ -186,8 +227,10 @@ export class NotebookViewerComponent
|
|||||||
onOk: () => void,
|
onOk: () => void,
|
||||||
cancelLabel: string,
|
cancelLabel: string,
|
||||||
onCancel: () => void,
|
onCancel: () => void,
|
||||||
|
progressIndicatorProps?: IProgressIndicatorProps,
|
||||||
choiceGroupProps?: IChoiceGroupProps,
|
choiceGroupProps?: IChoiceGroupProps,
|
||||||
textFieldProps?: TextFieldProps
|
textFieldProps?: TextFieldProps,
|
||||||
|
primaryButtonDisabled?: boolean
|
||||||
): void {
|
): void {
|
||||||
this.setState({
|
this.setState({
|
||||||
dialogProps: {
|
dialogProps: {
|
||||||
@@ -205,8 +248,10 @@ export class NotebookViewerComponent
|
|||||||
this.setState({ dialogProps: undefined });
|
this.setState({ dialogProps: undefined });
|
||||||
onCancel && onCancel();
|
onCancel && onCancel();
|
||||||
},
|
},
|
||||||
|
progressIndicatorProps,
|
||||||
choiceGroupProps,
|
choiceGroupProps,
|
||||||
textFieldProps,
|
textFieldProps,
|
||||||
|
primaryButtonDisabled,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,8 +221,6 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
|
|||||||
if (window.confirm("Are you sure you want to delete this query?")) {
|
if (window.confirm("Are you sure you want to delete this query?")) {
|
||||||
const container = window.dataExplorer;
|
const container = window.dataExplorer;
|
||||||
const startKey: number = TelemetryProcessor.traceStart(Action.DeleteSavedQuery, {
|
const startKey: number = TelemetryProcessor.traceStart(Action.DeleteSavedQuery, {
|
||||||
databaseAccountName: container && container.databaseAccount().name,
|
|
||||||
defaultExperience: container && container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.ContextualPane,
|
dataExplorerArea: Constants.Areas.ContextualPane,
|
||||||
paneTitle: container && container.browseQueriesPane.title(),
|
paneTitle: container && container.browseQueriesPane.title(),
|
||||||
});
|
});
|
||||||
@@ -231,8 +229,6 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
|
|||||||
TelemetryProcessor.traceSuccess(
|
TelemetryProcessor.traceSuccess(
|
||||||
Action.DeleteSavedQuery,
|
Action.DeleteSavedQuery,
|
||||||
{
|
{
|
||||||
databaseAccountName: container && container.databaseAccount().name,
|
|
||||||
defaultExperience: container && container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.ContextualPane,
|
dataExplorerArea: Constants.Areas.ContextualPane,
|
||||||
paneTitle: container && container.browseQueriesPane.title(),
|
paneTitle: container && container.browseQueriesPane.title(),
|
||||||
},
|
},
|
||||||
@@ -242,8 +238,6 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
|
|||||||
TelemetryProcessor.traceFailure(
|
TelemetryProcessor.traceFailure(
|
||||||
Action.DeleteSavedQuery,
|
Action.DeleteSavedQuery,
|
||||||
{
|
{
|
||||||
databaseAccountName: container && container.databaseAccount().name,
|
|
||||||
defaultExperience: container && container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.ContextualPane,
|
dataExplorerArea: Constants.Areas.ContextualPane,
|
||||||
paneTitle: container && container.browseQueriesPane.title(),
|
paneTitle: container && container.browseQueriesPane.title(),
|
||||||
error: getErrorMessage(error),
|
error: getErrorMessage(error),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { shallow } from "enzyme";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { SettingsComponentProps, SettingsComponent, SettingsComponentState } from "./SettingsComponent";
|
import { SettingsComponentProps, SettingsComponent, SettingsComponentState } from "./SettingsComponent";
|
||||||
import * as ViewModels from "../../../Contracts/ViewModels";
|
import * as ViewModels from "../../../Contracts/ViewModels";
|
||||||
import SettingsTabV2 from "../../Tabs/SettingsTabV2";
|
import { CollectionSettingsTabV2 } from "../../Tabs/SettingsTabV2";
|
||||||
import { collection } from "./TestUtils";
|
import { collection } from "./TestUtils";
|
||||||
import * as DataModels from "../../../Contracts/DataModels";
|
import * as DataModels from "../../../Contracts/DataModels";
|
||||||
import ko from "knockout";
|
import ko from "knockout";
|
||||||
@@ -37,16 +37,15 @@ jest.mock("../../../Common/dataAccess/updateOffer", () => ({
|
|||||||
|
|
||||||
describe("SettingsComponent", () => {
|
describe("SettingsComponent", () => {
|
||||||
const baseProps: SettingsComponentProps = {
|
const baseProps: SettingsComponentProps = {
|
||||||
settingsTab: new SettingsTabV2({
|
settingsTab: new CollectionSettingsTabV2({
|
||||||
collection: collection,
|
collection: collection,
|
||||||
tabKind: ViewModels.CollectionTabKind.SettingsV2,
|
tabKind: ViewModels.CollectionTabKind.CollectionSettingsV2,
|
||||||
title: "Scale & Settings",
|
title: "Scale & Settings",
|
||||||
tabPath: "",
|
tabPath: "",
|
||||||
node: undefined,
|
node: undefined,
|
||||||
hashLocation: "settings",
|
hashLocation: "settings",
|
||||||
isActive: ko.observable(false),
|
isActive: ko.observable(false),
|
||||||
onUpdateTabsButtons: undefined,
|
onUpdateTabsButtons: undefined,
|
||||||
getPendingNotification: Promise.resolve(undefined),
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,6 +138,7 @@ describe("SettingsComponent", () => {
|
|||||||
readSettings: undefined,
|
readSettings: undefined,
|
||||||
onSettingsClick: undefined,
|
onSettingsClick: undefined,
|
||||||
loadOffer: undefined,
|
loadOffer: undefined,
|
||||||
|
getPendingThroughputSplitNotification: undefined,
|
||||||
} as ViewModels.Database;
|
} as ViewModels.Database;
|
||||||
newCollection.getDatabase = () => newDatabase;
|
newCollection.getDatabase = () => newDatabase;
|
||||||
newCollection.offer = ko.observable(undefined);
|
newCollection.offer = ko.observable(undefined);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Explorer from "../../Explorer";
|
|||||||
import { updateOffer } from "../../../Common/dataAccess/updateOffer";
|
import { updateOffer } from "../../../Common/dataAccess/updateOffer";
|
||||||
import { updateCollection, updateMongoDBCollectionThroughRP } from "../../../Common/dataAccess/updateCollection";
|
import { updateCollection, updateMongoDBCollectionThroughRP } from "../../../Common/dataAccess/updateCollection";
|
||||||
import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent";
|
import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent";
|
||||||
import SettingsTab from "../../Tabs/SettingsTabV2";
|
import { SettingsTabV2 } from "../../Tabs/SettingsTabV2";
|
||||||
import { mongoIndexingPolicyAADError } from "./SettingsRenderUtils";
|
import { mongoIndexingPolicyAADError } from "./SettingsRenderUtils";
|
||||||
import { ScaleComponent, ScaleComponentProps } from "./SettingsSubComponents/ScaleComponent";
|
import { ScaleComponent, ScaleComponentProps } from "./SettingsSubComponents/ScaleComponent";
|
||||||
import {
|
import {
|
||||||
@@ -44,7 +44,6 @@ import { MongoDBCollectionResource, MongoIndex } from "../../../Utils/arm/genera
|
|||||||
import { readMongoDBCollectionThroughRP } from "../../../Common/dataAccess/readMongoDBCollection";
|
import { readMongoDBCollectionThroughRP } from "../../../Common/dataAccess/readMongoDBCollection";
|
||||||
import { getIndexTransformationProgress } from "../../../Common/dataAccess/getIndexTransformationProgress";
|
import { getIndexTransformationProgress } from "../../../Common/dataAccess/getIndexTransformationProgress";
|
||||||
import { getErrorMessage, getErrorStack } from "../../../Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack } from "../../../Common/ErrorHandlingUtils";
|
||||||
import { isEmpty } from "underscore";
|
|
||||||
|
|
||||||
interface SettingsV2TabInfo {
|
interface SettingsV2TabInfo {
|
||||||
tab: SettingsV2TabTypes;
|
tab: SettingsV2TabTypes;
|
||||||
@@ -58,7 +57,7 @@ interface ButtonV2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingsComponentProps {
|
export interface SettingsComponentProps {
|
||||||
settingsTab: SettingsTab;
|
settingsTab: SettingsTabV2;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingsComponentState {
|
export interface SettingsComponentState {
|
||||||
@@ -116,7 +115,10 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
private discardSettingsChangesButton: ButtonV2;
|
private discardSettingsChangesButton: ButtonV2;
|
||||||
|
|
||||||
private isAnalyticalStorageEnabled: boolean;
|
private isAnalyticalStorageEnabled: boolean;
|
||||||
|
private isCollectionSettingsTab: boolean;
|
||||||
private collection: ViewModels.Collection;
|
private collection: ViewModels.Collection;
|
||||||
|
private database: ViewModels.Database;
|
||||||
|
private offer: DataModels.Offer;
|
||||||
private container: Explorer;
|
private container: Explorer;
|
||||||
private changeFeedPolicyVisible: boolean;
|
private changeFeedPolicyVisible: boolean;
|
||||||
private isFixedContainer: boolean;
|
private isFixedContainer: boolean;
|
||||||
@@ -126,20 +128,28 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
constructor(props: SettingsComponentProps) {
|
constructor(props: SettingsComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.collection = this.props.settingsTab.collection as ViewModels.Collection;
|
this.isCollectionSettingsTab = this.props.settingsTab.tabKind === ViewModels.CollectionTabKind.CollectionSettingsV2;
|
||||||
this.container = this.collection?.container;
|
if (this.isCollectionSettingsTab) {
|
||||||
this.isAnalyticalStorageEnabled = !!this.collection?.analyticalStorageTtl();
|
this.collection = this.props.settingsTab.collection as ViewModels.Collection;
|
||||||
this.shouldShowIndexingPolicyEditor =
|
this.container = this.collection?.container;
|
||||||
this.container && !this.container.isPreferredApiCassandra() && !this.container.isPreferredApiMongoDB();
|
this.offer = this.collection?.offer();
|
||||||
|
this.isAnalyticalStorageEnabled = !!this.collection?.analyticalStorageTtl();
|
||||||
|
this.shouldShowIndexingPolicyEditor =
|
||||||
|
this.container && !this.container.isPreferredApiCassandra() && !this.container.isPreferredApiMongoDB();
|
||||||
|
|
||||||
this.changeFeedPolicyVisible = this.collection?.container.isFeatureEnabled(
|
this.changeFeedPolicyVisible = this.collection?.container.isFeatureEnabled(
|
||||||
Constants.Features.enableChangeFeedPolicy
|
Constants.Features.enableChangeFeedPolicy
|
||||||
);
|
);
|
||||||
|
|
||||||
// Mongo container with system partition key still treat as "Fixed"
|
// Mongo container with system partition key still treat as "Fixed"
|
||||||
this.isFixedContainer =
|
this.isFixedContainer =
|
||||||
this.container.isPreferredApiMongoDB() &&
|
this.container.isPreferredApiMongoDB() &&
|
||||||
(!this.collection.partitionKey || this.collection.partitionKey.systemKey);
|
(!this.collection?.partitionKey || this.collection?.partitionKey.systemKey);
|
||||||
|
} else {
|
||||||
|
this.database = this.props.settingsTab.database;
|
||||||
|
this.container = this.database?.container;
|
||||||
|
this.offer = this.database?.offer();
|
||||||
|
}
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
throughput: undefined,
|
throughput: undefined,
|
||||||
@@ -206,18 +216,21 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
this.refreshIndexTransformationProgress();
|
if (this.isCollectionSettingsTab) {
|
||||||
this.loadMongoIndexes();
|
this.refreshIndexTransformationProgress();
|
||||||
|
this.loadMongoIndexes();
|
||||||
|
}
|
||||||
|
|
||||||
this.setAutoPilotStates();
|
this.setAutoPilotStates();
|
||||||
this.setBaseline();
|
this.setBaseline();
|
||||||
if (this.props.settingsTab.isActive()) {
|
if (this.props.settingsTab.isActive()) {
|
||||||
this.props.settingsTab.getSettingsTabContainer().onUpdateTabsButtons(this.getTabsButtons());
|
this.props.settingsTab.getContainer().onUpdateTabsButtons(this.getTabsButtons());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(): void {
|
componentDidUpdate(): void {
|
||||||
if (this.props.settingsTab.isActive()) {
|
if (this.props.settingsTab.isActive()) {
|
||||||
this.props.settingsTab.getSettingsTabContainer().onUpdateTabsButtons(this.getTabsButtons());
|
this.props.settingsTab.getContainer().onUpdateTabsButtons(this.getTabsButtons());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +283,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
};
|
};
|
||||||
|
|
||||||
private setAutoPilotStates = (): void => {
|
private setAutoPilotStates = (): void => {
|
||||||
const autoscaleMaxThroughput = this.collection?.offer()?.autoscaleMaxThroughput;
|
const autoscaleMaxThroughput = this.offer?.autoscaleMaxThroughput;
|
||||||
|
|
||||||
if (autoscaleMaxThroughput && AutoPilotUtils.isValidAutoPilotThroughput(autoscaleMaxThroughput)) {
|
if (autoscaleMaxThroughput && AutoPilotUtils.isValidAutoPilotThroughput(autoscaleMaxThroughput)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -295,7 +308,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
!!this.collection.conflictResolutionPolicy();
|
!!this.collection.conflictResolutionPolicy();
|
||||||
|
|
||||||
public isOfferReplacePending = (): boolean => {
|
public isOfferReplacePending = (): boolean => {
|
||||||
return this.collection?.offer()?.offerReplacePending;
|
return this.offer?.offerReplacePending;
|
||||||
};
|
};
|
||||||
|
|
||||||
public onSaveClick = async (): Promise<void> => {
|
public onSaveClick = async (): Promise<void> => {
|
||||||
@@ -303,180 +316,14 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
|
|
||||||
this.props.settingsTab.isExecuting(true);
|
this.props.settingsTab.isExecuting(true);
|
||||||
const startKey: number = traceStart(Action.SettingsV2Updated, {
|
const startKey: number = traceStart(Action.SettingsV2Updated, {
|
||||||
databaseAccountName: this.container.databaseAccount()?.name,
|
|
||||||
defaultExperience: this.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const newCollection: DataModels.Collection = { ...this.collection.rawDataModel };
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
await (this.isCollectionSettingsTab
|
||||||
this.state.isSubSettingsSaveable ||
|
? this.saveCollectionSettings(startKey)
|
||||||
this.state.isIndexingPolicyDirty ||
|
: this.saveDatabaseSettings(startKey));
|
||||||
this.state.isConflictResolutionDirty
|
|
||||||
) {
|
|
||||||
let defaultTtl: number;
|
|
||||||
switch (this.state.timeToLive) {
|
|
||||||
case TtlType.On:
|
|
||||||
defaultTtl = Number(this.state.timeToLiveSeconds);
|
|
||||||
break;
|
|
||||||
case TtlType.OnNoDefault:
|
|
||||||
defaultTtl = -1;
|
|
||||||
break;
|
|
||||||
case TtlType.Off:
|
|
||||||
default:
|
|
||||||
defaultTtl = undefined;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
const wasIndexingPolicyModified = this.state.isIndexingPolicyDirty;
|
|
||||||
newCollection.defaultTtl = defaultTtl;
|
|
||||||
|
|
||||||
newCollection.indexingPolicy = this.state.indexingPolicyContent;
|
|
||||||
|
|
||||||
newCollection.changeFeedPolicy =
|
|
||||||
this.changeFeedPolicyVisible && this.state.changeFeedPolicy === ChangeFeedPolicyState.On
|
|
||||||
? {
|
|
||||||
retentionDuration: Constants.BackendDefaults.maxChangeFeedRetentionDuration,
|
|
||||||
}
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
newCollection.analyticalStorageTtl = this.getAnalyticalStorageTtl();
|
|
||||||
|
|
||||||
newCollection.geospatialConfig = {
|
|
||||||
type: this.state.geospatialConfigType,
|
|
||||||
};
|
|
||||||
|
|
||||||
const conflictResolutionChanges: DataModels.ConflictResolutionPolicy = this.getUpdatedConflictResolutionPolicy();
|
|
||||||
if (conflictResolutionChanges) {
|
|
||||||
newCollection.conflictResolutionPolicy = conflictResolutionChanges;
|
|
||||||
}
|
|
||||||
|
|
||||||
const updatedCollection: DataModels.Collection = await updateCollection(
|
|
||||||
this.collection.databaseId,
|
|
||||||
this.collection.id(),
|
|
||||||
newCollection
|
|
||||||
);
|
|
||||||
this.collection.rawDataModel = updatedCollection;
|
|
||||||
this.collection.defaultTtl(updatedCollection.defaultTtl);
|
|
||||||
this.collection.analyticalStorageTtl(updatedCollection.analyticalStorageTtl);
|
|
||||||
this.collection.id(updatedCollection.id);
|
|
||||||
this.collection.indexingPolicy(updatedCollection.indexingPolicy);
|
|
||||||
this.collection.conflictResolutionPolicy(updatedCollection.conflictResolutionPolicy);
|
|
||||||
this.collection.changeFeedPolicy(updatedCollection.changeFeedPolicy);
|
|
||||||
this.collection.geospatialConfig(updatedCollection.geospatialConfig);
|
|
||||||
|
|
||||||
if (wasIndexingPolicyModified) {
|
|
||||||
await this.refreshIndexTransformationProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({
|
|
||||||
isSubSettingsSaveable: false,
|
|
||||||
isSubSettingsDiscardable: false,
|
|
||||||
isIndexingPolicyDirty: false,
|
|
||||||
isConflictResolutionDirty: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.isMongoIndexingPolicySaveable && this.mongoDBCollectionResource) {
|
|
||||||
try {
|
|
||||||
const newMongoIndexes = this.getMongoIndexesToSave();
|
|
||||||
const newMongoCollection: MongoDBCollectionResource = {
|
|
||||||
...this.mongoDBCollectionResource,
|
|
||||||
indexes: newMongoIndexes,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.mongoDBCollectionResource = await updateMongoDBCollectionThroughRP(
|
|
||||||
this.collection.databaseId,
|
|
||||||
this.collection.id(),
|
|
||||||
newMongoCollection
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.refreshIndexTransformationProgress();
|
|
||||||
this.setState({
|
|
||||||
isMongoIndexingPolicySaveable: false,
|
|
||||||
indexesToDrop: [],
|
|
||||||
indexesToAdd: [],
|
|
||||||
currentMongoIndexes: [...this.mongoDBCollectionResource.indexes],
|
|
||||||
});
|
|
||||||
traceSuccess(
|
|
||||||
Action.MongoIndexUpdated,
|
|
||||||
{
|
|
||||||
databaseAccountName: this.container.databaseAccount()?.name,
|
|
||||||
databaseName: this.collection?.databaseId,
|
|
||||||
collectionName: this.collection?.id(),
|
|
||||||
defaultExperience: this.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
|
||||||
},
|
|
||||||
startKey
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
traceFailure(
|
|
||||||
Action.MongoIndexUpdated,
|
|
||||||
{
|
|
||||||
databaseAccountName: this.container.databaseAccount()?.name,
|
|
||||||
databaseName: this.collection?.databaseId,
|
|
||||||
collectionName: this.collection?.id(),
|
|
||||||
defaultExperience: this.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
|
||||||
error: getErrorMessage(error),
|
|
||||||
errorStack: getErrorStack(error),
|
|
||||||
},
|
|
||||||
startKey
|
|
||||||
);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.isScaleSaveable) {
|
|
||||||
const updateOfferParams: DataModels.UpdateOfferParams = {
|
|
||||||
databaseId: this.collection.databaseId,
|
|
||||||
collectionId: this.collection.id(),
|
|
||||||
currentOffer: this.collection.offer(),
|
|
||||||
autopilotThroughput: this.state.isAutoPilotSelected ? this.state.autoPilotThroughput : undefined,
|
|
||||||
manualThroughput: this.state.isAutoPilotSelected ? undefined : this.state.throughput,
|
|
||||||
};
|
|
||||||
if (this.hasProvisioningTypeChanged()) {
|
|
||||||
if (this.state.isAutoPilotSelected) {
|
|
||||||
updateOfferParams.migrateToAutoPilot = true;
|
|
||||||
} else {
|
|
||||||
updateOfferParams.migrateToManual = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const updatedOffer: DataModels.Offer = await updateOffer(updateOfferParams);
|
|
||||||
this.collection.offer(updatedOffer);
|
|
||||||
this.setState({ isScaleSaveable: false, isScaleDiscardable: false });
|
|
||||||
if (this.state.isAutoPilotSelected) {
|
|
||||||
this.setState({
|
|
||||||
autoPilotThroughput: updatedOffer.autoscaleMaxThroughput,
|
|
||||||
autoPilotThroughputBaseline: updatedOffer.autoscaleMaxThroughput,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
throughput: updatedOffer.manualThroughput,
|
|
||||||
throughputBaseline: updatedOffer.manualThroughput,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.container.isRefreshingExplorer(false);
|
|
||||||
this.setBaseline();
|
|
||||||
this.setState({ wasAutopilotOriginallySet: this.state.isAutoPilotSelected });
|
|
||||||
traceSuccess(
|
|
||||||
Action.SettingsV2Updated,
|
|
||||||
{
|
|
||||||
databaseAccountName: this.container.databaseAccount()?.name,
|
|
||||||
databaseName: this.collection?.databaseId,
|
|
||||||
collectionName: this.collection?.id(),
|
|
||||||
defaultExperience: this.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
|
||||||
},
|
|
||||||
startKey
|
|
||||||
);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.container.isRefreshingExplorer(false);
|
this.container.isRefreshingExplorer(false);
|
||||||
this.props.settingsTab.isExecutionError(true);
|
this.props.settingsTab.isExecutionError(true);
|
||||||
@@ -484,10 +331,9 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
traceFailure(
|
traceFailure(
|
||||||
Action.SettingsV2Updated,
|
Action.SettingsV2Updated,
|
||||||
{
|
{
|
||||||
databaseAccountName: this.container.databaseAccount()?.name,
|
|
||||||
databaseName: this.collection?.databaseId,
|
databaseName: this.collection?.databaseId,
|
||||||
collectionName: this.collection?.id(),
|
collectionName: this.collection?.id(),
|
||||||
defaultExperience: this.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
error: getErrorMessage(error),
|
error: getErrorMessage(error),
|
||||||
@@ -495,8 +341,9 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
},
|
},
|
||||||
startKey
|
startKey
|
||||||
);
|
);
|
||||||
|
} finally {
|
||||||
|
this.props.settingsTab.isExecuting(false);
|
||||||
}
|
}
|
||||||
this.props.settingsTab.isExecuting(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public onRevertClick = (): void => {
|
public onRevertClick = (): void => {
|
||||||
@@ -559,10 +406,9 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
traceSuccess(
|
traceSuccess(
|
||||||
Action.Tab,
|
Action.Tab,
|
||||||
{
|
{
|
||||||
databaseAccountName: this.container.databaseAccount().name,
|
|
||||||
databaseName: this.collection.databaseId,
|
databaseName: this.collection.databaseId,
|
||||||
collectionName: this.collection.id(),
|
collectionName: this.collection.id(),
|
||||||
defaultExperience: this.container.defaultExperience(),
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
},
|
},
|
||||||
@@ -693,6 +539,17 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
};
|
};
|
||||||
|
|
||||||
public setBaseline = (): void => {
|
public setBaseline = (): void => {
|
||||||
|
const offerThroughput = this.offer?.manualThroughput;
|
||||||
|
|
||||||
|
if (!this.isCollectionSettingsTab) {
|
||||||
|
this.setState({
|
||||||
|
throughput: offerThroughput,
|
||||||
|
throughputBaseline: offerThroughput,
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const defaultTtl = this.collection.defaultTtl();
|
const defaultTtl = this.collection.defaultTtl();
|
||||||
|
|
||||||
let timeToLive: TtlType = this.state.timeToLive;
|
let timeToLive: TtlType = this.state.timeToLive;
|
||||||
@@ -725,7 +582,6 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const offerThroughput = this.collection.offer()?.manualThroughput;
|
|
||||||
const changeFeedPolicy = this.collection.rawDataModel?.changeFeedPolicy
|
const changeFeedPolicy = this.collection.rawDataModel?.changeFeedPolicy
|
||||||
? ChangeFeedPolicyState.On
|
? ChangeFeedPolicyState.On
|
||||||
: ChangeFeedPolicyState.Off;
|
: ChangeFeedPolicyState.Off;
|
||||||
@@ -811,9 +667,220 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
this.setState({ selectedTab: selectedTab });
|
this.setState({ selectedTab: selectedTab });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private saveDatabaseSettings = async (startKey: number): Promise<void> => {
|
||||||
|
if (this.state.isScaleSaveable) {
|
||||||
|
const updateOfferParams: DataModels.UpdateOfferParams = {
|
||||||
|
databaseId: this.database.id(),
|
||||||
|
currentOffer: this.database.offer(),
|
||||||
|
autopilotThroughput: this.state.isAutoPilotSelected ? this.state.autoPilotThroughput : undefined,
|
||||||
|
manualThroughput: this.state.isAutoPilotSelected ? undefined : this.state.throughput,
|
||||||
|
};
|
||||||
|
if (this.hasProvisioningTypeChanged()) {
|
||||||
|
if (this.state.isAutoPilotSelected) {
|
||||||
|
updateOfferParams.migrateToAutoPilot = true;
|
||||||
|
} else {
|
||||||
|
updateOfferParams.migrateToManual = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const updatedOffer: DataModels.Offer = await updateOffer(updateOfferParams);
|
||||||
|
this.database.offer(updatedOffer);
|
||||||
|
this.offer = updatedOffer;
|
||||||
|
this.setState({ isScaleSaveable: false, isScaleDiscardable: false });
|
||||||
|
if (this.state.isAutoPilotSelected) {
|
||||||
|
this.setState({
|
||||||
|
autoPilotThroughput: updatedOffer.autoscaleMaxThroughput,
|
||||||
|
autoPilotThroughputBaseline: updatedOffer.autoscaleMaxThroughput,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({
|
||||||
|
throughput: updatedOffer.manualThroughput,
|
||||||
|
throughputBaseline: updatedOffer.manualThroughput,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.container.isRefreshingExplorer(false);
|
||||||
|
this.setBaseline();
|
||||||
|
this.setState({ wasAutopilotOriginallySet: this.state.isAutoPilotSelected });
|
||||||
|
traceSuccess(
|
||||||
|
Action.SettingsV2Updated,
|
||||||
|
{
|
||||||
|
databaseName: this.database.id(),
|
||||||
|
|
||||||
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
private saveCollectionSettings = async (startKey: number): Promise<void> => {
|
||||||
|
const newCollection: DataModels.Collection = { ...this.collection.rawDataModel };
|
||||||
|
|
||||||
|
if (this.state.isSubSettingsSaveable || this.state.isIndexingPolicyDirty || this.state.isConflictResolutionDirty) {
|
||||||
|
let defaultTtl: number;
|
||||||
|
switch (this.state.timeToLive) {
|
||||||
|
case TtlType.On:
|
||||||
|
defaultTtl = Number(this.state.timeToLiveSeconds);
|
||||||
|
break;
|
||||||
|
case TtlType.OnNoDefault:
|
||||||
|
defaultTtl = -1;
|
||||||
|
break;
|
||||||
|
case TtlType.Off:
|
||||||
|
default:
|
||||||
|
defaultTtl = undefined;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const wasIndexingPolicyModified = this.state.isIndexingPolicyDirty;
|
||||||
|
newCollection.defaultTtl = defaultTtl;
|
||||||
|
|
||||||
|
newCollection.indexingPolicy = this.state.indexingPolicyContent;
|
||||||
|
|
||||||
|
newCollection.changeFeedPolicy =
|
||||||
|
this.changeFeedPolicyVisible && this.state.changeFeedPolicy === ChangeFeedPolicyState.On
|
||||||
|
? {
|
||||||
|
retentionDuration: Constants.BackendDefaults.maxChangeFeedRetentionDuration,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
newCollection.analyticalStorageTtl = this.getAnalyticalStorageTtl();
|
||||||
|
|
||||||
|
newCollection.geospatialConfig = {
|
||||||
|
type: this.state.geospatialConfigType,
|
||||||
|
};
|
||||||
|
|
||||||
|
const conflictResolutionChanges: DataModels.ConflictResolutionPolicy = this.getUpdatedConflictResolutionPolicy();
|
||||||
|
if (conflictResolutionChanges) {
|
||||||
|
newCollection.conflictResolutionPolicy = conflictResolutionChanges;
|
||||||
|
}
|
||||||
|
|
||||||
|
const updatedCollection: DataModels.Collection = await updateCollection(
|
||||||
|
this.collection.databaseId,
|
||||||
|
this.collection.id(),
|
||||||
|
newCollection
|
||||||
|
);
|
||||||
|
this.collection.rawDataModel = updatedCollection;
|
||||||
|
this.collection.defaultTtl(updatedCollection.defaultTtl);
|
||||||
|
this.collection.analyticalStorageTtl(updatedCollection.analyticalStorageTtl);
|
||||||
|
this.collection.id(updatedCollection.id);
|
||||||
|
this.collection.indexingPolicy(updatedCollection.indexingPolicy);
|
||||||
|
this.collection.conflictResolutionPolicy(updatedCollection.conflictResolutionPolicy);
|
||||||
|
this.collection.changeFeedPolicy(updatedCollection.changeFeedPolicy);
|
||||||
|
this.collection.geospatialConfig(updatedCollection.geospatialConfig);
|
||||||
|
|
||||||
|
if (wasIndexingPolicyModified) {
|
||||||
|
await this.refreshIndexTransformationProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
isSubSettingsSaveable: false,
|
||||||
|
isSubSettingsDiscardable: false,
|
||||||
|
isIndexingPolicyDirty: false,
|
||||||
|
isConflictResolutionDirty: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.state.isMongoIndexingPolicySaveable && this.mongoDBCollectionResource) {
|
||||||
|
try {
|
||||||
|
const newMongoIndexes = this.getMongoIndexesToSave();
|
||||||
|
const newMongoCollection: MongoDBCollectionResource = {
|
||||||
|
...this.mongoDBCollectionResource,
|
||||||
|
indexes: newMongoIndexes,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.mongoDBCollectionResource = await updateMongoDBCollectionThroughRP(
|
||||||
|
this.collection.databaseId,
|
||||||
|
this.collection.id(),
|
||||||
|
newMongoCollection
|
||||||
|
);
|
||||||
|
|
||||||
|
await this.refreshIndexTransformationProgress();
|
||||||
|
this.setState({
|
||||||
|
isMongoIndexingPolicySaveable: false,
|
||||||
|
indexesToDrop: [],
|
||||||
|
indexesToAdd: [],
|
||||||
|
currentMongoIndexes: [...this.mongoDBCollectionResource.indexes],
|
||||||
|
});
|
||||||
|
traceSuccess(
|
||||||
|
Action.MongoIndexUpdated,
|
||||||
|
{
|
||||||
|
databaseName: this.collection?.databaseId,
|
||||||
|
collectionName: this.collection?.id(),
|
||||||
|
|
||||||
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
traceFailure(
|
||||||
|
Action.MongoIndexUpdated,
|
||||||
|
{
|
||||||
|
databaseName: this.collection?.databaseId,
|
||||||
|
collectionName: this.collection?.id(),
|
||||||
|
|
||||||
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
|
error: getErrorMessage(error),
|
||||||
|
errorStack: getErrorStack(error),
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.state.isScaleSaveable) {
|
||||||
|
const updateOfferParams: DataModels.UpdateOfferParams = {
|
||||||
|
databaseId: this.collection.databaseId,
|
||||||
|
collectionId: this.collection.id(),
|
||||||
|
currentOffer: this.collection.offer(),
|
||||||
|
autopilotThroughput: this.state.isAutoPilotSelected ? this.state.autoPilotThroughput : undefined,
|
||||||
|
manualThroughput: this.state.isAutoPilotSelected ? undefined : this.state.throughput,
|
||||||
|
};
|
||||||
|
if (this.hasProvisioningTypeChanged()) {
|
||||||
|
if (this.state.isAutoPilotSelected) {
|
||||||
|
updateOfferParams.migrateToAutoPilot = true;
|
||||||
|
} else {
|
||||||
|
updateOfferParams.migrateToManual = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const updatedOffer: DataModels.Offer = await updateOffer(updateOfferParams);
|
||||||
|
this.collection.offer(updatedOffer);
|
||||||
|
this.offer = updatedOffer;
|
||||||
|
this.setState({ isScaleSaveable: false, isScaleDiscardable: false });
|
||||||
|
if (this.state.isAutoPilotSelected) {
|
||||||
|
this.setState({
|
||||||
|
autoPilotThroughput: updatedOffer.autoscaleMaxThroughput,
|
||||||
|
autoPilotThroughputBaseline: updatedOffer.autoscaleMaxThroughput,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({
|
||||||
|
throughput: updatedOffer.manualThroughput,
|
||||||
|
throughputBaseline: updatedOffer.manualThroughput,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.container.isRefreshingExplorer(false);
|
||||||
|
this.setBaseline();
|
||||||
|
this.setState({ wasAutopilotOriginallySet: this.state.isAutoPilotSelected });
|
||||||
|
traceSuccess(
|
||||||
|
Action.SettingsV2Updated,
|
||||||
|
{
|
||||||
|
databaseName: this.collection?.databaseId,
|
||||||
|
collectionName: this.collection?.id(),
|
||||||
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const scaleComponentProps: ScaleComponentProps = {
|
const scaleComponentProps: ScaleComponentProps = {
|
||||||
collection: this.collection,
|
collection: this.collection,
|
||||||
|
database: this.database,
|
||||||
container: this.container,
|
container: this.container,
|
||||||
isFixedContainer: this.isFixedContainer,
|
isFixedContainer: this.isFixedContainer,
|
||||||
onThroughputChange: this.onThroughputChange,
|
onThroughputChange: this.onThroughputChange,
|
||||||
@@ -830,6 +897,16 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
initialNotification: this.props.settingsTab.pendingNotification(),
|
initialNotification: this.props.settingsTab.pendingNotification(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!this.isCollectionSettingsTab) {
|
||||||
|
return (
|
||||||
|
<div className="settingsV2MainContainer">
|
||||||
|
<div className="settingsV2TabsContainer">
|
||||||
|
<ScaleComponent {...scaleComponentProps} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const subSettingsComponentProps: SubSettingsComponentProps = {
|
const subSettingsComponentProps: SubSettingsComponentProps = {
|
||||||
collection: this.collection,
|
collection: this.collection,
|
||||||
container: this.container,
|
container: this.container,
|
||||||
@@ -899,7 +976,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
};
|
};
|
||||||
|
|
||||||
const tabs: SettingsV2TabInfo[] = [];
|
const tabs: SettingsV2TabInfo[] = [];
|
||||||
if (!hasDatabaseSharedThroughput(this.collection) && this.collection.offer()) {
|
if (!hasDatabaseSharedThroughput(this.collection) && this.offer) {
|
||||||
tabs.push({
|
tabs.push({
|
||||||
tab: SettingsV2TabTypes.ScaleTab,
|
tab: SettingsV2TabTypes.ScaleTab,
|
||||||
content: <ScaleComponent {...scaleComponentProps} />,
|
content: <ScaleComponent {...scaleComponentProps} />,
|
||||||
@@ -917,16 +994,16 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
content: <IndexingPolicyComponent {...indexingPolicyComponentProps} />,
|
content: <IndexingPolicyComponent {...indexingPolicyComponentProps} />,
|
||||||
});
|
});
|
||||||
} else if (this.container.isPreferredApiMongoDB()) {
|
} else if (this.container.isPreferredApiMongoDB()) {
|
||||||
if (isEmpty(this.container.features())) {
|
if (this.container.isEnableMongoCapabilityPresent()) {
|
||||||
tabs.push({
|
|
||||||
tab: SettingsV2TabTypes.IndexingPolicyTab,
|
|
||||||
content: mongoIndexingPolicyAADError,
|
|
||||||
});
|
|
||||||
} else if (this.container.isEnableMongoCapabilityPresent()) {
|
|
||||||
tabs.push({
|
tabs.push({
|
||||||
tab: SettingsV2TabTypes.IndexingPolicyTab,
|
tab: SettingsV2TabTypes.IndexingPolicyTab,
|
||||||
content: <MongoIndexingPolicyComponent {...mongoIndexingPolicyComponentProps} />,
|
content: <MongoIndexingPolicyComponent {...mongoIndexingPolicyComponentProps} />,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
tabs.push({
|
||||||
|
tab: SettingsV2TabTypes.IndexingPolicyTab,
|
||||||
|
content: mongoIndexingPolicyAADError,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ export const getThroughputApplyShortDelayMessage = (
|
|||||||
<Text styles={infoAndToolTipTextStyle} id="throughputApplyShortDelayMessage">
|
<Text styles={infoAndToolTipTextStyle} id="throughputApplyShortDelayMessage">
|
||||||
A request to increase the throughput is currently in progress. This operation will take some time to complete.
|
A request to increase the throughput is currently in progress. This operation will take some time to complete.
|
||||||
<br />
|
<br />
|
||||||
Database: {databaseName}, Container: {collectionName}{" "}
|
{collectionName ? `Database: ${databaseName}, Container: ${collectionName} ` : `Database: ${databaseName} `}
|
||||||
{getCurrentThroughput(isAutoscale, throughput, throughputUnit)}
|
{getCurrentThroughput(isAutoscale, throughput, throughputUnit)}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
@@ -392,7 +392,7 @@ export const getThroughputApplyLongDelayMessage = (
|
|||||||
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to
|
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to
|
||||||
complete. View the latest status in Notifications.
|
complete. View the latest status in Notifications.
|
||||||
<br />
|
<br />
|
||||||
Database: {databaseName}, Container: {collectionName}{" "}
|
{collectionName ? `Database: ${databaseName}, Container: ${collectionName} ` : `Database: ${databaseName} `}
|
||||||
{getCurrentThroughput(isAutoscale, throughput, throughputUnit, requestedThroughput)}
|
{getCurrentThroughput(isAutoscale, throughput, throughputUnit, requestedThroughput)}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ describe("ScaleComponent", () => {
|
|||||||
|
|
||||||
const baseProps: ScaleComponentProps = {
|
const baseProps: ScaleComponentProps = {
|
||||||
collection: collection,
|
collection: collection,
|
||||||
|
database: undefined,
|
||||||
container: container,
|
container: container,
|
||||||
isFixedContainer: false,
|
isFixedContainer: false,
|
||||||
onThroughputChange: () => {
|
onThroughputChange: () => {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { configContext, Platform } from "../../../../ConfigContext";
|
|||||||
|
|
||||||
export interface ScaleComponentProps {
|
export interface ScaleComponentProps {
|
||||||
collection: ViewModels.Collection;
|
collection: ViewModels.Collection;
|
||||||
|
database: ViewModels.Database;
|
||||||
container: Explorer;
|
container: Explorer;
|
||||||
isFixedContainer: boolean;
|
isFixedContainer: boolean;
|
||||||
onThroughputChange: (newThroughput: number) => void;
|
onThroughputChange: (newThroughput: number) => void;
|
||||||
@@ -39,9 +40,16 @@ export interface ScaleComponentProps {
|
|||||||
|
|
||||||
export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
||||||
private isEmulator: boolean;
|
private isEmulator: boolean;
|
||||||
|
private offer: DataModels.Offer;
|
||||||
|
private databaseId: string;
|
||||||
|
private collectionId: string;
|
||||||
|
|
||||||
constructor(props: ScaleComponentProps) {
|
constructor(props: ScaleComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
this.isEmulator = configContext.platform === Platform.Emulator;
|
this.isEmulator = configContext.platform === Platform.Emulator;
|
||||||
|
this.offer = this.props.database?.offer() || this.props.collection?.offer();
|
||||||
|
this.databaseId = this.props.database?.id() || this.props.collection.databaseId;
|
||||||
|
this.collectionId = this.props.collection?.id();
|
||||||
}
|
}
|
||||||
|
|
||||||
public isAutoScaleEnabled = (): boolean => {
|
public isAutoScaleEnabled = (): boolean => {
|
||||||
@@ -87,9 +95,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
return SharedConstants.CollectionCreation.DefaultCollectionRUs400;
|
return SharedConstants.CollectionCreation.DefaultCollectionRUs400;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return this.offer?.minimumThroughput || SharedConstants.CollectionCreation.DefaultCollectionRUs400;
|
||||||
this.props.collection.offer()?.minimumThroughput || SharedConstants.CollectionCreation.DefaultCollectionRUs400
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public getThroughputTitle = (): string => {
|
public getThroughputTitle = (): string => {
|
||||||
@@ -115,15 +121,14 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
return this.getLongDelayMessage();
|
return this.getLongDelayMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
const offer = this.props.collection?.offer();
|
if (this.offer?.offerReplacePending) {
|
||||||
if (offer?.offerReplacePending) {
|
const throughput = this.offer.manualThroughput || this.offer.autoscaleMaxThroughput;
|
||||||
const throughput = offer.manualThroughput || offer.autoscaleMaxThroughput;
|
|
||||||
return getThroughputApplyShortDelayMessage(
|
return getThroughputApplyShortDelayMessage(
|
||||||
this.props.isAutoPilotSelected,
|
this.props.isAutoPilotSelected,
|
||||||
throughput,
|
throughput,
|
||||||
throughputUnit,
|
throughputUnit,
|
||||||
this.props.collection.databaseId,
|
this.databaseId,
|
||||||
this.props.collection.id()
|
this.collectionId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +140,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
this.canThroughputExceedMaximumValue() &&
|
this.canThroughputExceedMaximumValue() &&
|
||||||
this.props.throughput > SharedConstants.CollectionCreation.DefaultCollectionRUs1Million;
|
this.props.throughput > SharedConstants.CollectionCreation.DefaultCollectionRUs1Million;
|
||||||
|
|
||||||
if (throughputExceedsBackendLimits && !!this.props.collection.partitionKey && !this.props.isFixedContainer) {
|
if (throughputExceedsBackendLimits && !this.props.isFixedContainer) {
|
||||||
return updateThroughputBeyondLimitWarningMessage;
|
return updateThroughputBeyondLimitWarningMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +159,8 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
this.props.wasAutopilotOriginallySet,
|
this.props.wasAutopilotOriginallySet,
|
||||||
throughput,
|
throughput,
|
||||||
throughputUnit,
|
throughputUnit,
|
||||||
this.props.collection.databaseId,
|
this.databaseId,
|
||||||
this.props.collection.id(),
|
this.collectionId,
|
||||||
targetThroughput
|
targetThroughput
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -165,15 +170,15 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
private getThroughputInputComponent = (): JSX.Element => (
|
private getThroughputInputComponent = (): JSX.Element => (
|
||||||
<ThroughputInputAutoPilotV3Component
|
<ThroughputInputAutoPilotV3Component
|
||||||
databaseAccount={this.props.container.databaseAccount()}
|
databaseAccount={this.props.container.databaseAccount()}
|
||||||
databaseName={this.props.collection.databaseId}
|
databaseName={this.databaseId}
|
||||||
collectionName={this.props.collection.id()}
|
collectionName={this.collectionId}
|
||||||
serverId={this.props.container.serverId()}
|
serverId={this.props.container.serverId()}
|
||||||
throughput={this.props.throughput}
|
throughput={this.props.throughput}
|
||||||
throughputBaseline={this.props.throughputBaseline}
|
throughputBaseline={this.props.throughputBaseline}
|
||||||
onThroughputChange={this.props.onThroughputChange}
|
onThroughputChange={this.props.onThroughputChange}
|
||||||
minimum={this.getMinRUs()}
|
minimum={this.getMinRUs()}
|
||||||
maximum={this.getMaxRUs()}
|
maximum={this.getMaxRUs()}
|
||||||
isEnabled={!hasDatabaseSharedThroughput(this.props.collection)}
|
isEnabled={!!this.props.database || !hasDatabaseSharedThroughput(this.props.collection)}
|
||||||
canExceedMaximumValue={this.canThroughputExceedMaximumValue()}
|
canExceedMaximumValue={this.canThroughputExceedMaximumValue()}
|
||||||
label={this.getThroughputTitle()}
|
label={this.getThroughputTitle()}
|
||||||
isEmulator={this.isEmulator}
|
isEmulator={this.isEmulator}
|
||||||
@@ -189,7 +194,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
onScaleSaveableChange={this.props.onScaleSaveableChange}
|
onScaleSaveableChange={this.props.onScaleSaveableChange}
|
||||||
onScaleDiscardableChange={this.props.onScaleDiscardableChange}
|
onScaleDiscardableChange={this.props.onScaleDiscardableChange}
|
||||||
getThroughputWarningMessage={this.getThroughputWarningMessage}
|
getThroughputWarningMessage={this.getThroughputWarningMessage}
|
||||||
usageSizeInKB={this.props.collection.usageSizeInKB()}
|
usageSizeInKB={this.props.collection?.usageSizeInKB()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -230,7 +235,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
|||||||
{!this.isAutoScaleEnabled() && (
|
{!this.isAutoScaleEnabled() && (
|
||||||
<Stack {...subComponentStackProps}>
|
<Stack {...subComponentStackProps}>
|
||||||
{this.getThroughputInputComponent()}
|
{this.getThroughputInputComponent()}
|
||||||
{this.getStorageCapacityTitle()}
|
{!this.props.database && this.getStorageCapacityTitle()}
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import { userContext } from "../../../../../UserContext";
|
|||||||
import { SubscriptionType } from "../../../../../Contracts/SubscriptionType";
|
import { SubscriptionType } from "../../../../../Contracts/SubscriptionType";
|
||||||
import { usageInGB, calculateEstimateNumber } from "../../../../../Utils/PricingUtils";
|
import { usageInGB, calculateEstimateNumber } from "../../../../../Utils/PricingUtils";
|
||||||
import { Features } from "../../../../../Common/Constants";
|
import { Features } from "../../../../../Common/Constants";
|
||||||
|
import { minAutoPilotThroughput } from "../../../../../Utils/AutoPilotUtils";
|
||||||
|
|
||||||
import * as TelemetryProcessor from "../../../../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { Action, ActionModifiers } from "../../../../../Shared/Telemetry/TelemetryConstants";
|
import { Action, ActionModifiers } from "../../../../../Shared/Telemetry/TelemetryConstants";
|
||||||
@@ -457,11 +458,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
TelemetryProcessor.trace(Action.ToggleAutoscaleSetting, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.ToggleAutoscaleSetting, ActionModifiers.Mark, {
|
||||||
changedSelectedValueTo:
|
changedSelectedValueTo:
|
||||||
option.key === "true" ? ActionModifiers.ToggleAutoscaleOn : ActionModifiers.ToggleAutoscaleOff,
|
option.key === "true" ? ActionModifiers.ToggleAutoscaleOn : ActionModifiers.ToggleAutoscaleOff,
|
||||||
subscriptionId: userContext.subscriptionId,
|
|
||||||
databaseAccountName: this.props.databaseAccount?.name,
|
|
||||||
databaseName: this.props.databaseName,
|
databaseName: this.props.databaseName,
|
||||||
collectionName: this.props.collectionName,
|
collectionName: this.props.collectionName,
|
||||||
apiKind: userContext.defaultExperience,
|
|
||||||
dataExplorerArea: "Scale Tab V2",
|
dataExplorerArea: "Scale Tab V2",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -541,6 +539,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
step={AutoPilotUtils.autoPilotIncrementStep}
|
step={AutoPilotUtils.autoPilotIncrementStep}
|
||||||
value={this.overrideWithProvisionedThroughputSettings() ? "" : this.props.maxAutoPilotThroughput?.toString()}
|
value={this.overrideWithProvisionedThroughputSettings() ? "" : this.props.maxAutoPilotThroughput?.toString()}
|
||||||
onChange={this.onAutoPilotThroughputChange}
|
onChange={this.onAutoPilotThroughputChange}
|
||||||
|
min={minAutoPilotThroughput}
|
||||||
/>
|
/>
|
||||||
{!this.overrideWithProvisionedThroughputSettings() && this.getAutoPilotUsageCost()}
|
{!this.overrideWithProvisionedThroughputSettings() && this.getAutoPilotUsageCost()}
|
||||||
{this.minRUperGBSurvey()}
|
{this.minRUperGBSurvey()}
|
||||||
@@ -579,6 +578,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
: this.props.throughput?.toString()
|
: this.props.throughput?.toString()
|
||||||
}
|
}
|
||||||
onChange={this.onThroughputChange}
|
onChange={this.onThroughputChange}
|
||||||
|
min={this.props.minimum}
|
||||||
/>
|
/>
|
||||||
{this.state.exceedFreeTierThroughput && (
|
{this.state.exceedFreeTierThroughput && (
|
||||||
<MessageBar
|
<MessageBar
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
id="autopilotInput"
|
id="autopilotInput"
|
||||||
key="auto pilot throughput input"
|
key="auto pilot throughput input"
|
||||||
label="Max RU/s"
|
label="Max RU/s"
|
||||||
|
min={4000}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
required={true}
|
required={true}
|
||||||
step={1000}
|
step={1000}
|
||||||
@@ -260,6 +261,7 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
disabled={false}
|
disabled={false}
|
||||||
id="throughputInput"
|
id="throughputInput"
|
||||||
key="provisioned throughput input"
|
key="provisioned throughput input"
|
||||||
|
min={10000}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
required={true}
|
required={true}
|
||||||
step={100}
|
step={100}
|
||||||
@@ -533,6 +535,7 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
disabled={false}
|
disabled={false}
|
||||||
id="throughputInput"
|
id="throughputInput"
|
||||||
key="provisioned throughput input"
|
key="provisioned throughput input"
|
||||||
|
min={10000}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
required={true}
|
required={true}
|
||||||
step={100}
|
step={100}
|
||||||
|
|||||||
@@ -23,11 +23,7 @@ exports[`ScaleComponent renders with correct initial notification 1`] = `
|
|||||||
>
|
>
|
||||||
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to complete. View the latest status in Notifications.
|
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to complete. View the latest status in Notifications.
|
||||||
<br />
|
<br />
|
||||||
Database:
|
Database: test, Container: test
|
||||||
test
|
|
||||||
, Container:
|
|
||||||
test
|
|
||||||
|
|
||||||
, Current autoscale throughput: 100 - 1000 RU/s, Target autoscale throughput: 600 - 6000 RU/s
|
, Current autoscale throughput: 100 - 1000 RU/s, Target autoscale throughput: 600 - 6000 RU/s
|
||||||
</Text>
|
</Text>
|
||||||
</StyledMessageBarBase>
|
</StyledMessageBarBase>
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ describe("SettingsUtils", () => {
|
|||||||
readSettings: undefined,
|
readSettings: undefined,
|
||||||
onSettingsClick: undefined,
|
onSettingsClick: undefined,
|
||||||
loadOffer: undefined,
|
loadOffer: undefined,
|
||||||
|
getPendingThroughputSplitNotification: undefined,
|
||||||
} as ViewModels.Database;
|
} as ViewModels.Database;
|
||||||
};
|
};
|
||||||
newCollection.offer(undefined);
|
newCollection.offer(undefined);
|
||||||
|
|||||||
@@ -28,16 +28,11 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"changeFeedPolicy": [Function],
|
"changeFeedPolicy": [Function],
|
||||||
"conflictResolutionPolicy": [Function],
|
"conflictResolutionPolicy": [Function],
|
||||||
"container": Explorer {
|
"container": Explorer {
|
||||||
"_addSynapseLinkDialogProps": [Function],
|
|
||||||
"_closeModalDialog": [Function],
|
"_closeModalDialog": [Function],
|
||||||
"_closeSynapseLinkModalDialog": [Function],
|
"_closeSynapseLinkModalDialog": [Function],
|
||||||
"_dialogProps": [Function],
|
|
||||||
"_importExplorerConfigComplete": false,
|
|
||||||
"_isAfecFeatureRegistered": [Function],
|
"_isAfecFeatureRegistered": [Function],
|
||||||
"_isInitializingNotebooks": false,
|
"_isInitializingNotebooks": false,
|
||||||
"_isInitializingSparkConnectionInfo": false,
|
|
||||||
"_isSystemDatabasePredicate": [Function],
|
"_isSystemDatabasePredicate": [Function],
|
||||||
"_openShareDialog": [Function],
|
|
||||||
"_panes": Array [
|
"_panes": Array [
|
||||||
AddDatabasePane {
|
AddDatabasePane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
@@ -440,22 +435,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"validPartitionKeyValue": [Function],
|
"validPartitionKeyValue": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
UploadItemsPane {
|
UploadItemsPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"fileUploadSummaryText": [Function],
|
"fileUploadSummaryText": [Function],
|
||||||
@@ -695,9 +674,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"addDatabaseText": [Function],
|
"addDatabaseText": [Function],
|
||||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"addTableEntityPane": AddTableEntityPane {
|
"addTableEntityPane": AddTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -804,6 +780,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"clickHostedAccountSwitch": [Function],
|
"clickHostedAccountSwitch": [Function],
|
||||||
"clickHostedDirectorySwitch": [Function],
|
"clickHostedDirectorySwitch": [Function],
|
||||||
|
"closeDialog": undefined,
|
||||||
|
"closeSidePanel": undefined,
|
||||||
"collapsedResourceTreeWidth": 36,
|
"collapsedResourceTreeWidth": 36,
|
||||||
"collectionCreationDefaults": Object {
|
"collectionCreationDefaults": Object {
|
||||||
"storage": "100",
|
"storage": "100",
|
||||||
@@ -858,9 +836,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"dialogComponentAdapter": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
"editTableEntityPane": EditTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -950,11 +925,9 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isCopyNotebookPaneEnabled": [Function],
|
"isCopyNotebookPaneEnabled": [Function],
|
||||||
"isEnableMongoCapabilityPresent": [Function],
|
"isEnableMongoCapabilityPresent": [Function],
|
||||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||||
"isGalleryPublishEnabled": [Function],
|
|
||||||
"isGitHubPaneEnabled": [Function],
|
"isGitHubPaneEnabled": [Function],
|
||||||
"isHostedDataExplorerEnabled": [Function],
|
"isHostedDataExplorerEnabled": [Function],
|
||||||
"isLeftPaneExpanded": [Function],
|
"isLeftPaneExpanded": [Function],
|
||||||
"isLinkInjectionEnabled": [Function],
|
|
||||||
"isMongoIndexingEnabled": [Function],
|
"isMongoIndexingEnabled": [Function],
|
||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
@@ -964,8 +937,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
"isPreferredApiTable": [Function],
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isReadToggled": [Function],
|
|
||||||
"isReadWriteToggled": [Function],
|
|
||||||
"isRefreshingExplorer": [Function],
|
"isRefreshingExplorer": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@@ -991,13 +962,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"memoryUsageInfo": [Function],
|
"memoryUsageInfo": [Function],
|
||||||
"mostRecentActivity": MostRecentActivity {
|
|
||||||
"container": [Circular],
|
|
||||||
"storedData": Object {
|
|
||||||
"itemsMap": Object {},
|
|
||||||
"schemaVersion": "1",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"newVertexPane": NewVertexPane {
|
"newVertexPane": NewVertexPane {
|
||||||
"buildString": [Function],
|
"buildString": [Function],
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -1020,7 +984,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"onRefreshDatabasesKeyPress": [Function],
|
"onRefreshDatabasesKeyPress": [Function],
|
||||||
"onRefreshResourcesClick": [Function],
|
"onRefreshResourcesClick": [Function],
|
||||||
"onSwitchToConnectionString": [Function],
|
"onSwitchToConnectionString": [Function],
|
||||||
"onToggleKeyDown": [Function],
|
"openDialog": undefined,
|
||||||
|
"openSidePanel": undefined,
|
||||||
"provideFeedbackEmail": [Function],
|
"provideFeedbackEmail": [Function],
|
||||||
"queriesClient": QueriesClient {
|
"queriesClient": QueriesClient {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -1049,24 +1014,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"refreshDatabaseAccount": [Function],
|
"refreshDatabaseAccount": [Function],
|
||||||
"refreshNotebookList": [Function],
|
"refreshNotebookList": [Function],
|
||||||
"refreshTreeTitle": [Function],
|
"refreshTreeTitle": [Function],
|
||||||
"renewAdHocAccessPane": RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"renewToken": [Function],
|
|
||||||
"renewTokenError": [Function],
|
|
||||||
"resourceTokenCollection": [Function],
|
"resourceTokenCollection": [Function],
|
||||||
"resourceTokenCollectionId": [Function],
|
"resourceTokenCollectionId": [Function],
|
||||||
"resourceTokenDatabaseId": [Function],
|
"resourceTokenDatabaseId": [Function],
|
||||||
@@ -1113,14 +1060,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"selectedDatabaseId": [Function],
|
"selectedDatabaseId": [Function],
|
||||||
"selectedNode": [Function],
|
"selectedNode": [Function],
|
||||||
"selfServeComponentAdapter": SelfServeComponentAdapter {
|
|
||||||
"container": [Circular],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeLoadingComponentAdapter": SelfServeLoadingComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeType": [Function],
|
|
||||||
"serverId": [Function],
|
"serverId": [Function],
|
||||||
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
||||||
"setIsNotificationConsoleExpanded": undefined,
|
"setIsNotificationConsoleExpanded": undefined,
|
||||||
@@ -1162,22 +1101,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"shareAccessData": [Function],
|
|
||||||
"shareAccessToggleState": [Function],
|
|
||||||
"shareAccessUrl": [Function],
|
|
||||||
"shareTokenCopyHelperText": [Function],
|
|
||||||
"shareUrlCopyHelperText": [Function],
|
|
||||||
"shouldShowContextSwitchPrompt": [Function],
|
|
||||||
"shouldShowDataAccessExpiryDialog": [Function],
|
|
||||||
"shouldShowShareDialogContents": [Function],
|
|
||||||
"signInAad": [Function],
|
"signInAad": [Function],
|
||||||
"sparkClusterConnectionInfo": [Function],
|
"sparkClusterConnectionInfo": [Function],
|
||||||
"splashScreenAdapter": SplashScreenComponentAdapter {
|
|
||||||
"clearMostRecent": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"forceRender": [Function],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"splitter": Splitter {
|
"splitter": Splitter {
|
||||||
"bounds": Object {
|
"bounds": Object {
|
||||||
"max": 400,
|
"max": 400,
|
||||||
@@ -1235,9 +1160,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"openedTabs": [Function],
|
"openedTabs": [Function],
|
||||||
},
|
},
|
||||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||||
"toggleRead": [Function],
|
|
||||||
"toggleReadWrite": [Function],
|
|
||||||
"tokenForRenewal": [Function],
|
|
||||||
"uploadFilePane": UploadFilePane {
|
"uploadFilePane": UploadFilePane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"extensions": [Function],
|
"extensions": [Function],
|
||||||
@@ -1307,16 +1229,11 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
}
|
}
|
||||||
container={
|
container={
|
||||||
Explorer {
|
Explorer {
|
||||||
"_addSynapseLinkDialogProps": [Function],
|
|
||||||
"_closeModalDialog": [Function],
|
"_closeModalDialog": [Function],
|
||||||
"_closeSynapseLinkModalDialog": [Function],
|
"_closeSynapseLinkModalDialog": [Function],
|
||||||
"_dialogProps": [Function],
|
|
||||||
"_importExplorerConfigComplete": false,
|
|
||||||
"_isAfecFeatureRegistered": [Function],
|
"_isAfecFeatureRegistered": [Function],
|
||||||
"_isInitializingNotebooks": false,
|
"_isInitializingNotebooks": false,
|
||||||
"_isInitializingSparkConnectionInfo": false,
|
|
||||||
"_isSystemDatabasePredicate": [Function],
|
"_isSystemDatabasePredicate": [Function],
|
||||||
"_openShareDialog": [Function],
|
|
||||||
"_panes": Array [
|
"_panes": Array [
|
||||||
AddDatabasePane {
|
AddDatabasePane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
@@ -1719,22 +1636,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"validPartitionKeyValue": [Function],
|
"validPartitionKeyValue": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
UploadItemsPane {
|
UploadItemsPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"fileUploadSummaryText": [Function],
|
"fileUploadSummaryText": [Function],
|
||||||
@@ -1974,9 +1875,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"addDatabaseText": [Function],
|
"addDatabaseText": [Function],
|
||||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"addTableEntityPane": AddTableEntityPane {
|
"addTableEntityPane": AddTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -2083,6 +1981,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"clickHostedAccountSwitch": [Function],
|
"clickHostedAccountSwitch": [Function],
|
||||||
"clickHostedDirectorySwitch": [Function],
|
"clickHostedDirectorySwitch": [Function],
|
||||||
|
"closeDialog": undefined,
|
||||||
|
"closeSidePanel": undefined,
|
||||||
"collapsedResourceTreeWidth": 36,
|
"collapsedResourceTreeWidth": 36,
|
||||||
"collectionCreationDefaults": Object {
|
"collectionCreationDefaults": Object {
|
||||||
"storage": "100",
|
"storage": "100",
|
||||||
@@ -2137,9 +2037,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"dialogComponentAdapter": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
"editTableEntityPane": EditTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -2229,11 +2126,9 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isCopyNotebookPaneEnabled": [Function],
|
"isCopyNotebookPaneEnabled": [Function],
|
||||||
"isEnableMongoCapabilityPresent": [Function],
|
"isEnableMongoCapabilityPresent": [Function],
|
||||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||||
"isGalleryPublishEnabled": [Function],
|
|
||||||
"isGitHubPaneEnabled": [Function],
|
"isGitHubPaneEnabled": [Function],
|
||||||
"isHostedDataExplorerEnabled": [Function],
|
"isHostedDataExplorerEnabled": [Function],
|
||||||
"isLeftPaneExpanded": [Function],
|
"isLeftPaneExpanded": [Function],
|
||||||
"isLinkInjectionEnabled": [Function],
|
|
||||||
"isMongoIndexingEnabled": [Function],
|
"isMongoIndexingEnabled": [Function],
|
||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
@@ -2243,8 +2138,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
"isPreferredApiTable": [Function],
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isReadToggled": [Function],
|
|
||||||
"isReadWriteToggled": [Function],
|
|
||||||
"isRefreshingExplorer": [Function],
|
"isRefreshingExplorer": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@@ -2270,13 +2163,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"memoryUsageInfo": [Function],
|
"memoryUsageInfo": [Function],
|
||||||
"mostRecentActivity": MostRecentActivity {
|
|
||||||
"container": [Circular],
|
|
||||||
"storedData": Object {
|
|
||||||
"itemsMap": Object {},
|
|
||||||
"schemaVersion": "1",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"newVertexPane": NewVertexPane {
|
"newVertexPane": NewVertexPane {
|
||||||
"buildString": [Function],
|
"buildString": [Function],
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -2299,7 +2185,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"onRefreshDatabasesKeyPress": [Function],
|
"onRefreshDatabasesKeyPress": [Function],
|
||||||
"onRefreshResourcesClick": [Function],
|
"onRefreshResourcesClick": [Function],
|
||||||
"onSwitchToConnectionString": [Function],
|
"onSwitchToConnectionString": [Function],
|
||||||
"onToggleKeyDown": [Function],
|
"openDialog": undefined,
|
||||||
|
"openSidePanel": undefined,
|
||||||
"provideFeedbackEmail": [Function],
|
"provideFeedbackEmail": [Function],
|
||||||
"queriesClient": QueriesClient {
|
"queriesClient": QueriesClient {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -2328,24 +2215,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"refreshDatabaseAccount": [Function],
|
"refreshDatabaseAccount": [Function],
|
||||||
"refreshNotebookList": [Function],
|
"refreshNotebookList": [Function],
|
||||||
"refreshTreeTitle": [Function],
|
"refreshTreeTitle": [Function],
|
||||||
"renewAdHocAccessPane": RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"renewToken": [Function],
|
|
||||||
"renewTokenError": [Function],
|
|
||||||
"resourceTokenCollection": [Function],
|
"resourceTokenCollection": [Function],
|
||||||
"resourceTokenCollectionId": [Function],
|
"resourceTokenCollectionId": [Function],
|
||||||
"resourceTokenDatabaseId": [Function],
|
"resourceTokenDatabaseId": [Function],
|
||||||
@@ -2392,14 +2261,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"selectedDatabaseId": [Function],
|
"selectedDatabaseId": [Function],
|
||||||
"selectedNode": [Function],
|
"selectedNode": [Function],
|
||||||
"selfServeComponentAdapter": SelfServeComponentAdapter {
|
|
||||||
"container": [Circular],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeLoadingComponentAdapter": SelfServeLoadingComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeType": [Function],
|
|
||||||
"serverId": [Function],
|
"serverId": [Function],
|
||||||
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
||||||
"setIsNotificationConsoleExpanded": undefined,
|
"setIsNotificationConsoleExpanded": undefined,
|
||||||
@@ -2441,22 +2302,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"shareAccessData": [Function],
|
|
||||||
"shareAccessToggleState": [Function],
|
|
||||||
"shareAccessUrl": [Function],
|
|
||||||
"shareTokenCopyHelperText": [Function],
|
|
||||||
"shareUrlCopyHelperText": [Function],
|
|
||||||
"shouldShowContextSwitchPrompt": [Function],
|
|
||||||
"shouldShowDataAccessExpiryDialog": [Function],
|
|
||||||
"shouldShowShareDialogContents": [Function],
|
|
||||||
"signInAad": [Function],
|
"signInAad": [Function],
|
||||||
"sparkClusterConnectionInfo": [Function],
|
"sparkClusterConnectionInfo": [Function],
|
||||||
"splashScreenAdapter": SplashScreenComponentAdapter {
|
|
||||||
"clearMostRecent": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"forceRender": [Function],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"splitter": Splitter {
|
"splitter": Splitter {
|
||||||
"bounds": Object {
|
"bounds": Object {
|
||||||
"max": 400,
|
"max": 400,
|
||||||
@@ -2514,9 +2361,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"openedTabs": [Function],
|
"openedTabs": [Function],
|
||||||
},
|
},
|
||||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||||
"toggleRead": [Function],
|
|
||||||
"toggleReadWrite": [Function],
|
|
||||||
"tokenForRenewal": [Function],
|
|
||||||
"uploadFilePane": UploadFilePane {
|
"uploadFilePane": UploadFilePane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"extensions": [Function],
|
"extensions": [Function],
|
||||||
@@ -2599,16 +2443,11 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"changeFeedPolicy": [Function],
|
"changeFeedPolicy": [Function],
|
||||||
"conflictResolutionPolicy": [Function],
|
"conflictResolutionPolicy": [Function],
|
||||||
"container": Explorer {
|
"container": Explorer {
|
||||||
"_addSynapseLinkDialogProps": [Function],
|
|
||||||
"_closeModalDialog": [Function],
|
"_closeModalDialog": [Function],
|
||||||
"_closeSynapseLinkModalDialog": [Function],
|
"_closeSynapseLinkModalDialog": [Function],
|
||||||
"_dialogProps": [Function],
|
|
||||||
"_importExplorerConfigComplete": false,
|
|
||||||
"_isAfecFeatureRegistered": [Function],
|
"_isAfecFeatureRegistered": [Function],
|
||||||
"_isInitializingNotebooks": false,
|
"_isInitializingNotebooks": false,
|
||||||
"_isInitializingSparkConnectionInfo": false,
|
|
||||||
"_isSystemDatabasePredicate": [Function],
|
"_isSystemDatabasePredicate": [Function],
|
||||||
"_openShareDialog": [Function],
|
|
||||||
"_panes": Array [
|
"_panes": Array [
|
||||||
AddDatabasePane {
|
AddDatabasePane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
@@ -3011,22 +2850,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"validPartitionKeyValue": [Function],
|
"validPartitionKeyValue": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
UploadItemsPane {
|
UploadItemsPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"fileUploadSummaryText": [Function],
|
"fileUploadSummaryText": [Function],
|
||||||
@@ -3266,9 +3089,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"addDatabaseText": [Function],
|
"addDatabaseText": [Function],
|
||||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"addTableEntityPane": AddTableEntityPane {
|
"addTableEntityPane": AddTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -3375,6 +3195,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"clickHostedAccountSwitch": [Function],
|
"clickHostedAccountSwitch": [Function],
|
||||||
"clickHostedDirectorySwitch": [Function],
|
"clickHostedDirectorySwitch": [Function],
|
||||||
|
"closeDialog": undefined,
|
||||||
|
"closeSidePanel": undefined,
|
||||||
"collapsedResourceTreeWidth": 36,
|
"collapsedResourceTreeWidth": 36,
|
||||||
"collectionCreationDefaults": Object {
|
"collectionCreationDefaults": Object {
|
||||||
"storage": "100",
|
"storage": "100",
|
||||||
@@ -3429,9 +3251,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"dialogComponentAdapter": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
"editTableEntityPane": EditTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -3521,11 +3340,9 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isCopyNotebookPaneEnabled": [Function],
|
"isCopyNotebookPaneEnabled": [Function],
|
||||||
"isEnableMongoCapabilityPresent": [Function],
|
"isEnableMongoCapabilityPresent": [Function],
|
||||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||||
"isGalleryPublishEnabled": [Function],
|
|
||||||
"isGitHubPaneEnabled": [Function],
|
"isGitHubPaneEnabled": [Function],
|
||||||
"isHostedDataExplorerEnabled": [Function],
|
"isHostedDataExplorerEnabled": [Function],
|
||||||
"isLeftPaneExpanded": [Function],
|
"isLeftPaneExpanded": [Function],
|
||||||
"isLinkInjectionEnabled": [Function],
|
|
||||||
"isMongoIndexingEnabled": [Function],
|
"isMongoIndexingEnabled": [Function],
|
||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
@@ -3535,8 +3352,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
"isPreferredApiTable": [Function],
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isReadToggled": [Function],
|
|
||||||
"isReadWriteToggled": [Function],
|
|
||||||
"isRefreshingExplorer": [Function],
|
"isRefreshingExplorer": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@@ -3562,13 +3377,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"memoryUsageInfo": [Function],
|
"memoryUsageInfo": [Function],
|
||||||
"mostRecentActivity": MostRecentActivity {
|
|
||||||
"container": [Circular],
|
|
||||||
"storedData": Object {
|
|
||||||
"itemsMap": Object {},
|
|
||||||
"schemaVersion": "1",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"newVertexPane": NewVertexPane {
|
"newVertexPane": NewVertexPane {
|
||||||
"buildString": [Function],
|
"buildString": [Function],
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -3591,7 +3399,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"onRefreshDatabasesKeyPress": [Function],
|
"onRefreshDatabasesKeyPress": [Function],
|
||||||
"onRefreshResourcesClick": [Function],
|
"onRefreshResourcesClick": [Function],
|
||||||
"onSwitchToConnectionString": [Function],
|
"onSwitchToConnectionString": [Function],
|
||||||
"onToggleKeyDown": [Function],
|
"openDialog": undefined,
|
||||||
|
"openSidePanel": undefined,
|
||||||
"provideFeedbackEmail": [Function],
|
"provideFeedbackEmail": [Function],
|
||||||
"queriesClient": QueriesClient {
|
"queriesClient": QueriesClient {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -3620,24 +3429,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"refreshDatabaseAccount": [Function],
|
"refreshDatabaseAccount": [Function],
|
||||||
"refreshNotebookList": [Function],
|
"refreshNotebookList": [Function],
|
||||||
"refreshTreeTitle": [Function],
|
"refreshTreeTitle": [Function],
|
||||||
"renewAdHocAccessPane": RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"renewToken": [Function],
|
|
||||||
"renewTokenError": [Function],
|
|
||||||
"resourceTokenCollection": [Function],
|
"resourceTokenCollection": [Function],
|
||||||
"resourceTokenCollectionId": [Function],
|
"resourceTokenCollectionId": [Function],
|
||||||
"resourceTokenDatabaseId": [Function],
|
"resourceTokenDatabaseId": [Function],
|
||||||
@@ -3684,14 +3475,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"selectedDatabaseId": [Function],
|
"selectedDatabaseId": [Function],
|
||||||
"selectedNode": [Function],
|
"selectedNode": [Function],
|
||||||
"selfServeComponentAdapter": SelfServeComponentAdapter {
|
|
||||||
"container": [Circular],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeLoadingComponentAdapter": SelfServeLoadingComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeType": [Function],
|
|
||||||
"serverId": [Function],
|
"serverId": [Function],
|
||||||
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
||||||
"setIsNotificationConsoleExpanded": undefined,
|
"setIsNotificationConsoleExpanded": undefined,
|
||||||
@@ -3733,22 +3516,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"shareAccessData": [Function],
|
|
||||||
"shareAccessToggleState": [Function],
|
|
||||||
"shareAccessUrl": [Function],
|
|
||||||
"shareTokenCopyHelperText": [Function],
|
|
||||||
"shareUrlCopyHelperText": [Function],
|
|
||||||
"shouldShowContextSwitchPrompt": [Function],
|
|
||||||
"shouldShowDataAccessExpiryDialog": [Function],
|
|
||||||
"shouldShowShareDialogContents": [Function],
|
|
||||||
"signInAad": [Function],
|
"signInAad": [Function],
|
||||||
"sparkClusterConnectionInfo": [Function],
|
"sparkClusterConnectionInfo": [Function],
|
||||||
"splashScreenAdapter": SplashScreenComponentAdapter {
|
|
||||||
"clearMostRecent": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"forceRender": [Function],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"splitter": Splitter {
|
"splitter": Splitter {
|
||||||
"bounds": Object {
|
"bounds": Object {
|
||||||
"max": 400,
|
"max": 400,
|
||||||
@@ -3806,9 +3575,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"openedTabs": [Function],
|
"openedTabs": [Function],
|
||||||
},
|
},
|
||||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||||
"toggleRead": [Function],
|
|
||||||
"toggleReadWrite": [Function],
|
|
||||||
"tokenForRenewal": [Function],
|
|
||||||
"uploadFilePane": UploadFilePane {
|
"uploadFilePane": UploadFilePane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"extensions": [Function],
|
"extensions": [Function],
|
||||||
@@ -3878,16 +3644,11 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
}
|
}
|
||||||
container={
|
container={
|
||||||
Explorer {
|
Explorer {
|
||||||
"_addSynapseLinkDialogProps": [Function],
|
|
||||||
"_closeModalDialog": [Function],
|
"_closeModalDialog": [Function],
|
||||||
"_closeSynapseLinkModalDialog": [Function],
|
"_closeSynapseLinkModalDialog": [Function],
|
||||||
"_dialogProps": [Function],
|
|
||||||
"_importExplorerConfigComplete": false,
|
|
||||||
"_isAfecFeatureRegistered": [Function],
|
"_isAfecFeatureRegistered": [Function],
|
||||||
"_isInitializingNotebooks": false,
|
"_isInitializingNotebooks": false,
|
||||||
"_isInitializingSparkConnectionInfo": false,
|
|
||||||
"_isSystemDatabasePredicate": [Function],
|
"_isSystemDatabasePredicate": [Function],
|
||||||
"_openShareDialog": [Function],
|
|
||||||
"_panes": Array [
|
"_panes": Array [
|
||||||
AddDatabasePane {
|
AddDatabasePane {
|
||||||
"autoPilotUsageCost": [Function],
|
"autoPilotUsageCost": [Function],
|
||||||
@@ -4290,22 +4051,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"validPartitionKeyValue": [Function],
|
"validPartitionKeyValue": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
UploadItemsPane {
|
UploadItemsPane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"fileUploadSummaryText": [Function],
|
"fileUploadSummaryText": [Function],
|
||||||
@@ -4545,9 +4290,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"addDatabaseText": [Function],
|
"addDatabaseText": [Function],
|
||||||
"addSynapseLinkDialog": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"addTableEntityPane": AddTableEntityPane {
|
"addTableEntityPane": AddTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -4654,6 +4396,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"clickHostedAccountSwitch": [Function],
|
"clickHostedAccountSwitch": [Function],
|
||||||
"clickHostedDirectorySwitch": [Function],
|
"clickHostedDirectorySwitch": [Function],
|
||||||
|
"closeDialog": undefined,
|
||||||
|
"closeSidePanel": undefined,
|
||||||
"collapsedResourceTreeWidth": 36,
|
"collapsedResourceTreeWidth": 36,
|
||||||
"collectionCreationDefaults": Object {
|
"collectionCreationDefaults": Object {
|
||||||
"storage": "100",
|
"storage": "100",
|
||||||
@@ -4708,9 +4452,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"deleteDatabaseText": [Function],
|
"deleteDatabaseText": [Function],
|
||||||
"dialogComponentAdapter": DialogComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"editTableEntityPane": EditTableEntityPane {
|
"editTableEntityPane": EditTableEntityPane {
|
||||||
"addButtonLabel": "Add Property",
|
"addButtonLabel": "Add Property",
|
||||||
"attributeNameLabel": "Property Name",
|
"attributeNameLabel": "Property Name",
|
||||||
@@ -4800,11 +4541,9 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isCopyNotebookPaneEnabled": [Function],
|
"isCopyNotebookPaneEnabled": [Function],
|
||||||
"isEnableMongoCapabilityPresent": [Function],
|
"isEnableMongoCapabilityPresent": [Function],
|
||||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||||
"isGalleryPublishEnabled": [Function],
|
|
||||||
"isGitHubPaneEnabled": [Function],
|
"isGitHubPaneEnabled": [Function],
|
||||||
"isHostedDataExplorerEnabled": [Function],
|
"isHostedDataExplorerEnabled": [Function],
|
||||||
"isLeftPaneExpanded": [Function],
|
"isLeftPaneExpanded": [Function],
|
||||||
"isLinkInjectionEnabled": [Function],
|
|
||||||
"isMongoIndexingEnabled": [Function],
|
"isMongoIndexingEnabled": [Function],
|
||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
@@ -4814,8 +4553,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
"isPreferredApiTable": [Function],
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isReadToggled": [Function],
|
|
||||||
"isReadWriteToggled": [Function],
|
|
||||||
"isRefreshingExplorer": [Function],
|
"isRefreshingExplorer": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@@ -4841,13 +4578,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"memoryUsageInfo": [Function],
|
"memoryUsageInfo": [Function],
|
||||||
"mostRecentActivity": MostRecentActivity {
|
|
||||||
"container": [Circular],
|
|
||||||
"storedData": Object {
|
|
||||||
"itemsMap": Object {},
|
|
||||||
"schemaVersion": "1",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"newVertexPane": NewVertexPane {
|
"newVertexPane": NewVertexPane {
|
||||||
"buildString": [Function],
|
"buildString": [Function],
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -4870,7 +4600,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"onRefreshDatabasesKeyPress": [Function],
|
"onRefreshDatabasesKeyPress": [Function],
|
||||||
"onRefreshResourcesClick": [Function],
|
"onRefreshResourcesClick": [Function],
|
||||||
"onSwitchToConnectionString": [Function],
|
"onSwitchToConnectionString": [Function],
|
||||||
"onToggleKeyDown": [Function],
|
"openDialog": undefined,
|
||||||
|
"openSidePanel": undefined,
|
||||||
"provideFeedbackEmail": [Function],
|
"provideFeedbackEmail": [Function],
|
||||||
"queriesClient": QueriesClient {
|
"queriesClient": QueriesClient {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
@@ -4899,24 +4630,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"refreshDatabaseAccount": [Function],
|
"refreshDatabaseAccount": [Function],
|
||||||
"refreshNotebookList": [Function],
|
"refreshNotebookList": [Function],
|
||||||
"refreshTreeTitle": [Function],
|
"refreshTreeTitle": [Function],
|
||||||
"renewAdHocAccessPane": RenewAdHocAccessPane {
|
|
||||||
"_renewShareAccess": [Function],
|
|
||||||
"accessKey": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"firstFieldHasFocus": [Function],
|
|
||||||
"formErrors": [Function],
|
|
||||||
"formErrorsDetails": [Function],
|
|
||||||
"id": "renewadhocaccesspane",
|
|
||||||
"isExecuting": [Function],
|
|
||||||
"isHelperImageVisible": [Function],
|
|
||||||
"isTemplateReady": [Function],
|
|
||||||
"onShowHelperImageClick": [Function],
|
|
||||||
"onShowHelperImageKeyPress": [Function],
|
|
||||||
"title": [Function],
|
|
||||||
"visible": [Function],
|
|
||||||
},
|
|
||||||
"renewToken": [Function],
|
|
||||||
"renewTokenError": [Function],
|
|
||||||
"resourceTokenCollection": [Function],
|
"resourceTokenCollection": [Function],
|
||||||
"resourceTokenCollectionId": [Function],
|
"resourceTokenCollectionId": [Function],
|
||||||
"resourceTokenDatabaseId": [Function],
|
"resourceTokenDatabaseId": [Function],
|
||||||
@@ -4963,14 +4676,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
},
|
},
|
||||||
"selectedDatabaseId": [Function],
|
"selectedDatabaseId": [Function],
|
||||||
"selectedNode": [Function],
|
"selectedNode": [Function],
|
||||||
"selfServeComponentAdapter": SelfServeComponentAdapter {
|
|
||||||
"container": [Circular],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeLoadingComponentAdapter": SelfServeLoadingComponentAdapter {
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"selfServeType": [Function],
|
|
||||||
"serverId": [Function],
|
"serverId": [Function],
|
||||||
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
"setInProgressConsoleDataIdToBeDeleted": undefined,
|
||||||
"setIsNotificationConsoleExpanded": undefined,
|
"setIsNotificationConsoleExpanded": undefined,
|
||||||
@@ -5012,22 +4717,8 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"title": [Function],
|
"title": [Function],
|
||||||
"visible": [Function],
|
"visible": [Function],
|
||||||
},
|
},
|
||||||
"shareAccessData": [Function],
|
|
||||||
"shareAccessToggleState": [Function],
|
|
||||||
"shareAccessUrl": [Function],
|
|
||||||
"shareTokenCopyHelperText": [Function],
|
|
||||||
"shareUrlCopyHelperText": [Function],
|
|
||||||
"shouldShowContextSwitchPrompt": [Function],
|
|
||||||
"shouldShowDataAccessExpiryDialog": [Function],
|
|
||||||
"shouldShowShareDialogContents": [Function],
|
|
||||||
"signInAad": [Function],
|
"signInAad": [Function],
|
||||||
"sparkClusterConnectionInfo": [Function],
|
"sparkClusterConnectionInfo": [Function],
|
||||||
"splashScreenAdapter": SplashScreenComponentAdapter {
|
|
||||||
"clearMostRecent": [Function],
|
|
||||||
"container": [Circular],
|
|
||||||
"forceRender": [Function],
|
|
||||||
"parameters": [Function],
|
|
||||||
},
|
|
||||||
"splitter": Splitter {
|
"splitter": Splitter {
|
||||||
"bounds": Object {
|
"bounds": Object {
|
||||||
"max": 400,
|
"max": 400,
|
||||||
@@ -5085,9 +4776,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"openedTabs": [Function],
|
"openedTabs": [Function],
|
||||||
},
|
},
|
||||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||||
"toggleRead": [Function],
|
|
||||||
"toggleReadWrite": [Function],
|
|
||||||
"tokenForRenewal": [Function],
|
|
||||||
"uploadFilePane": UploadFilePane {
|
"uploadFilePane": UploadFilePane {
|
||||||
"container": [Circular],
|
"container": [Circular],
|
||||||
"extensions": [Function],
|
"extensions": [Function],
|
||||||
|
|||||||
@@ -256,11 +256,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
>
|
>
|
||||||
A request to increase the throughput is currently in progress. This operation will take some time to complete.
|
A request to increase the throughput is currently in progress. This operation will take some time to complete.
|
||||||
<br />
|
<br />
|
||||||
Database:
|
Database: sampleDb, Container: sampleCollection
|
||||||
sampleDb
|
|
||||||
, Container:
|
|
||||||
sampleCollection
|
|
||||||
|
|
||||||
, Current manual throughput: 1000 RU/s
|
, Current manual throughput: 1000 RU/s
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
@@ -275,11 +271,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
>
|
>
|
||||||
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to complete. View the latest status in Notifications.
|
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to complete. View the latest status in Notifications.
|
||||||
<br />
|
<br />
|
||||||
Database:
|
Database: sampleDb, Container: sampleCollection
|
||||||
sampleDb
|
|
||||||
, Container:
|
|
||||||
sampleCollection
|
|
||||||
|
|
||||||
, Current manual throughput: 1000 RU/s, Target manual throughput: 2000
|
, Current manual throughput: 1000 RU/s, Target manual throughput: 2000
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import { SmartUiComponent, SmartUiDescriptor } from "./SmartUiComponent";
|
import { SmartUiComponent, SmartUiDescriptor } from "./SmartUiComponent";
|
||||||
import { NumberUiType, SmartUiInput } from "../../../SelfServe/SelfServeTypes";
|
import { NumberUiType, SmartUiInput, DescriptionType } from "../../../SelfServe/SelfServeTypes";
|
||||||
|
|
||||||
describe("SmartUiComponent", () => {
|
describe("SmartUiComponent", () => {
|
||||||
const exampleData: SmartUiDescriptor = {
|
const exampleData: SmartUiDescriptor = {
|
||||||
@@ -18,10 +18,12 @@ describe("SmartUiComponent", () => {
|
|||||||
{
|
{
|
||||||
id: "description",
|
id: "description",
|
||||||
input: {
|
input: {
|
||||||
|
labelTKey: undefined,
|
||||||
dataFieldName: "description",
|
dataFieldName: "description",
|
||||||
type: "string",
|
type: "string",
|
||||||
description: {
|
description: {
|
||||||
textTKey: "this is an example description text.",
|
textTKey: "this is an example description text.",
|
||||||
|
type: DescriptionType.Text,
|
||||||
link: {
|
link: {
|
||||||
href: "https://docs.microsoft.com/en-us/azure/cosmos-db/introduction",
|
href: "https://docs.microsoft.com/en-us/azure/cosmos-db/introduction",
|
||||||
textTKey: "Click here for more information.",
|
textTKey: "Click here for more information.",
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import { Dropdown, IDropdownOption } from "office-ui-fabric-react/lib/Dropdown";
|
|||||||
import { TextField } from "office-ui-fabric-react/lib/TextField";
|
import { TextField } from "office-ui-fabric-react/lib/TextField";
|
||||||
import { Text } from "office-ui-fabric-react/lib/Text";
|
import { Text } from "office-ui-fabric-react/lib/Text";
|
||||||
import { Stack, IStackTokens } from "office-ui-fabric-react/lib/Stack";
|
import { Stack, IStackTokens } from "office-ui-fabric-react/lib/Stack";
|
||||||
import { Link, MessageBar, MessageBarType, Toggle } from "office-ui-fabric-react";
|
import { Label, Link, MessageBar, MessageBarType, Toggle } from "office-ui-fabric-react";
|
||||||
import * as InputUtils from "./InputUtils";
|
import * as InputUtils from "./InputUtils";
|
||||||
import "./SmartUiComponent.less";
|
import "./SmartUiComponent.less";
|
||||||
import {
|
import {
|
||||||
ChoiceItem,
|
ChoiceItem,
|
||||||
Description,
|
Description,
|
||||||
|
DescriptionType,
|
||||||
Info,
|
Info,
|
||||||
InputType,
|
InputType,
|
||||||
InputTypeValue,
|
InputTypeValue,
|
||||||
@@ -19,6 +20,7 @@ import {
|
|||||||
SmartUiInput,
|
SmartUiInput,
|
||||||
} from "../../../SelfServe/SelfServeTypes";
|
} from "../../../SelfServe/SelfServeTypes";
|
||||||
import { TFunction } from "i18next";
|
import { TFunction } from "i18next";
|
||||||
|
import { ToolTipLabelComponent } from "../Settings/SettingsSubComponents/ToolTipLabelComponent";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic UX renderer
|
* Generic UX renderer
|
||||||
@@ -29,15 +31,14 @@ import { TFunction } from "i18next";
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
interface BaseDisplay {
|
interface BaseDisplay {
|
||||||
|
labelTKey: string;
|
||||||
dataFieldName: string;
|
dataFieldName: string;
|
||||||
errorMessage?: string;
|
errorMessage?: string;
|
||||||
type: InputTypeValue;
|
type: InputTypeValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BaseInput extends BaseDisplay {
|
interface BaseInput extends BaseDisplay {
|
||||||
labelTKey: string;
|
|
||||||
placeholderTKey?: string;
|
placeholderTKey?: string;
|
||||||
errorMessage?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +68,8 @@ interface ChoiceInput extends BaseInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface DescriptionDisplay extends BaseDisplay {
|
interface DescriptionDisplay extends BaseDisplay {
|
||||||
description: Description;
|
description?: Description;
|
||||||
|
isDynamicDescription?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type AnyDisplay = NumberInput | BooleanInput | StringInput | ChoiceInput | DescriptionDisplay;
|
type AnyDisplay = NumberInput | BooleanInput | StringInput | ChoiceInput | DescriptionDisplay;
|
||||||
@@ -123,25 +125,27 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
|
|
||||||
private renderInfo(info: Info): JSX.Element {
|
private renderInfo(info: Info): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<MessageBar styles={{ root: { width: 400 } }}>
|
info && (
|
||||||
{this.props.getTranslation(info.messageTKey)}
|
<Text>
|
||||||
{info.link && (
|
{this.props.getTranslation(info.messageTKey)}{" "}
|
||||||
<Link href={info.link.href} target="_blank">
|
{info.link && (
|
||||||
{this.props.getTranslation(info.link.textTKey)}
|
<Link href={info.link.href} target="_blank">
|
||||||
</Link>
|
{this.props.getTranslation(info.link.textTKey)}
|
||||||
)}
|
</Link>
|
||||||
</MessageBar>
|
)}
|
||||||
|
</Text>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderTextInput(input: StringInput): JSX.Element {
|
private renderTextInput(input: StringInput, labelId: string): JSX.Element {
|
||||||
const value = this.props.currentValues.get(input.dataFieldName)?.value as string;
|
const value = this.props.currentValues.get(input.dataFieldName)?.value as string;
|
||||||
const disabled = this.props.disabled || this.props.currentValues.get(input.dataFieldName)?.disabled;
|
const disabled = this.props.disabled || this.props.currentValues.get(input.dataFieldName)?.disabled;
|
||||||
return (
|
return (
|
||||||
<div className="stringInputContainer">
|
<div className="stringInputContainer">
|
||||||
<TextField
|
<TextField
|
||||||
id={`${input.dataFieldName}-textField-input`}
|
id={`${input.dataFieldName}-textField-input`}
|
||||||
label={this.props.getTranslation(input.labelTKey)}
|
aria-labelledby={labelId}
|
||||||
type="text"
|
type="text"
|
||||||
value={value || ""}
|
value={value || ""}
|
||||||
placeholder={this.props.getTranslation(input.placeholderTKey)}
|
placeholder={this.props.getTranslation(input.placeholderTKey)}
|
||||||
@@ -149,32 +153,35 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
onChange={(_, newValue) => this.props.onInputChange(input, newValue)}
|
onChange={(_, newValue) => this.props.onInputChange(input, newValue)}
|
||||||
styles={{
|
styles={{
|
||||||
root: { width: 400 },
|
root: { width: 400 },
|
||||||
subComponentStyles: {
|
|
||||||
label: {
|
|
||||||
root: {
|
|
||||||
...SmartUiComponent.labelStyle,
|
|
||||||
fontWeight: 600,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderDescription(input: DescriptionDisplay): JSX.Element {
|
private renderDescription(input: DescriptionDisplay, labelId: string): JSX.Element {
|
||||||
const description = input.description;
|
const dataFieldName = input.dataFieldName;
|
||||||
return (
|
const description = input.description || (this.props.currentValues.get(dataFieldName)?.value as Description);
|
||||||
<Text id={`${input.dataFieldName}-text-display`}>
|
if (!description) {
|
||||||
{this.props.getTranslation(input.description.textTKey)}{" "}
|
return this.renderError("Description is not provided.");
|
||||||
|
}
|
||||||
|
const descriptionElement = (
|
||||||
|
<Text id={`${dataFieldName}-text-display`} aria-labelledby={labelId}>
|
||||||
|
{this.props.getTranslation(description.textTKey)}{" "}
|
||||||
{description.link && (
|
{description.link && (
|
||||||
<Link target="_blank" href={input.description.link.href}>
|
<Link target="_blank" href={description.link.href}>
|
||||||
{this.props.getTranslation(input.description.link.textTKey)}
|
{this.props.getTranslation(description.link.textTKey)}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (description.type === DescriptionType.Text) {
|
||||||
|
return descriptionElement;
|
||||||
|
}
|
||||||
|
const messageBarType =
|
||||||
|
description.type === DescriptionType.InfoMessageBar ? MessageBarType.info : MessageBarType.warning;
|
||||||
|
return <MessageBar messageBarType={messageBarType}>{descriptionElement}</MessageBar>;
|
||||||
}
|
}
|
||||||
|
|
||||||
private clearError(dataFieldName: string): void {
|
private clearError(dataFieldName: string): void {
|
||||||
@@ -220,13 +227,12 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
private renderNumberInput(input: NumberInput): JSX.Element {
|
private renderNumberInput(input: NumberInput, labelId: string): JSX.Element {
|
||||||
const { labelTKey, min, max, dataFieldName, step } = input;
|
const { labelTKey, min, max, dataFieldName, step } = input;
|
||||||
const props = {
|
const props = {
|
||||||
label: this.props.getTranslation(labelTKey),
|
|
||||||
min: min,
|
min: min,
|
||||||
max: max,
|
max: max,
|
||||||
ariaLabel: labelTKey,
|
ariaLabel: this.props.getTranslation(labelTKey),
|
||||||
step: step,
|
step: step,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -243,13 +249,8 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
onIncrement={(newValue) => this.onIncrement(input, newValue, props.step, props.max)}
|
onIncrement={(newValue) => this.onIncrement(input, newValue, props.step, props.max)}
|
||||||
onDecrement={(newValue) => this.onDecrement(input, newValue, props.step, props.min)}
|
onDecrement={(newValue) => this.onDecrement(input, newValue, props.step, props.min)}
|
||||||
labelPosition={Position.top}
|
labelPosition={Position.top}
|
||||||
|
aria-labelledby={labelId}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
styles={{
|
|
||||||
label: {
|
|
||||||
...SmartUiComponent.labelStyle,
|
|
||||||
fontWeight: 600,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{this.state.errors.has(dataFieldName) && (
|
{this.state.errors.has(dataFieldName) && (
|
||||||
<MessageBar messageBarType={MessageBarType.error}>Error: {this.state.errors.get(dataFieldName)}</MessageBar>
|
<MessageBar messageBarType={MessageBarType.error}>Error: {this.state.errors.get(dataFieldName)}</MessageBar>
|
||||||
@@ -266,10 +267,6 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
onChange={(newValue) => this.props.onInputChange(input, newValue)}
|
onChange={(newValue) => this.props.onInputChange(input, newValue)}
|
||||||
styles={{
|
styles={{
|
||||||
root: { width: 400 },
|
root: { width: 400 },
|
||||||
titleLabel: {
|
|
||||||
...SmartUiComponent.labelStyle,
|
|
||||||
fontWeight: 600,
|
|
||||||
},
|
|
||||||
valueLabel: SmartUiComponent.labelStyle,
|
valueLabel: SmartUiComponent.labelStyle,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -280,13 +277,13 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderBooleanInput(input: BooleanInput): JSX.Element {
|
private renderBooleanInput(input: BooleanInput, labelId: string): JSX.Element {
|
||||||
const value = this.props.currentValues.get(input.dataFieldName)?.value as boolean;
|
const value = this.props.currentValues.get(input.dataFieldName)?.value as boolean;
|
||||||
const disabled = this.props.disabled || this.props.currentValues.get(input.dataFieldName)?.disabled;
|
const disabled = this.props.disabled || this.props.currentValues.get(input.dataFieldName)?.disabled;
|
||||||
return (
|
return (
|
||||||
<Toggle
|
<Toggle
|
||||||
id={`${input.dataFieldName}-toggle-input`}
|
id={`${input.dataFieldName}-toggle-input`}
|
||||||
label={this.props.getTranslation(input.labelTKey)}
|
aria-labelledby={labelId}
|
||||||
checked={value || false}
|
checked={value || false}
|
||||||
onText={this.props.getTranslation(input.trueLabelTKey)}
|
onText={this.props.getTranslation(input.trueLabelTKey)}
|
||||||
offText={this.props.getTranslation(input.falseLabelTKey)}
|
offText={this.props.getTranslation(input.falseLabelTKey)}
|
||||||
@@ -297,8 +294,8 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderChoiceInput(input: ChoiceInput): JSX.Element {
|
private renderChoiceInput(input: ChoiceInput, labelId: string): JSX.Element {
|
||||||
const { labelTKey, defaultKey, dataFieldName, choices, placeholderTKey } = input;
|
const { defaultKey, dataFieldName, choices, placeholderTKey } = input;
|
||||||
const value = this.props.currentValues.get(dataFieldName)?.value as string;
|
const value = this.props.currentValues.get(dataFieldName)?.value as string;
|
||||||
const disabled = this.props.disabled || this.props.currentValues.get(dataFieldName)?.disabled;
|
const disabled = this.props.disabled || this.props.currentValues.get(dataFieldName)?.disabled;
|
||||||
let selectedKey = value ? value : defaultKey;
|
let selectedKey = value ? value : defaultKey;
|
||||||
@@ -308,7 +305,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
id={`${input.dataFieldName}-dropdown-input`}
|
id={`${input.dataFieldName}-dropdown-input`}
|
||||||
label={this.props.getTranslation(labelTKey)}
|
aria-labelledby={labelId}
|
||||||
selectedKey={selectedKey}
|
selectedKey={selectedKey}
|
||||||
onChange={(_, item: IDropdownOption) => this.props.onInputChange(input, item.key.toString())}
|
onChange={(_, item: IDropdownOption) => this.props.onInputChange(input, item.key.toString())}
|
||||||
placeholder={this.props.getTranslation(placeholderTKey)}
|
placeholder={this.props.getTranslation(placeholderTKey)}
|
||||||
@@ -319,40 +316,53 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
}))}
|
}))}
|
||||||
styles={{
|
styles={{
|
||||||
root: { width: 400 },
|
root: { width: 400 },
|
||||||
label: {
|
|
||||||
...SmartUiComponent.labelStyle,
|
|
||||||
fontWeight: 600,
|
|
||||||
},
|
|
||||||
dropdown: SmartUiComponent.labelStyle,
|
dropdown: SmartUiComponent.labelStyle,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderError(input: AnyDisplay): JSX.Element {
|
private renderError(errorMessage: string): JSX.Element {
|
||||||
return <MessageBar messageBarType={MessageBarType.error}>Error: {input.errorMessage}</MessageBar>;
|
return <MessageBar messageBarType={MessageBarType.error}>Error: {errorMessage}</MessageBar>;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderDisplay(input: AnyDisplay): JSX.Element {
|
private renderDisplayWithInfoBubble(input: AnyDisplay, info: Info): JSX.Element {
|
||||||
if (input.errorMessage) {
|
if (input.errorMessage) {
|
||||||
return this.renderError(input);
|
return this.renderError(input.errorMessage);
|
||||||
}
|
}
|
||||||
const inputHidden = this.props.currentValues.get(input.dataFieldName)?.hidden;
|
const inputHidden = this.props.currentValues.get(input.dataFieldName)?.hidden;
|
||||||
if (inputHidden) {
|
if (inputHidden) {
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
const labelId = `${input.dataFieldName}-label`;
|
||||||
|
return (
|
||||||
|
<Stack>
|
||||||
|
{input.labelTKey && (
|
||||||
|
<Label id={labelId}>
|
||||||
|
<ToolTipLabelComponent
|
||||||
|
label={this.props.getTranslation(input.labelTKey)}
|
||||||
|
toolTipElement={this.renderInfo(info)}
|
||||||
|
/>
|
||||||
|
</Label>
|
||||||
|
)}
|
||||||
|
{this.renderDisplay(input, labelId)}
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private renderDisplay(input: AnyDisplay, labelId: string): JSX.Element {
|
||||||
switch (input.type) {
|
switch (input.type) {
|
||||||
case "string":
|
case "string":
|
||||||
if ("description" in input) {
|
if ("description" in input || "isDynamicDescription" in input) {
|
||||||
return this.renderDescription(input as DescriptionDisplay);
|
return this.renderDescription(input as DescriptionDisplay, labelId);
|
||||||
}
|
}
|
||||||
return this.renderTextInput(input as StringInput);
|
return this.renderTextInput(input as StringInput, labelId);
|
||||||
case "number":
|
case "number":
|
||||||
return this.renderNumberInput(input as NumberInput);
|
return this.renderNumberInput(input as NumberInput, labelId);
|
||||||
case "boolean":
|
case "boolean":
|
||||||
return this.renderBooleanInput(input as BooleanInput);
|
return this.renderBooleanInput(input as BooleanInput, labelId);
|
||||||
case "object":
|
case "object":
|
||||||
return this.renderChoiceInput(input as ChoiceInput);
|
return this.renderChoiceInput(input as ChoiceInput, labelId);
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown input type: ${input.type}`);
|
throw new Error(`Unknown input type: ${input.type}`);
|
||||||
}
|
}
|
||||||
@@ -363,10 +373,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack tokens={containerStackTokens} className="widgetRendererContainer">
|
<Stack tokens={containerStackTokens} className="widgetRendererContainer">
|
||||||
<Stack.Item>
|
<Stack.Item>{node.input && this.renderDisplayWithInfoBubble(node.input, node.info as Info)}</Stack.Item>
|
||||||
{node.info && this.renderInfo(node.info as Info)}
|
|
||||||
{node.input && this.renderDisplay(node.input)}
|
|
||||||
</Stack.Item>
|
|
||||||
{node.children && node.children.map((child) => <div key={child.id}>{this.renderNode(child)}</div>)}
|
{node.children && node.children.map((child) => <div key={child.id}>{this.renderNode(child)}</div>)}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,25 +9,7 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem />
|
||||||
<StyledMessageBarBase
|
|
||||||
styles={
|
|
||||||
Object {
|
|
||||||
"root": Object {
|
|
||||||
"width": 400,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Start at $24/mo per database
|
|
||||||
<StyledLinkBase
|
|
||||||
href="https://aka.ms/azure-cosmos-db-pricing"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
More Details
|
|
||||||
</StyledLinkBase>
|
|
||||||
</StyledMessageBarBase>
|
|
||||||
</StackItem>
|
|
||||||
<div
|
<div
|
||||||
key="description"
|
key="description"
|
||||||
>
|
>
|
||||||
@@ -40,18 +22,21 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<Text
|
<Stack>
|
||||||
id="description-text-display"
|
<Text
|
||||||
>
|
aria-labelledby="description-label"
|
||||||
this is an example description text.
|
id="description-text-display"
|
||||||
|
|
||||||
<StyledLinkBase
|
|
||||||
href="https://docs.microsoft.com/en-us/azure/cosmos-db/introduction"
|
|
||||||
target="_blank"
|
|
||||||
>
|
>
|
||||||
Click here for more information.
|
this is an example description text.
|
||||||
</StyledLinkBase>
|
|
||||||
</Text>
|
<StyledLinkBase
|
||||||
|
href="https://docs.microsoft.com/en-us/azure/cosmos-db/introduction"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Click here for more information.
|
||||||
|
</StyledLinkBase>
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,53 +52,53 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<Stack
|
<Stack>
|
||||||
styles={
|
<StyledLabelBase
|
||||||
Object {
|
id="throughput-label"
|
||||||
"root": Object {
|
>
|
||||||
"width": 400,
|
<ToolTipLabelComponent
|
||||||
},
|
label="Throughput (input)"
|
||||||
}
|
/>
|
||||||
}
|
</StyledLabelBase>
|
||||||
tokens={
|
<Stack
|
||||||
Object {
|
|
||||||
"childrenGap": 2,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<CustomizedSpinButton
|
|
||||||
ariaLabel="Throughput (input)"
|
|
||||||
decrementButtonIcon={
|
|
||||||
Object {
|
|
||||||
"iconName": "ChevronDownSmall",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
disabled={true}
|
|
||||||
id="throughput-spinner-input"
|
|
||||||
incrementButtonIcon={
|
|
||||||
Object {
|
|
||||||
"iconName": "ChevronUpSmall",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label="Throughput (input)"
|
|
||||||
labelPosition={0}
|
|
||||||
max={500}
|
|
||||||
min={400}
|
|
||||||
onDecrement={[Function]}
|
|
||||||
onIncrement={[Function]}
|
|
||||||
onValidate={[Function]}
|
|
||||||
step={10}
|
|
||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
"label": Object {
|
"root": Object {
|
||||||
"color": "#393939",
|
"width": 400,
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
|
||||||
"fontSize": 12,
|
|
||||||
"fontWeight": 600,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
tokens={
|
||||||
|
Object {
|
||||||
|
"childrenGap": 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<CustomizedSpinButton
|
||||||
|
aria-labelledby="throughput-label"
|
||||||
|
ariaLabel="Throughput (input)"
|
||||||
|
decrementButtonIcon={
|
||||||
|
Object {
|
||||||
|
"iconName": "ChevronDownSmall",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
disabled={true}
|
||||||
|
id="throughput-spinner-input"
|
||||||
|
incrementButtonIcon={
|
||||||
|
Object {
|
||||||
|
"iconName": "ChevronUpSmall",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
label=""
|
||||||
|
labelPosition={0}
|
||||||
|
max={500}
|
||||||
|
min={400}
|
||||||
|
onDecrement={[Function]}
|
||||||
|
onIncrement={[Function]}
|
||||||
|
onValidate={[Function]}
|
||||||
|
step={10}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -130,37 +115,39 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<div
|
<Stack>
|
||||||
id="throughput2-slider-input"
|
<StyledLabelBase
|
||||||
>
|
id="throughput2-label"
|
||||||
<StyledSliderBase
|
>
|
||||||
ariaLabel="Throughput (Slider)"
|
<ToolTipLabelComponent
|
||||||
disabled={true}
|
label="Throughput (Slider)"
|
||||||
label="Throughput (Slider)"
|
/>
|
||||||
max={500}
|
</StyledLabelBase>
|
||||||
min={400}
|
<div
|
||||||
onChange={[Function]}
|
id="throughput2-slider-input"
|
||||||
step={10}
|
>
|
||||||
styles={
|
<StyledSliderBase
|
||||||
Object {
|
ariaLabel="Throughput (Slider)"
|
||||||
"root": Object {
|
disabled={true}
|
||||||
"width": 400,
|
max={500}
|
||||||
},
|
min={400}
|
||||||
"titleLabel": Object {
|
onChange={[Function]}
|
||||||
"color": "#393939",
|
step={10}
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
styles={
|
||||||
"fontSize": 12,
|
Object {
|
||||||
"fontWeight": 600,
|
"root": Object {
|
||||||
},
|
"width": 400,
|
||||||
"valueLabel": Object {
|
},
|
||||||
"color": "#393939",
|
"valueLabel": Object {
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
"color": "#393939",
|
||||||
"fontSize": 12,
|
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
||||||
},
|
"fontSize": 12,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -197,35 +184,34 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<div
|
<Stack>
|
||||||
className="stringInputContainer"
|
<StyledLabelBase
|
||||||
>
|
id="containerId-label"
|
||||||
<StyledTextFieldBase
|
>
|
||||||
disabled={true}
|
<ToolTipLabelComponent
|
||||||
id="containerId-textField-input"
|
label="Container id"
|
||||||
label="Container id"
|
/>
|
||||||
onChange={[Function]}
|
</StyledLabelBase>
|
||||||
styles={
|
<div
|
||||||
Object {
|
className="stringInputContainer"
|
||||||
"root": Object {
|
>
|
||||||
"width": 400,
|
<StyledTextFieldBase
|
||||||
},
|
aria-labelledby="containerId-label"
|
||||||
"subComponentStyles": Object {
|
disabled={true}
|
||||||
"label": Object {
|
id="containerId-textField-input"
|
||||||
"root": Object {
|
onChange={[Function]}
|
||||||
"color": "#393939",
|
styles={
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
Object {
|
||||||
"fontSize": 12,
|
"root": Object {
|
||||||
"fontWeight": 600,
|
"width": 400,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
type="text"
|
||||||
type="text"
|
value=""
|
||||||
value=""
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -241,22 +227,31 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<StyledToggleBase
|
<Stack>
|
||||||
checked={false}
|
<StyledLabelBase
|
||||||
disabled={true}
|
id="analyticalStore-label"
|
||||||
id="analyticalStore-toggle-input"
|
>
|
||||||
label="Analytical Store"
|
<ToolTipLabelComponent
|
||||||
offText="Disabled"
|
label="Analytical Store"
|
||||||
onChange={[Function]}
|
/>
|
||||||
onText="Enabled"
|
</StyledLabelBase>
|
||||||
styles={
|
<StyledToggleBase
|
||||||
Object {
|
aria-labelledby="analyticalStore-label"
|
||||||
"root": Object {
|
checked={false}
|
||||||
"width": 400,
|
disabled={true}
|
||||||
},
|
id="analyticalStore-toggle-input"
|
||||||
|
offText="Disabled"
|
||||||
|
onChange={[Function]}
|
||||||
|
onText="Enabled"
|
||||||
|
styles={
|
||||||
|
Object {
|
||||||
|
"root": Object {
|
||||||
|
"width": 400,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
/>
|
||||||
/>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -272,47 +267,50 @@ exports[`SmartUiComponent disable all inputs 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<StyledWithResponsiveMode
|
<Stack>
|
||||||
disabled={true}
|
<StyledLabelBase
|
||||||
id="database-dropdown-input"
|
id="database-label"
|
||||||
label="Database"
|
>
|
||||||
onChange={[Function]}
|
<ToolTipLabelComponent
|
||||||
options={
|
label="Database"
|
||||||
Array [
|
/>
|
||||||
Object {
|
</StyledLabelBase>
|
||||||
"key": "db1",
|
<StyledWithResponsiveMode
|
||||||
"text": "Database 1",
|
aria-labelledby="database-label"
|
||||||
},
|
disabled={true}
|
||||||
Object {
|
id="database-dropdown-input"
|
||||||
"key": "db2",
|
onChange={[Function]}
|
||||||
"text": "Database 2",
|
options={
|
||||||
},
|
Array [
|
||||||
Object {
|
Object {
|
||||||
"key": "db3",
|
"key": "db1",
|
||||||
"text": "Database 3",
|
"text": "Database 1",
|
||||||
},
|
},
|
||||||
]
|
Object {
|
||||||
}
|
"key": "db2",
|
||||||
selectedKey="db2"
|
"text": "Database 2",
|
||||||
styles={
|
},
|
||||||
Object {
|
Object {
|
||||||
"dropdown": Object {
|
"key": "db3",
|
||||||
"color": "#393939",
|
"text": "Database 3",
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
},
|
||||||
"fontSize": 12,
|
]
|
||||||
},
|
|
||||||
"label": Object {
|
|
||||||
"color": "#393939",
|
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
|
||||||
"fontSize": 12,
|
|
||||||
"fontWeight": 600,
|
|
||||||
},
|
|
||||||
"root": Object {
|
|
||||||
"width": 400,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
selectedKey="db2"
|
||||||
/>
|
styles={
|
||||||
|
Object {
|
||||||
|
"dropdown": Object {
|
||||||
|
"color": "#393939",
|
||||||
|
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
||||||
|
"fontSize": 12,
|
||||||
|
},
|
||||||
|
"root": Object {
|
||||||
|
"width": 400,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -328,25 +326,7 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem />
|
||||||
<StyledMessageBarBase
|
|
||||||
styles={
|
|
||||||
Object {
|
|
||||||
"root": Object {
|
|
||||||
"width": 400,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Start at $24/mo per database
|
|
||||||
<StyledLinkBase
|
|
||||||
href="https://aka.ms/azure-cosmos-db-pricing"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
More Details
|
|
||||||
</StyledLinkBase>
|
|
||||||
</StyledMessageBarBase>
|
|
||||||
</StackItem>
|
|
||||||
<div
|
<div
|
||||||
key="description"
|
key="description"
|
||||||
>
|
>
|
||||||
@@ -359,18 +339,21 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<Text
|
<Stack>
|
||||||
id="description-text-display"
|
<Text
|
||||||
>
|
aria-labelledby="description-label"
|
||||||
this is an example description text.
|
id="description-text-display"
|
||||||
|
|
||||||
<StyledLinkBase
|
|
||||||
href="https://docs.microsoft.com/en-us/azure/cosmos-db/introduction"
|
|
||||||
target="_blank"
|
|
||||||
>
|
>
|
||||||
Click here for more information.
|
this is an example description text.
|
||||||
</StyledLinkBase>
|
|
||||||
</Text>
|
<StyledLinkBase
|
||||||
|
href="https://docs.microsoft.com/en-us/azure/cosmos-db/introduction"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Click here for more information.
|
||||||
|
</StyledLinkBase>
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -386,53 +369,53 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<Stack
|
<Stack>
|
||||||
styles={
|
<StyledLabelBase
|
||||||
Object {
|
id="throughput-label"
|
||||||
"root": Object {
|
>
|
||||||
"width": 400,
|
<ToolTipLabelComponent
|
||||||
},
|
label="Throughput (input)"
|
||||||
}
|
/>
|
||||||
}
|
</StyledLabelBase>
|
||||||
tokens={
|
<Stack
|
||||||
Object {
|
|
||||||
"childrenGap": 2,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<CustomizedSpinButton
|
|
||||||
ariaLabel="Throughput (input)"
|
|
||||||
decrementButtonIcon={
|
|
||||||
Object {
|
|
||||||
"iconName": "ChevronDownSmall",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
disabled={false}
|
|
||||||
id="throughput-spinner-input"
|
|
||||||
incrementButtonIcon={
|
|
||||||
Object {
|
|
||||||
"iconName": "ChevronUpSmall",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label="Throughput (input)"
|
|
||||||
labelPosition={0}
|
|
||||||
max={500}
|
|
||||||
min={400}
|
|
||||||
onDecrement={[Function]}
|
|
||||||
onIncrement={[Function]}
|
|
||||||
onValidate={[Function]}
|
|
||||||
step={10}
|
|
||||||
styles={
|
styles={
|
||||||
Object {
|
Object {
|
||||||
"label": Object {
|
"root": Object {
|
||||||
"color": "#393939",
|
"width": 400,
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
|
||||||
"fontSize": 12,
|
|
||||||
"fontWeight": 600,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
tokens={
|
||||||
|
Object {
|
||||||
|
"childrenGap": 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<CustomizedSpinButton
|
||||||
|
aria-labelledby="throughput-label"
|
||||||
|
ariaLabel="Throughput (input)"
|
||||||
|
decrementButtonIcon={
|
||||||
|
Object {
|
||||||
|
"iconName": "ChevronDownSmall",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
disabled={false}
|
||||||
|
id="throughput-spinner-input"
|
||||||
|
incrementButtonIcon={
|
||||||
|
Object {
|
||||||
|
"iconName": "ChevronUpSmall",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
label=""
|
||||||
|
labelPosition={0}
|
||||||
|
max={500}
|
||||||
|
min={400}
|
||||||
|
onDecrement={[Function]}
|
||||||
|
onIncrement={[Function]}
|
||||||
|
onValidate={[Function]}
|
||||||
|
step={10}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -449,36 +432,38 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<div
|
<Stack>
|
||||||
id="throughput2-slider-input"
|
<StyledLabelBase
|
||||||
>
|
id="throughput2-label"
|
||||||
<StyledSliderBase
|
>
|
||||||
ariaLabel="Throughput (Slider)"
|
<ToolTipLabelComponent
|
||||||
label="Throughput (Slider)"
|
label="Throughput (Slider)"
|
||||||
max={500}
|
/>
|
||||||
min={400}
|
</StyledLabelBase>
|
||||||
onChange={[Function]}
|
<div
|
||||||
step={10}
|
id="throughput2-slider-input"
|
||||||
styles={
|
>
|
||||||
Object {
|
<StyledSliderBase
|
||||||
"root": Object {
|
ariaLabel="Throughput (Slider)"
|
||||||
"width": 400,
|
max={500}
|
||||||
},
|
min={400}
|
||||||
"titleLabel": Object {
|
onChange={[Function]}
|
||||||
"color": "#393939",
|
step={10}
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
styles={
|
||||||
"fontSize": 12,
|
Object {
|
||||||
"fontWeight": 600,
|
"root": Object {
|
||||||
},
|
"width": 400,
|
||||||
"valueLabel": Object {
|
},
|
||||||
"color": "#393939",
|
"valueLabel": Object {
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
"color": "#393939",
|
||||||
"fontSize": 12,
|
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
||||||
},
|
"fontSize": 12,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -515,34 +500,33 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<div
|
<Stack>
|
||||||
className="stringInputContainer"
|
<StyledLabelBase
|
||||||
>
|
id="containerId-label"
|
||||||
<StyledTextFieldBase
|
>
|
||||||
id="containerId-textField-input"
|
<ToolTipLabelComponent
|
||||||
label="Container id"
|
label="Container id"
|
||||||
onChange={[Function]}
|
/>
|
||||||
styles={
|
</StyledLabelBase>
|
||||||
Object {
|
<div
|
||||||
"root": Object {
|
className="stringInputContainer"
|
||||||
"width": 400,
|
>
|
||||||
},
|
<StyledTextFieldBase
|
||||||
"subComponentStyles": Object {
|
aria-labelledby="containerId-label"
|
||||||
"label": Object {
|
id="containerId-textField-input"
|
||||||
"root": Object {
|
onChange={[Function]}
|
||||||
"color": "#393939",
|
styles={
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
Object {
|
||||||
"fontSize": 12,
|
"root": Object {
|
||||||
"fontWeight": 600,
|
"width": 400,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
type="text"
|
||||||
type="text"
|
value=""
|
||||||
value=""
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -558,21 +542,30 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<StyledToggleBase
|
<Stack>
|
||||||
checked={false}
|
<StyledLabelBase
|
||||||
id="analyticalStore-toggle-input"
|
id="analyticalStore-label"
|
||||||
label="Analytical Store"
|
>
|
||||||
offText="Disabled"
|
<ToolTipLabelComponent
|
||||||
onChange={[Function]}
|
label="Analytical Store"
|
||||||
onText="Enabled"
|
/>
|
||||||
styles={
|
</StyledLabelBase>
|
||||||
Object {
|
<StyledToggleBase
|
||||||
"root": Object {
|
aria-labelledby="analyticalStore-label"
|
||||||
"width": 400,
|
checked={false}
|
||||||
},
|
id="analyticalStore-toggle-input"
|
||||||
|
offText="Disabled"
|
||||||
|
onChange={[Function]}
|
||||||
|
onText="Enabled"
|
||||||
|
styles={
|
||||||
|
Object {
|
||||||
|
"root": Object {
|
||||||
|
"width": 400,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
/>
|
||||||
/>
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
@@ -588,46 +581,49 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackItem>
|
<StackItem>
|
||||||
<StyledWithResponsiveMode
|
<Stack>
|
||||||
id="database-dropdown-input"
|
<StyledLabelBase
|
||||||
label="Database"
|
id="database-label"
|
||||||
onChange={[Function]}
|
>
|
||||||
options={
|
<ToolTipLabelComponent
|
||||||
Array [
|
label="Database"
|
||||||
Object {
|
/>
|
||||||
"key": "db1",
|
</StyledLabelBase>
|
||||||
"text": "Database 1",
|
<StyledWithResponsiveMode
|
||||||
},
|
aria-labelledby="database-label"
|
||||||
Object {
|
id="database-dropdown-input"
|
||||||
"key": "db2",
|
onChange={[Function]}
|
||||||
"text": "Database 2",
|
options={
|
||||||
},
|
Array [
|
||||||
Object {
|
Object {
|
||||||
"key": "db3",
|
"key": "db1",
|
||||||
"text": "Database 3",
|
"text": "Database 1",
|
||||||
},
|
},
|
||||||
]
|
Object {
|
||||||
}
|
"key": "db2",
|
||||||
selectedKey="db2"
|
"text": "Database 2",
|
||||||
styles={
|
},
|
||||||
Object {
|
Object {
|
||||||
"dropdown": Object {
|
"key": "db3",
|
||||||
"color": "#393939",
|
"text": "Database 3",
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
},
|
||||||
"fontSize": 12,
|
]
|
||||||
},
|
|
||||||
"label": Object {
|
|
||||||
"color": "#393939",
|
|
||||||
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
|
||||||
"fontSize": 12,
|
|
||||||
"fontWeight": 600,
|
|
||||||
},
|
|
||||||
"root": Object {
|
|
||||||
"width": 400,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
selectedKey="db2"
|
||||||
/>
|
styles={
|
||||||
|
Object {
|
||||||
|
"dropdown": Object {
|
||||||
|
"color": "#393939",
|
||||||
|
"fontFamily": "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
|
||||||
|
"fontSize": 12,
|
||||||
|
},
|
||||||
|
"root": Object {
|
||||||
|
"width": 400,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ export interface ThroughputInputParams {
|
|||||||
throughputModeRadioName: string;
|
throughputModeRadioName: string;
|
||||||
maxAutoPilotThroughputSet: ViewModels.Editable<number>;
|
maxAutoPilotThroughputSet: ViewModels.Editable<number>;
|
||||||
autoPilotUsageCost: ko.Computed<string>;
|
autoPilotUsageCost: ko.Computed<string>;
|
||||||
showAutoPilot?: ko.Observable<boolean>;
|
|
||||||
overrideWithAutoPilotSettings: ko.Observable<boolean>;
|
overrideWithAutoPilotSettings: ko.Observable<boolean>;
|
||||||
overrideWithProvisionedThroughputSettings: ko.Observable<boolean>;
|
overrideWithProvisionedThroughputSettings: ko.Observable<boolean>;
|
||||||
freeTierExceedThroughputTooltip?: ko.Observable<string>;
|
freeTierExceedThroughputTooltip?: ko.Observable<string>;
|
||||||
@@ -158,7 +157,6 @@ export class ThroughputInputViewModel extends WaitsForTemplateViewModel {
|
|||||||
public infoBubbleText: string | ko.Observable<string>;
|
public infoBubbleText: string | ko.Observable<string>;
|
||||||
public label: ko.Observable<string>;
|
public label: ko.Observable<string>;
|
||||||
public isFixed: boolean;
|
public isFixed: boolean;
|
||||||
public showAutoPilot: ko.Observable<boolean>;
|
|
||||||
public isAutoPilotSelected: ko.Observable<boolean>;
|
public isAutoPilotSelected: ko.Observable<boolean>;
|
||||||
public throughputAutoPilotRadioId: string;
|
public throughputAutoPilotRadioId: string;
|
||||||
public throughputProvisionedRadioId: string;
|
public throughputProvisionedRadioId: string;
|
||||||
@@ -202,14 +200,10 @@ export class ThroughputInputViewModel extends WaitsForTemplateViewModel {
|
|||||||
this.isFixed = !!options.isFixed;
|
this.isFixed = !!options.isFixed;
|
||||||
this.infoBubbleText = options.infoBubbleText || ko.observable<string>();
|
this.infoBubbleText = options.infoBubbleText || ko.observable<string>();
|
||||||
this.label = options.label || ko.observable<string>();
|
this.label = options.label || ko.observable<string>();
|
||||||
this.showAutoPilot = options.showAutoPilot !== undefined ? options.showAutoPilot : ko.observable<boolean>(true);
|
|
||||||
this.isAutoPilotSelected = options.isAutoPilotSelected || ko.observable<boolean>(false);
|
this.isAutoPilotSelected = options.isAutoPilotSelected || ko.observable<boolean>(false);
|
||||||
this.isAutoPilotSelected.subscribe((value) => {
|
this.isAutoPilotSelected.subscribe((value) => {
|
||||||
TelemetryProcessor.trace(Action.ToggleAutoscaleSetting, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.ToggleAutoscaleSetting, ActionModifiers.Mark, {
|
||||||
changedSelectedValueTo: value ? ActionModifiers.ToggleAutoscaleOn : ActionModifiers.ToggleAutoscaleOff,
|
changedSelectedValueTo: value ? ActionModifiers.ToggleAutoscaleOn : ActionModifiers.ToggleAutoscaleOff,
|
||||||
databaseAccountName: userContext.databaseAccount?.name,
|
|
||||||
subscriptionId: userContext.subscriptionId,
|
|
||||||
apiKind: userContext.defaultExperience,
|
|
||||||
dataExplorerArea: "Scale Tab V1",
|
dataExplorerArea: "Scale Tab V1",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ko if: !isFixed -->
|
<!-- ko if: !isFixed -->
|
||||||
<div data-bind="visible: showAutoPilot" class="throughputModeContainer">
|
<div class="throughputModeContainer">
|
||||||
<input
|
<input
|
||||||
class="throughputModeRadio"
|
class="throughputModeRadio"
|
||||||
aria-label="Autopilot mode"
|
aria-label="Autopilot mode"
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ describe("ContainerSampleGenerator", () => {
|
|||||||
const database = {
|
const database = {
|
||||||
id: ko.observable(sampleDatabaseId),
|
id: ko.observable(sampleDatabaseId),
|
||||||
collections: ko.observableArray<ViewModels.Collection>([collection]),
|
collections: ko.observableArray<ViewModels.Collection>([collection]),
|
||||||
|
loadCollections: () => {},
|
||||||
} as ViewModels.Database;
|
} as ViewModels.Database;
|
||||||
database.findCollectionWithId = () => collection;
|
database.findCollectionWithId = () => collection;
|
||||||
|
|
||||||
@@ -109,6 +110,7 @@ describe("ContainerSampleGenerator", () => {
|
|||||||
const database = {
|
const database = {
|
||||||
id: ko.observable(sampleDatabaseId),
|
id: ko.observable(sampleDatabaseId),
|
||||||
collections: ko.observableArray<ViewModels.Collection>([collection]),
|
collections: ko.observableArray<ViewModels.Collection>([collection]),
|
||||||
|
loadCollections: () => {},
|
||||||
} as ViewModels.Database;
|
} as ViewModels.Database;
|
||||||
database.findCollectionWithId = () => collection;
|
database.findCollectionWithId = () => collection;
|
||||||
collection.databaseId = database.id();
|
collection.databaseId = database.id();
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export class ContainerSampleGenerator {
|
|||||||
if (!database) {
|
if (!database) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
await database.loadCollections();
|
||||||
return database.findCollectionWithId(this.sampleDataFile.collectionId);
|
return database.findCollectionWithId(this.sampleDataFile.collectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { NeighborVertexBasicInfo, EditedEdges, GraphNewEdgeData, PossibleVertex } from "./GraphExplorer";
|
import { NeighborVertexBasicInfo, EditedEdges, GraphNewEdgeData, PossibleVertex } from "./GraphExplorer";
|
||||||
import { GraphUtil } from "./GraphUtil";
|
import * as GraphUtil from "./GraphUtil";
|
||||||
import * as InputTypeaheadComponent from "../../Controls/InputTypeahead/InputTypeaheadComponent";
|
import * as InputTypeaheadComponent from "../../Controls/InputTypeahead/InputTypeaheadComponent";
|
||||||
import DeleteIcon from "../../../../images/delete.svg";
|
import DeleteIcon from "../../../../images/delete.svg";
|
||||||
import AddPropertyIcon from "../../../../images/Add-property.svg";
|
import AddPropertyIcon from "../../../../images/Add-property.svg";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { GraphVizComponentProps } from "./GraphVizComponent";
|
|||||||
import * as GraphData from "./GraphData";
|
import * as GraphData from "./GraphData";
|
||||||
import { ConsoleDataType } from "../../Menus/NotificationConsole/NotificationConsoleComponent";
|
import { ConsoleDataType } from "../../Menus/NotificationConsole/NotificationConsoleComponent";
|
||||||
import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils";
|
import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils";
|
||||||
import { GraphUtil } from "./GraphUtil";
|
import * as GraphUtil from "./GraphUtil";
|
||||||
import * as DataModels from "../../../Contracts/DataModels";
|
import * as DataModels from "../../../Contracts/DataModels";
|
||||||
import * as ViewModels from "../../../Contracts/ViewModels";
|
import * as ViewModels from "../../../Contracts/ViewModels";
|
||||||
import * as GremlinClient from "./GremlinClient";
|
import * as GremlinClient from "./GremlinClient";
|
||||||
@@ -1031,10 +1031,8 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
|
|||||||
TelemetryProcessor.traceSuccess(
|
TelemetryProcessor.traceSuccess(
|
||||||
Action.Tab,
|
Action.Tab,
|
||||||
{
|
{
|
||||||
databaseAccountName: this.props.resourceId,
|
|
||||||
databaseName: this.props.databaseId,
|
databaseName: this.props.databaseId,
|
||||||
collectionName: this.props.collectionId,
|
collectionName: this.props.collectionId,
|
||||||
defaultExperience: Constants.DefaultAccountExperience.Graph,
|
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle: "Graph",
|
tabTitle: "Graph",
|
||||||
},
|
},
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user