From 49cc0c5d5727c78bb2c6f4fc24eace8e1694813e Mon Sep 17 00:00:00 2001 From: LizBaldo Date: Thu, 6 Feb 2025 16:13:29 -0500 Subject: [PATCH] [AN-373] Remove Terra Workflow Repository feature flag (#5243) --- src/libs/feature-previews-config.ts | 9 ------- src/pages/library/WorkflowsLibrary.test.tsx | 3 ++- src/pages/library/WorkflowsLibrary.tsx | 24 ++++--------------- .../workspaces/workspace/Workflows.test.ts | 7 +++--- .../modals/FindWorkflowModal.test.tsx | 10 ++++++-- .../workspace/modals/FindWorkflowModal.tsx | 18 +++----------- .../workspace/workflows/WorkflowView.js | 3 +-- .../workspace/workflows/methodLink.js | 8 +------ 8 files changed, 22 insertions(+), 60 deletions(-) diff --git a/src/libs/feature-previews-config.ts b/src/libs/feature-previews-config.ts index 5ecb727571..1480334b40 100644 --- a/src/libs/feature-previews-config.ts +++ b/src/libs/feature-previews-config.ts @@ -3,7 +3,6 @@ export const ENABLE_JUPYTERLAB_ID = 'enableJupyterLabGCP'; export const HAIL_BATCH_AZURE_FEATURE_ID = 'hail-batch-azure'; export const ENABLE_AZURE_PFB_IMPORT = 'enableAzurePfbImport'; export const ENABLE_AZURE_TDR_IMPORT = 'enableAzureTdrImport'; -export const FIRECLOUD_UI_MIGRATION = 'firecloudUiMigration'; export const COHORT_BUILDER_CARD = 'cohortBuilderCard'; export const SPEND_REPORTING = 'spendReporting'; export const AUTO_GENERATE_DATA_TABLES = 'autoGenerateDataTables'; @@ -89,14 +88,6 @@ const featurePreviewsConfig: readonly FeaturePreview[] = [ )}`, lastUpdated: '12/1/2023', }, - { - id: FIRECLOUD_UI_MIGRATION, - title: 'Terra Workflow Repository Improvements', - description: - 'Enabling this feature will allow creating and editing workflows with the built-in Terra Workflow Repository UI. This replaces the external Broad Methods Repository. Changes made in Terra are reflected in the external Broad Methods Repository, and vice-versa.', - feedbackUrl: 'https://support.terra.bio/hc/en-us/articles/31191238873243', - lastUpdated: '1/7/2025', - }, { id: COHORT_BUILDER_CARD, title: 'Cohort Builder Card', diff --git a/src/pages/library/WorkflowsLibrary.test.tsx b/src/pages/library/WorkflowsLibrary.test.tsx index 9815caf01a..4d0d03df00 100644 --- a/src/pages/library/WorkflowsLibrary.test.tsx +++ b/src/pages/library/WorkflowsLibrary.test.tsx @@ -21,8 +21,9 @@ describe('Workflows Library', () => { // discover workflows section expect(screen.getByText('Discover Workflows')).toBeInTheDocument(); + // Dockstore and Terra Workflow Repo card expect(screen.getByText('Dockstore.org')).toBeInTheDocument(); - expect(screen.getByText('Broad Methods Repository')).toBeInTheDocument(); + expect(screen.getByText('Terra Workflow Repository')).toBeInTheDocument(); // curated workflows section expect(screen.getByText('Curated collections from our community:')).toBeInTheDocument(); diff --git a/src/pages/library/WorkflowsLibrary.tsx b/src/pages/library/WorkflowsLibrary.tsx index e474aeb310..d7c17aba0e 100644 --- a/src/pages/library/WorkflowsLibrary.tsx +++ b/src/pages/library/WorkflowsLibrary.tsx @@ -4,15 +4,11 @@ import React from 'react'; import FooterWrapper from 'src/components/FooterWrapper'; import { libraryTopMatter } from 'src/components/library-common'; import terraLogo from 'src/images/brands/terra/logo.svg'; -import broadLogo from 'src/images/library/workflows/broad-square.svg'; import dockstoreLogo from 'src/images/library/workflows/dockstore.svg'; import { Metrics } from 'src/libs/ajax/Metrics'; -import { getEnabledBrand } from 'src/libs/brand-utils'; import colors from 'src/libs/colors'; import { getConfig } from 'src/libs/config'; import Events, { MetricsEventName } from 'src/libs/events'; -import { isFeaturePreviewEnabled } from 'src/libs/feature-previews'; -import { FIRECLOUD_UI_MIGRATION } from 'src/libs/feature-previews-config'; import * as Nav from 'src/libs/nav'; import * as Style from 'src/libs/style'; import * as Utils from 'src/libs/utils'; @@ -62,12 +58,7 @@ interface WorkflowSourceBoxProps { const WorkflowSourceBox = (props: WorkflowSourceBoxProps) => { const sendMetrics = () => { - // don't send metrics if Broad Methods Repo card and links are shown in UI - // TODO: remove this if condition when feature flag FIRECLOUD_UI_MIGRATION is removed. - // https://broadworkbench.atlassian.net/browse/AN-373 - if (props.title !== 'Broad Methods Repository') { - void Metrics().captureEvent(props.metricsEventName); - } + void Metrics().captureEvent(props.metricsEventName); }; return ( @@ -145,11 +136,8 @@ const CuratedWorkflowsSection = () => { export const WorkflowsLibrary = () => { const dockstoreUrl = `${getConfig().dockstoreUrlRoot}/search?_type=workflow&descriptorType=WDL&searchMode=files`; - // Set to static `workflows` and remove feature flag - const workflowsRepoUrl: string = isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) - ? Nav.getLink('workflows') - : `${getConfig().firecloudUrlRoot}/?return=${getEnabledBrand().queryName}#methods`; - const workflowsRepoLogo = isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) ? terraLogo : broadLogo; + const workflowsRepoUrl: string = Nav.getLink('workflows'); + const workflowsRepoLogo = terraLogo; return ( @@ -171,11 +159,7 @@ export const WorkflowsLibrary = () => {
{ expect(findWorkflowModal).toBeInTheDocument(); expect(within(findWorkflowModal).getByText('Find a workflow')).toBeInTheDocument(); - // Dockstore and Broad Methods Repo cards + // Dockstore and Terra Workflow Repo card expect(within(findWorkflowModal).getByText('Dockstore.org')).toBeInTheDocument(); - expect(within(findWorkflowModal).getByText('Broad Methods Repository')).toBeInTheDocument(); + expect(within(findWorkflowModal).getByText('Terra Workflow Repository')).toBeInTheDocument(); // curated workflows section expect(within(findWorkflowModal).getByText('GATK Best Practices')).toBeInTheDocument(); expect(within(findWorkflowModal).getByText('Long Read Pipelines')).toBeInTheDocument(); diff --git a/src/pages/workspaces/workspace/modals/FindWorkflowModal.test.tsx b/src/pages/workspaces/workspace/modals/FindWorkflowModal.test.tsx index 42feeacfe3..cf972a13e8 100644 --- a/src/pages/workspaces/workspace/modals/FindWorkflowModal.test.tsx +++ b/src/pages/workspaces/workspace/modals/FindWorkflowModal.test.tsx @@ -4,6 +4,12 @@ import React from 'react'; import { FindWorkflowModal } from 'src/pages/workspaces/workspace/modals/FindWorkflowModal'; import { renderWithAppContexts as render } from 'src/testing/test-utils'; +jest.mock('src/libs/ajax'); +jest.mock('src/libs/nav', () => ({ + ...jest.requireActual('src/libs/nav'), + getLink: jest.fn(() => '#workflows'), +})); + describe('FindWorkflowModal', () => { it('renders elements in the modal', async () => { // Act @@ -15,9 +21,9 @@ describe('FindWorkflowModal', () => { expect(screen.getByText('Find a workflow')).toBeInTheDocument(); // 'x' close button expect(screen.getByLabelText('Close modal')).toBeInTheDocument(); - // Dockstore and Broad Methods Repo cards + // Dockstore and Terra Workflow Repo card expect(screen.getByText('Dockstore.org')).toBeInTheDocument(); - expect(screen.getByText('Broad Methods Repository')).toBeInTheDocument(); + expect(screen.getByText('Terra Workflow Repository')).toBeInTheDocument(); // curated workflows section expect(screen.getByText('GATK Best Practices')).toBeInTheDocument(); expect(screen.getByText('Long Read Pipelines')).toBeInTheDocument(); diff --git a/src/pages/workspaces/workspace/modals/FindWorkflowModal.tsx b/src/pages/workspaces/workspace/modals/FindWorkflowModal.tsx index 4609f373bb..8c4cdd3f2a 100644 --- a/src/pages/workspaces/workspace/modals/FindWorkflowModal.tsx +++ b/src/pages/workspaces/workspace/modals/FindWorkflowModal.tsx @@ -2,12 +2,9 @@ import { icon, Link, Modal } from '@terra-ui-packages/components'; import _ from 'lodash/fp'; import React from 'react'; import { Metrics } from 'src/libs/ajax/Metrics'; -import { getEnabledBrand } from 'src/libs/brand-utils'; import colors from 'src/libs/colors'; import { getConfig } from 'src/libs/config'; import Events, { MetricsEventName } from 'src/libs/events'; -import { isFeaturePreviewEnabled } from 'src/libs/feature-previews'; -import { FIRECLOUD_UI_MIGRATION } from 'src/libs/feature-previews-config'; import * as Nav from 'src/libs/nav'; import * as Utils from 'src/libs/utils'; import { CuratedWorkflowDetails, curatedWorkflowsList } from 'src/pages/library/workflows/curated-workflows-utils'; @@ -22,12 +19,7 @@ interface WorkflowSourceCardProps { const WorkflowSourceCard = (props: WorkflowSourceCardProps) => { const sendMetrics = () => { - // don't send metrics if Broad Methods Repo card and links are shown in UI - // TODO: remove this if condition when feature flag FIRECLOUD_UI_MIGRATION is removed. - // https://broadworkbench.atlassian.net/browse/AN-373 - if (props.title !== 'Broad Methods Repository') { - void Metrics().captureEvent(props.metricsEventName); - } + void Metrics().captureEvent(props.metricsEventName); }; return ( @@ -82,9 +74,7 @@ export const FindWorkflowModal = (props: FindWorkflowModalProps) => { const { onDismiss } = props; const dockstoreUrl = `${getConfig().dockstoreUrlRoot}/search?_type=workflow&descriptorType=WDL&searchMode=files`; - const workflowsRepoUrl: string = isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) - ? Nav.getLink('workflows') - : `${getConfig().firecloudUrlRoot}/?return=${getEnabledBrand().queryName}#methods`; + const workflowsRepoUrl = Nav.getLink('workflows'); return ( @@ -100,9 +90,7 @@ export const FindWorkflowModal = (props: FindWorkflowModalProps) => {
{ @@ -10,10 +7,7 @@ export const methodLink = (config) => { } = config; if (sourceRepo === 'agora') { - if (isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION)) { - return Nav.getLink('workflow-dashboard', { namespace: methodNamespace, name: methodName, snapshotId: methodVersion }); - } - return `${getConfig().firecloudUrlRoot}/?return=${getEnabledBrand().queryName}#methods/${methodNamespace}/${methodName}/${methodVersion}`; + return Nav.getLink('workflow-dashboard', { namespace: methodNamespace, name: methodName, snapshotId: methodVersion }); } return `${getConfig().dockstoreUrlRoot}/workflows/${methodPath}:${methodVersion}`; };