Skip to content

Commit

Permalink
Merge branch 'dev' into AN-370-submission-download
Browse files Browse the repository at this point in the history
  • Loading branch information
lucymcnatt authored Feb 6, 2025
2 parents 5a87b70 + 49cc0c5 commit 262d4ed
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 60 deletions.
9 changes: 0 additions & 9 deletions src/libs/feature-previews-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion src/pages/library/WorkflowsLibrary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
24 changes: 4 additions & 20 deletions src/pages/library/WorkflowsLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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 (
<FooterWrapper alwaysShow>
Expand All @@ -171,11 +159,7 @@ export const WorkflowsLibrary = () => {
</div>
<div style={{ marginLeft: 20 }}>
<WorkflowSourceBox
title={
isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION)
? 'Terra Workflow Repository'
: 'Broad Methods Repository'
}
title='Terra Workflow Repository'
description='A repository of WDL workflows that offers quick hosting of public and private workflows.'
url={workflowsRepoUrl}
logoFilePath={workflowsRepoLogo}
Expand Down
7 changes: 3 additions & 4 deletions src/pages/workspaces/workspace/Workflows.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { asMockedFn, partial } from '@terra-ui-packages/test-utils';
import { screen, within } from '@testing-library/react';
import { act } from '@testing-library/react';
import { act, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { h } from 'react-hyperscript-helpers';
import { Apps, AppsAjaxContract } from 'src/libs/ajax/leonardo/Apps';
Expand Down Expand Up @@ -128,9 +127,9 @@ describe('Find Workflow modal in Workflows view', () => {

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();
Expand Down
10 changes: 8 additions & 2 deletions src/pages/workspaces/workspace/modals/FindWorkflowModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
18 changes: 3 additions & 15 deletions src/pages/workspaces/workspace/modals/FindWorkflowModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 (
Expand Down Expand Up @@ -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 (
<Modal onDismiss={onDismiss} title='Find a workflow' showCancel okButton={false} showX width={870}>
Expand All @@ -100,9 +90,7 @@ export const FindWorkflowModal = (props: FindWorkflowModalProps) => {
</div>
<div style={{ flex: 1, marginLeft: 20 }}>
<WorkflowSourceCard
title={
isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) ? 'Terra Workflow Repository' : 'Broad Methods Repository'
}
title='Terra Workflow Repository'
description='A repository of WDL workflows that offers private workflows hosted in the platform.'
url={workflowsRepoUrl}
openInNewTab={false}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/workspaces/workspace/workflows/WorkflowView.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import colors, { terraSpecial } from 'src/libs/colors';
import { reportError, withErrorReporting } from 'src/libs/error';
import Events, { extractWorkspaceDetails } from 'src/libs/events';
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews';
import { FIRECLOUD_UI_MIGRATION, PREVIEW_COST_CAPPING } from 'src/libs/feature-previews-config';
import { PREVIEW_COST_CAPPING } from 'src/libs/feature-previews-config';
import { HiddenLabel } from 'src/libs/forms';
import * as Nav from 'src/libs/nav';
import { getLocalPref, setLocalPref } from 'src/libs/prefs';
Expand Down Expand Up @@ -971,7 +971,6 @@ export const WorkflowView = _.flow(
Link,
{
href: methodLink(modifiedConfig),
...(isFeaturePreviewEnabled(FIRECLOUD_UI_MIGRATION) ? {} : Utils.newTabLinkProps),
},
[sourceDisplay]
),
Expand Down
8 changes: 1 addition & 7 deletions src/pages/workspaces/workspace/workflows/methodLink.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { getEnabledBrand } from 'src/libs/brand-utils';
import { getConfig } from 'src/libs/config';
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews';
import { FIRECLOUD_UI_MIGRATION } from 'src/libs/feature-previews-config';
import * as Nav from 'src/libs/nav';

export const methodLink = (config) => {
Expand All @@ -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}`;
};

0 comments on commit 262d4ed

Please sign in to comment.