mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-07 19:46:53 +00:00
Compare commits
5 Commits
user/bchou
...
sung_playw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70ed0c79e1 | ||
|
|
c2785ace83 | ||
|
|
bb5d3bfc42 | ||
|
|
98a21f2fb1 | ||
|
|
945c457bd5 |
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
@@ -164,8 +164,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
|
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
|
||||||
shardTotal: [20]
|
shardTotal: [16]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Use Node.js 18.x
|
- name: Use Node.js 18.x
|
||||||
@@ -192,29 +192,24 @@ jobs:
|
|||||||
NOSQL_READONLY_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-sql-readonly.documents.azure.com/.default" -o tsv --query accessToken)
|
NOSQL_READONLY_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-sql-readonly.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
echo "::add-mask::$NOSQL_READONLY_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$NOSQL_READONLY_TESTACCOUNT_TOKEN"
|
||||||
echo NOSQL_READONLY_TESTACCOUNT_TOKEN=$NOSQL_READONLY_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo NOSQL_READONLY_TESTACCOUNT_TOKEN=$NOSQL_READONLY_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
NOSQL_CONTAINERCOPY_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-sql-containercopyonly.documents.azure.com/.default" -o tsv --query accessToken)
|
|
||||||
echo "::add-mask::$NOSQL_CONTAINERCOPY_TESTACCOUNT_TOKEN"
|
|
||||||
echo NOSQL_CONTAINERCOPY_TESTACCOUNT_TOKEN=$NOSQL_CONTAINERCOPY_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
|
||||||
TABLE_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-tables.documents.azure.com/.default" -o tsv --query accessToken)
|
TABLE_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-tables.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
echo "::add-mask::$TABLE_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$TABLE_TESTACCOUNT_TOKEN"
|
||||||
echo TABLE_TESTACCOUNT_TOKEN=$TABLE_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo TABLE_TESTACCOUNT_TOKEN=$TABLE_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
GREMLIN_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-gremlin.documents.azure.com/.default" -o tsv --query accessToken)
|
GREMLIN_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-gremlin.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
echo "::add-mask::$GREMLIN_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$GREMLIN_TESTACCOUNT_TOKEN"
|
||||||
echo GREMLIN_TESTACCOUNT_TOKEN=$GREMLIN_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo GREMLIN_TESTACCOUNT_TOKEN=$GREMLIN_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
# CASSANDRA_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-cassandra.documents.azure.com/.default" -o tsv --query accessToken)
|
CASSANDRA_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-cassandra.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
# echo "::add-mask::$CASSANDRA_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$CASSANDRA_TESTACCOUNT_TOKEN"
|
||||||
# echo CASSANDRA_TESTACCOUNT_TOKEN=$CASSANDRA_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo CASSANDRA_TESTACCOUNT_TOKEN=$CASSANDRA_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
# MONGO_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-mongo.documents.azure.com/.default" -o tsv --query accessToken)
|
MONGO_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-mongo.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
# echo "::add-mask::$MONGO_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$MONGO_TESTACCOUNT_TOKEN"
|
||||||
# echo MONGO_TESTACCOUNT_TOKEN=$MONGO_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo MONGO_TESTACCOUNT_TOKEN=$MONGO_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
# MONGO32_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-mongo32.documents.azure.com/.default" -o tsv --query accessToken)
|
MONGO32_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-mongo32.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
# echo "::add-mask::$MONGO32_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$MONGO32_TESTACCOUNT_TOKEN"
|
||||||
# echo MONGO32_TESTACCOUNT_TOKEN=$MONGO32_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo MONGO32_TESTACCOUNT_TOKEN=$MONGO32_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
# MONGO_READONLY_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-mongo-readonly.documents.azure.com/.default" -o tsv --query accessToken)
|
MONGO_READONLY_TESTACCOUNT_TOKEN=$(az account get-access-token --scope "https://github-e2etests-mongo-readonly.documents.azure.com/.default" -o tsv --query accessToken)
|
||||||
# echo "::add-mask::$MONGO_READONLY_TESTACCOUNT_TOKEN"
|
echo "::add-mask::$MONGO_READONLY_TESTACCOUNT_TOKEN"
|
||||||
# echo MONGO_READONLY_TESTACCOUNT_TOKEN=$MONGO_READONLY_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
echo MONGO_READONLY_TESTACCOUNT_TOKEN=$MONGO_READONLY_TESTACCOUNT_TOKEN >> $GITHUB_ENV
|
||||||
- name: List test files for shard ${{ matrix['shardIndex'] }} of ${{ matrix['shardTotal']}}
|
|
||||||
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --list
|
|
||||||
- name: Run test shard ${{ matrix['shardIndex'] }} of ${{ matrix['shardTotal']}}
|
- name: Run test shard ${{ matrix['shardIndex'] }} of ${{ matrix['shardTotal']}}
|
||||||
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=3
|
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=3
|
||||||
- name: Upload blob report to GitHub Actions Artifacts
|
- name: Upload blob report to GitHub Actions Artifacts
|
||||||
@@ -255,4 +250,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: html-report--attempt-${{ github.run_attempt }}
|
name: html-report--attempt-${{ github.run_attempt }}
|
||||||
path: playwright-report
|
path: playwright-report
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|||||||
6
.github/workflows/cleanup.yml
vendored
6
.github/workflows/cleanup.yml
vendored
@@ -6,8 +6,8 @@ on:
|
|||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
# Once every two hours
|
# Once every hour
|
||||||
- cron: "0 */2 * * *"
|
- cron: "0 15 * * *"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
@@ -36,4 +36,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: node utils/cleanupDBs.js
|
- run: node utils/cleanupDBs.js
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
|
||||||
<path d="M4 4c0-1.1.9-2 2-2h3.59c.4 0 .78.16 1.06.44l3.91 3.91c.28.28.44.67.44 1.06V14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V8h-3.5A1.5 1.5 0 0 1 9 6.5V3H6Zm4 .2v3.3c0 .28.22.5.5.5h3.3L10 3.2ZM17 9a1 1 0 0 0-1-1v6a3 3 0 0 1-3 3H6a1 1 0 0 0 1 1h6.06A3.94 3.94 0 0 0 17 14.06V9Z" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 439 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M7.85032 3.0153C10.4276 3.21621 12.4563 5.37119 12.4563 8C12.4563 10.7614 10.2177 13 7.45629 13C5.70158 13 4.15722 12.0961 3.26465 10.7271C4.66791 10.3479 6.58077 9.42526 7.42438 7.17555C7.97709 5.70162 8.00857 4.23763 7.85032 3.0153ZM13.4563 8C13.4563 4.68629 10.77 2 7.45629 2C7.38577 2 7.31552 2.00122 7.24555 2.00364C7.09984 2.00867 6.96358 2.07706 6.87247 2.19089C6.78136 2.30471 6.74447 2.45263 6.77147 2.59591C7.00024 3.81021 7.05064 5.32413 6.48805 6.82444C5.68804 8.95787 3.68609 9.66359 2.41062 9.89533C2.25698 9.92325 2.1252 10.0213 2.05438 10.1605C1.98356 10.2997 1.98182 10.4639 2.04969 10.6046C3.01873 12.6128 5.07502 14 7.45629 14C10.77 14 13.4563 11.3137 13.4563 8Z" fill="#0078d4" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 814 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M8 1.33C8.276 1.33 8.5 1.554 8.5 1.83V2.83C8.5 3.106 8.276 3.33 8 3.33C7.724 3.33 7.5 3.106 7.5 2.83V1.83C7.5 1.554 7.724 1.33 8 1.33ZM8 11.33C9.841 11.33 11.33 9.841 11.33 8C11.33 6.159 9.841 4.67 8 4.67C6.159 4.67 4.67 6.159 4.67 8C4.67 9.841 6.159 11.33 8 11.33ZM8 10.33C6.711 10.33 5.67 9.289 5.67 8C5.67 6.711 6.711 5.67 8 5.67C9.289 5.67 10.33 6.711 10.33 8C10.33 9.289 9.289 10.33 8 10.33ZM14.17 8.5C14.446 8.5 14.67 8.276 14.67 8C14.67 7.724 14.446 7.5 14.17 7.5H13.17C12.894 7.5 12.67 7.724 12.67 8C12.67 8.276 12.894 8.5 13.17 8.5H14.17ZM8 12.67C8.276 12.67 8.5 12.894 8.5 13.17V14.17C8.5 14.446 8.276 14.67 8 14.67C7.724 14.67 7.5 14.446 7.5 14.17V13.17C7.5 12.894 7.724 12.67 8 12.67ZM2.83 8.5C3.106 8.5 3.33 8.276 3.33 8C3.33 7.724 3.106 7.5 2.83 7.5H1.83C1.554 7.5 1.33 7.724 1.33 8C1.33 8.276 1.554 8.5 1.83 8.5H2.83ZM2.813 2.813C3.009 2.617 3.325 2.617 3.521 2.813L4.521 3.813C4.717 4.009 4.717 4.325 4.521 4.521C4.325 4.717 4.009 4.717 3.813 4.521L2.813 3.521C2.617 3.325 2.617 3.009 2.813 2.813ZM3.521 13.187C3.325 13.383 3.009 13.383 2.813 13.187C2.617 12.991 2.617 12.675 2.813 12.479L3.813 11.479C4.009 11.283 4.325 11.283 4.521 11.479C4.717 11.675 4.717 11.991 4.521 12.187L3.521 13.187ZM13.187 2.813C12.991 2.617 12.675 2.617 12.479 2.813L11.479 3.813C11.283 4.009 11.283 4.325 11.479 4.521C11.675 4.717 11.991 4.717 12.187 4.521L13.187 3.521C13.383 3.325 13.383 3.009 13.187 2.813ZM12.479 13.187C12.675 13.383 12.991 13.383 13.187 13.187C13.383 12.991 13.383 12.675 13.187 12.479L12.187 11.479C11.991 11.283 11.675 11.283 11.479 11.479C11.283 11.675 11.283 11.991 11.479 12.187L12.479 13.187Z" fill="#0078d4" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,3 +0,0 @@
|
|||||||
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M4 7.5C4 5.567 5.567 4 7.5 4C8.5 4 9.4 4.4 10 5.1C9.5 4.8 8.9 4.6 8.3 4.6C6.8 4.6 5.6 5.8 5.6 7.3C5.6 8.8 6.8 10 8.3 10C8.9 10 9.5 9.8 10 9.5C9.4 10.2 8.5 10.6 7.5 10.6C5.567 10.6 4 9.033 4 7.1V7.5Z" fill="#0078D4"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 328 B |
@@ -1,11 +0,0 @@
|
|||||||
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M6 2C6 1.44772 6.44772 1 7 1C7.55228 1 8 1.44772 8 2C8 2.55228 7.55228 3 7 3C6.44772 3 6 2.55228 6 2Z" fill="#0078D4"/>
|
|
||||||
<path d="M6 13C6 12.4477 6.44772 12 7 12C7.55228 12 8 12.4477 8 13C8 13.5523 7.55228 14 7 14C6.44772 14 6 13.5523 6 13Z" fill="#0078D4"/>
|
|
||||||
<path d="M1 7C1 6.44772 1.44772 6 2 6C2.55228 6 3 6.44772 3 7C3 7.55228 2.55228 8 2 8C1.44772 8 1 7.55228 1 7Z" fill="#0078D4"/>
|
|
||||||
<path d="M12 7C12 6.44772 12.4477 6 13 6C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8C12.4477 8 12 7.55228 12 7Z" fill="#0078D4"/>
|
|
||||||
<path d="M2.63604 3.63604C3.02656 3.24551 3.65973 3.24551 4.05025 3.63604C4.44078 4.02656 4.44078 4.65973 4.05025 5.05025C3.65973 5.44078 3.02656 5.44078 2.63604 5.05025C2.24551 4.65973 2.24551 4.02656 2.63604 3.63604Z" fill="#0078D4"/>
|
|
||||||
<path d="M10.9497 9.94975C11.3403 9.55922 11.9734 9.55922 12.364 9.94975C12.7545 10.3403 12.7545 10.9734 12.364 11.364C11.9734 11.7545 11.3403 11.7545 10.9497 11.364C10.5592 10.9734 10.5592 10.3403 10.9497 9.94975Z" fill="#0078D4"/>
|
|
||||||
<path d="M10.9497 5.05025C10.5592 4.65973 10.5592 4.02656 10.9497 3.63604C11.3403 3.24551 11.9734 3.24551 12.364 3.63604C12.7545 4.02656 12.7545 4.65973 12.364 5.05025C11.9734 5.44078 11.3403 5.44078 10.9497 5.05025Z" fill="#0078D4"/>
|
|
||||||
<path d="M2.63604 11.364C2.24551 10.9734 2.24551 10.3403 2.63604 9.94975C3.02656 9.55922 3.65973 9.55922 4.05025 9.94975C4.44078 10.3403 4.44078 10.9734 4.05025 11.364C3.65973 11.7545 3.02656 11.7545 2.63604 11.364Z" fill="#0078D4"/>
|
|
||||||
<circle cx="7.5" cy="7.5" r="2.5" fill="#0078D4"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -128,7 +128,7 @@
|
|||||||
@provisionDatabaseThroughputInfo: 200px;
|
@provisionDatabaseThroughputInfo: 200px;
|
||||||
|
|
||||||
//tabs container
|
//tabs container
|
||||||
@ActiveTabHeight: 32px;
|
@ActiveTabHeight: 31px;
|
||||||
@ActiveTabWidth: 141px;
|
@ActiveTabWidth: 141px;
|
||||||
@TabsHeight: 30px;
|
@TabsHeight: 30px;
|
||||||
@TabsWidth: 140px;
|
@TabsWidth: 140px;
|
||||||
@@ -237,11 +237,11 @@
|
|||||||
*********************************************************************************************/
|
*********************************************************************************************/
|
||||||
|
|
||||||
.hover() {
|
.hover() {
|
||||||
background-color: var(--colorNeutralBackground1Hover);
|
background-color: @AccentLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active() {
|
.active() {
|
||||||
background-color: var(--colorNeutralBackground1Hover);
|
background-color: @AccentExtra;
|
||||||
}
|
}
|
||||||
|
|
||||||
.focus() {
|
.focus() {
|
||||||
|
|||||||
@@ -1740,7 +1740,7 @@ input::-webkit-calendar-picker-indicator {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
padding-left: 34px;
|
padding-left: 34px;
|
||||||
padding-right: 34px;
|
padding-right: 34px;
|
||||||
color: var(--colorNeutralForeground1);
|
color: @BaseDark;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
margin: (2 * @MediumSpace) 0px;
|
margin: (2 * @MediumSpace) 0px;
|
||||||
@@ -1749,6 +1749,7 @@ input::-webkit-calendar-picker-indicator {
|
|||||||
.contextual-pane .panelMainContent {
|
.contextual-pane .panelMainContent {
|
||||||
padding-left: 34px;
|
padding-left: 34px;
|
||||||
padding-right: 34px;
|
padding-right: 34px;
|
||||||
|
color: @BaseDark;
|
||||||
margin: (2 * @MediumSpace) 0px;
|
margin: (2 * @MediumSpace) 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1913,8 +1914,7 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs-margin {
|
.nav-tabs-margin {
|
||||||
background-color: var(--colorNeutralBackground1);
|
background-color: #f2f2f2;
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
|
|
||||||
.nav-tabs {
|
.nav-tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1922,19 +1922,11 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-bottom: -0.5px;
|
margin-bottom: -0.5px;
|
||||||
background-color: var(--colorNeutralBackground1Selected);
|
|
||||||
|
|
||||||
li {
|
li {
|
||||||
|
// Override the bootstrap defaults here to align with our layout constants.
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--colorNeutralBackground1Hover);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: var(--colorNeutralBackground1Pressed);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1948,9 +1940,8 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
.nav.nav-tabs.qslevel > li > a:hover {
|
.nav.nav-tabs.qslevel > li > a:hover {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
background-color: var(--colorNeutralBackground1Selected);
|
background-color: transparent !important;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.numbersize {
|
.numbersize {
|
||||||
@@ -2385,8 +2376,6 @@ a:link {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-width: 0; // This prevents it to grow past the parent's width if its content is too wide
|
min-width: 0; // This prevents it to grow past the parent's width if its content is too wide
|
||||||
background-color: var(--colorNeutralBackground1);
|
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs {
|
.tabs {
|
||||||
@@ -2642,16 +2631,14 @@ a:link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tabPanesContainer {
|
.tabPanesContainer {
|
||||||
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: var(--colorNeutralBackground1);
|
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs-container {
|
.tabs-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-y: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.paddingspan4 {
|
.paddingspan4 {
|
||||||
@@ -2668,18 +2655,24 @@ a:link {
|
|||||||
.nav-tabs > li.active > .tabNavContentContainer,
|
.nav-tabs > li.active > .tabNavContentContainer,
|
||||||
.nav-tabs > li.active > .tabNavContentContainer:focus,
|
.nav-tabs > li.active > .tabNavContentContainer:focus,
|
||||||
.nav-tabs > li.active > .tabNavContentContainer:hover {
|
.nav-tabs > li.active > .tabNavContentContainer:hover {
|
||||||
color: var(--colorNeutralForeground1);
|
color: #555;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
background-color: var(--colorNeutralBackground1);
|
background-color: @BaseLight;
|
||||||
border-color: var(--colorNeutralStroke1);
|
border-color: @BaseMedium;
|
||||||
|
border-bottom-color: @BaseLight;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
height: @ActiveTabHeight;
|
height: @ActiveTabHeight;
|
||||||
width: @ActiveTabWidth;
|
width: @ActiveTabWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs > li.active .contentWrapper .tabNavText {
|
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content > .contentWrapper > .tabNavText {
|
||||||
border-bottom: 2px solid var(--colorCompoundBrandBackground);
|
font-weight: bolder;
|
||||||
|
border-bottom: 2px solid rgba(0, 120, 212, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-tabs > li.active:focus > .tabNavContentContainer {
|
||||||
|
.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabNavContentContainer {
|
.tabNavContentContainer {
|
||||||
@@ -2688,7 +2681,7 @@ a:link {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-radius: 2px 2px 0 0;
|
border-radius: 2px 2px 0 0;
|
||||||
padding: @DefaultSpace 0px @SmallSpace 0px;
|
padding: @DefaultSpace 0px @SmallSpace 0px;
|
||||||
color: var(--colorNeutralForeground1);
|
color: @BaseHigh;
|
||||||
width: @TabsWidth;
|
width: @TabsWidth;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -2696,21 +2689,19 @@ a:link {
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background-color: var(--colorNeutralBackground1Hover);
|
background-color: @BaseMediumLow;
|
||||||
border-color: transparent;
|
border-color: @BaseMediumLow;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: var(--colorNeutralBackground1Pressed);
|
background-color: @BaseMediumLow;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab_Content {
|
.tab_Content {
|
||||||
.flex-display();
|
.flex-display();
|
||||||
width: @TabsWidth;
|
width: @TabsWidth;
|
||||||
border-right: @ButtonBorderWidth solid var(--colorNeutralStroke1);
|
border-right: @ButtonBorderWidth solid @BaseMedium;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
|
|
||||||
.contentWrapper {
|
.contentWrapper {
|
||||||
.flex-display();
|
.flex-display();
|
||||||
width: @ContentWrapper;
|
width: @ContentWrapper;
|
||||||
@@ -2732,8 +2723,9 @@ a:link {
|
|||||||
background-image: url(../images/error_no_outline.svg);
|
background-image: url(../images/error_no_outline.svg);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
background-size: 3px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 4px 0px 0px 6px;
|
margin: 1px 0px 0px 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2758,60 +2750,39 @@ a:link {
|
|||||||
.loadingIcon {
|
.loadingIcon {
|
||||||
width: @LoadingErrorIconSize;
|
width: @LoadingErrorIconSize;
|
||||||
height: @LoadingErrorIconSize;
|
height: @LoadingErrorIconSize;
|
||||||
margin-top: 1px;
|
margin: 0px 0px @SmallSpace @SmallSpace;
|
||||||
}
|
|
||||||
|
|
||||||
.warningIconContainer {
|
|
||||||
width: @ErrorIconContainer;
|
|
||||||
height: @ErrorIconContainer;
|
|
||||||
margin-top: 1px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabNavText {
|
.tabNavText {
|
||||||
margin-left: @SmallSpace;
|
margin-left: @SmallSpace;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
color: var(--colorNeutralForeground1);
|
color: @BaseDark;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-size: 12px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabIconSection {
|
.tabIconSection {
|
||||||
|
width: 29px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
padding-top: 2px;
|
||||||
|
|
||||||
.cancelButton {
|
.cancelButton {
|
||||||
padding: 0px @SmallSpace 0px @SmallSpace;
|
padding: 0px @SmallSpace 0px @SmallSpace;
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--colorNeutralBackground1Hover);
|
.hover();
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
background-color: var(--colorNeutralBackground1Pressed);
|
.focus();
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: var(--colorNeutralBackground1Pressed);
|
.active();
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: "×";
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3166,12 +3137,3 @@ a:link {
|
|||||||
.sidebarContainer {
|
.sidebarContainer {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-Icon {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ html {
|
|||||||
body {
|
body {
|
||||||
font-family: @FabricFont;
|
font-family: @FabricFont;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
--colorCompoundBrandBackground: @FabricAccentMedium;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@@ -42,7 +41,7 @@ a:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs-margin {
|
.nav-tabs-margin {
|
||||||
padding-top: 0px;
|
padding-top: 5px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,20 +68,17 @@ a:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs > li > .tabNavContentContainer > .tab_Content:hover {
|
.nav-tabs > li > .tabNavContentContainer > .tab_Content:hover {
|
||||||
border-bottom: none;
|
border-bottom: 2px solid #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content,
|
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content,
|
||||||
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content:hover {
|
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content:hover {
|
||||||
border-bottom: none;
|
border-bottom: 2px solid @FabricAccentMedium;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content > .contentWrapper > .tabNavText {
|
.nav-tabs > li.active > .tabNavContentContainer > .tab_Content > .contentWrapper > .tabNavText {
|
||||||
border-bottom: 0px none transparent;
|
border-bottom: 0px none transparent;
|
||||||
}
|
}
|
||||||
.nav-tabs > li.active .contentWrapper .tabNavText {
|
|
||||||
border-bottom: 2px solid @FabricAccentMedium;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabNavContentContainer {
|
.tabNavContentContainer {
|
||||||
padding: @SmallSpace 0px @SmallSpace 0px;
|
padding: @SmallSpace 0px @SmallSpace 0px;
|
||||||
@@ -218,7 +214,6 @@ a:focus {
|
|||||||
|
|
||||||
.tabPanesContainer {
|
.tabPanesContainer {
|
||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
display: flex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs-container {
|
.tabs-container {
|
||||||
|
|||||||
200
less/forms.less
200
less/forms.less
@@ -1,227 +1,211 @@
|
|||||||
@import "./Common/Constants";
|
@import "./Common/Constants";
|
||||||
|
|
||||||
.dirty {
|
.dirty {
|
||||||
border: 1px solid #9b4f96;
|
border: 1px solid #9b4f96;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dirty:focus {
|
.dirty:focus {
|
||||||
outline: 1px solid #9b4f96;
|
outline: 1px solid #9b4f96;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabForm {
|
.tabForm {
|
||||||
padding: 12px 20px 20px 20px;
|
padding: 12px 20px 20px 20px;
|
||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.storedTabForm {
|
.storedTabForm {
|
||||||
padding-top: @LargeSpace;
|
padding-top: @LargeSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scaleSettingScrollable {
|
.scaleSettingScrollable {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
height: 100%;
|
height:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disableFocusDefaults[tabindex] {
|
.disableFocusDefaults[tabindex] {
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexingPolicyEditor {
|
.indexingPolicyEditor {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(~"100vh - 400px");
|
height: calc(~"100vh - 400px");
|
||||||
}
|
}
|
||||||
|
|
||||||
.scaleDivison {
|
.scaleDivison {
|
||||||
padding: @MediumSpace 0px @DefaultSpace 0px;
|
padding: @MediumSpace 0px @DefaultSpace 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scaleSettingTitle {
|
.scaleSettingTitle {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoScaleThroughputTitle {
|
.autoScaleThroughputTitle {
|
||||||
margin-bottom: @SmallSpace;
|
margin-bottom: @SmallSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoScaleDescription {
|
.autoScaleDescription {
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
margin-bottom: @SmallSpace;
|
margin-bottom: @SmallSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ssExpandCollapseIcon {
|
.ssExpandCollapseIcon {
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ssCollapseIcon {
|
.ssCollapseIcon {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ssTextAllignment {
|
.ssTextAllignment {
|
||||||
padding-left: 19px;
|
padding-left: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.throughputStorageBlock {
|
.throughputStorageBlock {
|
||||||
border-top: 1px solid #bbb;
|
border-top: 1px solid #bbb;
|
||||||
border-bottom: 1px solid #bbb;
|
border-bottom: 1px solid #bbb;
|
||||||
background-color: #ccc;
|
background-color: #ccc;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
width: 315px;
|
width: 315px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.storageCapacityTitle {
|
.storageCapacityTitle {
|
||||||
padding: @LargeSpace 0px;
|
padding: @LargeSpace 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
.throughputStorageValue {
|
.throughputStorageValue {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.estimatedCost,
|
.estimatedCost, .largePartitionKeyEnabled {
|
||||||
.largePartitionKeyEnabled {
|
padding: @SmallSpace 0px @LargeSpace;
|
||||||
padding: @SmallSpace 0px @LargeSpace;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.storagePadding {
|
.storagePadding {
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
padding-bottom: 14px;
|
padding-bottom: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dirtyTextbox {
|
.dirtyTextbox {
|
||||||
width: 176px;
|
width: 176px;
|
||||||
margin-top: 7px;
|
margin-top: 7px;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formTitleFirst {
|
.formTitleFirst {
|
||||||
padding: @DefaultSpace (2 * @MediumSpace);
|
padding: @DefaultSpace (2 * @MediumSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
.formTitleTextbox {
|
.formTitleTextbox {
|
||||||
padding: 0px 0px @DefaultSpace (2 * @MediumSpace);
|
padding: 0px 0px @DefaultSpace (2 * @MediumSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
.formTree {
|
.formTree {
|
||||||
border: 1px solid var(--colorNeutralStroke1);
|
border: 1px solid #969696;
|
||||||
color: var(--colorNeutralForeground1);
|
color: #393939;
|
||||||
background-color: var(--colorNeutralBackground1);
|
padding: 0px 12px 1px 8px;
|
||||||
padding: 0px 12px 1px 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.formTree:hover {
|
.formTree:hover {
|
||||||
border: 1px solid var(--colorNeutralStroke1Hover);
|
border: 1px solid #969696;
|
||||||
background-color: var(--colorNeutralBackground1Hover);
|
background-color: #e6f8fe;
|
||||||
}
|
|
||||||
|
|
||||||
.formTree::placeholder {
|
|
||||||
color: var(--colorNeutralForeground2);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.formTree:active {
|
.formTree:active {
|
||||||
border: 1px solid var(--colorNeutralStroke1Pressed);
|
border: 1px solid #1ebbee;
|
||||||
background-color: var(--colorNeutralBackground1Pressed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.scaleForm {
|
.scaleForm {
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
color: @BaseDark;
|
color: @BaseDark;
|
||||||
border: 1px solid #969696;
|
border: 1px solid #969696;
|
||||||
min-width: @ScaleFormWidth;
|
min-width: @ScaleFormWidth;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #e6f8fe;
|
background-color: #e6f8fe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.formTitle {
|
.formTitle {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.spUdfTriggerHeader {
|
.spUdfTriggerHeader {
|
||||||
padding: @DefaultSpace 0px @SmallSpace (2 * @MediumSpace);
|
padding: @DefaultSpace 0px @SmallSpace (2 * @MediumSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
.storedUdfTriggerEditor {
|
.storedUdfTriggerEditor {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unselectedRadio {
|
.unselectedRadio {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-color: #eee !important;
|
border-color: #EEE!important;
|
||||||
color: black !important;
|
color: black!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disabledRadio {
|
.disabledRadio {
|
||||||
background-color: #a19f9d;
|
background-color: #A19F9D;
|
||||||
border-color: #eee !important;
|
border-color: #EEE!important;
|
||||||
color: white !important;
|
color: white!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectedRadio {
|
.selectedRadio {
|
||||||
background-color: @AccentMediumHigh;
|
background-color: @AccentMediumHigh;
|
||||||
border-color: #eee !important;
|
border-color: #EEE!important;
|
||||||
color: white !important;
|
color: white!important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectedRadio:hover {
|
.selectedRadio:hover {
|
||||||
background-color: @AccentMediumHigh;
|
background-color: @AccentMediumHigh;
|
||||||
border-color: #eee !important;
|
border-color: #EEE!important;
|
||||||
color: white !important;
|
color: white!important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectedRadio:active {
|
.selectedRadio:active {
|
||||||
background-color: #0072c6;
|
background-color: #0072c6;
|
||||||
border-color: #eee !important;
|
border-color: #EEE!important;
|
||||||
color: white !important;
|
color: white!important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 1px solid #0072c6;
|
border: 1px solid #0072c6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectedRadio.dirty {
|
.selectedRadio.dirty {
|
||||||
background-color: #9b4f96;
|
background-color: #9b4f96;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs {
|
.tabs {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formReadOnly {
|
.formReadOnly {
|
||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
border: 1px solid #969696;
|
border: 1px solid #969696;
|
||||||
min-width: 184px;
|
min-width: 184px;
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.migration:disabled {
|
.migration:disabled {
|
||||||
background-color: #ccc;
|
background-color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trigger-field {
|
.trigger-field {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
margin-top: 10px;
|
margin-top: 10px
|
||||||
background-color: var(--colorNeutralBackground1);
|
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.trigger-field input::placeholder {
|
|
||||||
color: var(--colorNeutralForeground3);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trigger-form {
|
.trigger-form {
|
||||||
background-color: var(--colorNeutralBackground1);
|
padding: 10px 30px 10px 30px;
|
||||||
color: var(--colorNeutralForeground1);
|
}
|
||||||
padding: 10px 30px;
|
|
||||||
}
|
|
||||||
@@ -255,7 +255,7 @@ body {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
padding-left: 34px;
|
padding-left: 34px;
|
||||||
padding-right: 34px;
|
padding-right: 34px;
|
||||||
color: var(--colorNeutralForeground1);
|
color: @BaseDark;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
margin: (2 * @MediumSpace) 0px;
|
margin: (2 * @MediumSpace) 0px;
|
||||||
|
|||||||
270
less/tree.less
Normal file
270
less/tree.less
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
@import "./Common/Constants";
|
||||||
|
|
||||||
|
.resourceTree {
|
||||||
|
height: 100%;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
.main {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.resourceTreeScroll {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userSelectNone {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.treeHovermargin {
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
padding: @SmallSpace 2px;
|
||||||
|
outline: 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.hover();
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
.active();
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextmenushowing {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collectionstree {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: @DefaultSpace;
|
||||||
|
|
||||||
|
.databaseList {
|
||||||
|
list-style-type: none;
|
||||||
|
padding-left: 0px;
|
||||||
|
|
||||||
|
.collectionList {
|
||||||
|
padding-left: (2 * @MediumSpace);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collectionChildList {
|
||||||
|
padding-left: @LargeSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.databaseDocuments {
|
||||||
|
padding-left: (5 * @MediumSpace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointerCursor {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuEllipsis {
|
||||||
|
padding-right: 6px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
position: relative;
|
||||||
|
top: -5px;
|
||||||
|
left: 0px;
|
||||||
|
float: right;
|
||||||
|
display: none;
|
||||||
|
padding-left: 6px !important;
|
||||||
|
line-height: @TreeLineHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
.databaseMenu {
|
||||||
|
.flex-display();
|
||||||
|
}
|
||||||
|
|
||||||
|
.databaseMenu:hover .menuEllipsis,
|
||||||
|
.databaseMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.databaseCollChildTextOverflow {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collectionMenu {
|
||||||
|
.flex-display();
|
||||||
|
}
|
||||||
|
|
||||||
|
.collectionMenu:hover .menuEllipsis,
|
||||||
|
.collectionMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documentsMenu:hover .menuEllipsis,
|
||||||
|
.documentsMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.treeChildMenu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storedProcedureMenu:hover .menuEllipsis,
|
||||||
|
.storedProcedureMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.childMenu {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-left: (6 * @MediumSpace);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storedChildMenu:hover .menuEllipsis,
|
||||||
|
.storedChildMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextmenu6 {
|
||||||
|
top: -29px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userDefinedMenu:hover .contextmenu6 {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userDefinedchildMenu:hover .menuEllipsis,
|
||||||
|
.userDefinedchildMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triggersMenu:hover .menuEllipsis,
|
||||||
|
.triggersMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triggersChildMenu:hover .menuEllipsis,
|
||||||
|
.triggersChildMenu:focus .menuEllipsis {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.databaseId {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storedUdfTriggerMenu {
|
||||||
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collectionstree img {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
vertical-align: text-top;
|
||||||
|
}
|
||||||
|
|
||||||
|
img.collectionsTreeCollapseExpand {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsed::before {
|
||||||
|
content: "\23F5";
|
||||||
|
margin-left: 0px;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.expanded::before {
|
||||||
|
content: "\23F7";
|
||||||
|
margin-left: 0px;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collectionMenuChildren {
|
||||||
|
padding-left: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-nav {
|
||||||
|
width: 100vh;
|
||||||
|
height: 40px;
|
||||||
|
background: white;
|
||||||
|
transform-origin: left top;
|
||||||
|
-webkit-transform-origin: left top;
|
||||||
|
-ms-transform-origin: left top;
|
||||||
|
transform: rotate(-90deg) translateX(-100%);
|
||||||
|
-webkit-transform: rotate(-90deg) translateX(-100%);
|
||||||
|
-ms-transform: rotate(-90deg) translateX(-100%);
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-nav-img {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: -32px 0 0 0;
|
||||||
|
transform: rotate(-90deg) translateX(-100%);
|
||||||
|
-webkit-transform: rotate(-90deg) translateX(-100%);
|
||||||
|
-ms-transform: rotate(-90deg) translateX(-100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-nav-img.main-nav-sub-img {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0px 0px 0 0;
|
||||||
|
transform: rotate(180deg) translateX(0%);
|
||||||
|
-webkit-transform: rotate(180deg) translateX(0%);
|
||||||
|
-ms-transform: rotate(180deg) translateX(0%);
|
||||||
|
position: absolute;
|
||||||
|
right: -8px;
|
||||||
|
top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.nav {
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini ul.nav li {
|
||||||
|
float: right;
|
||||||
|
line-height: 25px;
|
||||||
|
height: auto;
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spancolchildstyle {
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextmenubutton {
|
||||||
|
float: right;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight:hover > .contextmenubutton {
|
||||||
|
display: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight:hover > .contextmenubutton::after {
|
||||||
|
content: "\2026";
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showEllipsis {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -116,8 +116,8 @@
|
|||||||
"tinykeys": "2.1.0",
|
"tinykeys": "2.1.0",
|
||||||
"underscore": "1.12.1",
|
"underscore": "1.12.1",
|
||||||
"utility-types": "3.10.0",
|
"utility-types": "3.10.0",
|
||||||
"uuid": "9.0.0",
|
|
||||||
"web-vitals": "4.2.4",
|
"web-vitals": "4.2.4",
|
||||||
|
"uuid": "9.0.0",
|
||||||
"zustand": "3.5.0"
|
"zustand": "3.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ export default defineConfig({
|
|||||||
reporter: process.env.CI ? "blob" : "html",
|
reporter: process.env.CI ? "blob" : "html",
|
||||||
timeout: 10 * 60 * 1000,
|
timeout: 10 * 60 * 1000,
|
||||||
use: {
|
use: {
|
||||||
trace: "retain-on-failure",
|
trace: "off",
|
||||||
video: "retain-on-failure",
|
video: "off",
|
||||||
screenshot: "on",
|
screenshot: "on",
|
||||||
testIdAttribute: "data-test",
|
testIdAttribute: "data-testid",
|
||||||
contextOptions: {
|
contextOptions: {
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ const LoadingOverlay: React.FC<LoadingOverlayProps> = ({ isLoading, label }) =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Overlay
|
<Overlay
|
||||||
data-test="loading-overlay"
|
|
||||||
styles={{
|
styles={{
|
||||||
root: {
|
root: {
|
||||||
backgroundColor: "rgba(255,255,255,0.9)",
|
backgroundColor: "rgba(255,255,255,0.9)",
|
||||||
|
|||||||
@@ -50,33 +50,10 @@ export const Upload: FunctionComponent<UploadProps> = ({
|
|||||||
const title = label + " to upload";
|
const title = label + " to upload";
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<span className="renewUploadItemsHeader" style={{ color: "var(--colorNeutralForeground1)" }}>
|
<span className="renewUploadItemsHeader">{label}</span>
|
||||||
{label}
|
|
||||||
</span>
|
|
||||||
{tooltip && <InfoTooltip>{tooltip}</InfoTooltip>}
|
{tooltip && <InfoTooltip>{tooltip}</InfoTooltip>}
|
||||||
<Stack horizontal>
|
<Stack horizontal>
|
||||||
<TextField
|
<TextField styles={{ fieldGroup: { width: 300 } }} readOnly value={selectedFilesTitle.toString()} />
|
||||||
styles={{
|
|
||||||
fieldGroup: {
|
|
||||||
width: 300,
|
|
||||||
backgroundColor: "var(--colorNeutralBackground3)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
field: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground3)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
subComponentStyles: {
|
|
||||||
label: {
|
|
||||||
root: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
readOnly
|
|
||||||
value={selectedFilesTitle.toString()}
|
|
||||||
/>
|
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
id="importFileInput"
|
id="importFileInput"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
exports[`LoadingOverlay should handle long labels properly 1`] = `
|
exports[`LoadingOverlay should handle long labels properly 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Overlay root-109"
|
class="ms-Overlay root-109"
|
||||||
data-test="loading-overlay"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Spinner root-111"
|
class="ms-Spinner root-111"
|
||||||
@@ -23,7 +22,6 @@ exports[`LoadingOverlay should handle long labels properly 1`] = `
|
|||||||
exports[`LoadingOverlay should render loading overlay when isLoading is true 1`] = `
|
exports[`LoadingOverlay should render loading overlay when isLoading is true 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Overlay root-109"
|
class="ms-Overlay root-109"
|
||||||
data-test="loading-overlay"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Spinner root-111"
|
class="ms-Spinner root-111"
|
||||||
@@ -43,7 +41,6 @@ exports[`LoadingOverlay should render loading overlay when isLoading is true 1`]
|
|||||||
exports[`LoadingOverlay should render loading overlay with custom label 1`] = `
|
exports[`LoadingOverlay should render loading overlay with custom label 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Overlay root-109"
|
class="ms-Overlay root-109"
|
||||||
data-test="loading-overlay"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Spinner root-111"
|
class="ms-Spinner root-111"
|
||||||
@@ -63,7 +60,6 @@ exports[`LoadingOverlay should render loading overlay with custom label 1`] = `
|
|||||||
exports[`LoadingOverlay should render loading overlay with empty label 1`] = `
|
exports[`LoadingOverlay should render loading overlay with empty label 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Overlay root-109"
|
class="ms-Overlay root-109"
|
||||||
data-test="loading-overlay"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Spinner root-111"
|
class="ms-Spinner root-111"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { configContext } from "ConfigContext";
|
|
||||||
import { ApiType, userContext } from "UserContext";
|
import { ApiType, userContext } from "UserContext";
|
||||||
import * as NotificationConsoleUtils from "Utils/NotificationConsoleUtils";
|
import * as NotificationConsoleUtils from "Utils/NotificationConsoleUtils";
|
||||||
import {
|
import {
|
||||||
@@ -15,12 +14,9 @@ import {
|
|||||||
DataTransferJobFeedResults,
|
DataTransferJobFeedResults,
|
||||||
DataTransferJobGetResults,
|
DataTransferJobGetResults,
|
||||||
} from "Utils/arm/generatedClients/dataTransferService/types";
|
} from "Utils/arm/generatedClients/dataTransferService/types";
|
||||||
import { armRequest } from "Utils/arm/request";
|
|
||||||
import { addToPolling, removeFromPolling, updateDataTransferJob, useDataTransferJobs } from "hooks/useDataTransferJobs";
|
import { addToPolling, removeFromPolling, updateDataTransferJob, useDataTransferJobs } from "hooks/useDataTransferJobs";
|
||||||
import promiseRetry, { AbortError, FailedAttemptError } from "p-retry";
|
import promiseRetry, { AbortError, FailedAttemptError } from "p-retry";
|
||||||
|
|
||||||
export const DATA_TRANSFER_JOB_API_VERSION = "2025-05-01-preview";
|
|
||||||
|
|
||||||
export interface DataTransferParams {
|
export interface DataTransferParams {
|
||||||
jobName: string;
|
jobName: string;
|
||||||
apiType: ApiType;
|
apiType: ApiType;
|
||||||
@@ -37,34 +33,26 @@ export const getDataTransferJobs = async (
|
|||||||
subscriptionId: string,
|
subscriptionId: string,
|
||||||
resourceGroup: string,
|
resourceGroup: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
signal?: AbortSignal,
|
|
||||||
): Promise<DataTransferJobGetResults[]> => {
|
): Promise<DataTransferJobGetResults[]> => {
|
||||||
let dataTransferJobs: DataTransferJobGetResults[] = [];
|
let dataTransferJobs: DataTransferJobGetResults[] = [];
|
||||||
let dataTransferFeeds: DataTransferJobFeedResults = await listByDatabaseAccount(
|
let dataTransferFeeds: DataTransferJobFeedResults = await listByDatabaseAccount(
|
||||||
subscriptionId,
|
subscriptionId,
|
||||||
resourceGroup,
|
resourceGroup,
|
||||||
accountName,
|
accountName,
|
||||||
signal,
|
|
||||||
);
|
);
|
||||||
dataTransferJobs = [...dataTransferJobs, ...(dataTransferFeeds?.value || [])];
|
dataTransferJobs = [...dataTransferJobs, ...(dataTransferFeeds?.value || [])];
|
||||||
while (dataTransferFeeds?.nextLink) {
|
while (dataTransferFeeds?.nextLink) {
|
||||||
/**
|
const nextResponse = await window.fetch(dataTransferFeeds.nextLink, {
|
||||||
* The `nextLink` URL returned by the Cosmos DB SQL API pointed to an incorrect endpoint, causing timeouts.
|
headers: {
|
||||||
* (i.e: https://cdbmgmtprodby.documents.azure.com:450/subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.DocumentDB/databaseAccounts/{account}/sql/dataTransferJobs?$top=100&$skiptoken=...)
|
Authorization: userContext.authorizationToken,
|
||||||
* We manipulate the URL by parsing it to extract the path and query parameters,
|
},
|
||||||
* then construct the correct URL for the Azure Resource Manager (ARM) API.
|
|
||||||
* This ensures that the request is made to the correct base URL (`configContext.ARM_ENDPOINT`),
|
|
||||||
* which is required for ARM operations.
|
|
||||||
*/
|
|
||||||
const parsedUrl = new URL(dataTransferFeeds.nextLink);
|
|
||||||
const nextUrlPath = parsedUrl.pathname + parsedUrl.search;
|
|
||||||
dataTransferFeeds = await armRequest({
|
|
||||||
host: configContext.ARM_ENDPOINT,
|
|
||||||
path: nextUrlPath,
|
|
||||||
method: "GET",
|
|
||||||
apiVersion: DATA_TRANSFER_JOB_API_VERSION,
|
|
||||||
});
|
});
|
||||||
dataTransferJobs.push(...(dataTransferFeeds?.value || []));
|
if (nextResponse.ok) {
|
||||||
|
dataTransferFeeds = await nextResponse.json();
|
||||||
|
dataTransferJobs = [...dataTransferJobs, ...(dataTransferFeeds?.value || [])];
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return dataTransferJobs;
|
return dataTransferJobs;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -50,5 +50,4 @@ export enum MessageTypes {
|
|||||||
OpenCESCVAFeedbackBlade,
|
OpenCESCVAFeedbackBlade,
|
||||||
ActivateTab,
|
ActivateTab,
|
||||||
OpenContainerCopyFeedbackBlade,
|
OpenContainerCopyFeedbackBlade,
|
||||||
UpdateTheme,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
TriggerDefinition,
|
TriggerDefinition,
|
||||||
UserDefinedFunctionDefinition,
|
UserDefinedFunctionDefinition,
|
||||||
} from "@azure/cosmos";
|
} from "@azure/cosmos";
|
||||||
import type Explorer from "../Explorer/Explorer";
|
import Explorer from "../Explorer/Explorer";
|
||||||
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/ConsoleData";
|
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/ConsoleData";
|
||||||
import { CassandraTableKey, CassandraTableKeys } from "../Explorer/Tables/TableDataClient";
|
import { CassandraTableKey, CassandraTableKeys } from "../Explorer/Tables/TableDataClient";
|
||||||
import ConflictId from "../Explorer/Tree/ConflictId";
|
import ConflictId from "../Explorer/Tree/ConflictId";
|
||||||
@@ -447,9 +447,6 @@ export interface DataExplorerInputsFrame {
|
|||||||
aadToken?: string;
|
aadToken?: string;
|
||||||
containerCopyEnabled?: boolean;
|
containerCopyEnabled?: boolean;
|
||||||
sessionId?: string;
|
sessionId?: string;
|
||||||
theme?: {
|
|
||||||
mode: number;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SelfServeFrameInputs {
|
export interface SelfServeFrameInputs {
|
||||||
@@ -483,6 +480,3 @@ export interface DropdownOption<T> {
|
|||||||
value: T;
|
value: T;
|
||||||
disable?: boolean;
|
disable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the duplicate Explorer interface and export the type
|
|
||||||
export type { Explorer };
|
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ describe("CopyJobActions", () => {
|
|||||||
(dataTransferService.listByDatabaseAccount as jest.Mock).mockRejectedValue(abortError);
|
(dataTransferService.listByDatabaseAccount as jest.Mock).mockRejectedValue(abortError);
|
||||||
|
|
||||||
await expect(getCopyJobs()).rejects.toMatchObject({
|
await expect(getCopyJobs()).rejects.toMatchObject({
|
||||||
message: expect.stringContaining("Previous copy job request was cancelled."),
|
message: expect.stringContaining("Please wait for the current fetch request to complete"),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ export const getCopyJobs = async (): Promise<CopyJobType[]> => {
|
|||||||
const errorContent = JSON.stringify(error.content || error.message || error);
|
const errorContent = JSON.stringify(error.content || error.message || error);
|
||||||
if (errorContent.includes("signal is aborted without reason")) {
|
if (errorContent.includes("signal is aborted without reason")) {
|
||||||
throw {
|
throw {
|
||||||
message: "Previous copy job request was cancelled.",
|
message:
|
||||||
|
"Please wait for the current fetch request to complete. The previous copy job fetch request was aborted.",
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -162,10 +162,10 @@ export default {
|
|||||||
viewDetails: "View Details",
|
viewDetails: "View Details",
|
||||||
},
|
},
|
||||||
Status: {
|
Status: {
|
||||||
Pending: "Queued",
|
Pending: "Pending",
|
||||||
InProgress: "Running",
|
InProgress: "In Progress",
|
||||||
Running: "Running",
|
Running: "In Progress",
|
||||||
Partitioning: "Running",
|
Partitioning: "In Progress",
|
||||||
Paused: "Paused",
|
Paused: "Paused",
|
||||||
Completed: "Completed",
|
Completed: "Completed",
|
||||||
Failed: "Failed",
|
Failed: "Failed",
|
||||||
|
|||||||
@@ -59,8 +59,15 @@ describe("CopyJobContext", () => {
|
|||||||
jobName: "",
|
jobName: "",
|
||||||
migrationType: CopyJobMigrationType.Offline,
|
migrationType: CopyJobMigrationType.Offline,
|
||||||
source: {
|
source: {
|
||||||
subscription: null,
|
subscription: {
|
||||||
account: null,
|
subscriptionId: "test-subscription-id",
|
||||||
|
},
|
||||||
|
account: {
|
||||||
|
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDB/databaseAccounts/test-account",
|
||||||
|
name: "test-account",
|
||||||
|
location: "East US",
|
||||||
|
kind: "GlobalDocumentDB",
|
||||||
|
},
|
||||||
databaseId: "",
|
databaseId: "",
|
||||||
containerId: "",
|
containerId: "",
|
||||||
},
|
},
|
||||||
@@ -598,8 +605,8 @@ describe("CopyJobContext", () => {
|
|||||||
</CopyJobContextProvider>,
|
</CopyJobContextProvider>,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(contextValue.copyJobState.source?.subscription?.subscriptionId).toBeUndefined();
|
expect(contextValue.copyJobState.source.subscription.subscriptionId).toBe("test-subscription-id");
|
||||||
expect(contextValue.copyJobState.source?.account?.name).toBeUndefined();
|
expect(contextValue.copyJobState.source.account.name).toBe("test-account");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should initialize target with userContext values", () => {
|
it("should initialize target with userContext values", () => {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Explorer from "Explorer/Explorer";
|
import Explorer from "Explorer/Explorer";
|
||||||
|
import { Subscription } from "Contracts/DataModels";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { userContext } from "UserContext";
|
import { userContext } from "UserContext";
|
||||||
import { CopyJobMigrationType } from "../Enums/CopyJobEnums";
|
import { CopyJobMigrationType } from "../Enums/CopyJobEnums";
|
||||||
@@ -23,8 +24,10 @@ const getInitialCopyJobState = (): CopyJobContextState => {
|
|||||||
jobName: "",
|
jobName: "",
|
||||||
migrationType: CopyJobMigrationType.Offline,
|
migrationType: CopyJobMigrationType.Offline,
|
||||||
source: {
|
source: {
|
||||||
subscription: null,
|
subscription: {
|
||||||
account: null,
|
subscriptionId: userContext.subscriptionId || "",
|
||||||
|
} as Subscription,
|
||||||
|
account: userContext.databaseAccount || null,
|
||||||
databaseId: "",
|
databaseId: "",
|
||||||
containerId: "",
|
containerId: "",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export function isEqual(prevJobs: CopyJobType[], newJobs: CopyJobType[]): boolea
|
|||||||
}
|
}
|
||||||
|
|
||||||
const truncateLength = 5;
|
const truncateLength = 5;
|
||||||
export const truncateName = (name: string, length: number = truncateLength): string => {
|
const truncateName = (name: string, length: number = truncateLength): string => {
|
||||||
return name.length <= length ? name : name.slice(0, length);
|
return name.length <= length ? name : name.slice(0, length);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ const AddManagedIdentity: React.FC<AddManagedIdentityProps> = () => {
|
|||||||
<InfoTooltip content={managedIdentityTooltip} />
|
<InfoTooltip content={managedIdentityTooltip} />
|
||||||
</Text>
|
</Text>
|
||||||
<Toggle
|
<Toggle
|
||||||
data-test="btn-toggle"
|
|
||||||
checked={systemAssigned}
|
checked={systemAssigned}
|
||||||
onText={ContainerCopyMessages.toggleBtn.onText}
|
onText={ContainerCopyMessages.toggleBtn.onText}
|
||||||
offText={ContainerCopyMessages.toggleBtn.offText}
|
offText={ContainerCopyMessages.toggleBtn.offText}
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ const AddReadPermissionToDefaultIdentity: React.FC<AddReadPermissionToDefaultIde
|
|||||||
<InfoTooltip content={TooltipContent} />
|
<InfoTooltip content={TooltipContent} />
|
||||||
</Text>
|
</Text>
|
||||||
<Toggle
|
<Toggle
|
||||||
data-test="btn-toggle"
|
|
||||||
checked={readPermissionAssigned}
|
checked={readPermissionAssigned}
|
||||||
onText={ContainerCopyMessages.toggleBtn.onText}
|
onText={ContainerCopyMessages.toggleBtn.onText}
|
||||||
offText={ContainerCopyMessages.toggleBtn.offText}
|
offText={ContainerCopyMessages.toggleBtn.offText}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useCopyJobPrerequisitesCache } from "../../Utils/useCopyJobPrerequisite
|
|||||||
import usePermissionSections, { PermissionGroupConfig, PermissionSectionConfig } from "./hooks/usePermissionsSection";
|
import usePermissionSections, { PermissionGroupConfig, PermissionSectionConfig } from "./hooks/usePermissionsSection";
|
||||||
|
|
||||||
const PermissionSection: React.FC<PermissionSectionConfig> = ({ id, title, Component, completed, disabled }) => (
|
const PermissionSection: React.FC<PermissionSectionConfig> = ({ id, title, Component, completed, disabled }) => (
|
||||||
<AccordionItem key={id} value={id} disabled={disabled} data-test="accordion-item">
|
<AccordionItem key={id} value={id} disabled={disabled}>
|
||||||
<AccordionHeader className="accordionHeader">
|
<AccordionHeader className="accordionHeader">
|
||||||
<Text className="accordionHeaderText" variant="medium">
|
<Text className="accordionHeaderText" variant="medium">
|
||||||
{title}
|
{title}
|
||||||
@@ -25,13 +25,13 @@ const PermissionSection: React.FC<PermissionSectionConfig> = ({ id, title, Compo
|
|||||||
height={completed ? 20 : 24}
|
height={completed ? 20 : 24}
|
||||||
/>
|
/>
|
||||||
</AccordionHeader>
|
</AccordionHeader>
|
||||||
<AccordionPanel aria-disabled={disabled} className="accordionPanel" data-test="accordion-panel">
|
<AccordionPanel aria-disabled={disabled} className="accordionPanel">
|
||||||
<Component />
|
<Component />
|
||||||
</AccordionPanel>
|
</AccordionPanel>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
);
|
);
|
||||||
|
|
||||||
const PermissionGroup: React.FC<PermissionGroupConfig> = ({ id, title, description, sections }) => {
|
const PermissionGroup: React.FC<PermissionGroupConfig> = ({ title, description, sections }) => {
|
||||||
const [openItems, setOpenItems] = React.useState<string[]>([]);
|
const [openItems, setOpenItems] = React.useState<string[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -44,7 +44,6 @@ const PermissionGroup: React.FC<PermissionGroupConfig> = ({ id, title, descripti
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
data-test={`permission-group-container-${id}`}
|
|
||||||
tokens={{ childrenGap: 15 }}
|
tokens={{ childrenGap: 15 }}
|
||||||
styles={{
|
styles={{
|
||||||
root: {
|
root: {
|
||||||
@@ -100,11 +99,7 @@ const AssignPermissions = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack className="assignPermissionsContainer" tokens={{ childrenGap: 20 }}>
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
className="assignPermissionsContainer"
|
|
||||||
tokens={{ childrenGap: 20 }}
|
|
||||||
>
|
|
||||||
<Text variant="medium">
|
<Text variant="medium">
|
||||||
{isSameAccount && copyJobState.migrationType === CopyJobMigrationType.Online
|
{isSameAccount && copyJobState.migrationType === CopyJobMigrationType.Online
|
||||||
? ContainerCopyMessages.assignPermissions.intraAccountOnlineDescription(
|
? ContainerCopyMessages.assignPermissions.intraAccountOnlineDescription(
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ const DefaultManagedIdentity: React.FC<AddManagedIdentityProps> = () => {
|
|||||||
<InfoTooltip content={managedIdentityTooltip} />
|
<InfoTooltip content={managedIdentityTooltip} />
|
||||||
</div>
|
</div>
|
||||||
<Toggle
|
<Toggle
|
||||||
data-test="btn-toggle"
|
|
||||||
checked={defaultSystemAssigned}
|
checked={defaultSystemAssigned}
|
||||||
onText={ContainerCopyMessages.toggleBtn.onText}
|
onText={ContainerCopyMessages.toggleBtn.onText}
|
||||||
offText={ContainerCopyMessages.toggleBtn.offText}
|
offText={ContainerCopyMessages.toggleBtn.offText}
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ const PointInTimeRestore: React.FC = () => {
|
|||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
{showRefreshButton ? (
|
{showRefreshButton ? (
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
data-test="pointInTimeRestore:RefreshBtn"
|
|
||||||
className="fullWidth"
|
className="fullWidth"
|
||||||
text={ContainerCopyMessages.refreshButtonLabel}
|
text={ContainerCopyMessages.refreshButtonLabel}
|
||||||
iconProps={{ iconName: "Refresh" }}
|
iconProps={{ iconName: "Refresh" }}
|
||||||
@@ -135,7 +134,6 @@ const PointInTimeRestore: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
data-test="pointInTimeRestore:PrimaryBtn"
|
|
||||||
className="fullWidth"
|
className="fullWidth"
|
||||||
text={loading ? "" : ContainerCopyMessages.pointInTimeRestore.buttonText}
|
text={loading ? "" : ContainerCopyMessages.pointInTimeRestore.buttonText}
|
||||||
{...(loading ? { iconProps: { iconName: "SyncStatusSolid" } } : {})}
|
{...(loading ? { iconProps: { iconName: "SyncStatusSolid" } } : {})}
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ exports[`AddManagedIdentity Snapshot Tests renders initial state correctly 1`] =
|
|||||||
class="ms-Toggle-background pill-117"
|
class="ms-Toggle-background pill-117"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle1"
|
id="Toggle1"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -155,7 +154,6 @@ exports[`AddManagedIdentity Snapshot Tests renders loading state 1`] = `
|
|||||||
class="ms-Toggle-background pill-121"
|
class="ms-Toggle-background pill-121"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle11"
|
id="Toggle11"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -175,12 +173,10 @@ exports[`AddManagedIdentity Snapshot Tests renders loading state 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground loading css-123"
|
class="ms-Stack popover-container foreground loading css-123"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Overlay root-135"
|
class="ms-Overlay root-135"
|
||||||
data-test="loading-overlay"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Spinner root-137"
|
class="ms-Spinner root-137"
|
||||||
@@ -327,7 +323,6 @@ exports[`AddManagedIdentity Snapshot Tests renders with toggle on and popover vi
|
|||||||
class="ms-Toggle-background pill-121"
|
class="ms-Toggle-background pill-121"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle3"
|
id="Toggle3"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -347,7 +342,6 @@ exports[`AddManagedIdentity Snapshot Tests renders with toggle on and popover vi
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-123"
|
class="ms-Stack popover-container foreground css-123"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ exports[`AddReadPermissionToDefaultIdentity Component Edge Cases should handle m
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle17"
|
id="Toggle17"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -104,7 +103,6 @@ exports[`AddReadPermissionToDefaultIdentity Component Edge Cases should handle m
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle16"
|
id="Toggle16"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -167,7 +165,6 @@ exports[`AddReadPermissionToDefaultIdentity Component Rendering should render co
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle3"
|
id="Toggle3"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -230,7 +227,6 @@ exports[`AddReadPermissionToDefaultIdentity Component Rendering should render co
|
|||||||
class="ms-Toggle-background pill-119"
|
class="ms-Toggle-background pill-119"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle1"
|
id="Toggle1"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -318,7 +314,6 @@ exports[`AddReadPermissionToDefaultIdentity Component Rendering should render co
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle0"
|
id="Toggle0"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -381,7 +376,6 @@ exports[`AddReadPermissionToDefaultIdentity Component Rendering should render co
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle2"
|
id="Toggle2"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ exports[`AssignPermissions Component Accordion Behavior should render accordion
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -16,7 +15,6 @@ exports[`AssignPermissions Component Accordion Behavior should render accordion
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-testGroup"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -38,7 +36,6 @@ exports[`AssignPermissions Component Accordion Behavior should render accordion
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -88,7 +85,6 @@ exports[`AssignPermissions Component Accordion Behavior should render accordion
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -138,7 +134,6 @@ exports[`AssignPermissions Component Accordion Behavior should render accordion
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
Incomplete Component
|
Incomplete Component
|
||||||
@@ -147,7 +142,6 @@ exports[`AssignPermissions Component Accordion Behavior should render accordion
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
||||||
@@ -207,7 +201,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -219,7 +212,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-testGroup"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -241,7 +233,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -291,7 +282,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -341,7 +331,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
Incomplete Component
|
Incomplete Component
|
||||||
@@ -350,7 +339,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
||||||
@@ -410,7 +398,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -422,7 +409,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-testGroup"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -444,7 +430,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -494,7 +479,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -544,7 +528,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
Incomplete Component
|
Incomplete Component
|
||||||
@@ -553,7 +536,6 @@ exports[`AssignPermissions Component Edge Cases should calculate correct indent
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
||||||
@@ -613,7 +595,6 @@ exports[`AssignPermissions Component Edge Cases should handle missing account na
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -625,7 +606,6 @@ exports[`AssignPermissions Component Edge Cases should handle missing account na
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-testGroup"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -647,7 +627,6 @@ exports[`AssignPermissions Component Edge Cases should handle missing account na
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -697,7 +676,6 @@ exports[`AssignPermissions Component Edge Cases should handle missing account na
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -747,7 +725,6 @@ exports[`AssignPermissions Component Edge Cases should handle missing account na
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
Incomplete Component
|
Incomplete Component
|
||||||
@@ -756,7 +733,6 @@ exports[`AssignPermissions Component Edge Cases should handle missing account na
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
class="fui-AccordionHeader accordionHeader ___lyghz50_53x5ri0 f1s2aq7o f1c21dwh f1s184ao ft85np5 fwrgwhw"
|
||||||
@@ -816,7 +792,6 @@ exports[`AssignPermissions Component Permission Groups should render multiple pe
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -828,7 +803,6 @@ exports[`AssignPermissions Component Permission Groups should render multiple pe
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-crossAccountConfigs"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -850,7 +824,6 @@ exports[`AssignPermissions Component Permission Groups should render multiple pe
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -902,7 +875,6 @@ exports[`AssignPermissions Component Permission Groups should render multiple pe
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-onlineConfigs"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -924,7 +896,6 @@ exports[`AssignPermissions Component Permission Groups should render multiple pe
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -974,7 +945,6 @@ exports[`AssignPermissions Component Permission Groups should render multiple pe
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
data-testid="online-copy-enabled"
|
data-testid="online-copy-enabled"
|
||||||
@@ -994,7 +964,6 @@ exports[`AssignPermissions Component Permission Groups should render online migr
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -1006,7 +975,6 @@ exports[`AssignPermissions Component Permission Groups should render online migr
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-onlineConfigs"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -1028,7 +996,6 @@ exports[`AssignPermissions Component Permission Groups should render online migr
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -1078,7 +1045,6 @@ exports[`AssignPermissions Component Permission Groups should render online migr
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -1128,7 +1094,6 @@ exports[`AssignPermissions Component Permission Groups should render online migr
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
data-testid="online-copy-enabled"
|
data-testid="online-copy-enabled"
|
||||||
@@ -1148,7 +1113,6 @@ exports[`AssignPermissions Component Permission Groups should render permission
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -1160,7 +1124,6 @@ exports[`AssignPermissions Component Permission Groups should render permission
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-112"
|
class="ms-Stack css-112"
|
||||||
data-test="permission-group-container-crossAccountConfigs"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack css-113"
|
class="ms-Stack css-113"
|
||||||
@@ -1182,7 +1145,6 @@ exports[`AssignPermissions Component Permission Groups should render permission
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -1232,7 +1194,6 @@ exports[`AssignPermissions Component Permission Groups should render permission
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionItem"
|
class="fui-AccordionItem"
|
||||||
data-test="accordion-item"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
class="fui-AccordionHeader accordionHeader ___kex8dp0_1udlp87 f19n0e5 f1c21dwh f1s184ao ft85np5"
|
||||||
@@ -1282,7 +1243,6 @@ exports[`AssignPermissions Component Permission Groups should render permission
|
|||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
aria-disabled="false"
|
||||||
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
class="fui-AccordionPanel accordionPanel ___1rufncu_1hx1scr f1axvtxu"
|
||||||
data-test="accordion-panel"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
data-testid="add-read-permission"
|
data-testid="add-read-permission"
|
||||||
@@ -1302,7 +1262,6 @@ exports[`AssignPermissions Component Rendering should render without crashing wi
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
@@ -1324,7 +1283,6 @@ exports[`AssignPermissions Component Rendering should render without crashing wi
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack assignPermissionsContainer css-109"
|
class="ms-Stack assignPermissionsContainer css-109"
|
||||||
data-test="Panel:AssignPermissionsContainer"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="css-110"
|
class="css-110"
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ exports[`DefaultManagedIdentity Edge Cases should handle missing account name gr
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle14"
|
id="Toggle14"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -104,7 +103,6 @@ exports[`DefaultManagedIdentity Edge Cases should handle null account 1`] = `
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle15"
|
id="Toggle15"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -167,7 +165,6 @@ exports[`DefaultManagedIdentity Loading States should render loading state snaps
|
|||||||
class="ms-Toggle-background pill-119"
|
class="ms-Toggle-background pill-119"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle10"
|
id="Toggle10"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -259,7 +256,6 @@ exports[`DefaultManagedIdentity Rendering should render correctly with default s
|
|||||||
class="ms-Toggle-background pill-115"
|
class="ms-Toggle-background pill-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle0"
|
id="Toggle0"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -322,7 +318,6 @@ exports[`DefaultManagedIdentity Toggle Interactions should render toggle with ch
|
|||||||
class="ms-Toggle-background pill-119"
|
class="ms-Toggle-background pill-119"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="btn-toggle"
|
|
||||||
id="Toggle7"
|
id="Toggle7"
|
||||||
role="switch"
|
role="switch"
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ exports[`PointInTimeRestore Initial Render should render correctly with default
|
|||||||
<button
|
<button
|
||||||
class="ms-Button ms-Button--primary fullWidth root-115"
|
class="ms-Button ms-Button--primary fullWidth root-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-test="pointInTimeRestore:PrimaryBtn"
|
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -132,7 +131,6 @@ exports[`PointInTimeRestore Initial Render should render with empty account name
|
|||||||
<button
|
<button
|
||||||
class="ms-Button ms-Button--primary fullWidth root-115"
|
class="ms-Button ms-Button--primary fullWidth root-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-test="pointInTimeRestore:PrimaryBtn"
|
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -163,7 +161,6 @@ exports[`PointInTimeRestore Snapshots should match snapshot in loading state 1`]
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Overlay root-123"
|
class="ms-Overlay root-123"
|
||||||
data-test="loading-overlay"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Spinner root-125"
|
class="ms-Spinner root-125"
|
||||||
@@ -226,7 +223,6 @@ exports[`PointInTimeRestore Snapshots should match snapshot in loading state 1`]
|
|||||||
aria-disabled="true"
|
aria-disabled="true"
|
||||||
class="ms-Button ms-Button--primary is-disabled fullWidth root-128"
|
class="ms-Button ms-Button--primary is-disabled fullWidth root-128"
|
||||||
data-is-focusable="false"
|
data-is-focusable="false"
|
||||||
data-test="pointInTimeRestore:PrimaryBtn"
|
|
||||||
disabled=""
|
disabled=""
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
@@ -305,7 +301,6 @@ exports[`PointInTimeRestore Snapshots should match snapshot with refresh button
|
|||||||
<button
|
<button
|
||||||
class="ms-Button ms-Button--primary fullWidth root-115"
|
class="ms-Button ms-Button--primary fullWidth root-115"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-test="pointInTimeRestore:RefreshBtn"
|
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -76,12 +76,10 @@ const mockedRbacUtils = RbacUtils as jest.Mocked<typeof RbacUtils>;
|
|||||||
const mockedCopyJobPrerequisitesCache = CopyJobPrerequisitesCacheModule as jest.Mocked<
|
const mockedCopyJobPrerequisitesCache = CopyJobPrerequisitesCacheModule as jest.Mocked<
|
||||||
typeof CopyJobPrerequisitesCacheModule
|
typeof CopyJobPrerequisitesCacheModule
|
||||||
>;
|
>;
|
||||||
|
|
||||||
interface TestWrapperProps {
|
interface TestWrapperProps {
|
||||||
state: CopyJobContextState;
|
state: CopyJobContextState;
|
||||||
onResult?: (result: PermissionGroupConfig[]) => void;
|
onResult?: (result: PermissionGroupConfig[]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TestWrapper: React.FC<TestWrapperProps> = ({ state, onResult }) => {
|
const TestWrapper: React.FC<TestWrapperProps> = ({ state, onResult }) => {
|
||||||
const result = usePermissionSections(state);
|
const result = usePermissionSections(state);
|
||||||
|
|
||||||
|
|||||||
@@ -19,21 +19,9 @@ const NavigationControls: React.FC<NavigationControlsProps> = ({
|
|||||||
isPreviousDisabled,
|
isPreviousDisabled,
|
||||||
}) => (
|
}) => (
|
||||||
<Stack horizontal tokens={{ childrenGap: 20 }}>
|
<Stack horizontal tokens={{ childrenGap: 20 }}>
|
||||||
<PrimaryButton
|
<PrimaryButton text={primaryBtnText} onClick={onPrimary} allowDisabledFocus disabled={isPrimaryDisabled} />
|
||||||
data-test="copy-job-primary"
|
<DefaultButton text="Previous" onClick={onPrevious} allowDisabledFocus disabled={isPreviousDisabled} />
|
||||||
text={primaryBtnText}
|
<DefaultButton text="Cancel" onClick={onCancel} />
|
||||||
onClick={onPrimary}
|
|
||||||
allowDisabledFocus
|
|
||||||
disabled={isPrimaryDisabled}
|
|
||||||
/>
|
|
||||||
<DefaultButton
|
|
||||||
data-test="copy-job-previous"
|
|
||||||
text="Previous"
|
|
||||||
onClick={onPrevious}
|
|
||||||
allowDisabledFocus
|
|
||||||
disabled={isPreviousDisabled}
|
|
||||||
/>
|
|
||||||
<DefaultButton data-test="copy-job-cancel" text="Cancel" onClick={onCancel} />
|
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ const PopoverContainer: React.FC<PopoverContainerProps> = React.memo(
|
|||||||
({ isLoading = false, title, children, onPrimary, onCancel }) => {
|
({ isLoading = false, title, children, onPrimary, onCancel }) => {
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
data-test="popover-container"
|
|
||||||
className={`popover-container foreground ${isLoading ? "loading" : ""}`}
|
className={`popover-container foreground ${isLoading ? "loading" : ""}`}
|
||||||
tokens={{ childrenGap: 20 }}
|
tokens={{ childrenGap: 20 }}
|
||||||
style={{ maxWidth: 450 }}
|
style={{ maxWidth: 450 }}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ exports[`PopoverMessage Component Edge Cases should handle empty string title 1`
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -72,7 +71,6 @@ exports[`PopoverMessage Component Edge Cases should handle null children 1`] = `
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -135,7 +133,6 @@ exports[`PopoverMessage Component Edge Cases should handle undefined children 1`
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -198,7 +195,6 @@ exports[`PopoverMessage Component Edge Cases should handle very long title 1`] =
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -270,7 +266,6 @@ exports[`PopoverMessage Component Rendering should render correctly when visible
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -340,7 +335,6 @@ exports[`PopoverMessage Component Rendering should render correctly with differe
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -415,7 +409,6 @@ exports[`PopoverMessage Component Rendering should render correctly with differe
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground css-109"
|
class="ms-Stack popover-container foreground css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -485,7 +478,6 @@ exports[`PopoverMessage Component Rendering should render correctly with loading
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack popover-container foreground loading css-109"
|
class="ms-Stack popover-container foreground loading css-109"
|
||||||
data-test="popover-container"
|
|
||||||
style="max-width: 450px;"
|
style="max-width: 450px;"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ const CreateCopyJobScreens: React.FC = () => {
|
|||||||
<Stack.Item className="createCopyJobScreensContent">
|
<Stack.Item className="createCopyJobScreensContent">
|
||||||
{contextError && (
|
{contextError && (
|
||||||
<MessageBar
|
<MessageBar
|
||||||
data-test="Panel:ErrorContainer"
|
|
||||||
className="createCopyJobErrorMessageBar"
|
className="createCopyJobErrorMessageBar"
|
||||||
messageBarType={MessageBarType.blocked}
|
messageBarType={MessageBarType.blocked}
|
||||||
isMultiline={false}
|
isMultiline={false}
|
||||||
|
|||||||
@@ -31,17 +31,17 @@ const PreviewCopyJob: React.FC = () => {
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Stack tokens={{ childrenGap: 20 }} className="previewCopyJobContainer" data-test="Panel:PreviewCopyJob">
|
<Stack tokens={{ childrenGap: 20 }} className="previewCopyJobContainer">
|
||||||
<FieldRow label={ContainerCopyMessages.jobNameLabel}>
|
<FieldRow label={ContainerCopyMessages.jobNameLabel}>
|
||||||
<TextField data-test="job-name-textfield" value={jobName} onChange={onJobNameChange} />
|
<TextField value={jobName} onChange={onJobNameChange} />
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text className="bold">{ContainerCopyMessages.sourceSubscriptionLabel}</Text>
|
<Text className="bold">{ContainerCopyMessages.sourceSubscriptionLabel}</Text>
|
||||||
<Text data-test="source-subscription-name">{copyJobState.source?.subscription?.displayName}</Text>
|
<Text>{copyJobState.source?.subscription?.displayName}</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text className="bold">{ContainerCopyMessages.sourceAccountLabel}</Text>
|
<Text className="bold">{ContainerCopyMessages.sourceAccountLabel}</Text>
|
||||||
<Text data-test="source-account-name">{copyJobState.source?.account?.name}</Text>
|
<Text>{copyJobState.source?.account?.name}</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<DetailsList
|
<DetailsList
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
exports[`PreviewCopyJob should handle special characters in database and container names 1`] = `
|
exports[`PreviewCopyJob should handle special characters in database and container names 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -33,7 +32,6 @@ exports[`PreviewCopyJob should handle special characters in database and contain
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField84"
|
id="TextField84"
|
||||||
type="text"
|
type="text"
|
||||||
value="job-with@special#chars_123"
|
value="job-with@special#chars_123"
|
||||||
@@ -53,7 +51,6 @@ exports[`PreviewCopyJob should handle special characters in database and contain
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -68,7 +65,6 @@ exports[`PreviewCopyJob should handle special characters in database and contain
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
@@ -325,7 +321,6 @@ exports[`PreviewCopyJob should handle special characters in database and contain
|
|||||||
exports[`PreviewCopyJob should render component with cross-subscription setup 1`] = `
|
exports[`PreviewCopyJob should render component with cross-subscription setup 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -355,7 +350,6 @@ exports[`PreviewCopyJob should render component with cross-subscription setup 1`
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField96"
|
id="TextField96"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@@ -375,7 +369,6 @@ exports[`PreviewCopyJob should render component with cross-subscription setup 1`
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -390,7 +383,6 @@ exports[`PreviewCopyJob should render component with cross-subscription setup 1`
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
@@ -647,7 +639,6 @@ exports[`PreviewCopyJob should render component with cross-subscription setup 1`
|
|||||||
exports[`PreviewCopyJob should render with default state and empty job name 1`] = `
|
exports[`PreviewCopyJob should render with default state and empty job name 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -677,7 +668,6 @@ exports[`PreviewCopyJob should render with default state and empty job name 1`]
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField0"
|
id="TextField0"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@@ -697,7 +687,6 @@ exports[`PreviewCopyJob should render with default state and empty job name 1`]
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -712,7 +701,6 @@ exports[`PreviewCopyJob should render with default state and empty job name 1`]
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
@@ -969,7 +957,6 @@ exports[`PreviewCopyJob should render with default state and empty job name 1`]
|
|||||||
exports[`PreviewCopyJob should render with long subscription and account names 1`] = `
|
exports[`PreviewCopyJob should render with long subscription and account names 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -999,7 +986,6 @@ exports[`PreviewCopyJob should render with long subscription and account names 1
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField60"
|
id="TextField60"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@@ -1019,7 +1005,6 @@ exports[`PreviewCopyJob should render with long subscription and account names 1
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
This is a very long subscription name that might cause display issues if not handled properly
|
This is a very long subscription name that might cause display issues if not handled properly
|
||||||
</span>
|
</span>
|
||||||
@@ -1034,7 +1019,6 @@ exports[`PreviewCopyJob should render with long subscription and account names 1
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
this-is-a-very-long-database-account-name-that-might-cause-display-issues
|
this-is-a-very-long-database-account-name-that-might-cause-display-issues
|
||||||
</span>
|
</span>
|
||||||
@@ -1291,7 +1275,6 @@ exports[`PreviewCopyJob should render with long subscription and account names 1
|
|||||||
exports[`PreviewCopyJob should render with missing source account information 1`] = `
|
exports[`PreviewCopyJob should render with missing source account information 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -1321,7 +1304,6 @@ exports[`PreviewCopyJob should render with missing source account information 1`
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField36"
|
id="TextField36"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@@ -1341,7 +1323,6 @@ exports[`PreviewCopyJob should render with missing source account information 1`
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -1607,7 +1588,6 @@ exports[`PreviewCopyJob should render with missing source account information 1`
|
|||||||
exports[`PreviewCopyJob should render with missing source subscription information 1`] = `
|
exports[`PreviewCopyJob should render with missing source subscription information 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -1637,7 +1617,6 @@ exports[`PreviewCopyJob should render with missing source subscription informati
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField24"
|
id="TextField24"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@@ -1666,7 +1645,6 @@ exports[`PreviewCopyJob should render with missing source subscription informati
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
@@ -1923,7 +1901,6 @@ exports[`PreviewCopyJob should render with missing source subscription informati
|
|||||||
exports[`PreviewCopyJob should render with online migration type 1`] = `
|
exports[`PreviewCopyJob should render with online migration type 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -1953,7 +1930,6 @@ exports[`PreviewCopyJob should render with online migration type 1`] = `
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField72"
|
id="TextField72"
|
||||||
type="text"
|
type="text"
|
||||||
value="online-migration-job"
|
value="online-migration-job"
|
||||||
@@ -1973,7 +1949,6 @@ exports[`PreviewCopyJob should render with online migration type 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -1988,7 +1963,6 @@ exports[`PreviewCopyJob should render with online migration type 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
@@ -2245,7 +2219,6 @@ exports[`PreviewCopyJob should render with online migration type 1`] = `
|
|||||||
exports[`PreviewCopyJob should render with pre-filled job name 1`] = `
|
exports[`PreviewCopyJob should render with pre-filled job name 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -2275,7 +2248,6 @@ exports[`PreviewCopyJob should render with pre-filled job name 1`] = `
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField12"
|
id="TextField12"
|
||||||
type="text"
|
type="text"
|
||||||
value="custom-job-name-123"
|
value="custom-job-name-123"
|
||||||
@@ -2295,7 +2267,6 @@ exports[`PreviewCopyJob should render with pre-filled job name 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -2310,7 +2281,6 @@ exports[`PreviewCopyJob should render with pre-filled job name 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
@@ -2567,7 +2537,6 @@ exports[`PreviewCopyJob should render with pre-filled job name 1`] = `
|
|||||||
exports[`PreviewCopyJob should render with undefined database and container names 1`] = `
|
exports[`PreviewCopyJob should render with undefined database and container names 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack previewCopyJobContainer css-109"
|
class="ms-Stack previewCopyJobContainer css-109"
|
||||||
data-test="Panel:PreviewCopyJob"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Stack flex-row css-110"
|
class="ms-Stack flex-row css-110"
|
||||||
@@ -2597,7 +2566,6 @@ exports[`PreviewCopyJob should render with undefined database and container name
|
|||||||
<input
|
<input
|
||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="ms-TextField-field field-115"
|
class="ms-TextField-field field-115"
|
||||||
data-test="job-name-textfield"
|
|
||||||
id="TextField48"
|
id="TextField48"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@@ -2617,7 +2585,6 @@ exports[`PreviewCopyJob should render with undefined database and container name
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-subscription-name"
|
|
||||||
>
|
>
|
||||||
Test Subscription
|
Test Subscription
|
||||||
</span>
|
</span>
|
||||||
@@ -2632,7 +2599,6 @@ exports[`PreviewCopyJob should render with undefined database and container name
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="css-125"
|
class="css-125"
|
||||||
data-test="source-account-name"
|
|
||||||
>
|
>
|
||||||
test-account
|
test-account
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,424 +1,219 @@
|
|||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { configContext, Platform } from "../../../../../../ConfigContext";
|
import { DropdownOptionType } from "../../../../Types/CopyJobTypes";
|
||||||
import { DatabaseAccount } from "../../../../../../Contracts/DataModels";
|
import { AccountDropdown } from "./AccountDropdown";
|
||||||
import * as useDatabaseAccountsHook from "../../../../../../hooks/useDatabaseAccounts";
|
|
||||||
import { apiType, userContext } from "../../../../../../UserContext";
|
|
||||||
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
|
||||||
import { CopyJobContext } from "../../../../Context/CopyJobContext";
|
|
||||||
import { CopyJobMigrationType } from "../../../../Enums/CopyJobEnums";
|
|
||||||
import { CopyJobContextProviderType, CopyJobContextState } from "../../../../Types/CopyJobTypes";
|
|
||||||
import { AccountDropdown, normalizeAccountId } from "./AccountDropdown";
|
|
||||||
|
|
||||||
jest.mock("../../../../../../hooks/useDatabaseAccounts");
|
|
||||||
jest.mock("../../../../../../UserContext", () => ({
|
|
||||||
userContext: {
|
|
||||||
databaseAccount: null as DatabaseAccount | null,
|
|
||||||
},
|
|
||||||
apiType: jest.fn(),
|
|
||||||
}));
|
|
||||||
jest.mock("../../../../../../ConfigContext", () => ({
|
|
||||||
configContext: {
|
|
||||||
platform: "Portal",
|
|
||||||
},
|
|
||||||
Platform: {
|
|
||||||
Portal: "Portal",
|
|
||||||
Hosted: "Hosted",
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const mockUseDatabaseAccounts = useDatabaseAccountsHook.useDatabaseAccounts as jest.MockedFunction<
|
|
||||||
typeof useDatabaseAccountsHook.useDatabaseAccounts
|
|
||||||
>;
|
|
||||||
|
|
||||||
describe("AccountDropdown", () => {
|
describe("AccountDropdown", () => {
|
||||||
const mockSetCopyJobState = jest.fn();
|
const mockOnChange = jest.fn();
|
||||||
const mockCopyJobState = {
|
|
||||||
jobName: "",
|
const mockAccountOptions: DropdownOptionType[] = [
|
||||||
migrationType: CopyJobMigrationType.Offline,
|
{
|
||||||
source: {
|
key: "account-1",
|
||||||
subscription: {
|
text: "Development Account",
|
||||||
subscriptionId: "test-subscription-id",
|
data: {
|
||||||
displayName: "Test Subscription",
|
id: "account-1",
|
||||||
|
name: "Development Account",
|
||||||
|
location: "East US",
|
||||||
|
resourceGroup: "dev-rg",
|
||||||
|
kind: "GlobalDocumentDB",
|
||||||
|
properties: {
|
||||||
|
documentEndpoint: "https://dev-account.documents.azure.com:443/",
|
||||||
|
provisioningState: "Succeeded",
|
||||||
|
consistencyPolicy: {
|
||||||
|
defaultConsistencyLevel: "Session",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
account: null,
|
|
||||||
databaseId: "",
|
|
||||||
containerId: "",
|
|
||||||
},
|
},
|
||||||
target: {
|
{
|
||||||
subscriptionId: "",
|
key: "account-2",
|
||||||
account: null,
|
text: "Production Account",
|
||||||
databaseId: "",
|
data: {
|
||||||
containerId: "",
|
id: "account-2",
|
||||||
|
name: "Production Account",
|
||||||
|
location: "West US 2",
|
||||||
|
resourceGroup: "prod-rg",
|
||||||
|
kind: "GlobalDocumentDB",
|
||||||
|
properties: {
|
||||||
|
documentEndpoint: "https://prod-account.documents.azure.com:443/",
|
||||||
|
provisioningState: "Succeeded",
|
||||||
|
consistencyPolicy: {
|
||||||
|
defaultConsistencyLevel: "Strong",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
sourceReadAccessFromTarget: false,
|
{
|
||||||
} as CopyJobContextState;
|
key: "account-3",
|
||||||
|
text: "Testing Account",
|
||||||
const mockCopyJobContextValue = {
|
data: {
|
||||||
copyJobState: mockCopyJobState,
|
id: "account-3",
|
||||||
setCopyJobState: mockSetCopyJobState,
|
name: "Testing Account",
|
||||||
flow: null,
|
location: "Central US",
|
||||||
setFlow: jest.fn(),
|
resourceGroup: "test-rg",
|
||||||
contextError: null,
|
kind: "GlobalDocumentDB",
|
||||||
setContextError: jest.fn(),
|
properties: {
|
||||||
resetCopyJobState: jest.fn(),
|
documentEndpoint: "https://test-account.documents.azure.com:443/",
|
||||||
} as CopyJobContextProviderType;
|
provisioningState: "Succeeded",
|
||||||
|
consistencyPolicy: {
|
||||||
const mockDatabaseAccount1: DatabaseAccount = {
|
defaultConsistencyLevel: "Eventual",
|
||||||
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/account1",
|
},
|
||||||
name: "test-account-1",
|
},
|
||||||
kind: "GlobalDocumentDB",
|
},
|
||||||
location: "East US",
|
|
||||||
type: "Microsoft.DocumentDB/databaseAccounts",
|
|
||||||
tags: {},
|
|
||||||
properties: {
|
|
||||||
documentEndpoint: "https://account1.documents.azure.com:443/",
|
|
||||||
capabilities: [],
|
|
||||||
enableMultipleWriteLocations: false,
|
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|
||||||
const mockDatabaseAccount2: DatabaseAccount = {
|
|
||||||
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/account2",
|
|
||||||
name: "test-account-2",
|
|
||||||
kind: "GlobalDocumentDB",
|
|
||||||
location: "West US",
|
|
||||||
type: "Microsoft.DocumentDB/databaseAccounts",
|
|
||||||
tags: {},
|
|
||||||
properties: {
|
|
||||||
documentEndpoint: "https://account2.documents.azure.com:443/",
|
|
||||||
capabilities: [],
|
|
||||||
enableMultipleWriteLocations: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const mockNonSqlAccount: DatabaseAccount = {
|
|
||||||
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/mongo-account",
|
|
||||||
name: "mongo-account",
|
|
||||||
kind: "MongoDB",
|
|
||||||
location: "Central US",
|
|
||||||
type: "Microsoft.DocumentDB/databaseAccounts",
|
|
||||||
tags: {},
|
|
||||||
properties: {
|
|
||||||
documentEndpoint: "https://mongo-account.documents.azure.com:443/",
|
|
||||||
capabilities: [],
|
|
||||||
enableMultipleWriteLocations: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const renderWithContext = (contextValue = mockCopyJobContextValue) => {
|
|
||||||
return render(
|
|
||||||
<CopyJobContext.Provider value={contextValue}>
|
|
||||||
<AccountDropdown />
|
|
||||||
</CopyJobContext.Provider>,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
(apiType as jest.MockedFunction<any>).mockImplementation((account: DatabaseAccount) => {
|
|
||||||
return account.kind === "MongoDB" ? "MongoDB" : "SQL";
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Rendering", () => {
|
describe("Snapshot Testing", () => {
|
||||||
it("should render dropdown with correct label and placeholder", () => {
|
it("matches snapshot with all account options", () => {
|
||||||
mockUseDatabaseAccounts.mockReturnValue([]);
|
const { container } = render(
|
||||||
|
<AccountDropdown options={mockAccountOptions} disabled={false} onChange={mockOnChange} />,
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
expect(
|
|
||||||
screen.getByText(`${ContainerCopyMessages.sourceAccountDropdownLabel}:`, { exact: true }),
|
|
||||||
).toBeInTheDocument();
|
|
||||||
expect(screen.getByRole("combobox")).toHaveAttribute(
|
|
||||||
"aria-label",
|
|
||||||
ContainerCopyMessages.sourceAccountDropdownLabel,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render disabled dropdown when no subscription is selected", () => {
|
it("matches snapshot with selected account", () => {
|
||||||
mockUseDatabaseAccounts.mockReturnValue([]);
|
const { container } = render(
|
||||||
const contextWithoutSubscription = {
|
<AccountDropdown
|
||||||
...mockCopyJobContextValue,
|
options={mockAccountOptions}
|
||||||
copyJobState: {
|
selectedKey="account-2"
|
||||||
...mockCopyJobState,
|
disabled={false}
|
||||||
source: {
|
onChange={mockOnChange}
|
||||||
...mockCopyJobState.source,
|
/>,
|
||||||
subscription: null,
|
);
|
||||||
},
|
|
||||||
} as CopyJobContextState,
|
|
||||||
};
|
|
||||||
|
|
||||||
renderWithContext(contextWithoutSubscription);
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-disabled", "true");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render disabled dropdown when no accounts are available", () => {
|
it("matches snapshot with disabled dropdown", () => {
|
||||||
mockUseDatabaseAccounts.mockReturnValue([]);
|
const { container } = render(
|
||||||
|
<AccountDropdown
|
||||||
|
options={mockAccountOptions}
|
||||||
|
selectedKey="account-1"
|
||||||
|
disabled={true}
|
||||||
|
onChange={mockOnChange}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
renderWithContext();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-disabled", "true");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render enabled dropdown when accounts are available", () => {
|
it("matches snapshot with empty options", () => {
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1, mockDatabaseAccount2]);
|
const { container } = render(<AccountDropdown options={[]} disabled={false} onChange={mockOnChange} />);
|
||||||
|
|
||||||
renderWithContext();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-disabled", "false");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Account filtering", () => {
|
|
||||||
it("should filter accounts to only show SQL API accounts", () => {
|
|
||||||
const allAccounts = [mockDatabaseAccount1, mockDatabaseAccount2, mockNonSqlAccount];
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue(allAccounts);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
expect(mockUseDatabaseAccounts).toHaveBeenCalledWith("test-subscription-id");
|
|
||||||
|
|
||||||
expect(apiType as jest.MockedFunction<any>).toHaveBeenCalledWith(mockDatabaseAccount1);
|
|
||||||
expect(apiType as jest.MockedFunction<any>).toHaveBeenCalledWith(mockDatabaseAccount2);
|
|
||||||
expect(apiType as jest.MockedFunction<any>).toHaveBeenCalledWith(mockNonSqlAccount);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Account selection", () => {
|
|
||||||
it("should auto-select the first SQL account when no account is currently selected", async () => {
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1, mockDatabaseAccount2]);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
const stateUpdateFunction = mockSetCopyJobState.mock.calls[0][0];
|
|
||||||
const newState = stateUpdateFunction(mockCopyJobState);
|
|
||||||
expect(newState.source.account).toEqual({
|
|
||||||
...mockDatabaseAccount1,
|
|
||||||
id: normalizeAccountId(mockDatabaseAccount1.id),
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should auto-select predefined account from userContext if available", async () => {
|
it("matches snapshot with single option", () => {
|
||||||
const userContextAccount = {
|
const { container } = render(
|
||||||
...mockDatabaseAccount2,
|
<AccountDropdown
|
||||||
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDB/databaseAccounts/account2",
|
options={[mockAccountOptions[0]]}
|
||||||
};
|
selectedKey="account-1"
|
||||||
|
disabled={false}
|
||||||
|
onChange={mockOnChange}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
(userContext as any).databaseAccount = userContextAccount;
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1, mockDatabaseAccount2]);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
const stateUpdateFunction = mockSetCopyJobState.mock.calls[0][0];
|
|
||||||
const newState = stateUpdateFunction(mockCopyJobState);
|
|
||||||
expect(newState.source.account).toEqual({
|
|
||||||
...mockDatabaseAccount2,
|
|
||||||
id: normalizeAccountId(mockDatabaseAccount2.id),
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should keep current account if it exists in the filtered list", async () => {
|
it("matches snapshot with special characters in options", () => {
|
||||||
const contextWithSelectedAccount = {
|
const specialOptions = [
|
||||||
...mockCopyJobContextValue,
|
{
|
||||||
copyJobState: {
|
key: "special",
|
||||||
...mockCopyJobState,
|
text: 'Account with & <special> "characters"',
|
||||||
source: {
|
data: {
|
||||||
...mockCopyJobState.source,
|
id: "special",
|
||||||
account: mockDatabaseAccount1,
|
name: 'Account with & <special> "characters"',
|
||||||
|
location: "East US",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1, mockDatabaseAccount2]);
|
const { container } = render(
|
||||||
|
<AccountDropdown options={specialOptions} disabled={false} onChange={mockOnChange} />,
|
||||||
|
);
|
||||||
|
|
||||||
renderWithContext(contextWithSelectedAccount);
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
await waitFor(() => {
|
it("matches snapshot with long account name", () => {
|
||||||
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
const longNameOption = [
|
||||||
});
|
{
|
||||||
|
key: "long",
|
||||||
const stateUpdateFunction = mockSetCopyJobState.mock.calls[0][0];
|
text: "This is an extremely long account name that tests how the component handles text overflow and layout constraints in the dropdown",
|
||||||
const newState = stateUpdateFunction(contextWithSelectedAccount.copyJobState);
|
data: {
|
||||||
expect(newState).toEqual({
|
id: "long",
|
||||||
...contextWithSelectedAccount.copyJobState,
|
name: "This is an extremely long account name that tests how the component handles text overflow and layout constraints in the dropdown",
|
||||||
source: {
|
location: "North Central US",
|
||||||
...contextWithSelectedAccount.copyJobState.source,
|
|
||||||
account: {
|
|
||||||
...mockDatabaseAccount1,
|
|
||||||
id: normalizeAccountId(mockDatabaseAccount1.id),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
];
|
||||||
|
|
||||||
|
const { container } = render(
|
||||||
|
<AccountDropdown options={longNameOption} selectedKey="long" disabled={false} onChange={mockOnChange} />,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle account change when user selects different account", async () => {
|
it("matches snapshot with disabled state and no selection", () => {
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1, mockDatabaseAccount2]);
|
const { container } = render(
|
||||||
|
<AccountDropdown options={mockAccountOptions} disabled={true} onChange={mockOnChange} />,
|
||||||
|
);
|
||||||
|
|
||||||
renderWithContext();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const option = screen.getByText("test-account-2");
|
|
||||||
fireEvent.click(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe("ID normalization", () => {
|
it("matches snapshot with multiple account types", () => {
|
||||||
it("should normalize account ID for Portal platform", () => {
|
const mixedAccountOptions = [
|
||||||
const portalAccount = {
|
{
|
||||||
...mockDatabaseAccount1,
|
key: "sql-account",
|
||||||
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDB/databaseAccounts/account1",
|
text: "SQL API Account",
|
||||||
};
|
data: {
|
||||||
|
id: "sql-account",
|
||||||
(configContext as any).platform = Platform.Portal;
|
name: "SQL API Account",
|
||||||
mockUseDatabaseAccounts.mockReturnValue([portalAccount]);
|
kind: "GlobalDocumentDB",
|
||||||
|
location: "East US",
|
||||||
const contextWithSelectedAccount = {
|
|
||||||
...mockCopyJobContextValue,
|
|
||||||
copyJobState: {
|
|
||||||
...mockCopyJobState,
|
|
||||||
source: {
|
|
||||||
...mockCopyJobState.source,
|
|
||||||
account: portalAccount,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
{
|
||||||
|
key: "mongo-account",
|
||||||
renderWithContext(contextWithSelectedAccount);
|
text: "MongoDB Account",
|
||||||
|
data: {
|
||||||
const dropdown = screen.getByRole("combobox");
|
id: "mongo-account",
|
||||||
expect(dropdown).toMatchSnapshot();
|
name: "MongoDB Account",
|
||||||
});
|
kind: "MongoDB",
|
||||||
|
location: "West US",
|
||||||
it("should normalize account ID for Hosted platform", () => {
|
|
||||||
const hostedAccount = {
|
|
||||||
...mockDatabaseAccount1,
|
|
||||||
id: "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDB/databaseAccounts/account1",
|
|
||||||
};
|
|
||||||
|
|
||||||
(configContext as any).platform = Platform.Hosted;
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([hostedAccount]);
|
|
||||||
|
|
||||||
const contextWithSelectedAccount = {
|
|
||||||
...mockCopyJobContextValue,
|
|
||||||
copyJobState: {
|
|
||||||
...mockCopyJobState,
|
|
||||||
source: {
|
|
||||||
...mockCopyJobState.source,
|
|
||||||
account: hostedAccount,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
{
|
||||||
|
key: "cassandra-account",
|
||||||
renderWithContext(contextWithSelectedAccount);
|
text: "Cassandra Account",
|
||||||
|
data: {
|
||||||
const dropdown = screen.getByRole("combobox");
|
id: "cassandra-account",
|
||||||
expect(dropdown).toBeInTheDocument();
|
name: "Cassandra Account",
|
||||||
});
|
kind: "Cassandra",
|
||||||
});
|
location: "Central US",
|
||||||
|
|
||||||
describe("Edge cases", () => {
|
|
||||||
it("should handle empty account list gracefully", () => {
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([]);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-disabled", "true");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should handle null account list gracefully", () => {
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue(null as any);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-disabled", "true");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should handle undefined subscription ID", () => {
|
|
||||||
const contextWithoutSubscription = {
|
|
||||||
...mockCopyJobContextValue,
|
|
||||||
copyJobState: {
|
|
||||||
...mockCopyJobState,
|
|
||||||
source: {
|
|
||||||
...mockCopyJobState.source,
|
|
||||||
subscription: null,
|
|
||||||
},
|
|
||||||
} as CopyJobContextState,
|
|
||||||
};
|
|
||||||
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([]);
|
|
||||||
|
|
||||||
renderWithContext(contextWithoutSubscription);
|
|
||||||
|
|
||||||
expect(mockUseDatabaseAccounts).toHaveBeenCalledWith(undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should not update state if account is already selected and the same", async () => {
|
|
||||||
const selectedAccount = mockDatabaseAccount1;
|
|
||||||
const contextWithSelectedAccount = {
|
|
||||||
...mockCopyJobContextValue,
|
|
||||||
copyJobState: {
|
|
||||||
...mockCopyJobState,
|
|
||||||
source: {
|
|
||||||
...mockCopyJobState.source,
|
|
||||||
account: selectedAccount,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1, mockDatabaseAccount2]);
|
const { container } = render(
|
||||||
|
<AccountDropdown
|
||||||
|
options={mixedAccountOptions}
|
||||||
|
selectedKey="mongo-account"
|
||||||
|
disabled={false}
|
||||||
|
onChange={mockOnChange}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
renderWithContext(contextWithSelectedAccount);
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
const stateUpdateFunction = mockSetCopyJobState.mock.calls[0][0];
|
|
||||||
const newState = stateUpdateFunction(contextWithSelectedAccount.copyJobState);
|
|
||||||
expect(newState).toBe(contextWithSelectedAccount.copyJobState);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Accessibility", () => {
|
|
||||||
it("should have proper aria-label", () => {
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1]);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-label", ContainerCopyMessages.sourceAccountDropdownLabel);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should have required attribute", () => {
|
|
||||||
mockUseDatabaseAccounts.mockReturnValue([mockDatabaseAccount1]);
|
|
||||||
|
|
||||||
renderWithContext();
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveAttribute("aria-required", "true");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,96 +1,31 @@
|
|||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import { Dropdown } from "@fluentui/react";
|
import { Dropdown } from "@fluentui/react";
|
||||||
import { configContext, Platform } from "ConfigContext";
|
import React from "react";
|
||||||
import React, { useEffect } from "react";
|
|
||||||
import { DatabaseAccount } from "../../../../../../Contracts/DataModels";
|
|
||||||
import { useDatabaseAccounts } from "../../../../../../hooks/useDatabaseAccounts";
|
|
||||||
import { apiType, userContext } from "../../../../../../UserContext";
|
|
||||||
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
||||||
import { useCopyJobContext } from "../../../../Context/CopyJobContext";
|
import { DropdownOptionType } from "../../../../Types/CopyJobTypes";
|
||||||
import FieldRow from "../../Components/FieldRow";
|
import FieldRow from "../../Components/FieldRow";
|
||||||
|
|
||||||
interface AccountDropdownProps {}
|
interface AccountDropdownProps {
|
||||||
|
options: DropdownOptionType[];
|
||||||
|
selectedKey?: string;
|
||||||
|
disabled: boolean;
|
||||||
|
onChange: (_ev?: React.FormEvent, option?: DropdownOptionType) => void;
|
||||||
|
}
|
||||||
|
|
||||||
export const normalizeAccountId = (id: string = "") => {
|
export const AccountDropdown: React.FC<AccountDropdownProps> = React.memo(
|
||||||
if (configContext.platform === Platform.Portal) {
|
({ options, selectedKey, disabled, onChange }) => (
|
||||||
return id.replace("/Microsoft.DocumentDb/", "/Microsoft.DocumentDB/");
|
|
||||||
} else if (configContext.platform === Platform.Hosted) {
|
|
||||||
return id.replace("/Microsoft.DocumentDB/", "/Microsoft.DocumentDb/");
|
|
||||||
} else {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AccountDropdown: React.FC<AccountDropdownProps> = () => {
|
|
||||||
const { copyJobState, setCopyJobState } = useCopyJobContext();
|
|
||||||
|
|
||||||
const selectedSubscriptionId = copyJobState?.source?.subscription?.subscriptionId;
|
|
||||||
const allAccounts: DatabaseAccount[] = useDatabaseAccounts(selectedSubscriptionId);
|
|
||||||
const sqlApiOnlyAccounts = (allAccounts || [])
|
|
||||||
.filter((account) => apiType(account) === "SQL")
|
|
||||||
.map((account) => ({
|
|
||||||
...account,
|
|
||||||
id: normalizeAccountId(account.id),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const updateCopyJobState = (newAccount: DatabaseAccount) => {
|
|
||||||
setCopyJobState((prevState) => {
|
|
||||||
if (prevState.source?.account?.id !== newAccount.id) {
|
|
||||||
return {
|
|
||||||
...prevState,
|
|
||||||
source: {
|
|
||||||
...prevState.source,
|
|
||||||
account: newAccount,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return prevState;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (sqlApiOnlyAccounts && sqlApiOnlyAccounts.length > 0 && selectedSubscriptionId) {
|
|
||||||
const currentAccountId = copyJobState?.source?.account?.id;
|
|
||||||
const predefinedAccountId = normalizeAccountId(userContext.databaseAccount?.id);
|
|
||||||
const selectedAccountId = currentAccountId || predefinedAccountId;
|
|
||||||
|
|
||||||
const targetAccount: DatabaseAccount | null =
|
|
||||||
sqlApiOnlyAccounts.find((account) => account.id === selectedAccountId) || null;
|
|
||||||
updateCopyJobState(targetAccount || sqlApiOnlyAccounts[0]);
|
|
||||||
}
|
|
||||||
}, [sqlApiOnlyAccounts?.length, selectedSubscriptionId]);
|
|
||||||
|
|
||||||
const accountOptions =
|
|
||||||
sqlApiOnlyAccounts?.map((account) => ({
|
|
||||||
key: account.id,
|
|
||||||
text: account.name,
|
|
||||||
data: account,
|
|
||||||
})) || [];
|
|
||||||
|
|
||||||
const handleAccountChange = (_ev?: React.FormEvent, option?: (typeof accountOptions)[0]) => {
|
|
||||||
const selectedAccount = option?.data as DatabaseAccount;
|
|
||||||
|
|
||||||
if (selectedAccount) {
|
|
||||||
updateCopyJobState(selectedAccount);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const isAccountDropdownDisabled = !selectedSubscriptionId || accountOptions.length === 0;
|
|
||||||
const selectedAccountId = normalizeAccountId(copyJobState?.source?.account?.id ?? "");
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FieldRow label={ContainerCopyMessages.sourceAccountDropdownLabel}>
|
<FieldRow label={ContainerCopyMessages.sourceAccountDropdownLabel}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
placeholder={ContainerCopyMessages.sourceAccountDropdownPlaceholder}
|
placeholder={ContainerCopyMessages.sourceAccountDropdownPlaceholder}
|
||||||
ariaLabel={ContainerCopyMessages.sourceAccountDropdownLabel}
|
ariaLabel={ContainerCopyMessages.sourceAccountDropdownLabel}
|
||||||
options={accountOptions}
|
options={options}
|
||||||
disabled={isAccountDropdownDisabled}
|
disabled={disabled}
|
||||||
required
|
required
|
||||||
selectedKey={selectedAccountId}
|
selectedKey={selectedKey}
|
||||||
onChange={handleAccountChange}
|
onChange={onChange}
|
||||||
data-test="account-dropdown"
|
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
);
|
),
|
||||||
};
|
(prev, next) => prev.options.length === next.options.length && prev.selectedKey === next.selectedKey,
|
||||||
|
);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ interface MigrationTypeCheckboxProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MigrationTypeCheckbox: React.FC<MigrationTypeCheckboxProps> = React.memo(({ checked, onChange }) => (
|
export const MigrationTypeCheckbox: React.FC<MigrationTypeCheckboxProps> = React.memo(({ checked, onChange }) => (
|
||||||
<Stack horizontal horizontalAlign="space-between" className="migrationTypeRow" data-test="migration-type-checkbox">
|
<Stack horizontal horizontalAlign="space-between" className="migrationTypeRow">
|
||||||
<Checkbox label={ContainerCopyMessages.migrationTypeCheckboxLabel} checked={checked} onChange={onChange} />
|
<Checkbox label={ContainerCopyMessages.migrationTypeCheckboxLabel} checked={checked} onChange={onChange} />
|
||||||
</Stack>
|
</Stack>
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -1,295 +1,118 @@
|
|||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { act, fireEvent, render, screen, waitFor } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Subscription } from "../../../../../../Contracts/DataModels";
|
import { DropdownOptionType } from "../../../../Types/CopyJobTypes";
|
||||||
import Explorer from "../../../../../Explorer";
|
|
||||||
import CopyJobContextProvider from "../../../../Context/CopyJobContext";
|
|
||||||
import { SubscriptionDropdown } from "./SubscriptionDropdown";
|
import { SubscriptionDropdown } from "./SubscriptionDropdown";
|
||||||
|
|
||||||
jest.mock("../../../../../../hooks/useSubscriptions");
|
|
||||||
jest.mock("../../../../../../UserContext");
|
|
||||||
jest.mock("../../../../ContainerCopyMessages");
|
|
||||||
|
|
||||||
const mockUseSubscriptions = jest.requireMock("../../../../../../hooks/useSubscriptions").useSubscriptions;
|
|
||||||
const mockUserContext = jest.requireMock("../../../../../../UserContext").userContext;
|
|
||||||
const mockContainerCopyMessages = jest.requireMock("../../../../ContainerCopyMessages").default;
|
|
||||||
|
|
||||||
mockContainerCopyMessages.subscriptionDropdownLabel = "Subscription";
|
|
||||||
mockContainerCopyMessages.subscriptionDropdownPlaceholder = "Select a subscription";
|
|
||||||
|
|
||||||
describe("SubscriptionDropdown", () => {
|
describe("SubscriptionDropdown", () => {
|
||||||
let mockExplorer: Explorer;
|
const mockOnChange = jest.fn();
|
||||||
const mockSubscriptions: Subscription[] = [
|
|
||||||
|
const mockSubscriptionOptions: DropdownOptionType[] = [
|
||||||
{
|
{
|
||||||
subscriptionId: "sub-1",
|
key: "sub-1",
|
||||||
displayName: "Subscription One",
|
text: "Development Subscription",
|
||||||
state: "Enabled",
|
data: {
|
||||||
tenantId: "tenant-1",
|
subscriptionId: "sub-1",
|
||||||
|
displayName: "Development Subscription",
|
||||||
|
authorizationSource: "RoleBased",
|
||||||
|
subscriptionPolicies: {
|
||||||
|
quotaId: "quota-1",
|
||||||
|
spendingLimit: "Off",
|
||||||
|
locationPlacementId: "loc-1",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
subscriptionId: "sub-2",
|
key: "sub-2",
|
||||||
displayName: "Subscription Two",
|
text: "Production Subscription",
|
||||||
state: "Enabled",
|
data: {
|
||||||
tenantId: "tenant-1",
|
subscriptionId: "sub-2",
|
||||||
|
displayName: "Production Subscription",
|
||||||
|
authorizationSource: "RoleBased",
|
||||||
|
subscriptionPolicies: {
|
||||||
|
quotaId: "quota-2",
|
||||||
|
spendingLimit: "On",
|
||||||
|
locationPlacementId: "loc-2",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
subscriptionId: "sub-3",
|
key: "sub-3",
|
||||||
displayName: "Another Subscription",
|
text: "Testing Subscription",
|
||||||
state: "Enabled",
|
data: {
|
||||||
tenantId: "tenant-1",
|
subscriptionId: "sub-3",
|
||||||
|
displayName: "Testing Subscription",
|
||||||
|
authorizationSource: "Legacy",
|
||||||
|
subscriptionPolicies: {
|
||||||
|
quotaId: "quota-3",
|
||||||
|
spendingLimit: "Off",
|
||||||
|
locationPlacementId: "loc-3",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const renderWithProvider = (children: React.ReactNode) => {
|
|
||||||
return render(<CopyJobContextProvider explorer={mockExplorer}>{children}</CopyJobContextProvider>);
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
mockExplorer = {} as Explorer;
|
|
||||||
|
|
||||||
mockUseSubscriptions.mockReturnValue(mockSubscriptions);
|
|
||||||
mockUserContext.subscriptionId = "sub-1";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Rendering", () => {
|
describe("Snapshot Testing", () => {
|
||||||
it("should render subscription dropdown with correct attributes", () => {
|
it("matches snapshot with all subscription options", () => {
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
const { container } = render(<SubscriptionDropdown options={mockSubscriptionOptions} onChange={mockOnChange} />);
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
expect(dropdown).toBeInTheDocument();
|
|
||||||
expect(dropdown).toHaveAttribute("aria-label", "Subscription");
|
|
||||||
expect(dropdown).toHaveAttribute("data-test", "subscription-dropdown");
|
|
||||||
expect(dropdown).toBeRequired();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render field label correctly", () => {
|
it("matches snapshot with selected subscription", () => {
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
const { container } = render(
|
||||||
|
<SubscriptionDropdown options={mockSubscriptionOptions} selectedKey="sub-2" onChange={mockOnChange} />,
|
||||||
expect(screen.getByText("Subscription:")).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should show placeholder when no subscription is selected", async () => {
|
|
||||||
mockUserContext.subscriptionId = "";
|
|
||||||
mockUseSubscriptions.mockReturnValue([]);
|
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Select a subscription");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Subscription Options", () => {
|
|
||||||
it("should populate dropdown with available subscriptions", async () => {
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(screen.getByText("Subscription One", { selector: ".ms-Dropdown-optionText" })).toBeInTheDocument();
|
|
||||||
expect(screen.getByText("Subscription Two", { selector: ".ms-Dropdown-optionText" })).toBeInTheDocument();
|
|
||||||
expect(screen.getByText("Another Subscription", { selector: ".ms-Dropdown-optionText" })).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should handle empty subscriptions list", () => {
|
|
||||||
mockUseSubscriptions.mockReturnValue([]);
|
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toBeInTheDocument();
|
|
||||||
expect(dropdown).toHaveTextContent("Select a subscription");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should handle undefined subscriptions", () => {
|
|
||||||
mockUseSubscriptions.mockReturnValue(undefined);
|
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toBeInTheDocument();
|
|
||||||
expect(dropdown).toHaveTextContent("Select a subscription");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Selection Logic", () => {
|
|
||||||
it("should auto-select subscription based on userContext.subscriptionId on mount", async () => {
|
|
||||||
mockUserContext.subscriptionId = "sub-2";
|
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription Two");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should maintain current selection when subscriptions list updates with same subscription", async () => {
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription One");
|
|
||||||
});
|
|
||||||
|
|
||||||
act(() => {
|
|
||||||
mockUseSubscriptions.mockReturnValue([...mockSubscriptions]);
|
|
||||||
});
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription One");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should prioritize current copyJobState subscription over userContext subscription", async () => {
|
|
||||||
mockUserContext.subscriptionId = "sub-2";
|
|
||||||
|
|
||||||
const { rerender } = renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription Two");
|
|
||||||
});
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const option = screen.getByText("Another Subscription");
|
|
||||||
fireEvent.click(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
rerender(
|
|
||||||
<CopyJobContextProvider explorer={mockExplorer}>
|
|
||||||
<SubscriptionDropdown />
|
|
||||||
</CopyJobContextProvider>,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await waitFor(() => {
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Another Subscription");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle subscription selection change", async () => {
|
it("matches snapshot with empty options", () => {
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
const { container } = render(<SubscriptionDropdown options={[]} onChange={mockOnChange} />);
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const option = screen.getByText("Subscription Two");
|
|
||||||
fireEvent.click(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription Two");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not auto-select if target subscription not found in list", async () => {
|
it("matches snapshot with single option", () => {
|
||||||
mockUserContext.subscriptionId = "non-existent-sub";
|
const { container } = render(
|
||||||
|
<SubscriptionDropdown options={[mockSubscriptionOptions[0]]} selectedKey="sub-1" onChange={mockOnChange} />,
|
||||||
|
);
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Select a subscription");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Context State Management", () => {
|
|
||||||
it("should update copyJobState when subscription is selected", async () => {
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const option = screen.getByText("Subscription Two");
|
|
||||||
fireEvent.click(option);
|
|
||||||
});
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription Two");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should reset account when subscription changes", async () => {
|
it("matches snapshot with special characters in options", () => {
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
const specialOptions = [
|
||||||
|
{
|
||||||
|
key: "special",
|
||||||
|
text: 'Subscription with & <special> "characters"',
|
||||||
|
data: { subscriptionId: "special" },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
await waitFor(() => {
|
const { container } = render(<SubscriptionDropdown options={specialOptions} onChange={mockOnChange} />);
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription One");
|
|
||||||
});
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
const option = screen.getByText("Subscription Two");
|
|
||||||
fireEvent.click(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription Two");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not update state if same subscription is selected", async () => {
|
it("matches snapshot with long subscription name", () => {
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
const longNameOption = [
|
||||||
|
{
|
||||||
|
key: "long",
|
||||||
|
text: "This is an extremely long subscription name that tests how the component handles text overflow and layout constraints",
|
||||||
|
data: { subscriptionId: "long" },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
await waitFor(() => {
|
const { container } = render(
|
||||||
const dropdown = screen.getByRole("combobox");
|
<SubscriptionDropdown options={longNameOption} selectedKey="long" onChange={mockOnChange} />,
|
||||||
expect(dropdown).toHaveTextContent("Subscription One");
|
);
|
||||||
});
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
fireEvent.click(dropdown);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
const option = screen.getByText("Subscription One", { selector: ".ms-Dropdown-optionText" });
|
|
||||||
fireEvent.click(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(dropdown).toHaveTextContent("Subscription One");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Edge Cases", () => {
|
|
||||||
it("should handle subscription change event with option missing data", async () => {
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
fireEvent.click(dropdown);
|
|
||||||
expect(dropdown).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should handle subscriptions loading state", () => {
|
|
||||||
mockUseSubscriptions.mockReturnValue(undefined);
|
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toBeInTheDocument();
|
|
||||||
expect(dropdown).toHaveTextContent("Select a subscription");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should work when both userContext.subscriptionId and copyJobState subscription are null", () => {
|
|
||||||
mockUserContext.subscriptionId = "";
|
|
||||||
|
|
||||||
renderWithProvider(<SubscriptionDropdown />);
|
|
||||||
|
|
||||||
const dropdown = screen.getByRole("combobox");
|
|
||||||
expect(dropdown).toBeInTheDocument();
|
|
||||||
expect(dropdown).toHaveTextContent("Select a subscription");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,79 +1,29 @@
|
|||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import { Dropdown } from "@fluentui/react";
|
import { Dropdown } from "@fluentui/react";
|
||||||
import React, { useEffect } from "react";
|
import React from "react";
|
||||||
import { Subscription } from "../../../../../../Contracts/DataModels";
|
|
||||||
import { useSubscriptions } from "../../../../../../hooks/useSubscriptions";
|
|
||||||
import { userContext } from "../../../../../../UserContext";
|
|
||||||
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
||||||
import { useCopyJobContext } from "../../../../Context/CopyJobContext";
|
import { DropdownOptionType } from "../../../../Types/CopyJobTypes";
|
||||||
import FieldRow from "../../Components/FieldRow";
|
import FieldRow from "../../Components/FieldRow";
|
||||||
|
|
||||||
interface SubscriptionDropdownProps {}
|
interface SubscriptionDropdownProps {
|
||||||
|
options: DropdownOptionType[];
|
||||||
|
selectedKey?: string;
|
||||||
|
onChange: (_ev?: React.FormEvent, option?: DropdownOptionType) => void;
|
||||||
|
}
|
||||||
|
|
||||||
export const SubscriptionDropdown: React.FC<SubscriptionDropdownProps> = React.memo(() => {
|
export const SubscriptionDropdown: React.FC<SubscriptionDropdownProps> = React.memo(
|
||||||
const { copyJobState, setCopyJobState } = useCopyJobContext();
|
({ options, selectedKey, onChange }) => (
|
||||||
const subscriptions: Subscription[] = useSubscriptions();
|
|
||||||
|
|
||||||
const updateCopyJobState = (newSubscription: Subscription) => {
|
|
||||||
setCopyJobState((prevState) => {
|
|
||||||
if (prevState.source?.subscription?.subscriptionId !== newSubscription.subscriptionId) {
|
|
||||||
return {
|
|
||||||
...prevState,
|
|
||||||
source: {
|
|
||||||
...prevState.source,
|
|
||||||
subscription: newSubscription,
|
|
||||||
account: null,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return prevState;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (subscriptions && subscriptions.length > 0) {
|
|
||||||
const currentSubscriptionId = copyJobState?.source?.subscription?.subscriptionId;
|
|
||||||
const predefinedSubscriptionId = userContext.subscriptionId;
|
|
||||||
const selectedSubscriptionId = currentSubscriptionId || predefinedSubscriptionId;
|
|
||||||
|
|
||||||
const targetSubscription: Subscription | null =
|
|
||||||
subscriptions.find((sub) => sub.subscriptionId === selectedSubscriptionId) || null;
|
|
||||||
|
|
||||||
if (targetSubscription) {
|
|
||||||
updateCopyJobState(targetSubscription);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [subscriptions?.length]);
|
|
||||||
|
|
||||||
const subscriptionOptions =
|
|
||||||
subscriptions?.map((sub) => ({
|
|
||||||
key: sub.subscriptionId,
|
|
||||||
text: sub.displayName,
|
|
||||||
data: sub,
|
|
||||||
})) || [];
|
|
||||||
|
|
||||||
const handleSubscriptionChange = (_ev?: React.FormEvent, option?: (typeof subscriptionOptions)[0]) => {
|
|
||||||
const selectedSubscription = option?.data as Subscription;
|
|
||||||
|
|
||||||
if (selectedSubscription) {
|
|
||||||
updateCopyJobState(selectedSubscription);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const selectedSubscriptionId = copyJobState?.source?.subscription?.subscriptionId;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FieldRow label={ContainerCopyMessages.subscriptionDropdownLabel}>
|
<FieldRow label={ContainerCopyMessages.subscriptionDropdownLabel}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
placeholder={ContainerCopyMessages.subscriptionDropdownPlaceholder}
|
placeholder={ContainerCopyMessages.subscriptionDropdownPlaceholder}
|
||||||
ariaLabel={ContainerCopyMessages.subscriptionDropdownLabel}
|
ariaLabel={ContainerCopyMessages.subscriptionDropdownLabel}
|
||||||
data-test="subscription-dropdown"
|
options={options}
|
||||||
options={subscriptionOptions}
|
|
||||||
required
|
required
|
||||||
selectedKey={selectedSubscriptionId}
|
selectedKey={selectedKey}
|
||||||
onChange={handleSubscriptionChange}
|
onChange={onChange}
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
);
|
),
|
||||||
});
|
(prev, next) => prev.options.length === next.options.length && prev.selectedKey === next.selectedKey,
|
||||||
|
);
|
||||||
|
|||||||
@@ -1,37 +1,514 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`AccountDropdown ID normalization should normalize account ID for Portal platform 1`] = `
|
exports[`AccountDropdown Snapshot Testing matches snapshot with all account options 1`] = `
|
||||||
<div
|
<div
|
||||||
aria-disabled="false"
|
class="ms-Stack flex-row css-109"
|
||||||
aria-expanded="false"
|
|
||||||
aria-haspopup="listbox"
|
|
||||||
aria-label="Account"
|
|
||||||
aria-required="true"
|
|
||||||
class="ms-Dropdown is-required dropdown-132"
|
|
||||||
data-is-focusable="true"
|
|
||||||
data-ktp-target="true"
|
|
||||||
data-test="account-dropdown"
|
|
||||||
id="Dropdown21"
|
|
||||||
role="combobox"
|
|
||||||
tabindex="0"
|
|
||||||
>
|
>
|
||||||
<span
|
<div
|
||||||
aria-invalid="false"
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
class="ms-Dropdown-title title-137"
|
|
||||||
id="Dropdown21-option"
|
|
||||||
>
|
>
|
||||||
test-account-1
|
<label
|
||||||
</span>
|
class="field-label "
|
||||||
<span
|
|
||||||
class="ms-Dropdown-caretDownWrapper caretDownWrapper-134"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
aria-hidden="true"
|
|
||||||
class="ms-Dropdown-caretDown caretDown-136"
|
|
||||||
data-icon-name="ChevronDown"
|
|
||||||
>
|
>
|
||||||
|
Account
|
||||||
</i>
|
:
|
||||||
</span>
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown0"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-112"
|
||||||
|
id="Dropdown0-option"
|
||||||
|
>
|
||||||
|
Select an account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with disabled dropdown 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="true"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-disabled is-required dropdown-133"
|
||||||
|
data-is-focusable="false"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown2"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-138"
|
||||||
|
id="Dropdown2-option"
|
||||||
|
>
|
||||||
|
Development Account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-135"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-137"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with disabled state and no selection 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="true"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-disabled is-required dropdown-133"
|
||||||
|
data-is-focusable="false"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown7"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-134"
|
||||||
|
id="Dropdown7-option"
|
||||||
|
>
|
||||||
|
Select an account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-135"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-137"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with empty options 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown3"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-112"
|
||||||
|
id="Dropdown3-option"
|
||||||
|
>
|
||||||
|
Select an account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with long account name 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown6"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown6-option"
|
||||||
|
>
|
||||||
|
This is an extremely long account name that tests how the component handles text overflow and layout constraints in the dropdown
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with multiple account types 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown8"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown8-option"
|
||||||
|
>
|
||||||
|
MongoDB Account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with selected account 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown1"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown1-option"
|
||||||
|
>
|
||||||
|
Production Account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with single option 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown4"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown4-option"
|
||||||
|
>
|
||||||
|
Development Account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`AccountDropdown Snapshot Testing matches snapshot with special characters in options 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Account
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-disabled="false"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Account"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown5"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-112"
|
||||||
|
id="Dropdown5-option"
|
||||||
|
>
|
||||||
|
Select an account
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
exports[`MigrationTypeCheckbox Component Rendering should render in checked state 1`] = `
|
exports[`MigrationTypeCheckbox Component Rendering should render in checked state 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack migrationTypeRow css-109"
|
class="ms-Stack migrationTypeRow css-109"
|
||||||
data-test="migration-type-checkbox"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Checkbox is-checked is-enabled root-119"
|
class="ms-Checkbox is-checked is-enabled root-119"
|
||||||
@@ -44,7 +43,6 @@ exports[`MigrationTypeCheckbox Component Rendering should render in checked stat
|
|||||||
exports[`MigrationTypeCheckbox Component Rendering should render with default props (unchecked state) 1`] = `
|
exports[`MigrationTypeCheckbox Component Rendering should render with default props (unchecked state) 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ms-Stack migrationTypeRow css-109"
|
class="ms-Stack migrationTypeRow css-109"
|
||||||
data-test="migration-type-checkbox"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ms-Checkbox is-enabled root-110"
|
class="ms-Checkbox is-enabled root-110"
|
||||||
|
|||||||
@@ -0,0 +1,337 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`SubscriptionDropdown Snapshot Testing matches snapshot with all subscription options 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Subscription
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Subscription"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown0"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-112"
|
||||||
|
id="Dropdown0-option"
|
||||||
|
>
|
||||||
|
Select a subscription
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SubscriptionDropdown Snapshot Testing matches snapshot with empty options 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Subscription
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Subscription"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown2"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-112"
|
||||||
|
id="Dropdown2-option"
|
||||||
|
>
|
||||||
|
Select a subscription
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SubscriptionDropdown Snapshot Testing matches snapshot with long subscription name 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Subscription
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Subscription"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown5"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown5-option"
|
||||||
|
>
|
||||||
|
This is an extremely long subscription name that tests how the component handles text overflow and layout constraints
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SubscriptionDropdown Snapshot Testing matches snapshot with selected subscription 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Subscription
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Subscription"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown1"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown1-option"
|
||||||
|
>
|
||||||
|
Production Subscription
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SubscriptionDropdown Snapshot Testing matches snapshot with single option 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Subscription
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Subscription"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown3"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title title-132"
|
||||||
|
id="Dropdown3-option"
|
||||||
|
>
|
||||||
|
Development Subscription
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SubscriptionDropdown Snapshot Testing matches snapshot with special characters in options 1`] = `
|
||||||
|
<div
|
||||||
|
class="ms-Stack flex-row css-109"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-fixed-width css-110"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="field-label "
|
||||||
|
>
|
||||||
|
Subscription
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ms-StackItem flex-grow-col css-110"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ms-Dropdown-container"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
aria-label="Subscription"
|
||||||
|
aria-required="true"
|
||||||
|
class="ms-Dropdown is-required dropdown-111"
|
||||||
|
data-is-focusable="true"
|
||||||
|
data-ktp-target="true"
|
||||||
|
id="Dropdown4"
|
||||||
|
role="combobox"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-invalid="false"
|
||||||
|
class="ms-Dropdown-title ms-Dropdown-titleIsPlaceHolder title-112"
|
||||||
|
id="Dropdown4-option"
|
||||||
|
>
|
||||||
|
Select a subscription
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="ms-Dropdown-caretDownWrapper caretDownWrapper-113"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
aria-hidden="true"
|
||||||
|
class="ms-Dropdown-caretDown caretDown-131"
|
||||||
|
data-icon-name="ChevronDown"
|
||||||
|
>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
@@ -1,170 +1,480 @@
|
|||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { fireEvent, render, screen } from "@testing-library/react";
|
import { fireEvent, render, screen } from "@testing-library/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useCopyJobContext } from "../../../Context/CopyJobContext";
|
import { apiType } from "UserContext";
|
||||||
|
import { DatabaseAccount, Subscription } from "../../../../../Contracts/DataModels";
|
||||||
|
import { useDatabaseAccounts } from "../../../../../hooks/useDatabaseAccounts";
|
||||||
|
import { useSubscriptions } from "../../../../../hooks/useSubscriptions";
|
||||||
import { CopyJobMigrationType } from "../../../Enums/CopyJobEnums";
|
import { CopyJobMigrationType } from "../../../Enums/CopyJobEnums";
|
||||||
import { CopyJobContextProviderType } from "../../../Types/CopyJobTypes";
|
import { CopyJobContextProviderType, CopyJobContextState } from "../../../Types/CopyJobTypes";
|
||||||
import SelectAccount from "./SelectAccount";
|
import SelectAccount from "./SelectAccount";
|
||||||
|
|
||||||
|
jest.mock("UserContext", () => ({
|
||||||
|
apiType: jest.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
|
jest.mock("../../../../../hooks/useDatabaseAccounts");
|
||||||
|
jest.mock("../../../../../hooks/useSubscriptions");
|
||||||
jest.mock("../../../Context/CopyJobContext", () => ({
|
jest.mock("../../../Context/CopyJobContext", () => ({
|
||||||
useCopyJobContext: jest.fn(),
|
useCopyJobContext: () => mockContextValue,
|
||||||
|
}));
|
||||||
|
|
||||||
|
jest.mock("./Utils/selectAccountUtils", () => ({
|
||||||
|
useDropdownOptions: jest.fn(),
|
||||||
|
useEventHandlers: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock("./Components/SubscriptionDropdown", () => ({
|
jest.mock("./Components/SubscriptionDropdown", () => ({
|
||||||
SubscriptionDropdown: jest.fn(() => <div data-testid="subscription-dropdown">Subscription Dropdown</div>),
|
SubscriptionDropdown: jest.fn(({ options, selectedKey, onChange, ...props }) => (
|
||||||
}));
|
<div data-testid="subscription-dropdown" data-selected={selectedKey} {...props}>
|
||||||
|
{options?.map((option: any) => (
|
||||||
jest.mock("./Components/AccountDropdown", () => ({
|
<div
|
||||||
AccountDropdown: jest.fn(() => <div data-testid="account-dropdown">Account Dropdown</div>),
|
key={option.key}
|
||||||
}));
|
data-testid={`subscription-option-${option.key}`}
|
||||||
|
onClick={() => onChange?.(undefined, option)}
|
||||||
jest.mock("./Components/MigrationTypeCheckbox", () => ({
|
>
|
||||||
MigrationTypeCheckbox: jest.fn(({ checked, onChange }: { checked: boolean; onChange: () => void }) => (
|
{option.text}
|
||||||
<div data-testid="migration-type-checkbox">
|
</div>
|
||||||
<input
|
))}
|
||||||
type="checkbox"
|
|
||||||
checked={checked}
|
|
||||||
onChange={onChange}
|
|
||||||
data-testid="migration-checkbox-input"
|
|
||||||
aria-label="Migration Type Checkbox"
|
|
||||||
/>
|
|
||||||
Copy container in offline mode
|
|
||||||
</div>
|
</div>
|
||||||
)),
|
)),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe("SelectAccount", () => {
|
jest.mock("./Components/AccountDropdown", () => ({
|
||||||
const mockSetCopyJobState = jest.fn();
|
AccountDropdown: jest.fn(({ options, selectedKey, disabled, onChange, ...props }) => (
|
||||||
|
<div data-testid="account-dropdown" data-selected={selectedKey} data-disabled={disabled} {...props}>
|
||||||
|
{options?.map((option: any) => (
|
||||||
|
<div
|
||||||
|
key={option.key}
|
||||||
|
data-testid={`account-option-${option.key}`}
|
||||||
|
onClick={() => onChange?.(undefined, option)}
|
||||||
|
>
|
||||||
|
{option.text}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)),
|
||||||
|
}));
|
||||||
|
|
||||||
const defaultContextValue: CopyJobContextProviderType = {
|
jest.mock("./Components/MigrationTypeCheckbox", () => ({
|
||||||
copyJobState: {
|
MigrationTypeCheckbox: jest.fn(({ checked, onChange, ...props }) => (
|
||||||
jobName: "",
|
<div data-testid="migration-type-checkbox" data-checked={checked} {...props}>
|
||||||
migrationType: CopyJobMigrationType.Online,
|
<input
|
||||||
source: {
|
type="checkbox"
|
||||||
subscription: null as any,
|
checked={checked}
|
||||||
account: null as any,
|
onChange={(e) => onChange?.(e, e.target.checked)}
|
||||||
databaseId: "",
|
data-testid="migration-checkbox-input"
|
||||||
containerId: "",
|
/>
|
||||||
},
|
</div>
|
||||||
target: {
|
)),
|
||||||
subscriptionId: "",
|
}));
|
||||||
account: null as any,
|
|
||||||
databaseId: "",
|
jest.mock("../../../ContainerCopyMessages", () => ({
|
||||||
containerId: "",
|
selectAccountDescription: "Select your source account and subscription",
|
||||||
},
|
}));
|
||||||
sourceReadAccessFromTarget: false,
|
|
||||||
|
const mockUseDatabaseAccounts = useDatabaseAccounts as jest.MockedFunction<typeof useDatabaseAccounts>;
|
||||||
|
const mockUseSubscriptions = useSubscriptions as jest.MockedFunction<typeof useSubscriptions>;
|
||||||
|
const mockApiType = apiType as jest.MockedFunction<typeof apiType>;
|
||||||
|
|
||||||
|
import { useDropdownOptions, useEventHandlers } from "./Utils/selectAccountUtils";
|
||||||
|
const mockUseDropdownOptions = useDropdownOptions as jest.MockedFunction<typeof useDropdownOptions>;
|
||||||
|
const mockUseEventHandlers = useEventHandlers as jest.MockedFunction<typeof useEventHandlers>;
|
||||||
|
|
||||||
|
const mockSubscriptions = [
|
||||||
|
{
|
||||||
|
subscriptionId: "sub-1",
|
||||||
|
displayName: "Test Subscription 1",
|
||||||
|
authorizationSource: "RoleBased",
|
||||||
|
subscriptionPolicies: {
|
||||||
|
quotaId: "quota-1",
|
||||||
|
spendingLimit: "Off",
|
||||||
|
locationPlacementId: "loc-1",
|
||||||
},
|
},
|
||||||
setCopyJobState: mockSetCopyJobState,
|
},
|
||||||
flow: { currentScreen: "selectAccount" },
|
{
|
||||||
setFlow: jest.fn(),
|
subscriptionId: "sub-2",
|
||||||
contextError: null,
|
displayName: "Test Subscription 2",
|
||||||
setContextError: jest.fn(),
|
authorizationSource: "RoleBased",
|
||||||
explorer: {} as any,
|
subscriptionPolicies: {
|
||||||
resetCopyJobState: jest.fn(),
|
quotaId: "quota-2",
|
||||||
};
|
spendingLimit: "On",
|
||||||
|
locationPlacementId: "loc-2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
] as Subscription[];
|
||||||
|
|
||||||
|
const mockAccounts = [
|
||||||
|
{
|
||||||
|
id: "/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1",
|
||||||
|
name: "test-cosmos-account-1",
|
||||||
|
location: "East US",
|
||||||
|
kind: "GlobalDocumentDB",
|
||||||
|
properties: {
|
||||||
|
documentEndpoint: "https://account-1.documents.azure.com/",
|
||||||
|
capabilities: [],
|
||||||
|
enableFreeTier: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-2",
|
||||||
|
name: "test-cosmos-account-2",
|
||||||
|
location: "West US",
|
||||||
|
kind: "MongoDB",
|
||||||
|
properties: {
|
||||||
|
documentEndpoint: "https://account-2.documents.azure.com/",
|
||||||
|
capabilities: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
] as DatabaseAccount[];
|
||||||
|
|
||||||
|
const mockDropdownOptions = {
|
||||||
|
subscriptionOptions: [
|
||||||
|
{ key: "sub-1", text: "Test Subscription 1", data: mockSubscriptions[0] },
|
||||||
|
{ key: "sub-2", text: "Test Subscription 2", data: mockSubscriptions[1] },
|
||||||
|
],
|
||||||
|
accountOptions: [{ key: mockAccounts[0].id, text: mockAccounts[0].name, data: mockAccounts[0] }],
|
||||||
|
};
|
||||||
|
|
||||||
|
const mockEventHandlers = {
|
||||||
|
handleSelectSourceAccount: jest.fn(),
|
||||||
|
handleMigrationTypeChange: jest.fn(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let mockContextValue = {
|
||||||
|
copyJobState: {
|
||||||
|
jobName: "",
|
||||||
|
migrationType: CopyJobMigrationType.Offline,
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
databaseId: "",
|
||||||
|
containerId: "",
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
subscriptionId: "",
|
||||||
|
account: null,
|
||||||
|
databaseId: "",
|
||||||
|
containerId: "",
|
||||||
|
},
|
||||||
|
sourceReadAccessFromTarget: false,
|
||||||
|
} as CopyJobContextState,
|
||||||
|
setCopyJobState: jest.fn(),
|
||||||
|
flow: null,
|
||||||
|
setFlow: jest.fn(),
|
||||||
|
contextError: null,
|
||||||
|
setContextError: jest.fn(),
|
||||||
|
resetCopyJobState: jest.fn(),
|
||||||
|
explorer: {} as any,
|
||||||
|
} as CopyJobContextProviderType;
|
||||||
|
|
||||||
|
describe("SelectAccount Component", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
(useCopyJobContext as jest.Mock).mockReturnValue(defaultContextValue);
|
|
||||||
|
mockContextValue = {
|
||||||
|
copyJobState: {
|
||||||
|
jobName: "",
|
||||||
|
migrationType: CopyJobMigrationType.Offline,
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
databaseId: "",
|
||||||
|
containerId: "",
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
subscriptionId: "",
|
||||||
|
account: null,
|
||||||
|
databaseId: "",
|
||||||
|
containerId: "",
|
||||||
|
},
|
||||||
|
sourceReadAccessFromTarget: false,
|
||||||
|
} as CopyJobContextState,
|
||||||
|
setCopyJobState: jest.fn(),
|
||||||
|
flow: null,
|
||||||
|
setFlow: jest.fn(),
|
||||||
|
contextError: null,
|
||||||
|
setContextError: jest.fn(),
|
||||||
|
resetCopyJobState: jest.fn(),
|
||||||
|
explorer: {} as any,
|
||||||
|
};
|
||||||
|
|
||||||
|
mockUseSubscriptions.mockReturnValue(mockSubscriptions);
|
||||||
|
mockUseDatabaseAccounts.mockReturnValue(mockAccounts);
|
||||||
|
mockApiType.mockReturnValue("SQL");
|
||||||
|
mockUseDropdownOptions.mockReturnValue(mockDropdownOptions);
|
||||||
|
mockUseEventHandlers.mockReturnValue(mockEventHandlers);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
describe("Rendering", () => {
|
||||||
jest.clearAllMocks();
|
it("should render component with default state", () => {
|
||||||
});
|
|
||||||
|
|
||||||
describe("Component Rendering", () => {
|
|
||||||
it("should render the component with all required elements", () => {
|
|
||||||
const { container } = render(<SelectAccount />);
|
const { container } = render(<SelectAccount />);
|
||||||
|
|
||||||
expect(container.firstChild).toHaveAttribute("data-test", "Panel:SelectAccountContainer");
|
expect(screen.getByText("Select your source account and subscription")).toBeInTheDocument();
|
||||||
expect(container.firstChild).toHaveClass("selectAccountContainer");
|
|
||||||
|
|
||||||
expect(screen.getByText(/Please select a source account from which to copy/i)).toBeInTheDocument();
|
|
||||||
|
|
||||||
expect(screen.getByTestId("subscription-dropdown")).toBeInTheDocument();
|
expect(screen.getByTestId("subscription-dropdown")).toBeInTheDocument();
|
||||||
expect(screen.getByTestId("account-dropdown")).toBeInTheDocument();
|
expect(screen.getByTestId("account-dropdown")).toBeInTheDocument();
|
||||||
expect(screen.getByTestId("migration-type-checkbox")).toBeInTheDocument();
|
expect(screen.getByTestId("migration-type-checkbox")).toBeInTheDocument();
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render correctly with snapshot", () => {
|
it("should render with selected subscription", () => {
|
||||||
|
mockContextValue.copyJobState.source.subscription = mockSubscriptions[0];
|
||||||
|
|
||||||
const { container } = render(<SelectAccount />);
|
const { container } = render(<SelectAccount />);
|
||||||
expect(container.firstChild).toMatchSnapshot();
|
|
||||||
|
expect(screen.getByTestId("subscription-dropdown")).toHaveAttribute("data-selected", "sub-1");
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should render with selected account", () => {
|
||||||
|
mockContextValue.copyJobState.source.subscription = mockSubscriptions[0];
|
||||||
|
mockContextValue.copyJobState.source.account = mockAccounts[0];
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
|
||||||
|
expect(screen.getByTestId("account-dropdown")).toHaveAttribute("data-selected", mockAccounts[0].id);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should render with offline migration type checked", () => {
|
||||||
|
mockContextValue.copyJobState.migrationType = CopyJobMigrationType.Offline;
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
|
||||||
|
expect(screen.getByTestId("migration-type-checkbox")).toHaveAttribute("data-checked", "true");
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should render with online migration type unchecked", () => {
|
||||||
|
mockContextValue.copyJobState.migrationType = CopyJobMigrationType.Online;
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
|
||||||
|
expect(screen.getByTestId("migration-type-checkbox")).toHaveAttribute("data-checked", "false");
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Migration Type Functionality", () => {
|
describe("Hook Integration", () => {
|
||||||
it("should display migration type checkbox as unchecked when migrationType is Online", () => {
|
it("should call useSubscriptions hook", () => {
|
||||||
(useCopyJobContext as jest.Mock).mockReturnValue({
|
|
||||||
...defaultContextValue,
|
|
||||||
copyJobState: {
|
|
||||||
...defaultContextValue.copyJobState,
|
|
||||||
migrationType: CopyJobMigrationType.Online,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
render(<SelectAccount />);
|
render(<SelectAccount />);
|
||||||
|
expect(mockUseSubscriptions).toHaveBeenCalledTimes(1);
|
||||||
const checkbox = screen.getByTestId("migration-checkbox-input");
|
|
||||||
expect(checkbox).not.toBeChecked();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should display migration type checkbox as checked when migrationType is Offline", () => {
|
it("should call useDatabaseAccounts with selected subscription ID", () => {
|
||||||
(useCopyJobContext as jest.Mock).mockReturnValue({
|
mockContextValue.copyJobState.source.subscription = mockSubscriptions[0];
|
||||||
...defaultContextValue,
|
|
||||||
copyJobState: {
|
|
||||||
...defaultContextValue.copyJobState,
|
|
||||||
migrationType: CopyJobMigrationType.Offline,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
render(<SelectAccount />);
|
render(<SelectAccount />);
|
||||||
|
|
||||||
const checkbox = screen.getByTestId("migration-checkbox-input");
|
expect(mockUseDatabaseAccounts).toHaveBeenCalledWith("sub-1");
|
||||||
expect(checkbox).toBeChecked();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call setCopyJobState with Online migration type when checkbox is unchecked", () => {
|
it("should call useDatabaseAccounts with undefined when no subscription selected", () => {
|
||||||
(useCopyJobContext as jest.Mock).mockReturnValue({
|
render(<SelectAccount />);
|
||||||
...defaultContextValue,
|
expect(mockUseDatabaseAccounts).toHaveBeenCalledWith(undefined);
|
||||||
copyJobState: {
|
});
|
||||||
...defaultContextValue.copyJobState,
|
|
||||||
migrationType: CopyJobMigrationType.Offline,
|
it("should filter accounts to SQL API only", () => {
|
||||||
},
|
mockApiType.mockReturnValueOnce("SQL").mockReturnValueOnce("Mongo");
|
||||||
});
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
expect(mockApiType).toHaveBeenCalledTimes(2);
|
||||||
|
expect(mockApiType).toHaveBeenCalledWith(mockAccounts[0]);
|
||||||
|
expect(mockApiType).toHaveBeenCalledWith(mockAccounts[1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should call useDropdownOptions with correct parameters", () => {
|
||||||
|
const sqlOnlyAccounts = [mockAccounts[0]]; // Only SQL account
|
||||||
|
mockApiType.mockImplementation((account) => (account === mockAccounts[0] ? "SQL" : "Mongo"));
|
||||||
|
|
||||||
render(<SelectAccount />);
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
expect(mockUseDropdownOptions).toHaveBeenCalledWith(mockSubscriptions, sqlOnlyAccounts);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should call useEventHandlers with setCopyJobState", () => {
|
||||||
|
render(<SelectAccount />);
|
||||||
|
expect(mockUseEventHandlers).toHaveBeenCalledWith(mockContextValue.setCopyJobState);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Event Handling", () => {
|
||||||
|
it("should handle subscription selection", () => {
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const subscriptionOption = screen.getByTestId("subscription-option-sub-1");
|
||||||
|
fireEvent.click(subscriptionOption);
|
||||||
|
|
||||||
|
expect(mockEventHandlers.handleSelectSourceAccount).toHaveBeenCalledWith("subscription", mockSubscriptions[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle account selection", () => {
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const accountOption = screen.getByTestId(`account-option-${mockAccounts[0].id}`);
|
||||||
|
fireEvent.click(accountOption);
|
||||||
|
|
||||||
|
expect(mockEventHandlers.handleSelectSourceAccount).toHaveBeenCalledWith("account", mockAccounts[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle migration type change", () => {
|
||||||
|
render(<SelectAccount />);
|
||||||
const checkbox = screen.getByTestId("migration-checkbox-input");
|
const checkbox = screen.getByTestId("migration-checkbox-input");
|
||||||
fireEvent.click(checkbox);
|
fireEvent.click(checkbox);
|
||||||
|
|
||||||
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
expect(mockEventHandlers.handleMigrationTypeChange).toHaveBeenCalledWith(expect.any(Object), false);
|
||||||
|
|
||||||
const updateFunction = mockSetCopyJobState.mock.calls[0][0];
|
|
||||||
const previousState = {
|
|
||||||
...defaultContextValue.copyJobState,
|
|
||||||
migrationType: CopyJobMigrationType.Offline,
|
|
||||||
};
|
|
||||||
const result = updateFunction(previousState);
|
|
||||||
|
|
||||||
expect(result).toEqual({
|
|
||||||
...previousState,
|
|
||||||
migrationType: CopyJobMigrationType.Online,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Performance and Optimization", () => {
|
describe("Dropdown States", () => {
|
||||||
it("should maintain referential equality of handler functions between renders", async () => {
|
it("should disable account dropdown when no subscription is selected", () => {
|
||||||
const { rerender } = render(<SelectAccount />);
|
render(<SelectAccount />);
|
||||||
|
|
||||||
const migrationCheckbox = (await import("./Components/MigrationTypeCheckbox")).MigrationTypeCheckbox as jest.Mock;
|
expect(screen.getByTestId("account-dropdown")).toHaveAttribute("data-disabled", "true");
|
||||||
const firstRenderHandler = migrationCheckbox.mock.calls[migrationCheckbox.mock.calls.length - 1][0].onChange;
|
});
|
||||||
|
|
||||||
rerender(<SelectAccount />);
|
it("should enable account dropdown when subscription is selected", () => {
|
||||||
|
mockContextValue.copyJobState.source.subscription = mockSubscriptions[0];
|
||||||
|
|
||||||
const secondRenderHandler = migrationCheckbox.mock.calls[migrationCheckbox.mock.calls.length - 1][0].onChange;
|
render(<SelectAccount />);
|
||||||
|
|
||||||
expect(firstRenderHandler).toBe(secondRenderHandler);
|
expect(screen.getByTestId("account-dropdown")).toHaveAttribute("data-disabled", "false");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Component Props", () => {
|
||||||
|
it("should pass correct props to SubscriptionDropdown", () => {
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const dropdown = screen.getByTestId("subscription-dropdown");
|
||||||
|
expect(dropdown).not.toHaveAttribute("data-selected");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should pass selected subscription ID to SubscriptionDropdown", () => {
|
||||||
|
mockContextValue.copyJobState.source.subscription = mockSubscriptions[0];
|
||||||
|
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const dropdown = screen.getByTestId("subscription-dropdown");
|
||||||
|
expect(dropdown).toHaveAttribute("data-selected", "sub-1");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should pass correct props to AccountDropdown", () => {
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const dropdown = screen.getByTestId("account-dropdown");
|
||||||
|
expect(dropdown).not.toHaveAttribute("data-selected");
|
||||||
|
expect(dropdown).toHaveAttribute("data-disabled", "true");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should pass selected account ID to AccountDropdown", () => {
|
||||||
|
mockContextValue.copyJobState.source.account = mockAccounts[0];
|
||||||
|
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const dropdown = screen.getByTestId("account-dropdown");
|
||||||
|
expect(dropdown).toHaveAttribute("data-selected", mockAccounts[0].id);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should pass correct checked state to MigrationTypeCheckbox", () => {
|
||||||
|
mockContextValue.copyJobState.migrationType = CopyJobMigrationType.Offline;
|
||||||
|
|
||||||
|
render(<SelectAccount />);
|
||||||
|
|
||||||
|
const checkbox = screen.getByTestId("migration-type-checkbox");
|
||||||
|
expect(checkbox).toHaveAttribute("data-checked", "true");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Edge Cases", () => {
|
||||||
|
it("should handle empty subscriptions array", () => {
|
||||||
|
mockUseSubscriptions.mockReturnValue([]);
|
||||||
|
mockUseDropdownOptions.mockReturnValue({
|
||||||
|
subscriptionOptions: [],
|
||||||
|
accountOptions: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle empty accounts array", () => {
|
||||||
|
mockUseDatabaseAccounts.mockReturnValue([]);
|
||||||
|
mockUseDropdownOptions.mockReturnValue({
|
||||||
|
subscriptionOptions: mockDropdownOptions.subscriptionOptions,
|
||||||
|
accountOptions: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle null subscription in context", () => {
|
||||||
|
mockContextValue.copyJobState.source.subscription = null;
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle null account in context", () => {
|
||||||
|
mockContextValue.copyJobState.source.account = null;
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle undefined subscriptions from hook", () => {
|
||||||
|
mockUseSubscriptions.mockReturnValue(undefined as any);
|
||||||
|
mockUseDropdownOptions.mockReturnValue({
|
||||||
|
subscriptionOptions: [],
|
||||||
|
accountOptions: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle undefined accounts from hook", () => {
|
||||||
|
mockUseDatabaseAccounts.mockReturnValue(undefined as any);
|
||||||
|
mockUseDropdownOptions.mockReturnValue({
|
||||||
|
subscriptionOptions: mockDropdownOptions.subscriptionOptions,
|
||||||
|
accountOptions: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should filter out non-SQL accounts correctly", () => {
|
||||||
|
const mixedAccounts = [
|
||||||
|
{ ...mockAccounts[0], kind: "GlobalDocumentDB" },
|
||||||
|
{ ...mockAccounts[1], kind: "MongoDB" },
|
||||||
|
];
|
||||||
|
|
||||||
|
mockUseDatabaseAccounts.mockReturnValue(mixedAccounts);
|
||||||
|
mockApiType.mockImplementation((account) => (account.kind === "GlobalDocumentDB" ? "SQL" : "Mongo"));
|
||||||
|
|
||||||
|
render(<SelectAccount />);
|
||||||
|
expect(mockApiType).toHaveBeenCalledTimes(2);
|
||||||
|
|
||||||
|
const sqlOnlyAccounts = mixedAccounts.filter((account) => apiType(account) === "SQL");
|
||||||
|
expect(mockUseDropdownOptions).toHaveBeenCalledWith(mockSubscriptions, sqlOnlyAccounts);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Complete Workflow", () => {
|
||||||
|
it("should render complete workflow with all selections", () => {
|
||||||
|
mockContextValue.copyJobState.source.subscription = mockSubscriptions[0];
|
||||||
|
mockContextValue.copyJobState.source.account = mockAccounts[0];
|
||||||
|
mockContextValue.copyJobState.migrationType = CopyJobMigrationType.Online;
|
||||||
|
|
||||||
|
const { container } = render(<SelectAccount />);
|
||||||
|
|
||||||
|
expect(screen.getByTestId("subscription-dropdown")).toHaveAttribute("data-selected", "sub-1");
|
||||||
|
expect(screen.getByTestId("account-dropdown")).toHaveAttribute("data-selected", mockAccounts[0].id);
|
||||||
|
expect(screen.getByTestId("account-dropdown")).toHaveAttribute("data-disabled", "false");
|
||||||
|
expect(screen.getByTestId("migration-type-checkbox")).toHaveAttribute("data-checked", "false");
|
||||||
|
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,37 +1,52 @@
|
|||||||
import { Stack, Text } from "@fluentui/react";
|
/* eslint-disable react/display-name */
|
||||||
|
import { Stack } from "@fluentui/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { apiType } from "UserContext";
|
||||||
|
import { DatabaseAccount, Subscription } from "../../../../../Contracts/DataModels";
|
||||||
|
import { useDatabaseAccounts } from "../../../../../hooks/useDatabaseAccounts";
|
||||||
|
import { useSubscriptions } from "../../../../../hooks/useSubscriptions";
|
||||||
import ContainerCopyMessages from "../../../ContainerCopyMessages";
|
import ContainerCopyMessages from "../../../ContainerCopyMessages";
|
||||||
import { useCopyJobContext } from "../../../Context/CopyJobContext";
|
import { useCopyJobContext } from "../../../Context/CopyJobContext";
|
||||||
import { CopyJobMigrationType } from "../../../Enums/CopyJobEnums";
|
import { CopyJobMigrationType } from "../../../Enums/CopyJobEnums";
|
||||||
import { AccountDropdown } from "./Components/AccountDropdown";
|
import { AccountDropdown } from "./Components/AccountDropdown";
|
||||||
import { MigrationTypeCheckbox } from "./Components/MigrationTypeCheckbox";
|
import { MigrationTypeCheckbox } from "./Components/MigrationTypeCheckbox";
|
||||||
import { SubscriptionDropdown } from "./Components/SubscriptionDropdown";
|
import { SubscriptionDropdown } from "./Components/SubscriptionDropdown";
|
||||||
|
import { useDropdownOptions, useEventHandlers } from "./Utils/selectAccountUtils";
|
||||||
|
|
||||||
const SelectAccount = React.memo(() => {
|
const SelectAccount = React.memo(() => {
|
||||||
const { copyJobState, setCopyJobState } = useCopyJobContext();
|
const { copyJobState, setCopyJobState } = useCopyJobContext();
|
||||||
|
const selectedSubscriptionId = copyJobState?.source?.subscription?.subscriptionId;
|
||||||
|
const selectedSourceAccountId = copyJobState?.source?.account?.id;
|
||||||
|
|
||||||
const handleMigrationTypeChange = (_ev?: React.FormEvent<HTMLElement>, checked?: boolean) => {
|
const subscriptions: Subscription[] = useSubscriptions();
|
||||||
setCopyJobState((prevState) => ({
|
const allAccounts: DatabaseAccount[] = useDatabaseAccounts(selectedSubscriptionId);
|
||||||
...prevState,
|
const sqlApiOnlyAccounts: DatabaseAccount[] = allAccounts?.filter((account) => apiType(account) === "SQL");
|
||||||
migrationType: checked ? CopyJobMigrationType.Offline : CopyJobMigrationType.Online,
|
|
||||||
}));
|
const { subscriptionOptions, accountOptions } = useDropdownOptions(subscriptions, sqlApiOnlyAccounts);
|
||||||
};
|
const { handleSelectSourceAccount, handleMigrationTypeChange } = useEventHandlers(setCopyJobState);
|
||||||
|
|
||||||
const migrationTypeChecked = copyJobState?.migrationType === CopyJobMigrationType.Offline;
|
const migrationTypeChecked = copyJobState?.migrationType === CopyJobMigrationType.Offline;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack data-test="Panel:SelectAccountContainer" className="selectAccountContainer" tokens={{ childrenGap: 15 }}>
|
<Stack className="selectAccountContainer" tokens={{ childrenGap: 15 }}>
|
||||||
<Text>{ContainerCopyMessages.selectAccountDescription}</Text>
|
<span>{ContainerCopyMessages.selectAccountDescription}</span>
|
||||||
|
|
||||||
<SubscriptionDropdown />
|
<SubscriptionDropdown
|
||||||
|
options={subscriptionOptions}
|
||||||
|
selectedKey={selectedSubscriptionId}
|
||||||
|
onChange={(_ev, option) => handleSelectSourceAccount("subscription", option?.data)}
|
||||||
|
/>
|
||||||
|
|
||||||
<AccountDropdown />
|
<AccountDropdown
|
||||||
|
options={accountOptions}
|
||||||
|
selectedKey={selectedSourceAccountId}
|
||||||
|
disabled={!selectedSubscriptionId}
|
||||||
|
onChange={(_ev, option) => handleSelectSourceAccount("account", option?.data)}
|
||||||
|
/>
|
||||||
|
|
||||||
<MigrationTypeCheckbox checked={migrationTypeChecked} onChange={handleMigrationTypeChange} />
|
<MigrationTypeCheckbox checked={migrationTypeChecked} onChange={handleMigrationTypeChange} />
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
SelectAccount.displayName = "SelectAccount";
|
|
||||||
|
|
||||||
export default SelectAccount;
|
export default SelectAccount;
|
||||||
|
|||||||
@@ -0,0 +1,526 @@
|
|||||||
|
import "@testing-library/jest-dom";
|
||||||
|
import { fireEvent, render } from "@testing-library/react";
|
||||||
|
import React from "react";
|
||||||
|
import { noop } from "underscore";
|
||||||
|
import { DatabaseAccount, Subscription } from "../../../../../../Contracts/DataModels";
|
||||||
|
import { CopyJobMigrationType } from "../../../../Enums/CopyJobEnums";
|
||||||
|
import { CopyJobContextState } from "../../../../Types/CopyJobTypes";
|
||||||
|
import { useDropdownOptions, useEventHandlers } from "./selectAccountUtils";
|
||||||
|
|
||||||
|
jest.mock("../../../Utils/useCopyJobPrerequisitesCache", () => ({
|
||||||
|
useCopyJobPrerequisitesCache: jest.fn(() => ({
|
||||||
|
setValidationCache: jest.fn(),
|
||||||
|
})),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const mockSubscriptions: Subscription[] = [
|
||||||
|
{
|
||||||
|
subscriptionId: "sub-1",
|
||||||
|
displayName: "Test Subscription 1",
|
||||||
|
state: "Enabled",
|
||||||
|
subscriptionPolicies: {
|
||||||
|
locationPlacementId: "test",
|
||||||
|
quotaId: "test",
|
||||||
|
spendingLimit: "Off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
subscriptionId: "sub-2",
|
||||||
|
displayName: "Test Subscription 2",
|
||||||
|
state: "Enabled",
|
||||||
|
subscriptionPolicies: {
|
||||||
|
locationPlacementId: "test",
|
||||||
|
quotaId: "test",
|
||||||
|
spendingLimit: "Off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const mockAccounts: DatabaseAccount[] = [
|
||||||
|
{
|
||||||
|
id: "account-1",
|
||||||
|
name: "Test Account 1",
|
||||||
|
location: "East US",
|
||||||
|
type: "Microsoft.DocumentDB/databaseAccounts",
|
||||||
|
kind: "GlobalDocumentDB",
|
||||||
|
properties: {
|
||||||
|
documentEndpoint: "https://test1.documents.azure.com:443/",
|
||||||
|
gremlinEndpoint: "https://test1.gremlin.cosmosdb.azure.com:443/",
|
||||||
|
tableEndpoint: "https://test1.table.cosmosdb.azure.com:443/",
|
||||||
|
cassandraEndpoint: "https://test1.cassandra.cosmosdb.azure.com:443/",
|
||||||
|
capabilities: [],
|
||||||
|
writeLocations: [],
|
||||||
|
readLocations: [],
|
||||||
|
locations: [],
|
||||||
|
ipRules: [],
|
||||||
|
enableMultipleWriteLocations: false,
|
||||||
|
isVirtualNetworkFilterEnabled: false,
|
||||||
|
enableFreeTier: false,
|
||||||
|
enableAnalyticalStorage: false,
|
||||||
|
publicNetworkAccess: "Enabled",
|
||||||
|
defaultIdentity: "",
|
||||||
|
disableLocalAuth: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "account-2",
|
||||||
|
name: "Test Account 2",
|
||||||
|
location: "West US",
|
||||||
|
type: "Microsoft.DocumentDB/databaseAccounts",
|
||||||
|
kind: "GlobalDocumentDB",
|
||||||
|
properties: {
|
||||||
|
documentEndpoint: "https://test2.documents.azure.com:443/",
|
||||||
|
gremlinEndpoint: "https://test2.gremlin.cosmosdb.azure.com:443/",
|
||||||
|
tableEndpoint: "https://test2.table.cosmosdb.azure.com:443/",
|
||||||
|
cassandraEndpoint: "https://test2.cassandra.cosmosdb.azure.com:443/",
|
||||||
|
capabilities: [],
|
||||||
|
writeLocations: [],
|
||||||
|
readLocations: [],
|
||||||
|
locations: [],
|
||||||
|
enableMultipleWriteLocations: false,
|
||||||
|
isVirtualNetworkFilterEnabled: false,
|
||||||
|
enableFreeTier: false,
|
||||||
|
enableAnalyticalStorage: false,
|
||||||
|
publicNetworkAccess: "Enabled",
|
||||||
|
defaultIdentity: "",
|
||||||
|
disableLocalAuth: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const DropdownOptionsTestComponent: React.FC<{
|
||||||
|
subscriptions: Subscription[];
|
||||||
|
accounts: DatabaseAccount[];
|
||||||
|
onResult?: (result: { subscriptionOptions: any[]; accountOptions: any[] }) => void;
|
||||||
|
}> = ({ subscriptions, accounts, onResult }) => {
|
||||||
|
const result = useDropdownOptions(subscriptions, accounts);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (onResult) {
|
||||||
|
onResult(result);
|
||||||
|
}
|
||||||
|
}, [result, onResult]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div data-testid="subscription-options-count">{result.subscriptionOptions.length}</div>
|
||||||
|
<div data-testid="account-options-count">{result.accountOptions.length}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const EventHandlersTestComponent: React.FC<{
|
||||||
|
setCopyJobState: jest.Mock;
|
||||||
|
onResult?: (result: any) => void;
|
||||||
|
}> = ({ setCopyJobState, onResult }) => {
|
||||||
|
const result = useEventHandlers(setCopyJobState);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (onResult) {
|
||||||
|
onResult(result);
|
||||||
|
}
|
||||||
|
}, [result, onResult]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
data-testid="select-subscription-button"
|
||||||
|
onClick={() => result.handleSelectSourceAccount("subscription", mockSubscriptions[0] as any)}
|
||||||
|
>
|
||||||
|
Select Subscription
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
data-testid="select-account-button"
|
||||||
|
onClick={() => result.handleSelectSourceAccount("account", mockAccounts[0] as any)}
|
||||||
|
>
|
||||||
|
Select Account
|
||||||
|
</button>
|
||||||
|
<button data-testid="migration-type-button" onClick={(e) => result.handleMigrationTypeChange(e, true)}>
|
||||||
|
Change Migration Type
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
describe("selectAccountUtils", () => {
|
||||||
|
describe("useDropdownOptions", () => {
|
||||||
|
it("should return empty arrays when subscriptions and accounts are undefined", () => {
|
||||||
|
let capturedResult: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DropdownOptionsTestComponent
|
||||||
|
subscriptions={undefined as any}
|
||||||
|
accounts={undefined as any}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedResult = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(capturedResult).toEqual({
|
||||||
|
subscriptionOptions: [],
|
||||||
|
accountOptions: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should return empty arrays when subscriptions and accounts are empty arrays", () => {
|
||||||
|
let capturedResult: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DropdownOptionsTestComponent
|
||||||
|
subscriptions={[]}
|
||||||
|
accounts={[]}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedResult = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(capturedResult).toEqual({
|
||||||
|
subscriptionOptions: [],
|
||||||
|
accountOptions: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should transform subscriptions into dropdown options correctly", () => {
|
||||||
|
let capturedResult: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DropdownOptionsTestComponent
|
||||||
|
subscriptions={mockSubscriptions}
|
||||||
|
accounts={[]}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedResult = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(capturedResult.subscriptionOptions).toHaveLength(2);
|
||||||
|
expect(capturedResult.subscriptionOptions[0]).toEqual({
|
||||||
|
key: "sub-1",
|
||||||
|
text: "Test Subscription 1",
|
||||||
|
data: mockSubscriptions[0],
|
||||||
|
});
|
||||||
|
expect(capturedResult.subscriptionOptions[1]).toEqual({
|
||||||
|
key: "sub-2",
|
||||||
|
text: "Test Subscription 2",
|
||||||
|
data: mockSubscriptions[1],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should transform accounts into dropdown options correctly", () => {
|
||||||
|
let capturedResult: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DropdownOptionsTestComponent
|
||||||
|
subscriptions={[]}
|
||||||
|
accounts={mockAccounts}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedResult = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(capturedResult.accountOptions).toHaveLength(2);
|
||||||
|
expect(capturedResult.accountOptions[0]).toEqual({
|
||||||
|
key: "account-1",
|
||||||
|
text: "Test Account 1",
|
||||||
|
data: mockAccounts[0],
|
||||||
|
});
|
||||||
|
expect(capturedResult.accountOptions[1]).toEqual({
|
||||||
|
key: "account-2",
|
||||||
|
text: "Test Account 2",
|
||||||
|
data: mockAccounts[1],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle both subscriptions and accounts correctly", () => {
|
||||||
|
let capturedResult: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DropdownOptionsTestComponent
|
||||||
|
subscriptions={mockSubscriptions}
|
||||||
|
accounts={mockAccounts}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedResult = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(capturedResult.subscriptionOptions).toHaveLength(2);
|
||||||
|
expect(capturedResult.accountOptions).toHaveLength(2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("useEventHandlers", () => {
|
||||||
|
let mockSetCopyJobState: jest.Mock;
|
||||||
|
let mockSetValidationCache: jest.Mock;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
mockSetCopyJobState = jest.fn();
|
||||||
|
mockSetValidationCache = jest.fn();
|
||||||
|
|
||||||
|
const { useCopyJobPrerequisitesCache } = await import("../../../Utils/useCopyJobPrerequisitesCache");
|
||||||
|
(useCopyJobPrerequisitesCache as unknown as jest.Mock).mockReturnValue({
|
||||||
|
setValidationCache: mockSetValidationCache,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle subscription selection correctly", () => {
|
||||||
|
const { getByTestId } = render(
|
||||||
|
<EventHandlersTestComponent setCopyJobState={mockSetCopyJobState} onResult={noop} />,
|
||||||
|
);
|
||||||
|
|
||||||
|
fireEvent.click(getByTestId("select-subscription-button"));
|
||||||
|
|
||||||
|
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
||||||
|
expect(mockSetValidationCache).toHaveBeenCalledWith(new Map<string, boolean>());
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: { id: "existing-account" } as any,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual({
|
||||||
|
source: {
|
||||||
|
subscription: mockSubscriptions[0],
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle account selection correctly", () => {
|
||||||
|
const { getByTestId } = render(
|
||||||
|
<EventHandlersTestComponent setCopyJobState={mockSetCopyJobState} onResult={noop} />,
|
||||||
|
);
|
||||||
|
|
||||||
|
fireEvent.click(getByTestId("select-account-button"));
|
||||||
|
|
||||||
|
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
||||||
|
expect(mockSetValidationCache).toHaveBeenCalledWith(new Map<string, boolean>());
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: { subscriptionId: "existing-sub" } as any,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual({
|
||||||
|
source: {
|
||||||
|
subscription: { subscriptionId: "existing-sub" },
|
||||||
|
account: mockAccounts[0],
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle subscription selection with undefined data", () => {
|
||||||
|
let capturedHandlers: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<EventHandlersTestComponent
|
||||||
|
setCopyJobState={mockSetCopyJobState}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedHandlers = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
capturedHandlers.handleSelectSourceAccount("subscription", undefined);
|
||||||
|
|
||||||
|
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: { subscriptionId: "existing-sub" } as any,
|
||||||
|
account: { id: "existing-account" } as any,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual({
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle account selection with undefined data", () => {
|
||||||
|
let capturedHandlers: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<EventHandlersTestComponent
|
||||||
|
setCopyJobState={mockSetCopyJobState}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedHandlers = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
capturedHandlers.handleSelectSourceAccount("account", undefined);
|
||||||
|
|
||||||
|
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: { subscriptionId: "existing-sub" } as any,
|
||||||
|
account: { id: "existing-account" } as any,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual({
|
||||||
|
source: {
|
||||||
|
subscription: { subscriptionId: "existing-sub" },
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle migration type change to offline", () => {
|
||||||
|
const { getByTestId } = render(<EventHandlersTestComponent setCopyJobState={mockSetCopyJobState} />);
|
||||||
|
|
||||||
|
fireEvent.click(getByTestId("migration-type-button"));
|
||||||
|
|
||||||
|
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
||||||
|
expect(mockSetValidationCache).toHaveBeenCalledWith(new Map<string, boolean>());
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual({
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Offline,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle migration type change to online when checked is false", () => {
|
||||||
|
let capturedHandlers: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<EventHandlersTestComponent
|
||||||
|
setCopyJobState={mockSetCopyJobState}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedHandlers = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
capturedHandlers.handleMigrationTypeChange(undefined, false);
|
||||||
|
|
||||||
|
expect(mockSetCopyJobState).toHaveBeenCalledWith(expect.any(Function));
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Offline,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual({
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should preserve other state properties when updating", () => {
|
||||||
|
let capturedHandlers: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<EventHandlersTestComponent
|
||||||
|
setCopyJobState={mockSetCopyJobState}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedHandlers = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
capturedHandlers.handleSelectSourceAccount("subscription", mockSubscriptions[0] as Subscription);
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState = {
|
||||||
|
jobName: "Test Job",
|
||||||
|
source: {
|
||||||
|
subscription: null,
|
||||||
|
account: null,
|
||||||
|
databaseId: "test-database-id",
|
||||||
|
containerId: "test-container-id",
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
target: {
|
||||||
|
account: { id: "dest-account" } as DatabaseAccount,
|
||||||
|
databaseId: "test-database-id",
|
||||||
|
containerId: "test-container-id",
|
||||||
|
subscriptionId: "dest-sub-id",
|
||||||
|
},
|
||||||
|
} as CopyJobContextState;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState.target).toEqual(mockPrevState.target);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should return the same state for unknown selection type", () => {
|
||||||
|
let capturedHandlers: any;
|
||||||
|
|
||||||
|
render(
|
||||||
|
<EventHandlersTestComponent
|
||||||
|
setCopyJobState={mockSetCopyJobState}
|
||||||
|
onResult={(result) => {
|
||||||
|
capturedHandlers = result;
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
capturedHandlers.handleSelectSourceAccount("unknown" as any, mockSubscriptions[0] as any);
|
||||||
|
|
||||||
|
const stateUpdater = mockSetCopyJobState.mock.calls[0][0];
|
||||||
|
const mockPrevState: CopyJobContextState = {
|
||||||
|
source: {
|
||||||
|
subscription: { subscriptionId: "existing-sub" } as any,
|
||||||
|
account: { id: "existing-account" } as any,
|
||||||
|
},
|
||||||
|
migrationType: CopyJobMigrationType.Online,
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const newState = stateUpdater(mockPrevState);
|
||||||
|
expect(newState).toEqual(mockPrevState);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { DatabaseAccount, Subscription } from "../../../../../../Contracts/DataModels";
|
||||||
|
import { CopyJobMigrationType } from "../../../../Enums/CopyJobEnums";
|
||||||
|
import { CopyJobContextProviderType, CopyJobContextState, DropdownOptionType } from "../../../../Types/CopyJobTypes";
|
||||||
|
import { useCopyJobPrerequisitesCache } from "../../../Utils/useCopyJobPrerequisitesCache";
|
||||||
|
|
||||||
|
export function useDropdownOptions(
|
||||||
|
subscriptions: Subscription[],
|
||||||
|
accounts: DatabaseAccount[],
|
||||||
|
): {
|
||||||
|
subscriptionOptions: DropdownOptionType[];
|
||||||
|
accountOptions: DropdownOptionType[];
|
||||||
|
} {
|
||||||
|
const subscriptionOptions =
|
||||||
|
subscriptions?.map((sub) => ({
|
||||||
|
key: sub.subscriptionId,
|
||||||
|
text: sub.displayName,
|
||||||
|
data: sub,
|
||||||
|
})) || [];
|
||||||
|
|
||||||
|
const normalizeAccountId = (id: string) => {
|
||||||
|
if (!id) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
return id.replace(/\/Microsoft\.DocumentDb\//i, "/Microsoft.DocumentDB/");
|
||||||
|
};
|
||||||
|
|
||||||
|
const accountOptions =
|
||||||
|
accounts?.map((account) => ({
|
||||||
|
key: normalizeAccountId(account.id),
|
||||||
|
text: account.name,
|
||||||
|
data: account,
|
||||||
|
})) || [];
|
||||||
|
|
||||||
|
return { subscriptionOptions, accountOptions };
|
||||||
|
}
|
||||||
|
|
||||||
|
type setCopyJobStateType = CopyJobContextProviderType["setCopyJobState"];
|
||||||
|
|
||||||
|
export function useEventHandlers(setCopyJobState: setCopyJobStateType) {
|
||||||
|
const { setValidationCache } = useCopyJobPrerequisitesCache();
|
||||||
|
const handleSelectSourceAccount = (
|
||||||
|
type: "subscription" | "account",
|
||||||
|
data: (Subscription & DatabaseAccount) | undefined,
|
||||||
|
) => {
|
||||||
|
setCopyJobState((prevState: CopyJobContextState) => {
|
||||||
|
if (type === "subscription") {
|
||||||
|
return {
|
||||||
|
...prevState,
|
||||||
|
source: {
|
||||||
|
...prevState.source,
|
||||||
|
subscription: data || null,
|
||||||
|
account: null,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (type === "account") {
|
||||||
|
return {
|
||||||
|
...prevState,
|
||||||
|
source: {
|
||||||
|
...prevState.source,
|
||||||
|
account: data || null,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return prevState;
|
||||||
|
});
|
||||||
|
setValidationCache(new Map<string, boolean>());
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleMigrationTypeChange = React.useCallback((_ev?: React.FormEvent<HTMLElement>, checked?: boolean) => {
|
||||||
|
setCopyJobState((prevState: CopyJobContextState) => ({
|
||||||
|
...prevState,
|
||||||
|
migrationType: checked ? CopyJobMigrationType.Offline : CopyJobMigrationType.Online,
|
||||||
|
}));
|
||||||
|
setValidationCache(new Map<string, boolean>());
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return { handleSelectSourceAccount, handleMigrationTypeChange };
|
||||||
|
}
|
||||||
@@ -1,34 +1,510 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`SelectAccount Component Rendering should render correctly with snapshot 1`] = `
|
exports[`SelectAccount Component Complete Workflow should render complete workflow with all selections 1`] = `
|
||||||
<div
|
<div>
|
||||||
class="ms-Stack selectAccountContainer css-109"
|
|
||||||
data-test="Panel:SelectAccountContainer"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="css-110"
|
|
||||||
>
|
|
||||||
Please select a source account from which to copy.
|
|
||||||
</span>
|
|
||||||
<div
|
<div
|
||||||
data-testid="subscription-dropdown"
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
>
|
>
|
||||||
Subscription Dropdown
|
<span>
|
||||||
</div>
|
Select your source account and subscription
|
||||||
<div
|
</span>
|
||||||
data-testid="account-dropdown"
|
<div
|
||||||
>
|
data-selected="sub-1"
|
||||||
Account Dropdown
|
data-testid="subscription-dropdown"
|
||||||
</div>
|
>
|
||||||
<div
|
<div
|
||||||
data-testid="migration-type-checkbox"
|
data-testid="subscription-option-sub-1"
|
||||||
>
|
>
|
||||||
<input
|
Test Subscription 1
|
||||||
aria-label="Migration Type Checkbox"
|
</div>
|
||||||
data-testid="migration-checkbox-input"
|
<div
|
||||||
type="checkbox"
|
data-testid="subscription-option-sub-2"
|
||||||
/>
|
>
|
||||||
Copy container in offline mode
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="false"
|
||||||
|
data-selected="/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="false"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Edge Cases should handle empty accounts array 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Edge Cases should handle empty subscriptions array 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Edge Cases should handle null account in context 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Edge Cases should handle null subscription in context 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Edge Cases should handle undefined accounts from hook 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Edge Cases should handle undefined subscriptions from hook 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Rendering should render component with default state 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Rendering should render with offline migration type checked 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Rendering should render with online migration type unchecked 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="true"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="false"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Rendering should render with selected account 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-selected="sub-1"
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="false"
|
||||||
|
data-selected="/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`SelectAccount Component Rendering should render with selected subscription 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="ms-Stack selectAccountContainer css-109"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Select your source account and subscription
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
data-selected="sub-1"
|
||||||
|
data-testid="subscription-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-1"
|
||||||
|
>
|
||||||
|
Test Subscription 1
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-testid="subscription-option-sub-2"
|
||||||
|
>
|
||||||
|
Test Subscription 2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-disabled="false"
|
||||||
|
data-testid="account-dropdown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid="account-option-/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.DocumentDB/databaseAccounts/account-1"
|
||||||
|
>
|
||||||
|
test-cosmos-account-1
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
data-checked="true"
|
||||||
|
data-testid="migration-type-checkbox"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
data-testid="migration-checkbox-input"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -47,11 +47,7 @@ const SelectSourceAndTargetContainers = ({ showAddCollectionPanel }: SelectSourc
|
|||||||
const onDropdownChange = dropDownChangeHandler(setCopyJobState);
|
const onDropdownChange = dropDownChangeHandler(setCopyJobState);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack className="selectSourceAndTargetContainers" tokens={{ childrenGap: 25 }}>
|
||||||
data-test="Panel:SelectSourceAndTargetContainers"
|
|
||||||
className="selectSourceAndTargetContainers"
|
|
||||||
tokens={{ childrenGap: 25 }}
|
|
||||||
>
|
|
||||||
<span>{ContainerCopyMessages.selectSourceAndTargetContainersDescription}</span>
|
<span>{ContainerCopyMessages.selectSourceAndTargetContainersDescription}</span>
|
||||||
<DatabaseContainerSection
|
<DatabaseContainerSection
|
||||||
heading={ContainerCopyMessages.sourceContainerSubHeading}
|
heading={ContainerCopyMessages.sourceContainerSubHeading}
|
||||||
@@ -63,7 +59,6 @@ const SelectSourceAndTargetContainers = ({ showAddCollectionPanel }: SelectSourc
|
|||||||
selectedContainer={source?.containerId}
|
selectedContainer={source?.containerId}
|
||||||
containerDisabled={!source?.databaseId}
|
containerDisabled={!source?.databaseId}
|
||||||
containerOnChange={onDropdownChange("sourceContainer")}
|
containerOnChange={onDropdownChange("sourceContainer")}
|
||||||
sectionType="source"
|
|
||||||
/>
|
/>
|
||||||
<DatabaseContainerSection
|
<DatabaseContainerSection
|
||||||
heading={ContainerCopyMessages.targetContainerSubHeading}
|
heading={ContainerCopyMessages.targetContainerSubHeading}
|
||||||
@@ -76,7 +71,6 @@ const SelectSourceAndTargetContainers = ({ showAddCollectionPanel }: SelectSourc
|
|||||||
containerDisabled={!target?.databaseId}
|
containerDisabled={!target?.databaseId}
|
||||||
containerOnChange={onDropdownChange("targetContainer")}
|
containerOnChange={onDropdownChange("targetContainer")}
|
||||||
handleOnDemandCreateContainer={showAddCollectionPanel}
|
handleOnDemandCreateContainer={showAddCollectionPanel}
|
||||||
sectionType="target"
|
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ describe("DatabaseContainerSection", () => {
|
|||||||
selectedContainer: "container1",
|
selectedContainer: "container1",
|
||||||
containerDisabled: false,
|
containerDisabled: false,
|
||||||
containerOnChange: mockContainerOnChange,
|
containerOnChange: mockContainerOnChange,
|
||||||
sectionType: "source",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -293,7 +292,6 @@ describe("DatabaseContainerSection", () => {
|
|||||||
containerOptions: mockContainerOptions,
|
containerOptions: mockContainerOptions,
|
||||||
selectedContainer: "container1",
|
selectedContainer: "container1",
|
||||||
containerOnChange: mockContainerOnChange,
|
containerOnChange: mockContainerOnChange,
|
||||||
sectionType: "source",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render(<DatabaseContainerSection {...minimalProps} />);
|
render(<DatabaseContainerSection {...minimalProps} />);
|
||||||
@@ -395,7 +393,6 @@ describe("DatabaseContainerSection", () => {
|
|||||||
containerOptions: [{ key: "c1", text: "Container 1", data: { id: "c1" } }],
|
containerOptions: [{ key: "c1", text: "Container 1", data: { id: "c1" } }],
|
||||||
selectedContainer: "c1",
|
selectedContainer: "c1",
|
||||||
containerOnChange: jest.fn(),
|
containerOnChange: jest.fn(),
|
||||||
sectionType: "source",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const { container } = render(<DatabaseContainerSection {...minimalProps} />);
|
const { container } = render(<DatabaseContainerSection {...minimalProps} />);
|
||||||
@@ -414,7 +411,6 @@ describe("DatabaseContainerSection", () => {
|
|||||||
containerDisabled: false,
|
containerDisabled: false,
|
||||||
containerOnChange: jest.fn(),
|
containerOnChange: jest.fn(),
|
||||||
handleOnDemandCreateContainer: jest.fn(),
|
handleOnDemandCreateContainer: jest.fn(),
|
||||||
sectionType: "target",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const { container } = render(<DatabaseContainerSection {...fullProps} />);
|
const { container } = render(<DatabaseContainerSection {...fullProps} />);
|
||||||
@@ -432,7 +428,6 @@ describe("DatabaseContainerSection", () => {
|
|||||||
selectedContainer: "container1",
|
selectedContainer: "container1",
|
||||||
containerDisabled: true,
|
containerDisabled: true,
|
||||||
containerOnChange: jest.fn(),
|
containerOnChange: jest.fn(),
|
||||||
sectionType: "target",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const { container } = render(<DatabaseContainerSection {...disabledProps} />);
|
const { container } = render(<DatabaseContainerSection {...disabledProps} />);
|
||||||
@@ -448,7 +443,6 @@ describe("DatabaseContainerSection", () => {
|
|||||||
containerOptions: [],
|
containerOptions: [],
|
||||||
selectedContainer: "",
|
selectedContainer: "",
|
||||||
containerOnChange: jest.fn(),
|
containerOnChange: jest.fn(),
|
||||||
sectionType: "target",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const { container } = render(<DatabaseContainerSection {...emptyOptionsProps} />);
|
const { container } = render(<DatabaseContainerSection {...emptyOptionsProps} />);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export const DatabaseContainerSection = ({
|
|||||||
containerDisabled,
|
containerDisabled,
|
||||||
containerOnChange,
|
containerOnChange,
|
||||||
handleOnDemandCreateContainer,
|
handleOnDemandCreateContainer,
|
||||||
sectionType,
|
|
||||||
}: DatabaseContainerSectionProps) => (
|
}: DatabaseContainerSectionProps) => (
|
||||||
<Stack tokens={{ childrenGap: 15 }} className="databaseContainerSection">
|
<Stack tokens={{ childrenGap: 15 }} className="databaseContainerSection">
|
||||||
<label className="subHeading">{heading}</label>
|
<label className="subHeading">{heading}</label>
|
||||||
@@ -28,7 +27,6 @@ export const DatabaseContainerSection = ({
|
|||||||
disabled={!!databaseDisabled}
|
disabled={!!databaseDisabled}
|
||||||
selectedKey={selectedDatabase}
|
selectedKey={selectedDatabase}
|
||||||
onChange={databaseOnChange}
|
onChange={databaseOnChange}
|
||||||
data-test={`${sectionType}-databaseDropdown`}
|
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
<FieldRow label={ContainerCopyMessages.containerDropdownLabel}>
|
<FieldRow label={ContainerCopyMessages.containerDropdownLabel}>
|
||||||
@@ -41,7 +39,6 @@ export const DatabaseContainerSection = ({
|
|||||||
disabled={!!containerDisabled}
|
disabled={!!containerDisabled}
|
||||||
selectedKey={selectedContainer}
|
selectedKey={selectedContainer}
|
||||||
onChange={containerOnChange}
|
onChange={containerOnChange}
|
||||||
data-test={`${sectionType}-containerDropdown`}
|
|
||||||
/>
|
/>
|
||||||
{handleOnDemandCreateContainer && (
|
{handleOnDemandCreateContainer && (
|
||||||
<ActionButton className="create-container-link-btn" onClick={() => handleOnDemandCreateContainer()}>
|
<ActionButton className="create-container-link-btn" onClick={() => handleOnDemandCreateContainer()}>
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with all pro
|
|||||||
class="ms-Dropdown is-required dropdown-112"
|
class="ms-Dropdown is-required dropdown-112"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="target-databaseDropdown"
|
|
||||||
id="Dropdown98"
|
id="Dropdown98"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -95,7 +94,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with all pro
|
|||||||
class="ms-Dropdown is-required dropdown-112"
|
class="ms-Dropdown is-required dropdown-112"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="target-containerDropdown"
|
|
||||||
id="Dropdown99"
|
id="Dropdown99"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -184,7 +182,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with disable
|
|||||||
class="ms-Dropdown is-disabled is-required dropdown-143"
|
class="ms-Dropdown is-disabled is-required dropdown-143"
|
||||||
data-is-focusable="false"
|
data-is-focusable="false"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="target-databaseDropdown"
|
|
||||||
id="Dropdown103"
|
id="Dropdown103"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
@@ -242,7 +239,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with disable
|
|||||||
class="ms-Dropdown is-disabled is-required dropdown-143"
|
class="ms-Dropdown is-disabled is-required dropdown-143"
|
||||||
data-is-focusable="false"
|
data-is-focusable="false"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="target-containerDropdown"
|
|
||||||
id="Dropdown104"
|
id="Dropdown104"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
@@ -310,7 +306,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with empty o
|
|||||||
class="ms-Dropdown is-required dropdown-112"
|
class="ms-Dropdown is-required dropdown-112"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="target-databaseDropdown"
|
|
||||||
id="Dropdown105"
|
id="Dropdown105"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -368,7 +363,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with empty o
|
|||||||
class="ms-Dropdown is-required dropdown-112"
|
class="ms-Dropdown is-required dropdown-112"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="target-containerDropdown"
|
|
||||||
id="Dropdown106"
|
id="Dropdown106"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -436,7 +430,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with minimal
|
|||||||
class="ms-Dropdown is-required dropdown-112"
|
class="ms-Dropdown is-required dropdown-112"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="source-databaseDropdown"
|
|
||||||
id="Dropdown96"
|
id="Dropdown96"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -494,7 +487,6 @@ exports[`DatabaseContainerSection Snapshot Testing matches snapshot with minimal
|
|||||||
class="ms-Dropdown is-required dropdown-112"
|
class="ms-Dropdown is-required dropdown-112"
|
||||||
data-is-focusable="true"
|
data-is-focusable="true"
|
||||||
data-ktp-target="true"
|
data-ktp-target="true"
|
||||||
data-test="source-containerDropdown"
|
|
||||||
id="Dropdown97"
|
id="Dropdown97"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export function useCopyJobNavigation() {
|
|||||||
const [state, dispatch] = useReducer(navigationReducer, { screenHistory: [SCREEN_KEYS.SelectAccount] });
|
const [state, dispatch] = useReducer(navigationReducer, { screenHistory: [SCREEN_KEYS.SelectAccount] });
|
||||||
|
|
||||||
const handlePrevious = useCallback(() => {
|
const handlePrevious = useCallback(() => {
|
||||||
setContextError(null);
|
|
||||||
dispatch({ type: "PREVIOUS" });
|
dispatch({ type: "PREVIOUS" });
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ const CopyJobActionMenu: React.FC<CopyJobActionMenuProps> = ({ job, handleClick
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
data-test={`CopyJobActionMenu/Button:${job.Name}`}
|
|
||||||
role="button"
|
role="button"
|
||||||
iconProps={{ iconName: "More", styles: { root: { fontSize: "20px", fontWeight: "bold" } } }}
|
iconProps={{ iconName: "More", styles: { root: { fontSize: "20px", fontWeight: "bold" } } }}
|
||||||
menuProps={{ items: getMenuItems() }}
|
menuProps={{ items: getMenuItems() }}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ describe("CopyJobStatusWithIcon", () => {
|
|||||||
|
|
||||||
const spinner = container.querySelector('[class*="ms-Spinner"]');
|
const spinner = container.querySelector('[class*="ms-Spinner"]');
|
||||||
expect(spinner).toBeInTheDocument();
|
expect(spinner).toBeInTheDocument();
|
||||||
expect(container).toHaveTextContent("Running");
|
expect(container).toHaveTextContent("In Progress");
|
||||||
expect(container.firstChild).toMatchSnapshot();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -83,18 +83,18 @@ describe("CopyJobStatusWithIcon", () => {
|
|||||||
it("provides meaningful text content for screen readers", () => {
|
it("provides meaningful text content for screen readers", () => {
|
||||||
const { container } = render(<CopyJobStatusWithIcon status={CopyJobStatusType.InProgress} />);
|
const { container } = render(<CopyJobStatusWithIcon status={CopyJobStatusType.InProgress} />);
|
||||||
|
|
||||||
expect(container).toHaveTextContent("Running");
|
expect(container).toHaveTextContent("In Progress");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Icon and Status Mapping", () => {
|
describe("Icon and Status Mapping", () => {
|
||||||
it("renders correct status text based on mapping", () => {
|
it("renders correct status text based on mapping", () => {
|
||||||
const statusMappings = [
|
const statusMappings = [
|
||||||
{ status: CopyJobStatusType.Pending, expectedText: "Queued" },
|
{ status: CopyJobStatusType.Pending, expectedText: "Pending" },
|
||||||
{ status: CopyJobStatusType.Paused, expectedText: "Paused" },
|
{ status: CopyJobStatusType.Paused, expectedText: "Paused" },
|
||||||
{ status: CopyJobStatusType.Failed, expectedText: "Failed" },
|
{ status: CopyJobStatusType.Failed, expectedText: "Failed" },
|
||||||
{ status: CopyJobStatusType.Completed, expectedText: "Completed" },
|
{ status: CopyJobStatusType.Completed, expectedText: "Completed" },
|
||||||
{ status: CopyJobStatusType.Running, expectedText: "Running" },
|
{ status: CopyJobStatusType.Running, expectedText: "In Progress" },
|
||||||
];
|
];
|
||||||
|
|
||||||
statusMappings.forEach(({ status, expectedText }) => {
|
statusMappings.forEach(({ status, expectedText }) => {
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ const CopyJobsList: React.FC<CopyJobsListProps> = ({ jobs, handleActionClick, pa
|
|||||||
<Stack.Item verticalFill={true} grow={1} shrink={1} style={styles.stackItem}>
|
<Stack.Item verticalFill={true} grow={1} shrink={1} style={styles.stackItem}>
|
||||||
<ScrollablePane scrollbarVisibility={ScrollbarVisibility.auto}>
|
<ScrollablePane scrollbarVisibility={ScrollbarVisibility.auto}>
|
||||||
<ShimmeredDetailsList
|
<ShimmeredDetailsList
|
||||||
className="CopyJobListContainer"
|
|
||||||
onRenderRow={_onRenderRow}
|
onRenderRow={_onRenderRow}
|
||||||
checkboxVisibility={2}
|
checkboxVisibility={2}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ exports[`CopyJobStatusWithIcon Spinner Status Types renders InProgress with spin
|
|||||||
<span
|
<span
|
||||||
class="css-112"
|
class="css-112"
|
||||||
>
|
>
|
||||||
Running
|
In Progress
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@@ -35,7 +35,7 @@ exports[`CopyJobStatusWithIcon Spinner Status Types renders Partitioning with sp
|
|||||||
<span
|
<span
|
||||||
class="css-112"
|
class="css-112"
|
||||||
>
|
>
|
||||||
Running
|
In Progress
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@@ -55,7 +55,7 @@ exports[`CopyJobStatusWithIcon Spinner Status Types renders Running with spinner
|
|||||||
<span
|
<span
|
||||||
class="css-112"
|
class="css-112"
|
||||||
>
|
>
|
||||||
Running
|
In Progress
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@@ -181,7 +181,7 @@ exports[`CopyJobStatusWithIcon Static Icon Status Types - Snapshot Tests renders
|
|||||||
<span
|
<span
|
||||||
class="css-112"
|
class="css-112"
|
||||||
>
|
>
|
||||||
Queued
|
Pending
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -44,9 +44,7 @@ const MonitorCopyJobs = forwardRef<MonitorCopyJobsRef, MonitorCopyJobsProps>(({
|
|||||||
return isEqual(prevJobs, normalizedResponse) ? prevJobs : normalizedResponse;
|
return isEqual(prevJobs, normalizedResponse) ? prevJobs : normalizedResponse;
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message !== "Previous copy job request was cancelled.") {
|
setError(error.message || "Failed to load copy jobs. Please try again later.");
|
||||||
setError(error.message || "Failed to load copy jobs. Please try again later.");
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
if (isFirstFetchRef.current) {
|
if (isFirstFetchRef.current) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ export interface DatabaseContainerSectionProps {
|
|||||||
containerDisabled?: boolean;
|
containerDisabled?: boolean;
|
||||||
containerOnChange: (ev: React.FormEvent<HTMLDivElement>, option: DropdownOptionType) => void;
|
containerOnChange: (ev: React.FormEvent<HTMLDivElement>, option: DropdownOptionType) => void;
|
||||||
handleOnDemandCreateContainer?: () => void;
|
handleOnDemandCreateContainer?: () => void;
|
||||||
sectionType: "source" | "target";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CopyJobContextState {
|
export interface CopyJobContextState {
|
||||||
@@ -57,14 +56,14 @@ export interface CopyJobContextState {
|
|||||||
migrationType: CopyJobMigrationType;
|
migrationType: CopyJobMigrationType;
|
||||||
sourceReadAccessFromTarget?: boolean;
|
sourceReadAccessFromTarget?: boolean;
|
||||||
source: {
|
source: {
|
||||||
subscription: Subscription | null;
|
subscription: Subscription;
|
||||||
account: DatabaseAccount | null;
|
account: DatabaseAccount;
|
||||||
databaseId: string;
|
databaseId: string;
|
||||||
containerId: string;
|
containerId: string;
|
||||||
};
|
};
|
||||||
target: {
|
target: {
|
||||||
subscriptionId: string;
|
subscriptionId: string;
|
||||||
account: DatabaseAccount | null;
|
account: DatabaseAccount;
|
||||||
databaseId: string;
|
databaseId: string;
|
||||||
containerId: string;
|
containerId: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export class CollapsibleSectionComponent extends React.Component<CollapsibleSect
|
|||||||
aria-expanded={this.state.isExpanded}
|
aria-expanded={this.state.isExpanded}
|
||||||
>
|
>
|
||||||
<Icon iconName={this.state.isExpanded ? "ChevronDown" : "ChevronRight"} />
|
<Icon iconName={this.state.isExpanded ? "ChevronDown" : "ChevronRight"} />
|
||||||
<Label styles={{ root: { color: "var(--colorNeutralForeground1)" } }}>{this.props.title}</Label>
|
<Label>{this.props.title}</Label>
|
||||||
{this.props.tooltipContent && (
|
{this.props.tooltipContent && (
|
||||||
<TooltipHost
|
<TooltipHost
|
||||||
directionalHint={DirectionalHint.bottomLeftEdge}
|
directionalHint={DirectionalHint.bottomLeftEdge}
|
||||||
@@ -79,14 +79,6 @@ export class CollapsibleSectionComponent extends React.Component<CollapsibleSect
|
|||||||
id={`delete-${this.props.title.split(" ").join("-")}`}
|
id={`delete-${this.props.title.split(" ").join("-")}`}
|
||||||
iconProps={{ iconName: "Delete" }}
|
iconProps={{ iconName: "Delete" }}
|
||||||
style={{ height: 27, marginRight: "20px" }}
|
style={{ height: 27, marginRight: "20px" }}
|
||||||
styles={{
|
|
||||||
rootHovered: {
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
rootPressed: {
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.props.onDelete();
|
this.props.onDelete();
|
||||||
|
|||||||
@@ -20,15 +20,7 @@ exports[`CollapsibleSectionComponent renders 1`] = `
|
|||||||
<Icon
|
<Icon
|
||||||
iconName="ChevronDown"
|
iconName="ChevronDown"
|
||||||
/>
|
/>
|
||||||
<StyledLabelBase
|
<StyledLabelBase>
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Sample title
|
Sample title
|
||||||
</StyledLabelBase>
|
</StyledLabelBase>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -58,26 +58,6 @@ export interface CommandButtonComponentProps {
|
|||||||
*/
|
*/
|
||||||
tooltipText?: string;
|
tooltipText?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom styles to apply to the button using Fluent UI theme tokens
|
|
||||||
*/
|
|
||||||
styles?: {
|
|
||||||
root?: {
|
|
||||||
backgroundColor?: string;
|
|
||||||
color?: string;
|
|
||||||
selectors?: {
|
|
||||||
":hover"?: {
|
|
||||||
backgroundColor?: string;
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
":active"?: {
|
|
||||||
backgroundColor?: string;
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tabindex for the command button
|
* tabindex for the command button
|
||||||
*/
|
*/
|
||||||
@@ -270,8 +250,6 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
|
|||||||
contentClassName += " hasHiddenItems";
|
contentClassName += " hasHiddenItems";
|
||||||
}
|
}
|
||||||
|
|
||||||
const style = this.props.styles?.root || {};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="commandButtonReact">
|
<div className="commandButtonReact">
|
||||||
<span
|
<span
|
||||||
@@ -284,7 +262,6 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
|
|||||||
aria-disabled={this.props.disabled}
|
aria-disabled={this.props.disabled}
|
||||||
aria-haspopup={this.props.hasPopup}
|
aria-haspopup={this.props.hasPopup}
|
||||||
aria-label={this.props.ariaLabel}
|
aria-label={this.props.ariaLabel}
|
||||||
style={style}
|
|
||||||
onClick={(e: React.MouseEvent<HTMLSpanElement>) => this.commandClickCallback(e)}
|
onClick={(e: React.MouseEvent<HTMLSpanElement>) => this.commandClickCallback(e)}
|
||||||
>
|
>
|
||||||
<div className={contentClassName}>
|
<div className={contentClassName}>
|
||||||
|
|||||||
@@ -179,18 +179,8 @@ export const Dialog: FC = () => {
|
|||||||
title,
|
title,
|
||||||
subText,
|
subText,
|
||||||
styles: {
|
styles: {
|
||||||
title: {
|
title: { fontSize: DIALOG_TITLE_FONT_SIZE, fontWeight: DIALOG_TITLE_FONT_WEIGHT },
|
||||||
fontSize: DIALOG_TITLE_FONT_SIZE,
|
subText: { fontSize: DIALOG_SUBTEXT_FONT_SIZE },
|
||||||
fontWeight: DIALOG_TITLE_FONT_WEIGHT,
|
|
||||||
},
|
|
||||||
subText: {
|
|
||||||
fontSize: DIALOG_SUBTEXT_FONT_SIZE,
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
showCloseButton: showCloseButton || false,
|
showCloseButton: showCloseButton || false,
|
||||||
onDismiss,
|
onDismiss,
|
||||||
@@ -198,60 +188,18 @@ export const Dialog: FC = () => {
|
|||||||
modalProps: { isBlocking: isModal, isDarkOverlay: false },
|
modalProps: { isBlocking: isModal, isDarkOverlay: false },
|
||||||
minWidth: DIALOG_MIN_WIDTH,
|
minWidth: DIALOG_MIN_WIDTH,
|
||||||
maxWidth: DIALOG_MAX_WIDTH,
|
maxWidth: DIALOG_MAX_WIDTH,
|
||||||
styles: {
|
|
||||||
main: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
selectors: {
|
|
||||||
".ms-Dialog-title": { color: "var(--colorNeutralForeground1)" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const primaryButtonProps: IButtonProps = {
|
const primaryButtonProps: IButtonProps = {
|
||||||
text: primaryButtonText,
|
text: primaryButtonText,
|
||||||
disabled: primaryButtonDisabled || false,
|
disabled: primaryButtonDisabled || false,
|
||||||
onClick: onPrimaryButtonClick,
|
onClick: onPrimaryButtonClick,
|
||||||
styles: {
|
|
||||||
root: {
|
|
||||||
backgroundColor: "var(--colorBrandBackground)",
|
|
||||||
color: "var(--colorNeutralForegroundOnBrand)",
|
|
||||||
selectors: {
|
|
||||||
":hover": {
|
|
||||||
backgroundColor: "var(--colorBrandBackgroundHover)",
|
|
||||||
color: "var(--colorNeutralForegroundOnBrand)",
|
|
||||||
},
|
|
||||||
":active": {
|
|
||||||
backgroundColor: "var(--colorBrandBackgroundPressed)",
|
|
||||||
color: "var(--colorNeutralForegroundOnBrand)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
const secondaryButtonProps: IButtonProps =
|
const secondaryButtonProps: IButtonProps =
|
||||||
secondaryButtonText && onSecondaryButtonClick
|
secondaryButtonText && onSecondaryButtonClick
|
||||||
? {
|
? {
|
||||||
text: secondaryButtonText,
|
text: secondaryButtonText,
|
||||||
onClick: onSecondaryButtonClick,
|
onClick: onSecondaryButtonClick,
|
||||||
styles: {
|
|
||||||
root: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
selectors: {
|
|
||||||
":hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground3)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
":active": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground3)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
borderColor: "var(--colorCompoundBrandStroke1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
: undefined;
|
: undefined;
|
||||||
return visible ? (
|
return visible ? (
|
||||||
@@ -266,9 +214,9 @@ export const Dialog: FC = () => {
|
|||||||
{contentHtml}
|
{contentHtml}
|
||||||
{progressIndicatorProps && <ProgressIndicator {...progressIndicatorProps} />}
|
{progressIndicatorProps && <ProgressIndicator {...progressIndicatorProps} />}
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<PrimaryButton {...primaryButtonProps} data-test={`DialogButton:${primaryButtonText}`} />
|
<PrimaryButton {...primaryButtonProps} data-testid={`DialogButton:${primaryButtonText}`} />
|
||||||
{secondaryButtonProps && (
|
{secondaryButtonProps && (
|
||||||
<DefaultButton {...secondaryButtonProps} data-test={`DialogButton:${secondaryButtonText}`} />
|
<DefaultButton {...secondaryButtonProps} data-testid={`DialogButton:${secondaryButtonText}`} />
|
||||||
)}
|
)}
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</FluentDialog>
|
</FluentDialog>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Spinner, SpinnerSize } from "@fluentui/react";
|
import { Spinner, SpinnerSize } from "@fluentui/react";
|
||||||
import { monacoTheme, useThemeStore } from "hooks/useTheme";
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { loadMonaco, monaco } from "../../LazyMonaco";
|
import { loadMonaco, monaco } from "../../LazyMonaco";
|
||||||
// import "./EditorReact.less";
|
// import "./EditorReact.less";
|
||||||
@@ -67,7 +66,6 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
private rootNode: HTMLElement;
|
private rootNode: HTMLElement;
|
||||||
public editor: monaco.editor.IStandaloneCodeEditor;
|
public editor: monaco.editor.IStandaloneCodeEditor;
|
||||||
private selectionListener: monaco.IDisposable;
|
private selectionListener: monaco.IDisposable;
|
||||||
private themeUnsubscribe: () => void;
|
|
||||||
monacoApi: {
|
monacoApi: {
|
||||||
default: typeof monaco;
|
default: typeof monaco;
|
||||||
Emitter: typeof monaco.Emitter;
|
Emitter: typeof monaco.Emitter;
|
||||||
@@ -96,13 +94,6 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
public componentDidMount(): void {
|
public componentDidMount(): void {
|
||||||
this.createEditor(this.configureEditor.bind(this));
|
this.createEditor(this.configureEditor.bind(this));
|
||||||
|
|
||||||
this.themeUnsubscribe = useThemeStore.subscribe((state) => {
|
|
||||||
if (this.editor) {
|
|
||||||
const newTheme = state.isDarkMode ? "vs-dark" : "vs";
|
|
||||||
this.monacoApi?.editor.setTheme(newTheme);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const suggestionWidget = this.editor?.getDomNode()?.querySelector(".suggest-widget") as HTMLElement;
|
const suggestionWidget = this.editor?.getDomNode()?.querySelector(".suggest-widget") as HTMLElement;
|
||||||
if (suggestionWidget) {
|
if (suggestionWidget) {
|
||||||
@@ -137,7 +128,6 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
|
|
||||||
public componentWillUnmount(): void {
|
public componentWillUnmount(): void {
|
||||||
this.selectionListener && this.selectionListener.dispose();
|
this.selectionListener && this.selectionListener.dispose();
|
||||||
this.themeUnsubscribe && this.themeUnsubscribe();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
@@ -147,7 +137,7 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
<Spinner size={SpinnerSize.large} className={this.props.spinnerClassName || "spinner"} />
|
<Spinner size={SpinnerSize.large} className={this.props.spinnerClassName || "spinner"} />
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
data-test="EditorReact/Host/Unloaded"
|
data-testid="EditorReact/Host/Unloaded"
|
||||||
className={this.props.className || "jsonEditor"}
|
className={this.props.className || "jsonEditor"}
|
||||||
style={this.props.monacoContainerStyles}
|
style={this.props.monacoContainerStyles}
|
||||||
ref={(elt: HTMLElement) => this.setRef(elt)}
|
ref={(elt: HTMLElement) => this.setRef(elt)}
|
||||||
@@ -158,7 +148,7 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
|
|
||||||
protected configureEditor(editor: monaco.editor.IStandaloneCodeEditor) {
|
protected configureEditor(editor: monaco.editor.IStandaloneCodeEditor) {
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
this.rootNode.dataset["test"] = "EditorReact/Host/Loaded";
|
this.rootNode.dataset["testid"] = "EditorReact/Host/Loaded";
|
||||||
|
|
||||||
// In development, we want to be able to access the editor instance from the console
|
// In development, we want to be able to access the editor instance from the console
|
||||||
if (process.env.NODE_ENV === "development") {
|
if (process.env.NODE_ENV === "development") {
|
||||||
@@ -221,7 +211,7 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
ariaLabel: this.props.ariaLabel,
|
ariaLabel: this.props.ariaLabel,
|
||||||
fontSize: this.props.fontSize || 12,
|
fontSize: this.props.fontSize || 12,
|
||||||
automaticLayout: true,
|
automaticLayout: true,
|
||||||
theme: monacoTheme(),
|
theme: this.props.theme,
|
||||||
wordWrap: this.props.wordWrap || "off",
|
wordWrap: this.props.wordWrap || "off",
|
||||||
lineNumbers: this.props.lineNumbers || "off",
|
lineNumbers: this.props.lineNumbers || "off",
|
||||||
lineNumbersMinChars: this.props.lineNumbersMinChars,
|
lineNumbersMinChars: this.props.lineNumbersMinChars,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import {
|
|||||||
DefaultButton,
|
DefaultButton,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
IDropdownOption,
|
IDropdownOption,
|
||||||
IDropdownStyles,
|
|
||||||
IStyleFunctionOrObject,
|
IStyleFunctionOrObject,
|
||||||
ITextFieldStyleProps,
|
ITextFieldStyleProps,
|
||||||
ITextFieldStyles,
|
ITextFieldStyles,
|
||||||
@@ -36,167 +35,31 @@ export interface FullTextPolicyData {
|
|||||||
const labelStyles = {
|
const labelStyles = {
|
||||||
root: {
|
root: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const textFieldStyles: IStyleFunctionOrObject<ITextFieldStyleProps, ITextFieldStyles> = {
|
const textFieldStyles: IStyleFunctionOrObject<ITextFieldStyleProps, ITextFieldStyles> = {
|
||||||
fieldGroup: {
|
fieldGroup: {
|
||||||
height: 27,
|
height: 27,
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
},
|
||||||
field: {
|
field: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
padding: "0 8px",
|
padding: "0 8px",
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
},
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
input: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"input:focus": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorBrandBackground)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const dropdownStyles: Partial<IDropdownStyles> = {
|
const dropdownStyles = {
|
||||||
root: {
|
title: {
|
||||||
width: "40%",
|
height: 27,
|
||||||
marginTop: "10px",
|
lineHeight: "24px",
|
||||||
selectors: {
|
fontSize: 12,
|
||||||
"&:hover .ms-Dropdown-title": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"&:hover span.ms-Dropdown-title": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:focus .ms-Dropdown-title": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
},
|
|
||||||
"&:focus span.ms-Dropdown-title": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
dropdown: {
|
dropdown: {
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
height: 27,
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
lineHeight: "24px",
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:focus": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:hover .ms-Dropdown-titleText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:focus .ms-Dropdown-titleText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"& .ms-Dropdown-titleText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&.ms-Dropdown-title--hasPlaceholder": {
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
errorMessage: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
caretDown: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
callout: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
border: "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
dropdownItems: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
},
|
},
|
||||||
dropdownItem: {
|
dropdownItem: {
|
||||||
backgroundColor: "transparent",
|
fontSize: 12,
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
minHeight: "36px",
|
|
||||||
lineHeight: "36px",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:hover .ms-Dropdown-optionText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:focus": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:active": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"& .ms-Dropdown-optionText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dropdownItemSelected: {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.08)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
minHeight: "36px",
|
|
||||||
lineHeight: "36px",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:hover .ms-Dropdown-optionText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:focus": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:active": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"& .ms-Dropdown-optionText": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dropdownOptionText: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
dropdownItemHeader: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -363,32 +226,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
|
|||||||
</Stack>
|
</Stack>
|
||||||
</CollapsibleSectionComponent>
|
</CollapsibleSectionComponent>
|
||||||
))}
|
))}
|
||||||
<DefaultButton
|
<DefaultButton id={`add-vector-policy`} styles={{ root: { maxWidth: 170, fontSize: 12 } }} onClick={onAdd}>
|
||||||
id={`add-vector-policy`}
|
|
||||||
styles={{
|
|
||||||
root: {
|
|
||||||
maxWidth: 170,
|
|
||||||
fontSize: 12,
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
rootHovered: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderColor: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
rootPressed: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderColor: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
rootDisabled: {
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onClick={onAdd}
|
|
||||||
>
|
|
||||||
Add full text path
|
Add full text path
|
||||||
</DefaultButton>
|
</DefaultButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export const InputDataList: FC<InputDataListProps> = ({
|
|||||||
<>
|
<>
|
||||||
<Input
|
<Input
|
||||||
id="filterInput"
|
id="filterInput"
|
||||||
data-test={"DocumentsTab/FilterInput"}
|
data-testid={"DocumentsTab/FilterInput"}
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: var(--colorNeutralBackground1);
|
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settingsV2ToolTip {
|
.settingsV2ToolTip {
|
||||||
@@ -25,8 +23,6 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: @DataExplorerFont;
|
font-family: @DataExplorerFont;
|
||||||
background-color: var(--colorNeutralBackground1);
|
|
||||||
color: var(--colorNeutralForeground1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settingsV2Editor {
|
.settingsV2Editor {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IPivotItemProps, IPivotProps, Pivot, PivotItem, Stack } from "@fluentui/react";
|
import { IPivotItemProps, IPivotProps, Pivot, PivotItem } from "@fluentui/react";
|
||||||
import { sendMessage } from "Common/MessageHandler";
|
import { sendMessage } from "Common/MessageHandler";
|
||||||
import { FabricMessageTypes } from "Contracts/FabricMessageTypes";
|
import { FabricMessageTypes } from "Contracts/FabricMessageTypes";
|
||||||
import {
|
import {
|
||||||
@@ -1477,111 +1477,28 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
selectedKey: SettingsV2TabTypes[this.state.selectedTab],
|
selectedKey: SettingsV2TabTypes[this.state.selectedTab],
|
||||||
};
|
};
|
||||||
|
|
||||||
const pivotStyles = {
|
const pivotItems = tabs.map((tab) => {
|
||||||
root: {
|
const pivotItemProps: IPivotItemProps = {
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
itemKey: SettingsV2TabTypes[tab.tab],
|
||||||
color: "var(--colorNeutralForeground1)",
|
style: { marginTop: 20 },
|
||||||
selectors: {
|
headerText: getTabTitle(tab.tab),
|
||||||
"& .ms-Pivot-link": {
|
};
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"& .ms-Pivot-link.is-selected::before": {
|
|
||||||
backgroundColor: "var(--colorCompoundBrandBackground)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
link: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:active": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
'&[aria-selected="true"]': {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:active": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
itemContainer: {
|
return (
|
||||||
// padding: '20px 24px',
|
<PivotItem key={pivotItemProps.itemKey} {...pivotItemProps}>
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
{tab.content}
|
||||||
color: "var(--colorNeutralForeground1)",
|
</PivotItem>
|
||||||
},
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
const contentStyles = {
|
|
||||||
root: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
// padding: '20px 24px'
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="settingsV2MainContainer">
|
||||||
className="settingsV2MainContainer"
|
|
||||||
style={
|
|
||||||
{
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
position: "relative",
|
|
||||||
} as React.CSSProperties
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{this.shouldShowKeyspaceSharedThroughputMessage() && (
|
{this.shouldShowKeyspaceSharedThroughputMessage() && (
|
||||||
<div>This table shared throughput is configured at the keyspace</div>
|
<div>This table shared throughput is configured at the keyspace</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div
|
<div className="settingsV2TabsContainer">
|
||||||
className="settingsV2TabsContainer"
|
<Pivot {...pivotProps}>{pivotItems}</Pivot>
|
||||||
style={
|
|
||||||
{
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
position: "relative",
|
|
||||||
padding: "20px 24px",
|
|
||||||
} as React.CSSProperties
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Pivot {...pivotProps} styles={pivotStyles}>
|
|
||||||
{tabs.map((tab) => {
|
|
||||||
const pivotItemProps: IPivotItemProps = {
|
|
||||||
itemKey: SettingsV2TabTypes[tab.tab],
|
|
||||||
style: {
|
|
||||||
marginTop: 20,
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
headerText: getTabTitle(tab.tab),
|
|
||||||
headerButtonProps: {
|
|
||||||
"data-test": `settings-tab-header/${SettingsV2TabTypes[tab.tab]}`,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PivotItem key={pivotItemProps.itemKey} {...pivotItemProps}>
|
|
||||||
<Stack styles={contentStyles}>{tab.content}</Stack>
|
|
||||||
</PivotItem>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Pivot>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export interface PriceBreakdown {
|
|||||||
|
|
||||||
export type editorType = "indexPolicy" | "computedProperties" | "dataMasking";
|
export type editorType = "indexPolicy" | "computedProperties" | "dataMasking";
|
||||||
|
|
||||||
export const infoAndToolTipTextStyle: ITextStyles = { root: { fontSize: 14, color: "var(--colorNeutralForeground1)" } };
|
export const infoAndToolTipTextStyle: ITextStyles = { root: { fontSize: 14, color: "windowtext" } };
|
||||||
|
|
||||||
export const noLeftPaddingCheckBoxStyle: ICheckboxStyles = {
|
export const noLeftPaddingCheckBoxStyle: ICheckboxStyles = {
|
||||||
label: {
|
label: {
|
||||||
@@ -119,89 +119,15 @@ export const addMongoIndexSubElementsTokens: IStackTokens = {
|
|||||||
|
|
||||||
export const mediumWidthStackStyles: IStackStyles = { root: { width: 600 } };
|
export const mediumWidthStackStyles: IStackStyles = { root: { width: 600 } };
|
||||||
|
|
||||||
export const shortWidthTextFieldStyles: Partial<ITextFieldStyles> = {
|
export const shortWidthTextFieldStyles: Partial<ITextFieldStyles> = { root: { paddingLeft: 10, width: 210 } };
|
||||||
root: { paddingLeft: 10, width: 210 },
|
|
||||||
fieldGroup: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
field: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const shortWidthDropDownStyles: Partial<IDropdownStyles> = {
|
export const shortWidthDropDownStyles: Partial<IDropdownStyles> = { dropdown: { paddingleft: 10, width: 202 } };
|
||||||
dropdown: { paddingLeft: 10, width: 202 },
|
|
||||||
title: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
caretDown: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
callout: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
border: "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
dropdownItems: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
},
|
|
||||||
dropdownItem: {
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:focus": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dropdownItemSelected: {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.08)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dropdownOptionText: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const transparentDetailsRowStyles: Partial<IDetailsRowStyles> = {
|
export const transparentDetailsRowStyles: Partial<IDetailsRowStyles> = {
|
||||||
root: {
|
root: {
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
selectors: {
|
||||||
":hover": {
|
":hover": {
|
||||||
backgroundColor: "var(--colorNeutralBackground1Hover)",
|
background: "transparent",
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
":hover .ms-DetailsRow-cell": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1Hover)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&.ms-DetailsRow": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
cell: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
":hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1Hover)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -209,11 +135,9 @@ export const transparentDetailsRowStyles: Partial<IDetailsRowStyles> = {
|
|||||||
|
|
||||||
export const transparentDetailsHeaderStyle: Partial<IDetailsColumnStyles> = {
|
export const transparentDetailsHeaderStyle: Partial<IDetailsColumnStyles> = {
|
||||||
root: {
|
root: {
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
selectors: {
|
||||||
":hover": {
|
":hover": {
|
||||||
background: "var(--colorNeutralBackground1Hover)",
|
background: "transparent",
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -225,35 +149,6 @@ export const customDetailsListStyles: Partial<IDetailsListStyles> = {
|
|||||||
".ms-FocusZone": {
|
".ms-FocusZone": {
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
},
|
},
|
||||||
".ms-DetailsHeader": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsHeader-cell": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
selectors: {
|
|
||||||
":hover": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1Hover)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
".ms-DetailsHeader-cellTitle": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsRow": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsRow-cell": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
// Tooltip styling for cells
|
|
||||||
".ms-TooltipHost": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsRow-cell .ms-TooltipHost": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -271,18 +166,7 @@ export const separatorStyles: Partial<ISeparatorStyles> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const messageBarStyles: Partial<IMessageBarStyles> = {
|
export const messageBarStyles: Partial<IMessageBarStyles> = {
|
||||||
root: {
|
root: { marginTop: "5px", backgroundColor: "white" },
|
||||||
marginTop: "5px",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
selectors: {
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground4)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground3)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
text: { fontSize: 14 },
|
text: { fontSize: 14 },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -338,11 +222,9 @@ export const getEstimatedSpendingElement = (
|
|||||||
const ruRange: string = isAutoscale ? throughput / 10 + " RU/s - " : "";
|
const ruRange: string = isAutoscale ? throughput / 10 + " RU/s - " : "";
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text style={{ fontWeight: 600, color: "var(--colorNeutralForeground1)" }}>Cost estimate*</Text>
|
<Text style={{ fontWeight: 600 }}>Cost estimate*</Text>
|
||||||
{costElement}
|
{costElement}
|
||||||
<Text style={{ fontWeight: 600, marginTop: 15, color: "var(--colorNeutralForeground1)" }}>
|
<Text style={{ fontWeight: 600, marginTop: 15 }}>How we calculate this</Text>
|
||||||
How we calculate this
|
|
||||||
</Text>
|
|
||||||
<Stack id="throughputSpendElement" style={{ marginTop: 5 }}>
|
<Stack id="throughputSpendElement" style={{ marginTop: 5 }}>
|
||||||
<span>
|
<span>
|
||||||
{numberOfRegions} region{numberOfRegions > 1 && <span>s</span>}
|
{numberOfRegions} region{numberOfRegions > 1 && <span>s</span>}
|
||||||
@@ -356,7 +238,7 @@ export const getEstimatedSpendingElement = (
|
|||||||
{priceBreakdown.pricePerRu}/RU
|
{priceBreakdown.pricePerRu}/RU
|
||||||
</span>
|
</span>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text style={{ marginTop: 15, color: "var(--colorNeutralForeground1)" }}>
|
<Text style={{ marginTop: 15 }}>
|
||||||
<em>*{estimatedCostDisclaimer}</em>
|
<em>*{estimatedCostDisclaimer}</em>
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -403,7 +285,7 @@ export const updateThroughputDelayedApplyWarningMessage: JSX.Element = (
|
|||||||
|
|
||||||
export const getUpdateThroughputBeyondInstantLimitMessage = (instantMaximumThroughput: number): JSX.Element => {
|
export const getUpdateThroughputBeyondInstantLimitMessage = (instantMaximumThroughput: number): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<Text id="updateThroughputDelayedApplyWarningMessage">
|
<Text styles={infoAndToolTipTextStyle} id="updateThroughputDelayedApplyWarningMessage">
|
||||||
Scaling up will take 4-6 hours as it exceeds what Azure Cosmos DB can instantly support currently based on your
|
Scaling up will take 4-6 hours as it exceeds what Azure Cosmos DB can instantly support currently based on your
|
||||||
number of physical partitions. You can increase your throughput to {instantMaximumThroughput} instantly or proceed
|
number of physical partitions. You can increase your throughput to {instantMaximumThroughput} instantly or proceed
|
||||||
with this value and wait until the scale-up is completed.
|
with this value and wait until the scale-up is completed.
|
||||||
@@ -421,7 +303,7 @@ export const getUpdateThroughputBeyondSupportLimitMessage = (
|
|||||||
Your request to increase throughput exceeds the pre-allocated capacity which may take longer than expected.
|
Your request to increase throughput exceeds the pre-allocated capacity which may take longer than expected.
|
||||||
There are three options you can choose from to proceed:
|
There are three options you can choose from to proceed:
|
||||||
</Text>
|
</Text>
|
||||||
<ol style={{ fontSize: 14, color: "var(--colorNeutralForeground1)", marginTop: "5px" }}>
|
<ol style={{ fontSize: 14, color: "windowtext", marginTop: "5px" }}>
|
||||||
<li>You can instantly scale up to {instantMaximumThroughput} RU/s.</li>
|
<li>You can instantly scale up to {instantMaximumThroughput} RU/s.</li>
|
||||||
{instantMaximumThroughput < maximumThroughput && (
|
{instantMaximumThroughput < maximumThroughput && (
|
||||||
<li>You can asynchronously scale up to any value under {maximumThroughput} RU/s in 4-6 hours.</li>
|
<li>You can asynchronously scale up to any value under {maximumThroughput} RU/s in 4-6 hours.</li>
|
||||||
@@ -457,7 +339,7 @@ export const getUpdateThroughputBelowMinimumMessage = (minimum: number): JSX.Ele
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const saveThroughputWarningMessage: JSX.Element = (
|
export const saveThroughputWarningMessage: JSX.Element = (
|
||||||
<Text>
|
<Text styles={infoAndToolTipTextStyle}>
|
||||||
Your bill will be affected as you update your throughput settings. Please review the updated cost estimate below
|
Your bill will be affected as you update your throughput settings. Please review the updated cost estimate below
|
||||||
before saving your changes
|
before saving your changes
|
||||||
</Text>
|
</Text>
|
||||||
@@ -577,13 +459,9 @@ export const changeFeedPolicyToolTip: JSX.Element = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const mongoIndexingPolicyDisclaimer: JSX.Element = (
|
export const mongoIndexingPolicyDisclaimer: JSX.Element = (
|
||||||
<Text style={{ color: "var(--colorNeutralForeground1)" }}>
|
<Text>
|
||||||
For queries that filter on multiple properties, create multiple single field indexes instead of a compound index.
|
For queries that filter on multiple properties, create multiple single field indexes instead of a compound index.
|
||||||
<Link
|
<Link href="https://docs.microsoft.com/azure/cosmos-db/mongodb-indexing#index-types" target="_blank">
|
||||||
href="https://docs.microsoft.com/azure/cosmos-db/mongodb-indexing#index-types"
|
|
||||||
target="_blank"
|
|
||||||
style={{ color: "var(--colorBrandForeground1)" }}
|
|
||||||
>
|
|
||||||
{` Compound indexes `}
|
{` Compound indexes `}
|
||||||
</Link>
|
</Link>
|
||||||
are only used for sorting query results. If you need to add a compound index, you can create one using the Mongo
|
are only used for sorting query results. If you need to add a compound index, you can create one using the Mongo
|
||||||
@@ -592,7 +470,7 @@ export const mongoIndexingPolicyDisclaimer: JSX.Element = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const mongoCompoundIndexNotSupportedMessage: JSX.Element = (
|
export const mongoCompoundIndexNotSupportedMessage: JSX.Element = (
|
||||||
<Text style={{ color: "var(--colorNeutralForeground1)" }}>
|
<Text>
|
||||||
Collections with compound indexes are not yet supported in the indexing editor. To modify indexing policy for this
|
Collections with compound indexes are not yet supported in the indexing editor. To modify indexing policy for this
|
||||||
collection, use the Mongo Shell.
|
collection, use the Mongo Shell.
|
||||||
</Text>
|
</Text>
|
||||||
@@ -641,50 +519,14 @@ export const getTextFieldStyles = (current: isDirtyTypes, baseline: isDirtyTypes
|
|||||||
fieldGroup: {
|
fieldGroup: {
|
||||||
height: 25,
|
height: 25,
|
||||||
width: 300,
|
width: 300,
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
borderColor: isDirty(current, baseline) ? StyleConstants.Dirty : "",
|
||||||
borderColor: isDirty(current, baseline) ? StyleConstants.Dirty : "var(--colorNeutralStroke1)",
|
|
||||||
selectors: {
|
selectors: {
|
||||||
":disabled": {
|
":disabled": {
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
backgroundColor: StyleConstants.BaseMedium,
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
borderColor: StyleConstants.BaseMediumHigh,
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
"input#autopilotInput": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground4)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
field: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
":disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
subComponentStyles: {
|
|
||||||
label: {
|
|
||||||
root: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
suffix: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
border: "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getChoiceGroupStyles = (
|
export const getChoiceGroupStyles = (
|
||||||
@@ -692,28 +534,6 @@ export const getChoiceGroupStyles = (
|
|||||||
baseline: isDirtyTypes,
|
baseline: isDirtyTypes,
|
||||||
isHorizontal?: boolean,
|
isHorizontal?: boolean,
|
||||||
): Partial<IChoiceGroupStyles> => ({
|
): Partial<IChoiceGroupStyles> => ({
|
||||||
label: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceFieldLabel": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceField-innerField": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-innerField": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
flexContainer: [
|
flexContainer: [
|
||||||
{
|
{
|
||||||
selectors: {
|
selectors: {
|
||||||
@@ -728,16 +548,6 @@ export const getChoiceGroupStyles = (
|
|||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontFamily: StyleConstants.DataExplorerFont,
|
fontFamily: StyleConstants.DataExplorerFont,
|
||||||
padding: "2px 5px",
|
padding: "2px 5px",
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel:hover": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
display: isHorizontal ? "inline-flex" : "default",
|
display: isHorizontal ? "inline-flex" : "default",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { FontIcon, IMessageBarStyles, Link, MessageBar, MessageBarType, Stack, Text } from "@fluentui/react";
|
import { FontIcon, Link, MessageBar, MessageBarType, Stack, Text } from "@fluentui/react";
|
||||||
import * as DataModels from "Contracts/DataModels";
|
import * as DataModels from "Contracts/DataModels";
|
||||||
import { titleAndInputStackProps, unsavedEditorWarningMessage } from "Explorer/Controls/Settings/SettingsRenderUtils";
|
import { titleAndInputStackProps, unsavedEditorWarningMessage } from "Explorer/Controls/Settings/SettingsRenderUtils";
|
||||||
import { isDirty } from "Explorer/Controls/Settings/SettingsUtils";
|
import { isDirty } from "Explorer/Controls/Settings/SettingsUtils";
|
||||||
import { loadMonaco } from "Explorer/LazyMonaco";
|
import { loadMonaco } from "Explorer/LazyMonaco";
|
||||||
import { monacoTheme, useThemeStore } from "hooks/useTheme";
|
|
||||||
import * as monaco from "monaco-editor";
|
import * as monaco from "monaco-editor";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
export interface ComputedPropertiesComponentProps {
|
export interface ComputedPropertiesComponentProps {
|
||||||
computedPropertiesContent: DataModels.ComputedProperties;
|
computedPropertiesContent: DataModels.ComputedProperties;
|
||||||
computedPropertiesContentBaseline: DataModels.ComputedProperties;
|
computedPropertiesContentBaseline: DataModels.ComputedProperties;
|
||||||
@@ -27,24 +27,6 @@ export class ComputedPropertiesComponent extends React.Component<
|
|||||||
private shouldCheckComponentIsDirty = true;
|
private shouldCheckComponentIsDirty = true;
|
||||||
private computedPropertiesDiv = React.createRef<HTMLDivElement>();
|
private computedPropertiesDiv = React.createRef<HTMLDivElement>();
|
||||||
private computedPropertiesEditor: monaco.editor.IStandaloneCodeEditor;
|
private computedPropertiesEditor: monaco.editor.IStandaloneCodeEditor;
|
||||||
private themeUnsubscribe: () => void;
|
|
||||||
|
|
||||||
private darkThemeMessageBarStyles: Partial<IMessageBarStyles> = {
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
backgroundColor: "var(--colorStatusWarningBackground1)",
|
|
||||||
border: "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(props: ComputedPropertiesComponentProps) {
|
constructor(props: ComputedPropertiesComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -66,10 +48,6 @@ export class ComputedPropertiesComponent extends React.Component<
|
|||||||
this.onComponentUpdate();
|
this.onComponentUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount(): void {
|
|
||||||
this.themeUnsubscribe && this.themeUnsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
public resetComputedPropertiesEditor = (): void => {
|
public resetComputedPropertiesEditor = (): void => {
|
||||||
if (!this.computedPropertiesEditor) {
|
if (!this.computedPropertiesEditor) {
|
||||||
this.createComputedPropertiesEditor();
|
this.createComputedPropertiesEditor();
|
||||||
@@ -108,16 +86,8 @@ export class ComputedPropertiesComponent extends React.Component<
|
|||||||
value: value,
|
value: value,
|
||||||
language: "json",
|
language: "json",
|
||||||
ariaLabel: "Computed properties",
|
ariaLabel: "Computed properties",
|
||||||
theme: monacoTheme(),
|
|
||||||
});
|
});
|
||||||
if (this.computedPropertiesEditor) {
|
if (this.computedPropertiesEditor) {
|
||||||
// Subscribe to theme changes
|
|
||||||
this.themeUnsubscribe = useThemeStore.subscribe(() => {
|
|
||||||
if (this.computedPropertiesEditor) {
|
|
||||||
monaco.editor.setTheme(monacoTheme());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const computedPropertiesEditorModel = this.computedPropertiesEditor.getModel();
|
const computedPropertiesEditorModel = this.computedPropertiesEditor.getModel();
|
||||||
computedPropertiesEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
computedPropertiesEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
||||||
this.props.logComputedPropertiesSuccessMessage();
|
this.props.logComputedPropertiesSuccessMessage();
|
||||||
@@ -141,15 +111,11 @@ export class ComputedPropertiesComponent extends React.Component<
|
|||||||
return (
|
return (
|
||||||
<Stack {...titleAndInputStackProps}>
|
<Stack {...titleAndInputStackProps}>
|
||||||
{isDirty(this.props.computedPropertiesContent, this.props.computedPropertiesContentBaseline) && (
|
{isDirty(this.props.computedPropertiesContent, this.props.computedPropertiesContentBaseline) && (
|
||||||
<MessageBar
|
<MessageBar messageBarType={MessageBarType.warning}>
|
||||||
messageBarType={MessageBarType.warning}
|
|
||||||
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
|
||||||
styles={this.darkThemeMessageBarStyles}
|
|
||||||
>
|
|
||||||
{unsavedEditorWarningMessage("computedProperties")}
|
{unsavedEditorWarningMessage("computedProperties")}
|
||||||
</MessageBar>
|
</MessageBar>
|
||||||
)}
|
)}
|
||||||
<Text style={{ marginLeft: "30px", marginBottom: "10px", color: "var(--colorNeutralForeground1)" }}>
|
<Text style={{ marginLeft: "30px", marginBottom: "10px" }}>
|
||||||
<Link target="_blank" href="https://aka.ms/computed-properties-preview/">
|
<Link target="_blank" href="https://aka.ms/computed-properties-preview/">
|
||||||
{"Learn more"} <FontIcon iconName="NavigateExternalInline" />
|
{"Learn more"} <FontIcon iconName="NavigateExternalInline" />
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
conflictResolutionCustomToolTip,
|
conflictResolutionCustomToolTip,
|
||||||
conflictResolutionLwwTooltip,
|
conflictResolutionLwwTooltip,
|
||||||
getChoiceGroupStyles,
|
getChoiceGroupStyles,
|
||||||
|
getTextFieldStyles,
|
||||||
subComponentStackProps,
|
subComponentStackProps,
|
||||||
} from "../SettingsRenderUtils";
|
} from "../SettingsRenderUtils";
|
||||||
import { isDirty } from "../SettingsUtils";
|
import { isDirty } from "../SettingsUtils";
|
||||||
@@ -105,46 +106,10 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
|
|||||||
id="conflictResolutionLwwTextField"
|
id="conflictResolutionLwwTextField"
|
||||||
label={"Conflict Resolver Property"}
|
label={"Conflict Resolver Property"}
|
||||||
onRenderLabel={this.onRenderLwwComponentTextField}
|
onRenderLabel={this.onRenderLwwComponentTextField}
|
||||||
styles={{
|
styles={getTextFieldStyles(
|
||||||
fieldGroup: {
|
this.props.conflictResolutionPolicyPath,
|
||||||
height: 25,
|
this.props.conflictResolutionPolicyPathBaseline,
|
||||||
width: 300,
|
)}
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
selectors: {
|
|
||||||
":disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
field: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
":disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
subComponentStyles: {
|
|
||||||
label: {
|
|
||||||
root: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
value={this.props.conflictResolutionPolicyPath}
|
value={this.props.conflictResolutionPolicyPath}
|
||||||
onChange={this.onConflictResolutionPolicyPathChange}
|
onChange={this.onConflictResolutionPolicyPathChange}
|
||||||
/>
|
/>
|
||||||
@@ -154,57 +119,19 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
|
|||||||
<ToolTipLabelComponent label={props.label} toolTipElement={conflictResolutionCustomToolTip} />
|
<ToolTipLabelComponent label={props.label} toolTipElement={conflictResolutionCustomToolTip} />
|
||||||
);
|
);
|
||||||
|
|
||||||
private getConflictResolutionCustomComponent = (): JSX.Element => {
|
private getConflictResolutionCustomComponent = (): JSX.Element => (
|
||||||
return (
|
<TextField
|
||||||
<TextField
|
id="conflictResolutionCustomTextField"
|
||||||
id="conflictResolutionCustomTextField"
|
label="Stored procedure"
|
||||||
label="Stored procedure"
|
onRenderLabel={this.onRenderCustomComponentTextField}
|
||||||
onRenderLabel={this.onRenderCustomComponentTextField}
|
styles={getTextFieldStyles(
|
||||||
styles={{
|
this.props.conflictResolutionPolicyProcedure,
|
||||||
fieldGroup: {
|
this.props.conflictResolutionPolicyProcedureBaseline,
|
||||||
height: 25,
|
)}
|
||||||
width: 300,
|
value={this.props.conflictResolutionPolicyProcedure}
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
onChange={this.onConflictResolutionPolicyProcedureChange}
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
/>
|
||||||
selectors: {
|
);
|
||||||
":disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
borderColor: "var(--colorNeutralStroke1)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
field: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
selectors: {
|
|
||||||
":disabled": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground2)",
|
|
||||||
color: "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
subComponentStyles: {
|
|
||||||
label: {
|
|
||||||
root: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
value={this.props.conflictResolutionPolicyProcedure}
|
|
||||||
onChange={this.onConflictResolutionPolicyProcedureChange}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -102,57 +102,11 @@ export const ContainerPolicyComponent: React.FC<ContainerPolicyComponentProps> =
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Pivot
|
<Pivot onLinkClick={onPivotChange} selectedKey={ContainerPolicyTabTypes[selectedTab]}>
|
||||||
onLinkClick={onPivotChange}
|
|
||||||
selectedKey={ContainerPolicyTabTypes[selectedTab]}
|
|
||||||
styles={{
|
|
||||||
root: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
link: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
selectors: {
|
|
||||||
":hover": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
":active": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
linkIsSelected: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
selectors: {
|
|
||||||
":before": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorBrandForeground1)",
|
|
||||||
},
|
|
||||||
":hover": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
":active": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
linkContent: {
|
|
||||||
color: "inherit",
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
color: "inherit",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{isVectorSearchEnabled && (
|
{isVectorSearchEnabled && (
|
||||||
<PivotItem
|
<PivotItem
|
||||||
itemKey={ContainerPolicyTabTypes[ContainerPolicyTabTypes.VectorPolicyTab]}
|
itemKey={ContainerPolicyTabTypes[ContainerPolicyTabTypes.VectorPolicyTab]}
|
||||||
style={{ marginTop: 20, color: "var(--colorNeutralForeground1)" }}
|
style={{ marginTop: 20 }}
|
||||||
headerText="Vector Policy"
|
headerText="Vector Policy"
|
||||||
>
|
>
|
||||||
<Stack {...titleAndInputStackProps} styles={{ root: { position: "relative", maxWidth: "400px" } }}>
|
<Stack {...titleAndInputStackProps} styles={{ root: { position: "relative", maxWidth: "400px" } }}>
|
||||||
@@ -174,7 +128,7 @@ export const ContainerPolicyComponent: React.FC<ContainerPolicyComponentProps> =
|
|||||||
{isFullTextSearchEnabled && (
|
{isFullTextSearchEnabled && (
|
||||||
<PivotItem
|
<PivotItem
|
||||||
itemKey={ContainerPolicyTabTypes[ContainerPolicyTabTypes.FullTextPolicyTab]}
|
itemKey={ContainerPolicyTabTypes[ContainerPolicyTabTypes.FullTextPolicyTab]}
|
||||||
style={{ marginTop: 20, color: "var(--colorNeutralForeground1)" }}
|
style={{ marginTop: 20 }}
|
||||||
headerText="Full Text Policy"
|
headerText="Full Text Policy"
|
||||||
>
|
>
|
||||||
<Stack {...titleAndInputStackProps} styles={{ root: { position: "relative", maxWidth: "400px" } }}>
|
<Stack {...titleAndInputStackProps} styles={{ root: { position: "relative", maxWidth: "400px" } }}>
|
||||||
@@ -190,27 +144,7 @@ export const ContainerPolicyComponent: React.FC<ContainerPolicyComponentProps> =
|
|||||||
) : (
|
) : (
|
||||||
<DefaultButton
|
<DefaultButton
|
||||||
id={"create-full-text-policy"}
|
id={"create-full-text-policy"}
|
||||||
styles={{
|
styles={{ root: { fontSize: 12 } }}
|
||||||
root: {
|
|
||||||
fontSize: 12,
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderColor: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
rootHovered: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderColor: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
rootPressed: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderColor: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
rootDisabled: {
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
checkAndSendFullTextPolicyToSettings({
|
checkAndSendFullTextPolicyToSettings({
|
||||||
defaultLanguage: getFullTextLanguageOptions()[0].key as never,
|
defaultLanguage: getFullTextLanguageOptions()[0].key as never,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { IMessageBarStyles, MessageBar, MessageBarType, Stack } from "@fluentui/react";
|
import { MessageBar, MessageBarType, Stack } from "@fluentui/react";
|
||||||
import { monacoTheme, useThemeStore } from "hooks/useTheme";
|
|
||||||
import * as monaco from "monaco-editor";
|
import * as monaco from "monaco-editor";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as DataModels from "../../../../Contracts/DataModels";
|
import * as DataModels from "../../../../Contracts/DataModels";
|
||||||
@@ -7,6 +6,7 @@ import { loadMonaco } from "../../../LazyMonaco";
|
|||||||
import { titleAndInputStackProps, unsavedEditorWarningMessage } from "../SettingsRenderUtils";
|
import { titleAndInputStackProps, unsavedEditorWarningMessage } from "../SettingsRenderUtils";
|
||||||
import { isDirty, isIndexTransforming } from "../SettingsUtils";
|
import { isDirty, isIndexTransforming } from "../SettingsUtils";
|
||||||
import { IndexingPolicyRefreshComponent } from "./IndexingPolicyRefresh/IndexingPolicyRefreshComponent";
|
import { IndexingPolicyRefreshComponent } from "./IndexingPolicyRefresh/IndexingPolicyRefreshComponent";
|
||||||
|
|
||||||
export interface IndexingPolicyComponentProps {
|
export interface IndexingPolicyComponentProps {
|
||||||
shouldDiscardIndexingPolicy: boolean;
|
shouldDiscardIndexingPolicy: boolean;
|
||||||
resetShouldDiscardIndexingPolicy: () => void;
|
resetShouldDiscardIndexingPolicy: () => void;
|
||||||
@@ -31,24 +31,6 @@ export class IndexingPolicyComponent extends React.Component<
|
|||||||
private shouldCheckComponentIsDirty = true;
|
private shouldCheckComponentIsDirty = true;
|
||||||
private indexingPolicyDiv = React.createRef<HTMLDivElement>();
|
private indexingPolicyDiv = React.createRef<HTMLDivElement>();
|
||||||
private indexingPolicyEditor: monaco.editor.IStandaloneCodeEditor;
|
private indexingPolicyEditor: monaco.editor.IStandaloneCodeEditor;
|
||||||
private themeUnsubscribe: () => void;
|
|
||||||
|
|
||||||
private darkThemeMessageBarStyles: Partial<IMessageBarStyles> = {
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
backgroundColor: "var(--colorStatusWarningBackground1)",
|
|
||||||
border: "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(props: IndexingPolicyComponentProps) {
|
constructor(props: IndexingPolicyComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -70,10 +52,6 @@ export class IndexingPolicyComponent extends React.Component<
|
|||||||
this.onComponentUpdate();
|
this.onComponentUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount(): void {
|
|
||||||
this.themeUnsubscribe && this.themeUnsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
public resetIndexingPolicyEditor = (): void => {
|
public resetIndexingPolicyEditor = (): void => {
|
||||||
if (!this.indexingPolicyEditor) {
|
if (!this.indexingPolicyEditor) {
|
||||||
this.createIndexingPolicyEditor();
|
this.createIndexingPolicyEditor();
|
||||||
@@ -109,30 +87,18 @@ export class IndexingPolicyComponent extends React.Component<
|
|||||||
};
|
};
|
||||||
|
|
||||||
private async createIndexingPolicyEditor(): Promise<void> {
|
private async createIndexingPolicyEditor(): Promise<void> {
|
||||||
if (!this.indexingPolicyDiv.current) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const value: string = JSON.stringify(this.props.indexingPolicyContent, undefined, 4);
|
const value: string = JSON.stringify(this.props.indexingPolicyContent, undefined, 4);
|
||||||
const monaco = await loadMonaco();
|
const monaco = await loadMonaco();
|
||||||
if (this.indexingPolicyDiv.current) {
|
this.indexingPolicyEditor = monaco.editor.create(this.indexingPolicyDiv.current, {
|
||||||
this.indexingPolicyEditor = monaco.editor.create(this.indexingPolicyDiv.current, {
|
value: value,
|
||||||
value: value,
|
language: "json",
|
||||||
language: "json",
|
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
|
||||||
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
|
ariaLabel: "Indexing Policy",
|
||||||
ariaLabel: "Indexing Policy",
|
});
|
||||||
theme: monacoTheme(),
|
if (this.indexingPolicyEditor) {
|
||||||
});
|
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
|
||||||
if (this.indexingPolicyEditor) {
|
indexingPolicyEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
||||||
this.themeUnsubscribe = useThemeStore.subscribe(() => {
|
this.props.logIndexingPolicySuccessMessage();
|
||||||
if (this.indexingPolicyEditor) {
|
|
||||||
monaco.editor.setTheme(monacoTheme());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
|
|
||||||
indexingPolicyEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
|
||||||
this.props.logIndexingPolicySuccessMessage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,13 +121,7 @@ export class IndexingPolicyComponent extends React.Component<
|
|||||||
refreshIndexTransformationProgress={this.props.refreshIndexTransformationProgress}
|
refreshIndexTransformationProgress={this.props.refreshIndexTransformationProgress}
|
||||||
/>
|
/>
|
||||||
{isDirty(this.props.indexingPolicyContent, this.props.indexingPolicyContentBaseline) && (
|
{isDirty(this.props.indexingPolicyContent, this.props.indexingPolicyContentBaseline) && (
|
||||||
<MessageBar
|
<MessageBar messageBarType={MessageBarType.warning}>{unsavedEditorWarningMessage("indexPolicy")}</MessageBar>
|
||||||
messageBarType={MessageBarType.warning}
|
|
||||||
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
|
||||||
styles={this.darkThemeMessageBarStyles}
|
|
||||||
>
|
|
||||||
{unsavedEditorWarningMessage("indexPolicy")}
|
|
||||||
</MessageBar>
|
|
||||||
)}
|
)}
|
||||||
<div className="settingsV2Editor" tabIndex={0} ref={this.indexingPolicyDiv}></div>
|
<div className="settingsV2Editor" tabIndex={0} ref={this.indexingPolicyDiv}></div>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ exports[`IndexingPolicyRefreshComponent renders 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
DetailsListLayoutMode,
|
DetailsListLayoutMode,
|
||||||
IColumn,
|
IColumn,
|
||||||
IconButton,
|
IconButton,
|
||||||
IMessageBarStyles,
|
|
||||||
MessageBar,
|
MessageBar,
|
||||||
MessageBarType,
|
MessageBarType,
|
||||||
SelectionMode,
|
SelectionMode,
|
||||||
@@ -31,12 +30,12 @@ import {
|
|||||||
} from "../../SettingsRenderUtils";
|
} from "../../SettingsRenderUtils";
|
||||||
import {
|
import {
|
||||||
AddMongoIndexProps,
|
AddMongoIndexProps,
|
||||||
getMongoIndexType,
|
|
||||||
getMongoIndexTypeText,
|
|
||||||
isIndexTransforming,
|
|
||||||
MongoIndexIdField,
|
MongoIndexIdField,
|
||||||
MongoIndexTypes,
|
MongoIndexTypes,
|
||||||
MongoNotificationType,
|
MongoNotificationType,
|
||||||
|
getMongoIndexType,
|
||||||
|
getMongoIndexTypeText,
|
||||||
|
isIndexTransforming,
|
||||||
} from "../../SettingsUtils";
|
} from "../../SettingsUtils";
|
||||||
import { IndexingPolicyRefreshComponent } from "../IndexingPolicyRefresh/IndexingPolicyRefreshComponent";
|
import { IndexingPolicyRefreshComponent } from "../IndexingPolicyRefresh/IndexingPolicyRefreshComponent";
|
||||||
import { AddMongoIndexComponent } from "./AddMongoIndexComponent";
|
import { AddMongoIndexComponent } from "./AddMongoIndexComponent";
|
||||||
@@ -64,24 +63,6 @@ interface MongoIndexDisplayProps {
|
|||||||
export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingPolicyComponentProps> {
|
export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingPolicyComponentProps> {
|
||||||
private shouldCheckComponentIsDirty = true;
|
private shouldCheckComponentIsDirty = true;
|
||||||
private addMongoIndexComponentRefs: React.RefObject<AddMongoIndexComponent>[] = [];
|
private addMongoIndexComponentRefs: React.RefObject<AddMongoIndexComponent>[] = [];
|
||||||
|
|
||||||
private darkThemeMessageBarStyles: Partial<IMessageBarStyles> = {
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
backgroundColor: "var(--colorStatusWarningBackground1)",
|
|
||||||
border: "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
private initialIndexesColumns: IColumn[] = [
|
private initialIndexesColumns: IColumn[] = [
|
||||||
{ key: "definition", name: "Definition", fieldName: "definition", minWidth: 100, maxWidth: 200, isResizable: true },
|
{ key: "definition", name: "Definition", fieldName: "definition", minWidth: 100, maxWidth: 200, isResizable: true },
|
||||||
{ key: "type", name: "Type", fieldName: "type", minWidth: 100, maxWidth: 200, isResizable: true },
|
{ key: "type", name: "Type", fieldName: "type", minWidth: 100, maxWidth: 200, isResizable: true },
|
||||||
@@ -190,8 +171,8 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
|
|||||||
let mongoIndexDisplayProps: MongoIndexDisplayProps;
|
let mongoIndexDisplayProps: MongoIndexDisplayProps;
|
||||||
if (type) {
|
if (type) {
|
||||||
mongoIndexDisplayProps = {
|
mongoIndexDisplayProps = {
|
||||||
definition: <Text style={{ color: "var(--colorNeutralForeground1)" }}>{definition}</Text>,
|
definition: <Text>{definition}</Text>,
|
||||||
type: <Text style={{ color: "var(--colorNeutralForeground1)" }}>{getMongoIndexTypeText(type)}</Text>,
|
type: <Text>{getMongoIndexTypeText(type)}</Text>,
|
||||||
actionButton: definition === MongoIndexIdField ? <></> : this.getActionButton(arrayPosition, isCurrentIndex),
|
actionButton: definition === MongoIndexIdField ? <></> : this.getActionButton(arrayPosition, isCurrentIndex),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -325,15 +306,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
|
|||||||
indexTransformationProgress={this.props.indexTransformationProgress}
|
indexTransformationProgress={this.props.indexTransformationProgress}
|
||||||
refreshIndexTransformationProgress={this.props.refreshIndexTransformationProgress}
|
refreshIndexTransformationProgress={this.props.refreshIndexTransformationProgress}
|
||||||
/>
|
/>
|
||||||
{warningMessage && (
|
{warningMessage && <MessageBar messageBarType={MessageBarType.warning}>{warningMessage}</MessageBar>}
|
||||||
<MessageBar
|
|
||||||
messageBarType={MessageBarType.warning}
|
|
||||||
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
|
||||||
styles={this.darkThemeMessageBarStyles}
|
|
||||||
>
|
|
||||||
{warningMessage}
|
|
||||||
</MessageBar>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,14 +22,6 @@ exports[`AddMongoIndexComponent renders 1`] = `
|
|||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"field": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"fieldGroup": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"paddingLeft": 10,
|
"paddingLeft": 10,
|
||||||
"width": 210,
|
"width": 210,
|
||||||
@@ -57,52 +49,10 @@ exports[`AddMongoIndexComponent renders 1`] = `
|
|||||||
selectedKey="Single"
|
selectedKey="Single"
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"callout": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"caretDown": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"dropdown": {
|
"dropdown": {
|
||||||
"paddingLeft": 10,
|
"paddingleft": 10,
|
||||||
"width": 202,
|
"width": 202,
|
||||||
},
|
},
|
||||||
"dropdownItem": {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
"&:focus": {
|
|
||||||
"backgroundColor": "rgba(255, 255, 255, 0.1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"&:hover": {
|
|
||||||
"backgroundColor": "rgba(255, 255, 255, 0.1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"dropdownItemSelected": {
|
|
||||||
"backgroundColor": "rgba(255, 255, 255, 0.08)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
"&:hover": {
|
|
||||||
"backgroundColor": "rgba(255, 255, 255, 0.1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"dropdownItems": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
},
|
|
||||||
"dropdownOptionText": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`MongoIndexingPolicyComponent error shown for collection with compound indexes 1`] = `
|
exports[`MongoIndexingPolicyComponent error shown for collection with compound indexes 1`] = `
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Collections with compound indexes are not yet supported in the indexing editor. To modify indexing policy for this collection, use the Mongo Shell.
|
Collections with compound indexes are not yet supported in the indexing editor. To modify indexing policy for this collection, use the Mongo Shell.
|
||||||
</Text>
|
</Text>
|
||||||
`;
|
`;
|
||||||
@@ -23,21 +17,10 @@ exports[`MongoIndexingPolicyComponent renders 1`] = `
|
|||||||
<IndexingPolicyRefreshComponent
|
<IndexingPolicyRefreshComponent
|
||||||
refreshIndexTransformationProgress={[Function]}
|
refreshIndexTransformationProgress={[Function]}
|
||||||
/>
|
/>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
For queries that filter on multiple properties, create multiple single field indexes instead of a compound index.
|
For queries that filter on multiple properties, create multiple single field indexes instead of a compound index.
|
||||||
<StyledLinkBase
|
<StyledLinkBase
|
||||||
href="https://docs.microsoft.com/azure/cosmos-db/mongodb-indexing#index-types"
|
href="https://docs.microsoft.com/azure/cosmos-db/mongodb-indexing#index-types"
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorBrandForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Compound indexes
|
Compound indexes
|
||||||
@@ -100,37 +83,9 @@ exports[`MongoIndexingPolicyComponent renders 1`] = `
|
|||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"selectors": {
|
"selectors": {
|
||||||
".ms-DetailsHeader": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsHeader-cell": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
":hover": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground1Hover)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
".ms-DetailsHeader-cellTitle": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsRow": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsRow-cell": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-DetailsRow-cell .ms-TooltipHost": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-FocusZone": {
|
".ms-FocusZone": {
|
||||||
"paddingTop": 0,
|
"paddingTop": 0,
|
||||||
},
|
},
|
||||||
".ms-TooltipHost": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
DefaultButton,
|
DefaultButton,
|
||||||
FontWeights,
|
FontWeights,
|
||||||
IMessageBarStyles,
|
|
||||||
Link,
|
Link,
|
||||||
MessageBar,
|
MessageBar,
|
||||||
MessageBarType,
|
MessageBarType,
|
||||||
@@ -33,23 +32,6 @@ export interface PartitionKeyComponentProps {
|
|||||||
isReadOnly?: boolean; // true: cannot change partition key
|
isReadOnly?: boolean; // true: cannot change partition key
|
||||||
}
|
}
|
||||||
|
|
||||||
const darkThemeMessageBarStyles: Partial<IMessageBarStyles> = {
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
backgroundColor: "var(--colorStatusWarningBackground1)",
|
|
||||||
border: "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const PartitionKeyComponent: React.FC<PartitionKeyComponentProps> = ({
|
export const PartitionKeyComponent: React.FC<PartitionKeyComponentProps> = ({
|
||||||
database,
|
database,
|
||||||
collection,
|
collection,
|
||||||
@@ -84,15 +66,13 @@ export const PartitionKeyComponent: React.FC<PartitionKeyComponentProps> = ({
|
|||||||
const partitionKeyValue = getPartitionKeyValue();
|
const partitionKeyValue = getPartitionKeyValue();
|
||||||
|
|
||||||
const textHeadingStyle = {
|
const textHeadingStyle = {
|
||||||
root: { fontWeight: FontWeights.semibold, fontSize: 16, color: "var(--colorNeutralForeground1)" },
|
root: { fontWeight: FontWeights.semibold, fontSize: 16 },
|
||||||
};
|
};
|
||||||
|
|
||||||
const textSubHeadingStyle = {
|
const textSubHeadingStyle = {
|
||||||
root: { fontWeight: FontWeights.semibold, color: "var(--colorNeutralForeground1)" },
|
root: { fontWeight: FontWeights.semibold },
|
||||||
};
|
|
||||||
const textSubHeadingStyle1 = {
|
|
||||||
root: { color: "var(--colorNeutralForeground1)" },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const startPollingforUpdate = (currentJob: DataTransferJobGetResults) => {
|
const startPollingforUpdate = (currentJob: DataTransferJobGetResults) => {
|
||||||
if (isCurrentJobInProgress(currentJob)) {
|
if (isCurrentJobInProgress(currentJob)) {
|
||||||
const jobName = currentJob?.properties?.jobName;
|
const jobName = currentJob?.properties?.jobName;
|
||||||
@@ -187,41 +167,32 @@ export const PartitionKeyComponent: React.FC<PartitionKeyComponentProps> = ({
|
|||||||
<Text styles={textSubHeadingStyle}>Current {partitionKeyName.toLowerCase()}</Text>
|
<Text styles={textSubHeadingStyle}>Current {partitionKeyName.toLowerCase()}</Text>
|
||||||
<Text styles={textSubHeadingStyle}>Partitioning</Text>
|
<Text styles={textSubHeadingStyle}>Partitioning</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack tokens={{ childrenGap: 5 }} data-test="partition-key-values">
|
<Stack tokens={{ childrenGap: 5 }}>
|
||||||
<Text styles={textSubHeadingStyle1}>{partitionKeyValue}</Text>
|
<Text>{partitionKeyValue}</Text>
|
||||||
<Text styles={textSubHeadingStyle1}>
|
<Text>{isHierarchicalPartitionedContainer() ? "Hierarchical" : "Non-hierarchical"}</Text>
|
||||||
{isHierarchicalPartitionedContainer() ? "Hierarchical" : "Non-hierarchical"}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{!isReadOnly && (
|
{!isReadOnly && (
|
||||||
<>
|
<>
|
||||||
<MessageBar
|
<MessageBar messageBarType={MessageBarType.warning}>
|
||||||
data-test="partition-key-warning"
|
|
||||||
messageBarType={MessageBarType.warning}
|
|
||||||
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
|
||||||
styles={darkThemeMessageBarStyles}
|
|
||||||
>
|
|
||||||
To safeguard the integrity of the data being copied to the new container, ensure that no updates are made to
|
To safeguard the integrity of the data being copied to the new container, ensure that no updates are made to
|
||||||
the source container for the entire duration of the partition key change process.
|
the source container for the entire duration of the partition key change process.
|
||||||
<Link
|
<Link
|
||||||
href="https://learn.microsoft.com/azure/cosmos-db/container-copy#how-does-container-copy-work"
|
href="https://learn.microsoft.com/azure/cosmos-db/container-copy#how-does-container-copy-work"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
underline
|
underline
|
||||||
style={{ color: "var(--colorBrandForeground1)" }}
|
|
||||||
>
|
>
|
||||||
Learn more
|
Learn more
|
||||||
</Link>
|
</Link>
|
||||||
</MessageBar>
|
</MessageBar>
|
||||||
<Text styles={{ root: { color: "var(--colorNeutralForeground1)" } }}>
|
<Text>
|
||||||
To change the partition key, a new destination container must be created or an existing destination
|
To change the partition key, a new destination container must be created or an existing destination
|
||||||
container selected. Data will then be copied to the destination container.
|
container selected. Data will then be copied to the destination container.
|
||||||
</Text>
|
</Text>
|
||||||
{configContext.platform !== Platform.Emulator && (
|
{configContext.platform !== Platform.Emulator && (
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
data-test="change-partition-key-button"
|
|
||||||
styles={{ root: { width: "fit-content" } }}
|
styles={{ root: { width: "fit-content" } }}
|
||||||
text="Change"
|
text="Change"
|
||||||
onClick={startPartitionkeyChangeWorkflow}
|
onClick={startPartitionkeyChangeWorkflow}
|
||||||
|
|||||||
@@ -1,15 +1,4 @@
|
|||||||
import {
|
import { ChoiceGroup, IChoiceGroupOption, Label, Link, MessageBar, Stack, Text, TextField } from "@fluentui/react";
|
||||||
ChoiceGroup,
|
|
||||||
IChoiceGroupOption,
|
|
||||||
Label,
|
|
||||||
Link,
|
|
||||||
MessageBar,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
TextField,
|
|
||||||
TooltipHost,
|
|
||||||
mergeStyleSets,
|
|
||||||
} from "@fluentui/react";
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as ViewModels from "../../../../Contracts/ViewModels";
|
import * as ViewModels from "../../../../Contracts/ViewModels";
|
||||||
import { userContext } from "../../../../UserContext";
|
import { userContext } from "../../../../UserContext";
|
||||||
@@ -36,11 +25,6 @@ import {
|
|||||||
} from "../SettingsUtils";
|
} from "../SettingsUtils";
|
||||||
import { ToolTipLabelComponent } from "./ToolTipLabelComponent";
|
import { ToolTipLabelComponent } from "./ToolTipLabelComponent";
|
||||||
|
|
||||||
const classNames = mergeStyleSets({
|
|
||||||
hintText: {
|
|
||||||
color: "var(--colorNeutralForeground1)", // theme-aware
|
|
||||||
},
|
|
||||||
});
|
|
||||||
export interface SubSettingsComponentProps {
|
export interface SubSettingsComponentProps {
|
||||||
collection: ViewModels.Collection;
|
collection: ViewModels.Collection;
|
||||||
timeToLive: TtlType;
|
timeToLive: TtlType;
|
||||||
@@ -143,9 +127,9 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
|
|||||||
};
|
};
|
||||||
|
|
||||||
private ttlChoiceGroupOptions: IChoiceGroupOption[] = [
|
private ttlChoiceGroupOptions: IChoiceGroupOption[] = [
|
||||||
{ key: TtlType.Off, text: "Off", ariaLabel: "ttl-off-option" },
|
{ key: TtlType.Off, text: "Off" },
|
||||||
{ key: TtlType.OnNoDefault, text: "On (no default)", ariaLabel: "ttl-on-no-default-option" },
|
{ key: TtlType.OnNoDefault, text: "On (no default)" },
|
||||||
{ key: TtlType.On, text: "On", ariaLabel: "ttl-on-option" },
|
{ key: TtlType.On, text: "On" },
|
||||||
];
|
];
|
||||||
|
|
||||||
public getTtlValue = (value: string): TtlType => {
|
public getTtlValue = (value: string): TtlType => {
|
||||||
@@ -201,31 +185,13 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
|
|||||||
userContext.apiType === "Mongo" ? (
|
userContext.apiType === "Mongo" ? (
|
||||||
<MessageBar
|
<MessageBar
|
||||||
messageBarIconProps={{ iconName: "InfoSolid", className: "messageBarInfoIcon" }}
|
messageBarIconProps={{ iconName: "InfoSolid", className: "messageBarInfoIcon" }}
|
||||||
styles={{
|
styles={{ text: { fontSize: 14 } }}
|
||||||
root: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground1)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
fontSize: 14,
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
icon: {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Text style={{ color: "var(--colorNeutralForeground1)" }}>
|
To enable time-to-live (TTL) for your collection/documents,
|
||||||
To enable time-to-live (TTL) for your collection/documents,{" "}
|
<Link href="https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-time-to-live" target="_blank">
|
||||||
<Link
|
create a TTL index
|
||||||
href="https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-time-to-live"
|
</Link>
|
||||||
target="_blank"
|
.
|
||||||
style={{ color: "var(--colorBrandForeground1)" }}
|
|
||||||
>
|
|
||||||
create a TTL index
|
|
||||||
</Link>
|
|
||||||
.
|
|
||||||
</Text>
|
|
||||||
</MessageBar>
|
</MessageBar>
|
||||||
) : (
|
) : (
|
||||||
<Stack {...titleAndInputStackProps}>
|
<Stack {...titleAndInputStackProps}>
|
||||||
@@ -257,7 +223,6 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
|
|||||||
onChange={this.onTimeToLiveSecondsChange}
|
onChange={this.onTimeToLiveSecondsChange}
|
||||||
suffix="second(s)"
|
suffix="second(s)"
|
||||||
ariaLabel={`Time to live in seconds`}
|
ariaLabel={`Time to live in seconds`}
|
||||||
data-test="ttl-input"
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -353,34 +318,23 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
|
|||||||
private getPartitionKeyComponent = (): JSX.Element => (
|
private getPartitionKeyComponent = (): JSX.Element => (
|
||||||
<Stack {...titleAndInputStackProps}>
|
<Stack {...titleAndInputStackProps}>
|
||||||
{this.getPartitionKeyVisible() && (
|
{this.getPartitionKeyVisible() && (
|
||||||
<TooltipHost
|
<TextField
|
||||||
content={`This ${this.partitionKeyName.toLowerCase()} is used to distribute data across multiple partitions for scalability. The value "${
|
label={this.partitionKeyName}
|
||||||
this.partitionKeyValue
|
disabled
|
||||||
}" determines how documents are partitioned.`}
|
styles={getTextFieldStyles(undefined, undefined)}
|
||||||
styles={{
|
defaultValue={this.partitionKeyValue}
|
||||||
root: {
|
/>
|
||||||
display: "block",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TextField
|
|
||||||
label={this.partitionKeyName}
|
|
||||||
disabled
|
|
||||||
styles={getTextFieldStyles(undefined, undefined)}
|
|
||||||
defaultValue={this.partitionKeyValue}
|
|
||||||
/>
|
|
||||||
</TooltipHost>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{userContext.apiType === "SQL" && this.isLargePartitionKeyEnabled() && (
|
{userContext.apiType === "SQL" && this.isLargePartitionKeyEnabled() && (
|
||||||
<Text className={classNames.hintText}>Large {this.partitionKeyName.toLowerCase()} has been enabled.</Text>
|
<Text>Large {this.partitionKeyName.toLowerCase()} has been enabled.</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{userContext.apiType === "SQL" &&
|
{userContext.apiType === "SQL" &&
|
||||||
(this.isHierarchicalPartitionedContainer() ? (
|
(this.isHierarchicalPartitionedContainer() ? (
|
||||||
<Text className={classNames.hintText}>Hierarchically partitioned container.</Text>
|
<Text>Hierarchically partitioned container.</Text>
|
||||||
) : (
|
) : (
|
||||||
<Text className={classNames.hintText}>Non-hierarchically partitioned container.</Text>
|
<Text>Non-hierarchically partitioned container.</Text>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export const ThroughputBucketsComponent: FC<ThroughputBucketsComponentProps> = (
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack tokens={{ childrenGap: "m" }} styles={{ root: { width: "70%", maxWidth: 700 } }}>
|
<Stack tokens={{ childrenGap: "m" }} styles={{ root: { width: "70%", maxWidth: 700 } }}>
|
||||||
<Label styles={{ root: { color: "var(--colorNeutralForeground1)" } }}>Throughput Buckets</Label>
|
<Label>Throughput Buckets</Label>
|
||||||
<Stack>
|
<Stack>
|
||||||
{throughputBuckets?.map((bucket) => (
|
{throughputBuckets?.map((bucket) => (
|
||||||
<Stack key={bucket.id} horizontal tokens={{ childrenGap: 8 }} verticalAlign="center">
|
<Stack key={bucket.id} horizontal tokens={{ childrenGap: 8 }} verticalAlign="center">
|
||||||
@@ -77,15 +77,7 @@ export const ThroughputBucketsComponent: FC<ThroughputBucketsComponentProps> = (
|
|||||||
onChange={(newValue) => handleBucketChange(bucket.id, newValue)}
|
onChange={(newValue) => handleBucketChange(bucket.id, newValue)}
|
||||||
showValue={false}
|
showValue={false}
|
||||||
label={`Bucket ${bucket.id}${bucket.id === 1 ? " (Data Explorer Query Bucket)" : ""}`}
|
label={`Bucket ${bucket.id}${bucket.id === 1 ? " (Data Explorer Query Bucket)" : ""}`}
|
||||||
styles={{
|
styles={{ root: { flex: 2, maxWidth: 400 } }}
|
||||||
root: { flex: 2, maxWidth: 400 },
|
|
||||||
titleLabel: {
|
|
||||||
color:
|
|
||||||
bucket.maxThroughputPercentage === 100
|
|
||||||
? "var(--colorNeutralForeground4)"
|
|
||||||
: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
disabled={bucket.maxThroughputPercentage === 100}
|
disabled={bucket.maxThroughputPercentage === 100}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
ChoiceGroup,
|
ChoiceGroup,
|
||||||
FontIcon,
|
FontIcon,
|
||||||
IChoiceGroupOption,
|
IChoiceGroupOption,
|
||||||
IMessageBarStyles,
|
|
||||||
IProgressIndicatorStyles,
|
IProgressIndicatorStyles,
|
||||||
ISeparatorStyles,
|
ISeparatorStyles,
|
||||||
Label,
|
Label,
|
||||||
@@ -38,6 +37,7 @@ import {
|
|||||||
getUpdateThroughputBeyondInstantLimitMessage,
|
getUpdateThroughputBeyondInstantLimitMessage,
|
||||||
getUpdateThroughputBeyondSupportLimitMessage,
|
getUpdateThroughputBeyondSupportLimitMessage,
|
||||||
manualToAutoscaleDisclaimerElement,
|
manualToAutoscaleDisclaimerElement,
|
||||||
|
messageBarStyles,
|
||||||
noLeftPaddingCheckBoxStyle,
|
noLeftPaddingCheckBoxStyle,
|
||||||
relaxedSpacingStackProps,
|
relaxedSpacingStackProps,
|
||||||
saveThroughputWarningMessage,
|
saveThroughputWarningMessage,
|
||||||
@@ -101,13 +101,6 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{ key: "false", text: "Manual" },
|
{ key: "false", text: "Manual" },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Style constants for theme-aware colors and layout
|
|
||||||
private static readonly TEXT_COLOR_PRIMARY = "var(--colorNeutralForeground1)";
|
|
||||||
private static readonly TEXT_COLOR_SECONDARY = "var(--colorNeutralForeground2)";
|
|
||||||
private static readonly TEXT_WIDTH_50 = "50%";
|
|
||||||
private static readonly TEXT_WIDTH_33 = "33%";
|
|
||||||
private static readonly LOCALE_EN_US = "en-US";
|
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
this.onComponentUpdate();
|
this.onComponentUpdate();
|
||||||
}
|
}
|
||||||
@@ -243,24 +236,12 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Text style={{ fontWeight: 600, color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY }}>
|
<Text style={{ fontWeight: 600 }}>Updated cost per month</Text>
|
||||||
Updated cost per month
|
|
||||||
</Text>
|
|
||||||
<Stack horizontal style={{ marginTop: 5, marginBottom: 10 }}>
|
<Stack horizontal style={{ marginTop: 5, marginBottom: 10 }}>
|
||||||
<Text
|
<Text style={{ width: "50%" }}>
|
||||||
style={{
|
|
||||||
width: ThroughputInputAutoPilotV3Component.TEXT_WIDTH_50,
|
|
||||||
color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice / 10)} min
|
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice / 10)} min
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text style={{ width: "50%" }}>
|
||||||
style={{
|
|
||||||
width: ThroughputInputAutoPilotV3Component.TEXT_WIDTH_50,
|
|
||||||
color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice)} max
|
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice)} max
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -273,24 +254,12 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
return (
|
return (
|
||||||
<Stack {...checkBoxAndInputStackProps} style={{ marginTop: 15 }}>
|
<Stack {...checkBoxAndInputStackProps} style={{ marginTop: 15 }}>
|
||||||
{newThroughput && newThroughputCostElement()}
|
{newThroughput && newThroughputCostElement()}
|
||||||
<Text style={{ fontWeight: 600, color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY }}>
|
<Text style={{ fontWeight: 600 }}>Current cost per month</Text>
|
||||||
Current cost per month
|
<Stack horizontal style={{ marginTop: 5 }}>
|
||||||
</Text>
|
<Text style={{ width: "50%" }}>
|
||||||
<Stack horizontal style={{ marginTop: 5, color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY }}>
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
width: ThroughputInputAutoPilotV3Component.TEXT_WIDTH_50,
|
|
||||||
color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice / 10)} min
|
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice / 10)} min
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text style={{ width: "50%" }}>
|
||||||
style={{
|
|
||||||
width: ThroughputInputAutoPilotV3Component.TEXT_WIDTH_50,
|
|
||||||
color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice)} max
|
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice)} max
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -300,12 +269,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
|
|
||||||
return getEstimatedSpendingElement(costElement(), newThroughput ?? throughput, numberOfRegions, prices, true);
|
return getEstimatedSpendingElement(costElement(), newThroughput ?? throughput, numberOfRegions, prices, true);
|
||||||
};
|
};
|
||||||
settingsAndScaleStyle = {
|
|
||||||
root: {
|
|
||||||
width: ThroughputInputAutoPilotV3Component.TEXT_WIDTH_33,
|
|
||||||
color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
private getEstimatedManualSpendElement = (
|
private getEstimatedManualSpendElement = (
|
||||||
throughput: number,
|
throughput: number,
|
||||||
serverId: string,
|
serverId: string,
|
||||||
@@ -325,17 +289,15 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Text style={{ fontWeight: 600, color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY }}>
|
<Text style={{ fontWeight: 600 }}>Updated cost per month</Text>
|
||||||
Updated cost per month
|
|
||||||
</Text>
|
|
||||||
<Stack horizontal style={{ marginTop: 5, marginBottom: 10 }}>
|
<Stack horizontal style={{ marginTop: 5, marginBottom: 10 }}>
|
||||||
<Text style={this.settingsAndScaleStyle.root}>
|
<Text style={{ width: "33%" }}>
|
||||||
{newPrices.currencySign} {calculateEstimateNumber(newPrices.hourlyPrice)}/hr
|
{newPrices.currencySign} {calculateEstimateNumber(newPrices.hourlyPrice)}/hr
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={this.settingsAndScaleStyle.root}>
|
<Text style={{ width: "33%" }}>
|
||||||
{newPrices.currencySign} {calculateEstimateNumber(newPrices.dailyPrice)}/day
|
{newPrices.currencySign} {calculateEstimateNumber(newPrices.dailyPrice)}/day
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={this.settingsAndScaleStyle.root}>
|
<Text style={{ width: "33%" }}>
|
||||||
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice)}/mo
|
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice)}/mo
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -348,17 +310,15 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
return (
|
return (
|
||||||
<Stack {...checkBoxAndInputStackProps} style={{ marginTop: 15 }}>
|
<Stack {...checkBoxAndInputStackProps} style={{ marginTop: 15 }}>
|
||||||
{newThroughput && newThroughputCostElement()}
|
{newThroughput && newThroughputCostElement()}
|
||||||
<Text style={{ fontWeight: 600, color: ThroughputInputAutoPilotV3Component.TEXT_COLOR_PRIMARY }}>
|
<Text style={{ fontWeight: 600 }}>Current cost per month</Text>
|
||||||
Current cost per month
|
|
||||||
</Text>
|
|
||||||
<Stack horizontal style={{ marginTop: 5 }}>
|
<Stack horizontal style={{ marginTop: 5 }}>
|
||||||
<Text style={this.settingsAndScaleStyle.root}>
|
<Text style={{ width: "33%" }}>
|
||||||
{prices.currencySign} {calculateEstimateNumber(prices.hourlyPrice)}/hr
|
{prices.currencySign} {calculateEstimateNumber(prices.hourlyPrice)}/hr
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={this.settingsAndScaleStyle.root}>
|
<Text style={{ width: "33%" }}>
|
||||||
{prices.currencySign} {calculateEstimateNumber(prices.dailyPrice)}/day
|
{prices.currencySign} {calculateEstimateNumber(prices.dailyPrice)}/day
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={this.settingsAndScaleStyle.root}>
|
<Text style={{ width: "33%" }}>
|
||||||
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice)}/mo
|
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice)}/mo
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -421,7 +381,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{this.overrideWithProvisionedThroughputSettings() && (
|
{this.overrideWithProvisionedThroughputSettings() && (
|
||||||
<MessageBar
|
<MessageBar
|
||||||
messageBarIconProps={{ iconName: "InfoSolid", className: "messageBarInfoIcon" }}
|
messageBarIconProps={{ iconName: "InfoSolid", className: "messageBarInfoIcon" }}
|
||||||
styles={this.darkThemeMessageBarStyles}
|
styles={messageBarStyles}
|
||||||
>
|
>
|
||||||
{manualToAutoscaleDisclaimerElement}
|
{manualToAutoscaleDisclaimerElement}
|
||||||
</MessageBar>
|
</MessageBar>
|
||||||
@@ -447,8 +407,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
const capacity: string = this.props.isFixed ? "Fixed" : "Unlimited";
|
const capacity: string = this.props.isFixed ? "Fixed" : "Unlimited";
|
||||||
return (
|
return (
|
||||||
<Stack {...titleAndInputStackProps}>
|
<Stack {...titleAndInputStackProps}>
|
||||||
<Label style={{ color: "var(--colorNeutralForeground1)" }}>Storage capacity</Label>
|
<Label>Storage capacity</Label>
|
||||||
<Text style={{ color: "var(--colorNeutralForeground1)" }}>{capacity}</Text>
|
<Text>{capacity}</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -458,7 +418,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{
|
{
|
||||||
selectors: {
|
selectors: {
|
||||||
"::before": {
|
"::before": {
|
||||||
backgroundColor: "var(--colorNeutralStroke2)",
|
backgroundColor: "rgb(200, 200, 200)",
|
||||||
height: "3px",
|
height: "3px",
|
||||||
marginTop: "-1px",
|
marginTop: "-1px",
|
||||||
},
|
},
|
||||||
@@ -497,10 +457,10 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{
|
{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
this.getCurrentRuRange() === "instant"
|
this.getCurrentRuRange() === "instant"
|
||||||
? "var(--colorBrandBackground)"
|
? "rgb(0, 120, 212)"
|
||||||
: this.getCurrentRuRange() === "delayed"
|
: this.getCurrentRuRange() === "delayed"
|
||||||
? "var(--colorStatusWarningBackground1)"
|
? "rgb(255 216 109)"
|
||||||
: "var(--colorStatusDangerBackground1)",
|
: "rgb(251, 217, 203)",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@@ -537,18 +497,13 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Stack horizontal>
|
<Stack horizontal>
|
||||||
<Stack.Item style={{ width: "34%" }}>
|
<Stack.Item style={{ width: "34%" }}>
|
||||||
<span>{this.props.minimum.toLocaleString(ThroughputInputAutoPilotV3Component.LOCALE_EN_US)}</span>
|
<span>{this.props.minimum.toLocaleString()}</span>
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
<Stack.Item style={{ width: "66%" }}>
|
<Stack.Item style={{ width: "66%" }}>
|
||||||
<span style={{ float: "left", transform: "translateX(-50%)" }}>
|
<span style={{ float: "left", transform: "translateX(-50%)" }}>
|
||||||
{this.props.instantMaximumThroughput.toLocaleString(ThroughputInputAutoPilotV3Component.LOCALE_EN_US)}
|
{this.props.instantMaximumThroughput.toLocaleString()}
|
||||||
</span>
|
|
||||||
<span style={{ float: "right" }}>
|
|
||||||
{this.props.softAllowedMaximumThroughput.toLocaleString(ThroughputInputAutoPilotV3Component.LOCALE_EN_US)}
|
|
||||||
</span>
|
|
||||||
<span style={{ float: "right" }} data-test="soft-allowed-maximum-throughput">
|
|
||||||
{this.props.softAllowedMaximumThroughput.toLocaleString(ThroughputInputAutoPilotV3Component.LOCALE_EN_US)}
|
|
||||||
</span>
|
</span>
|
||||||
|
<span style={{ float: "right" }}>{this.props.softAllowedMaximumThroughput.toLocaleString()}</span>
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
</Stack>
|
</Stack>
|
||||||
<ProgressIndicator
|
<ProgressIndicator
|
||||||
@@ -590,41 +545,12 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private darkThemeMessageBarStyles: Partial<IMessageBarStyles> = {
|
|
||||||
root: {
|
|
||||||
marginTop: "5px",
|
|
||||||
selectors: {
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
backgroundColor: "var(--colorStatusDangerBackground1)",
|
|
||||||
border: "1px solid var(--colorStatusDangerBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
backgroundColor: "var(--colorStatusWarningBackground1)",
|
|
||||||
border: "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--info": {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground3)",
|
|
||||||
border: "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
private getThroughputWarningMessageBar = (): JSX.Element => {
|
private getThroughputWarningMessageBar = (): JSX.Element => {
|
||||||
const isSevereWarning: boolean =
|
const isSevereWarning: boolean =
|
||||||
this.currentThroughputValue() > this.props.softAllowedMaximumThroughput ||
|
this.currentThroughputValue() > this.props.softAllowedMaximumThroughput ||
|
||||||
this.currentThroughputValue() < this.props.minimum;
|
this.currentThroughputValue() < this.props.minimum;
|
||||||
return (
|
return (
|
||||||
<MessageBar
|
<MessageBar messageBarType={isSevereWarning ? MessageBarType.severeWarning : MessageBarType.warning}>
|
||||||
messageBarType={isSevereWarning ? MessageBarType.severeWarning : MessageBarType.warning}
|
|
||||||
styles={this.darkThemeMessageBarStyles}
|
|
||||||
>
|
|
||||||
{this.getThroughputWarningMessageText()}
|
{this.getThroughputWarningMessageText()}
|
||||||
</MessageBar>
|
</MessageBar>
|
||||||
);
|
);
|
||||||
@@ -637,13 +563,10 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{/* Column 1: Minimum RU/s */}
|
{/* Column 1: Minimum RU/s */}
|
||||||
<Stack tokens={{ childrenGap: 4 }}>
|
<Stack tokens={{ childrenGap: 4 }}>
|
||||||
<Stack horizontal verticalAlign="center" tokens={{ childrenGap: 4 }}>
|
<Stack horizontal verticalAlign="center" tokens={{ childrenGap: 4 }}>
|
||||||
<Text
|
<Text variant="small" style={{ lineHeight: "20px", fontWeight: 600 }}>
|
||||||
variant="small"
|
|
||||||
style={{ lineHeight: "20px", fontWeight: 600, color: "var(--colorNeutralForeground1)" }}
|
|
||||||
>
|
|
||||||
Minimum RU/s
|
Minimum RU/s
|
||||||
</Text>
|
</Text>
|
||||||
<FontIcon iconName="Info" style={{ fontSize: 12, color: "var(--colorNeutralForeground2)" }} />
|
<FontIcon iconName="Info" style={{ fontSize: 12, color: "#666" }} />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
@@ -658,7 +581,6 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
boxSizing: "border-box",
|
boxSizing: "border-box",
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{AutoPilotUtils.getMinRUsBasedOnUserInput(this.props.maxAutoPilotThroughput)}
|
{AutoPilotUtils.getMinRUsBasedOnUserInput(this.props.maxAutoPilotThroughput)}
|
||||||
@@ -672,7 +594,6 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: 400,
|
fontWeight: 400,
|
||||||
paddingBottom: 6,
|
paddingBottom: 6,
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
x 10 =
|
x 10 =
|
||||||
@@ -681,13 +602,10 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{/* Column 3: Maximum RU/s */}
|
{/* Column 3: Maximum RU/s */}
|
||||||
<Stack tokens={{ childrenGap: 4 }}>
|
<Stack tokens={{ childrenGap: 4 }}>
|
||||||
<Stack horizontal verticalAlign="center" tokens={{ childrenGap: 4 }}>
|
<Stack horizontal verticalAlign="center" tokens={{ childrenGap: 4 }}>
|
||||||
<Text
|
<Text variant="small" style={{ lineHeight: "20px", fontWeight: 600 }}>
|
||||||
variant="small"
|
|
||||||
style={{ lineHeight: "20px", fontWeight: 600, color: "var(--colorNeutralForeground1)" }}
|
|
||||||
>
|
|
||||||
Maximum RU/s
|
Maximum RU/s
|
||||||
</Text>
|
</Text>
|
||||||
<FontIcon iconName="Info" style={{ fontSize: 12, color: "var(--colorNeutralForeground2)" }} />
|
<FontIcon iconName="Info" style={{ fontSize: 12, color: "#666" }} />
|
||||||
</Stack>
|
</Stack>
|
||||||
<TextField
|
<TextField
|
||||||
required
|
required
|
||||||
@@ -696,25 +614,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
key="auto pilot throughput input"
|
key="auto pilot throughput input"
|
||||||
styles={{
|
styles={{
|
||||||
...getTextFieldStyles(this.props.maxAutoPilotThroughput, this.props.maxAutoPilotThroughputBaseline),
|
...getTextFieldStyles(this.props.maxAutoPilotThroughput, this.props.maxAutoPilotThroughputBaseline),
|
||||||
fieldGroup: {
|
fieldGroup: { width: 100, height: 28 },
|
||||||
width: 100,
|
field: { fontSize: 14, fontWeight: 400 },
|
||||||
height: 28,
|
|
||||||
backgroundColor: "var(--colorNeutralBackground4)",
|
|
||||||
},
|
|
||||||
field: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: 400,
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
backgroundColor: "var(--colorNeutralBackground4)",
|
|
||||||
},
|
|
||||||
root: {
|
|
||||||
selectors: {
|
|
||||||
input: {
|
|
||||||
backgroundColor: "var(--colorNeutralBackground4)",
|
|
||||||
color: "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
disabled={this.overrideWithProvisionedThroughputSettings()}
|
disabled={this.overrideWithProvisionedThroughputSettings()}
|
||||||
step={AutoPilotUtils.autoPilotIncrementStep}
|
step={AutoPilotUtils.autoPilotIncrementStep}
|
||||||
@@ -725,12 +626,11 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
min={autoPilotThroughput1K}
|
min={autoPilotThroughput1K}
|
||||||
onGetErrorMessage={(value: string) => {
|
onGetErrorMessage={(value: string) => {
|
||||||
const sanitizedValue = getSanitizedInputValue(value);
|
const sanitizedValue = getSanitizedInputValue(value);
|
||||||
const errorMessage: string =
|
return sanitizedValue % 1000
|
||||||
sanitizedValue % 1000 ? "Throughput value must be in increments of 1000" : this.props.throughputError;
|
? "Throughput value must be in increments of 1000"
|
||||||
return <span data-test="autopilot-throughput-input-error">{errorMessage}</span>;
|
: this.props.throughputError;
|
||||||
}}
|
}}
|
||||||
validateOnLoad={false}
|
validateOnLoad={false}
|
||||||
data-test="autopilot-throughput-input"
|
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -750,10 +650,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
}
|
}
|
||||||
onChange={this.onThroughputChange}
|
onChange={this.onThroughputChange}
|
||||||
min={this.props.minimum}
|
min={this.props.minimum}
|
||||||
onGetErrorMessage={() => {
|
errorMessage={this.props.throughputError}
|
||||||
return <span data-test="manual-throughput-input-error">{this.props.throughputError}</span>;
|
|
||||||
}}
|
|
||||||
data-test="manual-throughput-input"
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@@ -771,7 +668,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{this.props.isAutoPilotSelected ? (
|
{this.props.isAutoPilotSelected ? (
|
||||||
<Text style={{ marginTop: "40px", color: "var(--colorNeutralForeground1)" }}>
|
<Text style={{ marginTop: "40px" }}>
|
||||||
Based on usage, your {this.props.collectionName ? "container" : "database"} throughput will scale from{" "}
|
Based on usage, your {this.props.collectionName ? "container" : "database"} throughput will scale from{" "}
|
||||||
<b>
|
<b>
|
||||||
{AutoPilotUtils.getMinRUsBasedOnUserInput(this.props.maxAutoPilotThroughput)} RU/s (10% of max RU/s) -{" "}
|
{AutoPilotUtils.getMinRUsBasedOnUserInput(this.props.maxAutoPilotThroughput)} RU/s (10% of max RU/s) -{" "}
|
||||||
@@ -784,7 +681,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{this.state.exceedFreeTierThroughput && (
|
{this.state.exceedFreeTierThroughput && (
|
||||||
<MessageBar
|
<MessageBar
|
||||||
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
||||||
styles={this.darkThemeMessageBarStyles}
|
styles={messageBarStyles}
|
||||||
style={{ marginTop: "40px" }}
|
style={{ marginTop: "40px" }}
|
||||||
>
|
>
|
||||||
{`Billing will apply if you provision more than ${SharedConstants.FreeTierLimits.RU} RU/s of manual throughput, or if the resource scales beyond ${SharedConstants.FreeTierLimits.RU} RU/s with autoscale.`}
|
{`Billing will apply if you provision more than ${SharedConstants.FreeTierLimits.RU} RU/s of manual throughput, or if the resource scales beyond ${SharedConstants.FreeTierLimits.RU} RU/s with autoscale.`}
|
||||||
@@ -793,7 +690,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{!this.overrideWithProvisionedThroughputSettings() && (
|
{!this.overrideWithProvisionedThroughputSettings() && (
|
||||||
<Text style={{ color: "var(--colorNeutralForeground1)" }}>
|
<Text>
|
||||||
Estimate your required RU/s with
|
Estimate your required RU/s with
|
||||||
<Link target="_blank" href="https://cosmos.azure.com/capacitycalculator/">
|
<Link target="_blank" href="https://cosmos.azure.com/capacitycalculator/">
|
||||||
{` capacity calculator`} <FontIcon iconName="NavigateExternalInline" />
|
{` capacity calculator`} <FontIcon iconName="NavigateExternalInline" />
|
||||||
@@ -834,7 +731,6 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
|||||||
{warningMessage && (
|
{warningMessage && (
|
||||||
<MessageBar
|
<MessageBar
|
||||||
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
messageBarIconProps={{ iconName: "WarningSolid", className: "messageBarWarningIcon" }}
|
||||||
styles={this.darkThemeMessageBarStyles}
|
|
||||||
role="alert"
|
role="alert"
|
||||||
>
|
>
|
||||||
{warningMessage}
|
{warningMessage}
|
||||||
|
|||||||
@@ -16,35 +16,17 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
role="alert"
|
role="alert"
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"marginTop": "5px",
|
|
||||||
"selectors": {
|
|
||||||
"&.ms-MessageBar--info": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground3)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusDangerBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
"backgroundColor": "var(--colorStatusWarningBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Text>
|
<Text
|
||||||
|
styles={
|
||||||
|
{
|
||||||
|
"root": {
|
||||||
|
"color": "windowtext",
|
||||||
|
"fontSize": 14,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
Your bill will be affected as you update your throughput settings. Please review the updated cost estimate below before saving your changes
|
Your bill will be affected as you update your throughput settings. Please review the updated cost estimate below before saving your changes
|
||||||
</Text>
|
</Text>
|
||||||
</StyledMessageBar>
|
</StyledMessageBar>
|
||||||
@@ -59,7 +41,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -80,27 +62,11 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
|
"backgroundColor": "white",
|
||||||
"marginTop": "5px",
|
"marginTop": "5px",
|
||||||
"selectors": {
|
},
|
||||||
"&.ms-MessageBar--info": {
|
"text": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground3)",
|
"fontSize": 14,
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusDangerBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
"backgroundColor": "var(--colorStatusWarningBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,7 +76,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -155,47 +121,15 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
".ms-ChoiceField-field.is-checked::before": {
|
".ms-ChoiceField-field.is-checked::before": {
|
||||||
"borderColor": undefined,
|
"borderColor": undefined,
|
||||||
},
|
},
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-wrapper label": {
|
".ms-ChoiceField-wrapper label": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontFamily": undefined,
|
"fontFamily": undefined,
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"padding": "2px 5px",
|
"padding": "2px 5px",
|
||||||
"whiteSpace": "nowrap",
|
"whiteSpace": "nowrap",
|
||||||
},
|
},
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel:hover": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"label": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -251,7 +185,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
"lineHeight": "20px",
|
"lineHeight": "20px",
|
||||||
}
|
}
|
||||||
@@ -264,7 +197,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
iconName="Info"
|
iconName="Info"
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground2)",
|
"color": "#666",
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -277,7 +210,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"border": "none",
|
"border": "none",
|
||||||
"boxSizing": "border-box",
|
"boxSizing": "border-box",
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"display": "flex",
|
"display": "flex",
|
||||||
"fontFamily": "Segoe UI",
|
"fontFamily": "Segoe UI",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
@@ -294,7 +226,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontFamily": "Segoe UI",
|
"fontFamily": "Segoe UI",
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
"fontWeight": 400,
|
"fontWeight": 400,
|
||||||
@@ -323,7 +254,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
"lineHeight": "20px",
|
"lineHeight": "20px",
|
||||||
}
|
}
|
||||||
@@ -336,14 +266,13 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
iconName="Info"
|
iconName="Info"
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground2)",
|
"color": "#666",
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StyledTextFieldBase
|
<StyledTextFieldBase
|
||||||
data-test="autopilot-throughput-input"
|
|
||||||
disabled={true}
|
disabled={true}
|
||||||
id="autopilotInput"
|
id="autopilotInput"
|
||||||
key="auto pilot throughput input"
|
key="auto pilot throughput input"
|
||||||
@@ -355,36 +284,13 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"field": {
|
"field": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground4)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"fontWeight": 400,
|
"fontWeight": 400,
|
||||||
},
|
},
|
||||||
"fieldGroup": {
|
"fieldGroup": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground4)",
|
|
||||||
"height": 28,
|
"height": 28,
|
||||||
"width": 100,
|
"width": 100,
|
||||||
},
|
},
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
"input": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground4)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"subComponentStyles": {
|
|
||||||
"label": {
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"suffix": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
type="number"
|
type="number"
|
||||||
@@ -435,16 +341,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
>
|
>
|
||||||
1,000,000
|
1,000,000
|
||||||
</span>
|
</span>
|
||||||
<span
|
|
||||||
data-test="soft-allowed-maximum-throughput"
|
|
||||||
style={
|
|
||||||
{
|
|
||||||
"float": "right",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
1,000,000
|
|
||||||
</span>
|
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StyledProgressIndicatorBase
|
<StyledProgressIndicatorBase
|
||||||
@@ -454,7 +350,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
{
|
{
|
||||||
"progressBar": [
|
"progressBar": [
|
||||||
{
|
{
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
"backgroundColor": "rgb(251, 217, 203)",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -478,7 +374,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
{
|
{
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"::before": {
|
"::before": {
|
||||||
"backgroundColor": "var(--colorNeutralStroke2)",
|
"backgroundColor": "rgb(200, 200, 200)",
|
||||||
"height": "3px",
|
"height": "3px",
|
||||||
"marginTop": "-1px",
|
"marginTop": "-1px",
|
||||||
},
|
},
|
||||||
@@ -506,7 +402,7 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
{
|
{
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"::before": {
|
"::before": {
|
||||||
"backgroundColor": "var(--colorNeutralStroke2)",
|
"backgroundColor": "rgb(200, 200, 200)",
|
||||||
"height": "3px",
|
"height": "3px",
|
||||||
"marginTop": "-1px",
|
"marginTop": "-1px",
|
||||||
},
|
},
|
||||||
@@ -523,39 +419,12 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
</Stack>
|
</Stack>
|
||||||
<StyledMessageBar
|
<StyledMessageBar
|
||||||
messageBarType={3}
|
messageBarType={3}
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"marginTop": "5px",
|
|
||||||
"selectors": {
|
|
||||||
"&.ms-MessageBar--info": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground3)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusDangerBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
"backgroundColor": "var(--colorStatusWarningBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -576,7 +445,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginTop": "40px",
|
"marginTop": "40px",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -608,22 +476,10 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StyledLabelBase
|
<StyledLabelBase>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Storage capacity
|
Storage capacity
|
||||||
</StyledLabelBase>
|
</StyledLabelBase>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Unlimited
|
Unlimited
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -642,7 +498,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -665,7 +520,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -684,7 +538,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "50%",
|
"width": "50%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -697,7 +550,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "50%",
|
"width": "50%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,7 +564,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -723,7 +574,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
horizontal={true}
|
horizontal={true}
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginTop": 5,
|
"marginTop": 5,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -731,7 +581,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "50%",
|
"width": "50%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -744,7 +593,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "50%",
|
"width": "50%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -759,7 +607,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
@@ -793,7 +640,6 @@ exports[`ThroughputInputAutoPilotV3Component autopilot input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -828,7 +674,7 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -869,47 +715,15 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
".ms-ChoiceField-field.is-checked::before": {
|
".ms-ChoiceField-field.is-checked::before": {
|
||||||
"borderColor": "",
|
"borderColor": "",
|
||||||
},
|
},
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-wrapper label": {
|
".ms-ChoiceField-wrapper label": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontFamily": undefined,
|
"fontFamily": undefined,
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"padding": "2px 5px",
|
"padding": "2px 5px",
|
||||||
"whiteSpace": "nowrap",
|
"whiteSpace": "nowrap",
|
||||||
},
|
},
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel:hover": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"label": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -938,64 +752,26 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StyledTextFieldBase
|
<StyledTextFieldBase
|
||||||
data-test="manual-throughput-input"
|
|
||||||
disabled={false}
|
disabled={false}
|
||||||
id="throughputInput"
|
id="throughputInput"
|
||||||
key="provisioned throughput input"
|
key="provisioned throughput input"
|
||||||
min={10000}
|
min={10000}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
onGetErrorMessage={[Function]}
|
|
||||||
required={true}
|
required={true}
|
||||||
step={100}
|
step={100}
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"field": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
":disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"fieldGroup": {
|
"fieldGroup": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"borderColor": "",
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"selectors": {
|
"selectors": {
|
||||||
":disabled": {
|
":disabled": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"backgroundColor": undefined,
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
"borderColor": undefined,
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
"input": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input#autopilotInput": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground4)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"width": 300,
|
"width": 300,
|
||||||
},
|
},
|
||||||
"subComponentStyles": {
|
|
||||||
"label": {
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"suffix": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
type="number"
|
type="number"
|
||||||
@@ -1043,16 +819,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
>
|
>
|
||||||
1,000,000
|
1,000,000
|
||||||
</span>
|
</span>
|
||||||
<span
|
|
||||||
data-test="soft-allowed-maximum-throughput"
|
|
||||||
style={
|
|
||||||
{
|
|
||||||
"float": "right",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
1,000,000
|
|
||||||
</span>
|
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StyledProgressIndicatorBase
|
<StyledProgressIndicatorBase
|
||||||
@@ -1062,7 +828,7 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
{
|
{
|
||||||
"progressBar": [
|
"progressBar": [
|
||||||
{
|
{
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
"backgroundColor": "rgb(251, 217, 203)",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -1086,7 +852,7 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
{
|
{
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"::before": {
|
"::before": {
|
||||||
"backgroundColor": "var(--colorNeutralStroke2)",
|
"backgroundColor": "rgb(200, 200, 200)",
|
||||||
"height": "3px",
|
"height": "3px",
|
||||||
"marginTop": "-1px",
|
"marginTop": "-1px",
|
||||||
},
|
},
|
||||||
@@ -1114,7 +880,7 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
{
|
{
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"::before": {
|
"::before": {
|
||||||
"backgroundColor": "var(--colorNeutralStroke2)",
|
"backgroundColor": "rgb(200, 200, 200)",
|
||||||
"height": "3px",
|
"height": "3px",
|
||||||
"marginTop": "-1px",
|
"marginTop": "-1px",
|
||||||
},
|
},
|
||||||
@@ -1131,39 +897,12 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
</Stack>
|
</Stack>
|
||||||
<StyledMessageBar
|
<StyledMessageBar
|
||||||
messageBarType={3}
|
messageBarType={3}
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"marginTop": "5px",
|
|
||||||
"selectors": {
|
|
||||||
"&.ms-MessageBar--info": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground3)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusDangerBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
"backgroundColor": "var(--colorStatusWarningBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -1181,13 +920,7 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
</Text>
|
</Text>
|
||||||
</StyledMessageBar>
|
</StyledMessageBar>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Estimate your required RU/s with
|
Estimate your required RU/s with
|
||||||
<StyledLinkBase
|
<StyledLinkBase
|
||||||
href="https://cosmos.azure.com/capacitycalculator/"
|
href="https://cosmos.azure.com/capacitycalculator/"
|
||||||
@@ -1231,22 +964,10 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StyledLabelBase
|
<StyledLabelBase>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Storage capacity
|
Storage capacity
|
||||||
</StyledLabelBase>
|
</StyledLabelBase>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Unlimited
|
Unlimited
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -1265,7 +986,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1287,7 +1007,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1305,7 +1024,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "33%",
|
"width": "33%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1318,7 +1036,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "33%",
|
"width": "33%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1331,7 +1048,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "33%",
|
"width": "33%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1346,7 +1062,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
@@ -1379,7 +1094,6 @@ exports[`ThroughputInputAutoPilotV3Component spendAck checkbox visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1414,7 +1128,7 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -1455,47 +1169,15 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
".ms-ChoiceField-field.is-checked::before": {
|
".ms-ChoiceField-field.is-checked::before": {
|
||||||
"borderColor": "",
|
"borderColor": "",
|
||||||
},
|
},
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-wrapper label": {
|
".ms-ChoiceField-wrapper label": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontFamily": undefined,
|
"fontFamily": undefined,
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"padding": "2px 5px",
|
"padding": "2px 5px",
|
||||||
"whiteSpace": "nowrap",
|
"whiteSpace": "nowrap",
|
||||||
},
|
},
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel:hover": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"label": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -1524,64 +1206,26 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StyledTextFieldBase
|
<StyledTextFieldBase
|
||||||
data-test="manual-throughput-input"
|
|
||||||
disabled={false}
|
disabled={false}
|
||||||
id="throughputInput"
|
id="throughputInput"
|
||||||
key="provisioned throughput input"
|
key="provisioned throughput input"
|
||||||
min={10000}
|
min={10000}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
onGetErrorMessage={[Function]}
|
|
||||||
required={true}
|
required={true}
|
||||||
step={100}
|
step={100}
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"field": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
":disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"fieldGroup": {
|
"fieldGroup": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"borderColor": "",
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"selectors": {
|
"selectors": {
|
||||||
":disabled": {
|
":disabled": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"backgroundColor": undefined,
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
"borderColor": undefined,
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
"input": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input#autopilotInput": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground4)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"width": 300,
|
"width": 300,
|
||||||
},
|
},
|
||||||
"subComponentStyles": {
|
|
||||||
"label": {
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"suffix": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
type="number"
|
type="number"
|
||||||
@@ -1629,16 +1273,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
>
|
>
|
||||||
1,000,000
|
1,000,000
|
||||||
</span>
|
</span>
|
||||||
<span
|
|
||||||
data-test="soft-allowed-maximum-throughput"
|
|
||||||
style={
|
|
||||||
{
|
|
||||||
"float": "right",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
1,000,000
|
|
||||||
</span>
|
|
||||||
</StackItem>
|
</StackItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StyledProgressIndicatorBase
|
<StyledProgressIndicatorBase
|
||||||
@@ -1648,7 +1282,7 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
{
|
{
|
||||||
"progressBar": [
|
"progressBar": [
|
||||||
{
|
{
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
"backgroundColor": "rgb(251, 217, 203)",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -1672,7 +1306,7 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
{
|
{
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"::before": {
|
"::before": {
|
||||||
"backgroundColor": "var(--colorNeutralStroke2)",
|
"backgroundColor": "rgb(200, 200, 200)",
|
||||||
"height": "3px",
|
"height": "3px",
|
||||||
"marginTop": "-1px",
|
"marginTop": "-1px",
|
||||||
},
|
},
|
||||||
@@ -1700,7 +1334,7 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
{
|
{
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"::before": {
|
"::before": {
|
||||||
"backgroundColor": "var(--colorNeutralStroke2)",
|
"backgroundColor": "rgb(200, 200, 200)",
|
||||||
"height": "3px",
|
"height": "3px",
|
||||||
"marginTop": "-1px",
|
"marginTop": "-1px",
|
||||||
},
|
},
|
||||||
@@ -1717,39 +1351,12 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
</Stack>
|
</Stack>
|
||||||
<StyledMessageBar
|
<StyledMessageBar
|
||||||
messageBarType={3}
|
messageBarType={3}
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"marginTop": "5px",
|
|
||||||
"selectors": {
|
|
||||||
"&.ms-MessageBar--info": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground3)",
|
|
||||||
"border": "1px solid var(--colorNeutralStroke1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--severeWarning": {
|
|
||||||
"backgroundColor": "var(--colorStatusDangerBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusDangerBorder1)",
|
|
||||||
},
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
"backgroundColor": "var(--colorStatusWarningBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -1767,13 +1374,7 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
</Text>
|
</Text>
|
||||||
</StyledMessageBar>
|
</StyledMessageBar>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Estimate your required RU/s with
|
Estimate your required RU/s with
|
||||||
<StyledLinkBase
|
<StyledLinkBase
|
||||||
href="https://cosmos.azure.com/capacitycalculator/"
|
href="https://cosmos.azure.com/capacitycalculator/"
|
||||||
@@ -1800,22 +1401,10 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StyledLabelBase
|
<StyledLabelBase>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Storage capacity
|
Storage capacity
|
||||||
</StyledLabelBase>
|
</StyledLabelBase>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Unlimited
|
Unlimited
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -1834,7 +1423,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1856,7 +1444,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1874,7 +1461,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "33%",
|
"width": "33%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1887,7 +1473,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "33%",
|
"width": "33%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1900,7 +1485,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"width": "33%",
|
"width": "33%",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1915,7 +1499,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
@@ -1948,7 +1531,6 @@ exports[`ThroughputInputAutoPilotV3Component throughput input visible 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { DirectionalHint, IIconStyles, Icon, Stack, Text, TooltipHost } from "@fluentui/react";
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Stack, Text, IIconStyles, Icon, TooltipHost, DirectionalHint } from "@fluentui/react";
|
||||||
import { toolTipLabelStackTokens } from "../SettingsRenderUtils";
|
import { toolTipLabelStackTokens } from "../SettingsRenderUtils";
|
||||||
|
|
||||||
export interface ToolTipLabelComponentProps {
|
export interface ToolTipLabelComponentProps {
|
||||||
@@ -14,9 +14,7 @@ export class ToolTipLabelComponent extends React.Component<ToolTipLabelComponent
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack horizontal verticalAlign="center" tokens={toolTipLabelStackTokens}>
|
<Stack horizontal verticalAlign="center" tokens={toolTipLabelStackTokens}>
|
||||||
{this.props.label && (
|
{this.props.label && <Text style={{ fontWeight: 600 }}>{this.props.label}</Text>}
|
||||||
<Text style={{ fontWeight: 600, color: "var(--colorNeutralForeground1)" }}>{this.props.label}</Text>
|
|
||||||
)}
|
|
||||||
{this.props.toolTipElement && (
|
{this.props.toolTipElement && (
|
||||||
<TooltipHost
|
<TooltipHost
|
||||||
content={this.props.toolTipElement}
|
content={this.props.toolTipElement}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ exports[`ComputedPropertiesComponent renders 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginBottom": "10px",
|
"marginBottom": "10px",
|
||||||
"marginLeft": "30px",
|
"marginLeft": "30px",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,47 +37,15 @@ exports[`ConflictResolutionComponent Path text field displayed 1`] = `
|
|||||||
".ms-ChoiceField-field.is-checked::before": {
|
".ms-ChoiceField-field.is-checked::before": {
|
||||||
"borderColor": undefined,
|
"borderColor": undefined,
|
||||||
},
|
},
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-wrapper label": {
|
".ms-ChoiceField-wrapper label": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontFamily": undefined,
|
"fontFamily": undefined,
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"padding": "2px 5px",
|
"padding": "2px 5px",
|
||||||
"whiteSpace": "nowrap",
|
"whiteSpace": "nowrap",
|
||||||
},
|
},
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel:hover": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"label": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -88,44 +56,17 @@ exports[`ConflictResolutionComponent Path text field displayed 1`] = `
|
|||||||
onRenderLabel={[Function]}
|
onRenderLabel={[Function]}
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"field": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
":disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"fieldGroup": {
|
"fieldGroup": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"borderColor": "",
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"selectors": {
|
"selectors": {
|
||||||
":disabled": {
|
":disabled": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"backgroundColor": undefined,
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
"borderColor": undefined,
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
"input": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"width": 300,
|
"width": 300,
|
||||||
},
|
},
|
||||||
"subComponentStyles": {
|
|
||||||
"label": {
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value=""
|
value=""
|
||||||
@@ -170,47 +111,15 @@ exports[`ConflictResolutionComponent Sproc text field displayed 1`] = `
|
|||||||
".ms-ChoiceField-field.is-checked::before": {
|
".ms-ChoiceField-field.is-checked::before": {
|
||||||
"borderColor": "",
|
"borderColor": "",
|
||||||
},
|
},
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-wrapper label": {
|
".ms-ChoiceField-wrapper label": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontFamily": undefined,
|
"fontFamily": undefined,
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"padding": "2px 5px",
|
"padding": "2px 5px",
|
||||||
"whiteSpace": "nowrap",
|
"whiteSpace": "nowrap",
|
||||||
},
|
},
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel:hover": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"label": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceField-innerField": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceField:hover .ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-ChoiceFieldLabel": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -221,44 +130,17 @@ exports[`ConflictResolutionComponent Sproc text field displayed 1`] = `
|
|||||||
onRenderLabel={[Function]}
|
onRenderLabel={[Function]}
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"field": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"selectors": {
|
|
||||||
":disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"fieldGroup": {
|
"fieldGroup": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"borderColor": "",
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"selectors": {
|
"selectors": {
|
||||||
":disabled": {
|
":disabled": {
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
"backgroundColor": undefined,
|
||||||
"borderColor": "var(--colorNeutralStroke1)",
|
"borderColor": undefined,
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
|
||||||
"input": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
"input:disabled": {
|
|
||||||
"backgroundColor": "var(--colorNeutralBackground2)",
|
|
||||||
"color": "var(--colorNeutralForeground2)",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"width": 300,
|
"width": 300,
|
||||||
},
|
},
|
||||||
"subComponentStyles": {
|
|
||||||
"label": {
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value=""
|
value=""
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ exports[`PartitionKeyComponent renders default component and matches snapshot 1`
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
},
|
},
|
||||||
@@ -55,7 +54,6 @@ exports[`PartitionKeyComponent renders default component and matches snapshot 1`
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -68,7 +66,6 @@ exports[`PartitionKeyComponent renders default component and matches snapshot 1`
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -78,91 +75,35 @@ exports[`PartitionKeyComponent renders default component and matches snapshot 1`
|
|||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
data-test="partition-key-values"
|
|
||||||
tokens={
|
tokens={
|
||||||
{
|
{
|
||||||
"childrenGap": 5,
|
"childrenGap": 5,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
<Text />
|
||||||
styles={
|
<Text>
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Text
|
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Non-hierarchical
|
Non-hierarchical
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StyledMessageBar
|
<StyledMessageBar
|
||||||
data-test="partition-key-warning"
|
|
||||||
messageBarIconProps={
|
|
||||||
{
|
|
||||||
"className": "messageBarWarningIcon",
|
|
||||||
"iconName": "WarningSolid",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
messageBarType={5}
|
messageBarType={5}
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"selectors": {
|
|
||||||
"&.ms-MessageBar--warning": {
|
|
||||||
"backgroundColor": "var(--colorStatusWarningBackground1)",
|
|
||||||
"border": "1px solid var(--colorStatusWarningBorder1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-icon": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
".ms-MessageBar-text": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
To safeguard the integrity of the data being copied to the new container, ensure that no updates are made to the source container for the entire duration of the partition key change process.
|
To safeguard the integrity of the data being copied to the new container, ensure that no updates are made to the source container for the entire duration of the partition key change process.
|
||||||
<StyledLinkBase
|
<StyledLinkBase
|
||||||
href="https://learn.microsoft.com/azure/cosmos-db/container-copy#how-does-container-copy-work"
|
href="https://learn.microsoft.com/azure/cosmos-db/container-copy#how-does-container-copy-work"
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorBrandForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target="_blank"
|
target="_blank"
|
||||||
underline={true}
|
underline={true}
|
||||||
>
|
>
|
||||||
Learn more
|
Learn more
|
||||||
</StyledLinkBase>
|
</StyledLinkBase>
|
||||||
</StyledMessageBar>
|
</StyledMessageBar>
|
||||||
<Text
|
<Text>
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
To change the partition key, a new destination container must be created or an existing destination container selected. Data will then be copied to the destination container.
|
To change the partition key, a new destination container must be created or an existing destination container selected. Data will then be copied to the destination container.
|
||||||
</Text>
|
</Text>
|
||||||
<CustomizedPrimaryButton
|
<CustomizedPrimaryButton
|
||||||
data-test="change-partition-key-button"
|
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
@@ -217,7 +158,6 @@ exports[`PartitionKeyComponent renders read-only component and matches snapshot
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -230,7 +170,6 @@ exports[`PartitionKeyComponent renders read-only component and matches snapshot
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -240,31 +179,14 @@ exports[`PartitionKeyComponent renders read-only component and matches snapshot
|
|||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
data-test="partition-key-values"
|
|
||||||
tokens={
|
tokens={
|
||||||
{
|
{
|
||||||
"childrenGap": 5,
|
"childrenGap": 5,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
<Text />
|
||||||
styles={
|
<Text>
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Text
|
|
||||||
styles={
|
|
||||||
{
|
|
||||||
"root": {
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Non-hierarchical
|
Non-hierarchical
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,6 @@ exports[`ToolTipLabelComponent renders 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,6 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,7 +15,6 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"fontWeight": 600,
|
"fontWeight": 600,
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
@@ -52,7 +50,6 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
"marginTop": 15,
|
"marginTop": 15,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +65,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -86,7 +83,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -107,7 +104,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -119,7 +116,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -139,7 +136,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -155,7 +152,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -170,7 +167,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -184,7 +181,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -196,7 +193,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -216,7 +213,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -224,21 +221,10 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
>
|
>
|
||||||
Enable change feed log retention policy to retain last 10 minutes of history for items in the container by default. To support this, the request unit (RU) charge for this container will be multiplied by a factor of two for writes. Reads are unaffected.
|
Enable change feed log retention policy to retain last 10 minutes of history for items in the container by default. To support this, the request unit (RU) charge for this container will be multiplied by a factor of two for writes. Reads are unaffected.
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text>
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorNeutralForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
For queries that filter on multiple properties, create multiple single field indexes instead of a compound index.
|
For queries that filter on multiple properties, create multiple single field indexes instead of a compound index.
|
||||||
<StyledLinkBase
|
<StyledLinkBase
|
||||||
href="https://docs.microsoft.com/azure/cosmos-db/mongodb-indexing#index-types"
|
href="https://docs.microsoft.com/azure/cosmos-db/mongodb-indexing#index-types"
|
||||||
style={
|
|
||||||
{
|
|
||||||
"color": "var(--colorBrandForeground1)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Compound indexes
|
Compound indexes
|
||||||
@@ -270,7 +256,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -286,7 +272,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -303,7 +289,7 @@ exports[`SettingsUtils functions render 1`] = `
|
|||||||
styles={
|
styles={
|
||||||
{
|
{
|
||||||
"root": {
|
"root": {
|
||||||
"color": "var(--colorNeutralForeground1)",
|
"color": "windowtext",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ export const CostEstimateText: FunctionComponent<CostEstimateTextProps> = ({
|
|||||||
|
|
||||||
if (isAutoscale) {
|
if (isAutoscale) {
|
||||||
return (
|
return (
|
||||||
<Stack style={{ marginBottom: 6, color: "var(--colorNeutralForeground1)" }}>
|
<Stack style={{ marginBottom: 6 }}>
|
||||||
<Text variant="small" style={{ color: "var(--colorNeutralForeground1)" }}>
|
<Text variant="small">
|
||||||
{estimatedMonthlyCost} ({currency}){iconWithEstimatedCostDisclaimer}:{" "}
|
{estimatedMonthlyCost} ({currency}){iconWithEstimatedCostDisclaimer}:{" "}
|
||||||
<b>
|
<b>
|
||||||
{currencySign + calculateEstimateNumber(monthlyPrice / 10)} -{" "}
|
{currencySign + calculateEstimateNumber(monthlyPrice / 10)} -{" "}
|
||||||
@@ -70,7 +70,7 @@ export const CostEstimateText: FunctionComponent<CostEstimateTextProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack style={{ marginBottom: 8 }}>
|
<Stack style={{ marginBottom: 8 }}>
|
||||||
<Text variant="small" style={{ color: "var(--colorNeutralForeground1)" }}>
|
<Text variant="small">
|
||||||
Estimated cost ({currency}){iconWithEstimatedCostDisclaimer}:{" "}
|
Estimated cost ({currency}){iconWithEstimatedCostDisclaimer}:{" "}
|
||||||
<b>
|
<b>
|
||||||
{currencySign + calculateEstimateNumber(hourlyPrice)} hourly /{" "}
|
{currencySign + calculateEstimateNumber(hourlyPrice)} hourly /{" "}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user