Skip to content

Commit 49cc0c5

Browse files
authored
[AN-373] Remove Terra Workflow Repository feature flag (#5243)
1 parent 6346dac commit 49cc0c5

File tree

8 files changed

+22
-60
lines changed

8 files changed

+22
-60
lines changed

src/libs/feature-previews-config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export const ENABLE_JUPYTERLAB_ID = 'enableJupyterLabGCP';
33
export const HAIL_BATCH_AZURE_FEATURE_ID = 'hail-batch-azure';
44
export const ENABLE_AZURE_PFB_IMPORT = 'enableAzurePfbImport';
55
export const ENABLE_AZURE_TDR_IMPORT = 'enableAzureTdrImport';
6-
export const FIRECLOUD_UI_MIGRATION = 'firecloudUiMigration';
76
export const COHORT_BUILDER_CARD = 'cohortBuilderCard';
87
export const SPEND_REPORTING = 'spendReporting';
98
export const AUTO_GENERATE_DATA_TABLES = 'autoGenerateDataTables';
@@ -89,14 +88,6 @@ const featurePreviewsConfig: readonly FeaturePreview[] = [
8988
)}`,
9089
lastUpdated: '12/1/2023',
9190
},
92-
{
93-
id: FIRECLOUD_UI_MIGRATION,
94-
title: 'Terra Workflow Repository Improvements',
95-
description:
96-
'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.',
97-
feedbackUrl: 'https://support.terra.bio/hc/en-us/articles/31191238873243',
98-
lastUpdated: '1/7/2025',
99-
},
10091
{
10192
id: COHORT_BUILDER_CARD,
10293
title: 'Cohort Builder Card',

src/pages/library/WorkflowsLibrary.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ describe('Workflows Library', () => {
2121

2222
// discover workflows section
2323
expect(screen.getByText('Discover Workflows')).toBeInTheDocument();
24+
// Dockstore and Terra Workflow Repo card
2425
expect(screen.getByText('Dockstore.org')).toBeInTheDocument();
25-
expect(screen.getByText('Broad Methods Repository')).toBeInTheDocument();
26+
expect(screen.getByText('Terra Workflow Repository')).toBeInTheDocument();
2627

2728
// curated workflows section
2829
expect(screen.getByText('Curated collections from our community:')).toBeInTheDocument();

src/pages/library/WorkflowsLibrary.tsx

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ import React from 'react';
44
import FooterWrapper from 'src/components/FooterWrapper';
55
import { libraryTopMatter } from 'src/components/library-common';
66
import terraLogo from 'src/images/brands/terra/logo.svg';
7-
import broadLogo from 'src/images/library/workflows/broad-square.svg';
87
import dockstoreLogo from 'src/images/library/workflows/dockstore.svg';
98
import { Metrics } from 'src/libs/ajax/Metrics';
10-
import { getEnabledBrand } from 'src/libs/brand-utils';
119
import colors from 'src/libs/colors';
1210
import { getConfig } from 'src/libs/config';
1311
import Events, { MetricsEventName } from 'src/libs/events';
14-
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews';
15-
import { FIRECLOUD_UI_MIGRATION } from 'src/libs/feature-previews-config';
1612
import * as Nav from 'src/libs/nav';
1713
import * as Style from 'src/libs/style';
1814
import * as Utils from 'src/libs/utils';
@@ -62,12 +58,7 @@ interface WorkflowSourceBoxProps {
6258

6359
const WorkflowSourceBox = (props: WorkflowSourceBoxProps) => {
6460
const sendMetrics = () => {
65-
// don't send metrics if Broad Methods Repo card and links are shown in UI
66-
// TODO: remove this if condition when feature flag FIRECLOUD_UI_MIGRATION is removed.
67-
// https://broadworkbench.atlassian.net/browse/AN-373
68-
if (props.title !== 'Broad Methods Repository') {
69-
void Metrics().captureEvent(props.metricsEventName);
70-
}
61+
void Metrics().captureEvent(props.metricsEventName);
7162
};
7263

7364
return (
@@ -145,11 +136,8 @@ const CuratedWorkflowsSection = () => {
145136
export const WorkflowsLibrary = () => {
146137
const dockstoreUrl = `${getConfig().dockstoreUrlRoot}/search?_type=workflow&descriptorType=WDL&searchMode=files`;
147138

148-
// Set to static `workflows` and remove feature flag
149-
const workflowsRepoUrl: string = isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION)
150-
? Nav.getLink('workflows')
151-
: `${getConfig().firecloudUrlRoot}/?return=${getEnabledBrand().queryName}#methods`;
152-
const workflowsRepoLogo = isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) ? terraLogo : broadLogo;
139+
const workflowsRepoUrl: string = Nav.getLink('workflows');
140+
const workflowsRepoLogo = terraLogo;
153141

154142
return (
155143
<FooterWrapper alwaysShow>
@@ -171,11 +159,7 @@ export const WorkflowsLibrary = () => {
171159
</div>
172160
<div style={{ marginLeft: 20 }}>
173161
<WorkflowSourceBox
174-
title={
175-
isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION)
176-
? 'Terra Workflow Repository'
177-
: 'Broad Methods Repository'
178-
}
162+
title='Terra Workflow Repository'
179163
description='A repository of WDL workflows that offers quick hosting of public and private workflows.'
180164
url={workflowsRepoUrl}
181165
logoFilePath={workflowsRepoLogo}

src/pages/workspaces/workspace/Workflows.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { asMockedFn, partial } from '@terra-ui-packages/test-utils';
2-
import { screen, within } from '@testing-library/react';
3-
import { act } from '@testing-library/react';
2+
import { act, screen, within } from '@testing-library/react';
43
import userEvent from '@testing-library/user-event';
54
import { h } from 'react-hyperscript-helpers';
65
import { Apps, AppsAjaxContract } from 'src/libs/ajax/leonardo/Apps';
@@ -128,9 +127,9 @@ describe('Find Workflow modal in Workflows view', () => {
128127

129128
expect(findWorkflowModal).toBeInTheDocument();
130129
expect(within(findWorkflowModal).getByText('Find a workflow')).toBeInTheDocument();
131-
// Dockstore and Broad Methods Repo cards
130+
// Dockstore and Terra Workflow Repo card
132131
expect(within(findWorkflowModal).getByText('Dockstore.org')).toBeInTheDocument();
133-
expect(within(findWorkflowModal).getByText('Broad Methods Repository')).toBeInTheDocument();
132+
expect(within(findWorkflowModal).getByText('Terra Workflow Repository')).toBeInTheDocument();
134133
// curated workflows section
135134
expect(within(findWorkflowModal).getByText('GATK Best Practices')).toBeInTheDocument();
136135
expect(within(findWorkflowModal).getByText('Long Read Pipelines')).toBeInTheDocument();

src/pages/workspaces/workspace/modals/FindWorkflowModal.test.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import React from 'react';
44
import { FindWorkflowModal } from 'src/pages/workspaces/workspace/modals/FindWorkflowModal';
55
import { renderWithAppContexts as render } from 'src/testing/test-utils';
66

7+
jest.mock('src/libs/ajax');
8+
jest.mock('src/libs/nav', () => ({
9+
...jest.requireActual('src/libs/nav'),
10+
getLink: jest.fn(() => '#workflows'),
11+
}));
12+
713
describe('FindWorkflowModal', () => {
814
it('renders elements in the modal', async () => {
915
// Act
@@ -15,9 +21,9 @@ describe('FindWorkflowModal', () => {
1521
expect(screen.getByText('Find a workflow')).toBeInTheDocument();
1622
// 'x' close button
1723
expect(screen.getByLabelText('Close modal')).toBeInTheDocument();
18-
// Dockstore and Broad Methods Repo cards
24+
// Dockstore and Terra Workflow Repo card
1925
expect(screen.getByText('Dockstore.org')).toBeInTheDocument();
20-
expect(screen.getByText('Broad Methods Repository')).toBeInTheDocument();
26+
expect(screen.getByText('Terra Workflow Repository')).toBeInTheDocument();
2127
// curated workflows section
2228
expect(screen.getByText('GATK Best Practices')).toBeInTheDocument();
2329
expect(screen.getByText('Long Read Pipelines')).toBeInTheDocument();

src/pages/workspaces/workspace/modals/FindWorkflowModal.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ import { icon, Link, Modal } from '@terra-ui-packages/components';
22
import _ from 'lodash/fp';
33
import React from 'react';
44
import { Metrics } from 'src/libs/ajax/Metrics';
5-
import { getEnabledBrand } from 'src/libs/brand-utils';
65
import colors from 'src/libs/colors';
76
import { getConfig } from 'src/libs/config';
87
import Events, { MetricsEventName } from 'src/libs/events';
9-
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews';
10-
import { FIRECLOUD_UI_MIGRATION } from 'src/libs/feature-previews-config';
118
import * as Nav from 'src/libs/nav';
129
import * as Utils from 'src/libs/utils';
1310
import { CuratedWorkflowDetails, curatedWorkflowsList } from 'src/pages/library/workflows/curated-workflows-utils';
@@ -22,12 +19,7 @@ interface WorkflowSourceCardProps {
2219

2320
const WorkflowSourceCard = (props: WorkflowSourceCardProps) => {
2421
const sendMetrics = () => {
25-
// don't send metrics if Broad Methods Repo card and links are shown in UI
26-
// TODO: remove this if condition when feature flag FIRECLOUD_UI_MIGRATION is removed.
27-
// https://broadworkbench.atlassian.net/browse/AN-373
28-
if (props.title !== 'Broad Methods Repository') {
29-
void Metrics().captureEvent(props.metricsEventName);
30-
}
22+
void Metrics().captureEvent(props.metricsEventName);
3123
};
3224

3325
return (
@@ -82,9 +74,7 @@ export const FindWorkflowModal = (props: FindWorkflowModalProps) => {
8274
const { onDismiss } = props;
8375

8476
const dockstoreUrl = `${getConfig().dockstoreUrlRoot}/search?_type=workflow&descriptorType=WDL&searchMode=files`;
85-
const workflowsRepoUrl: string = isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION)
86-
? Nav.getLink('workflows')
87-
: `${getConfig().firecloudUrlRoot}/?return=${getEnabledBrand().queryName}#methods`;
77+
const workflowsRepoUrl = Nav.getLink('workflows');
8878

8979
return (
9080
<Modal onDismiss={onDismiss} title='Find a workflow' showCancel okButton={false} showX width={870}>
@@ -100,9 +90,7 @@ export const FindWorkflowModal = (props: FindWorkflowModalProps) => {
10090
</div>
10191
<div style={{ flex: 1, marginLeft: 20 }}>
10292
<WorkflowSourceCard
103-
title={
104-
isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) ? 'Terra Workflow Repository' : 'Broad Methods Repository'
105-
}
93+
title='Terra Workflow Repository'
10694
description='A repository of WDL workflows that offers private workflows hosted in the platform.'
10795
url={workflowsRepoUrl}
10896
openInNewTab={false}

src/pages/workspaces/workspace/workflows/WorkflowView.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import colors, { terraSpecial } from 'src/libs/colors';
3636
import { reportError, withErrorReporting } from 'src/libs/error';
3737
import Events, { extractWorkspaceDetails } from 'src/libs/events';
3838
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews';
39-
import { FIRECLOUD_UI_MIGRATION, PREVIEW_COST_CAPPING } from 'src/libs/feature-previews-config';
39+
import { PREVIEW_COST_CAPPING } from 'src/libs/feature-previews-config';
4040
import { HiddenLabel } from 'src/libs/forms';
4141
import * as Nav from 'src/libs/nav';
4242
import { getLocalPref, setLocalPref } from 'src/libs/prefs';
@@ -971,7 +971,6 @@ export const WorkflowView = _.flow(
971971
Link,
972972
{
973973
href: methodLink(modifiedConfig),
974-
...(isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) ? {} : Utils.newTabLinkProps),
975974
},
976975
[sourceDisplay]
977976
),
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { getEnabledBrand } from 'src/libs/brand-utils';
21
import { getConfig } from 'src/libs/config';
3-
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews';
4-
import { FIRECLOUD_UI_MIGRATION } from 'src/libs/feature-previews-config';
52
import * as Nav from 'src/libs/nav';
63

74
export const methodLink = (config) => {
@@ -10,10 +7,7 @@ export const methodLink = (config) => {
107
} = config;
118

129
if (sourceRepo === 'agora') {
13-
if (isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION)) {
14-
return Nav.getLink('workflow-dashboard', { namespace: methodNamespace, name: methodName, snapshotId: methodVersion });
15-
}
16-
return `${getConfig().firecloudUrlRoot}/?return=${getEnabledBrand().queryName}#methods/${methodNamespace}/${methodName}/${methodVersion}`;
10+
return Nav.getLink('workflow-dashboard', { namespace: methodNamespace, name: methodName, snapshotId: methodVersion });
1711
}
1812
return `${getConfig().dockstoreUrlRoot}/workflows/${methodPath}:${methodVersion}`;
1913
};

0 commit comments

Comments
 (0)