From 3138580eae6c2c0034f6d5b7d99cbe5b89f8281d Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Wed, 9 Oct 2024 14:23:31 +0200 Subject: [PATCH 1/2] Move column selection out of mpac (#1980) --- .../DocumentsTableComponent.tsx | 84 +++++++++---------- 1 file changed, 40 insertions(+), 44 deletions(-) diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx index 36689dc59..730e2c1a6 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx @@ -38,7 +38,6 @@ import { TextSortDescendingRegular, } from "@fluentui/react-icons"; import { NormalizedEventKey } from "Common/Constants"; -import { Environment, getEnvironment } from "Common/EnvironmentUtility"; import { TableColumnSelectionPane } from "Explorer/Panes/TableColumnSelectionPane/TableColumnSelectionPane"; import { ColumnSizesMap, @@ -228,31 +227,29 @@ export const DocumentsTableComponent: React.FC = } onClick={onRefreshTable}> Refresh - {[Environment.Development, Environment.Mpac].includes(getEnvironment()) && ( - <> - } - onClick={(e) => onSortClick(e, column.id, "ascending")} - > - Sort ascending + <> + } + onClick={(e) => onSortClick(e, column.id, "ascending")} + > + Sort ascending + + } + onClick={(e) => onSortClick(e, column.id, "descending")} + > + Sort descending + + } onClick={(e) => onSortClick(e, undefined, undefined)}> + Reset sorting + + {!isColumnSelectionDisabled && ( + } onClick={openColumnSelectionPane}> + Edit columns - } - onClick={(e) => onSortClick(e, column.id, "descending")} - > - Sort descending - - } onClick={(e) => onSortClick(e, undefined, undefined)}> - Reset sorting - - {!isColumnSelectionDisabled && ( - } onClick={openColumnSelectionPane}> - Edit columns - - )} - - - )} + )} + + } @@ -260,25 +257,24 @@ export const DocumentsTableComponent: React.FC = > Resize with left/right arrow keys - {[Environment.Development, Environment.Mpac].includes(getEnvironment()) && - !isColumnSelectionDisabled && ( - } - onClick={() => { - // Remove column id from selectedColumnIds - const index = selectedColumnIds.indexOf(column.id); - if (index === -1) { - return; - } - const newSelectedColumnIds = [...selectedColumnIds]; - newSelectedColumnIds.splice(index, 1); - onColumnSelectionChange(newSelectedColumnIds); - }} - > - Remove column - - )} + {!isColumnSelectionDisabled && ( + } + onClick={() => { + // Remove column id from selectedColumnIds + const index = selectedColumnIds.indexOf(column.id); + if (index === -1) { + return; + } + const newSelectedColumnIds = [...selectedColumnIds]; + newSelectedColumnIds.splice(index, 1); + onColumnSelectionChange(newSelectedColumnIds); + }} + > + Remove column + + )} From ac2e2a6f8ed32edc8df0c1bf411d741fe96f594d Mon Sep 17 00:00:00 2001 From: sindhuba <122321535+sindhuba@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:41:58 -0700 Subject: [PATCH 2/2] Add tenantId info in Data Explorer while opening from Portal (#1987) * Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Remove unnecessary code * Remove unnecessary code * Add code to fix VCoreMongo/PG bug * Address feedback * Add more logs for RBAC feature * Add more logs for RBAC features * Add AAD endpoints for all environments * Add AAD endpoints * Run npm format * Support multi-tenant switching for Data plane RBAC * Run npm format --------- Co-authored-by: Asier Isayas --- src/Contracts/ViewModels.ts | 1 + src/UserContext.ts | 1 + src/hooks/useKnockoutExplorer.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Contracts/ViewModels.ts b/src/Contracts/ViewModels.ts index 767665686..f8c6d885c 100644 --- a/src/Contracts/ViewModels.ts +++ b/src/Contracts/ViewModels.ts @@ -381,6 +381,7 @@ export enum TerminalKind { export interface DataExplorerInputsFrame { databaseAccount: any; subscriptionId?: string; + tenantId?: string; resourceGroup?: string; masterKey?: string; hasWriteAccess?: boolean; diff --git a/src/UserContext.ts b/src/UserContext.ts index ac534029a..f4b43a2f3 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -74,6 +74,7 @@ export interface UserContext { readonly authType?: AuthType; readonly masterKey?: string; readonly subscriptionId?: string; + readonly tenantId?: string; readonly resourceGroup?: string; readonly databaseAccount?: DatabaseAccount; readonly endpoint?: string; diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 590b9195b..f86e380a1 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -693,6 +693,7 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) { databaseAccount, resourceGroup: inputs.resourceGroup, subscriptionId: inputs.subscriptionId, + tenantId: inputs.tenantId, subscriptionType: inputs.subscriptionType, quotaId: inputs.quotaId, portalEnv: inputs.serverId as PortalEnv,