From 42a1c6c3195c9237d58620fbfd7680257127287a Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Thu, 19 Sep 2024 07:18:03 +0200 Subject: [PATCH] Move table column selection out of feature flag to MPAC. (#1973) --- .../DocumentsTableComponent.tsx | 41 ++++++++++--------- src/Platform/Hosted/extractFeatures.ts | 2 - 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx index c96d63ff5..36689dc59 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx @@ -38,6 +38,7 @@ 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, @@ -50,7 +51,6 @@ import { import { INITIAL_SELECTED_ROW_INDEX, useDocumentsTabStyles } from "Explorer/Tabs/DocumentsTabV2/DocumentsTabV2"; import { selectionHelper } from "Explorer/Tabs/DocumentsTabV2/SelectionHelper"; import { LayoutConstants } from "Explorer/Theme/ThemeUtil"; -import { userContext } from "UserContext"; import { isEnvironmentCtrlPressed, isEnvironmentShiftPressed } from "Utils/KeyboardUtils"; import { useSidePanel } from "hooks/useSidePanel"; import React, { useCallback, useMemo } from "react"; @@ -228,7 +228,7 @@ export const DocumentsTableComponent: React.FC = } onClick={onRefreshTable}> Refresh - {userContext.features.enableDocumentsTableColumnSelection && ( + {[Environment.Development, Environment.Mpac].includes(getEnvironment()) && ( <> } @@ -260,24 +260,25 @@ export const DocumentsTableComponent: React.FC = > Resize with left/right arrow keys - {userContext.features.enableDocumentsTableColumnSelection && !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 - - )} + {[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 + + )} diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 2ae14e59e..5bd84516e 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -38,7 +38,6 @@ export type Features = { readonly copilotChatFixedMonacoEditorHeight: boolean; readonly enablePriorityBasedExecution: boolean; readonly disableConnectionStringLogin: boolean; - readonly enableDocumentsTableColumnSelection: boolean; // can be set via both flight and feature flag autoscaleDefault: boolean; @@ -109,7 +108,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear copilotChatFixedMonacoEditorHeight: "true" === get("copilotchatfixedmonacoeditorheight"), enablePriorityBasedExecution: "true" === get("enableprioritybasedexecution"), disableConnectionStringLogin: "true" === get("disableconnectionstringlogin"), - enableDocumentsTableColumnSelection: "true" === get("enabledocumentstablecolumnselection"), }; }