Skip to content

Commit bee7eff

Browse files
authored
feat: show ncpi exports, as disabled with coming soon (#4754) (#4755)
Co-authored-by: Fran McDade <18710366+frano-m@users.noreply.github.com>
1 parent d9d4175 commit bee7eff

File tree

11 files changed

+23
-91
lines changed

11 files changed

+23
-91
lines changed

app/components/Export/components/AnVILExplorer/platform/ExportMethod/exportMethod.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/shared/entities.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/**
22
* Set of possible feature flags.
33
*/
4-
export enum FEATURES {
5-
NCPI_EXPORT = "ncpiexport",
6-
}
4+
export enum FEATURES {}

app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ export const buildDatasetExportToPlatformMethod = ({
634634
return {
635635
...props,
636636
...getExportMethodAccessibility(viewContext),
637+
comingSoon: true,
637638
route: `${datasetPath}${route}`,
638639
};
639640
};
@@ -1076,6 +1077,7 @@ export const buildExportToPlatformMethod = (
10761077
return {
10771078
...props,
10781079
...getExportMethodAccessibility(viewContext),
1080+
comingSoon: true,
10791081
};
10801082
};
10811083
};

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"check-system-status:anvil-cmg": "esrun e2e/anvil/anvil-check-system-status.ts"
3333
},
3434
"dependencies": {
35-
"@databiosphere/findable-ui": "^50.5.0",
35+
"@databiosphere/findable-ui": "^50.6.0",
3636
"@emotion/react": "^11",
3737
"@emotion/styled": "^11",
3838
"@mdx-js/loader": "^3",

pages/[entityListType]/[...params].tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import { EntityGuard } from "../../app/components/Detail/components/EntityGuard/
3030
import { readFile } from "../../app/utils/tsvParser";
3131
import { useRouter } from "next/router";
3232
import { useConfig } from "@databiosphere/findable-ui/lib/hooks/useConfig";
33-
import { useFeatureFlag } from "@databiosphere/findable-ui/lib/hooks/useFeatureFlag/useFeatureFlag";
34-
import { FEATURES } from "../../app/shared/entities";
3533
import NextError from "next/error";
3634
import { ROUTES } from "../../site-config/anvil-cmg/dev/export/routes";
3735

@@ -40,12 +38,6 @@ import { DatasetsResponse } from "../../app/apis/azul/anvil-cmg/common/responses
4038

4139
const setOfProcessedIds = new Set<string>();
4240

43-
const NCPI_EXPORT_PATHS = [
44-
ROUTES.BIO_DATA_CATALYST,
45-
ROUTES.CANCER_GENOMICS_CLOUD,
46-
ROUTES.CAVATICA,
47-
];
48-
4941
const CURL_DOWNLOAD_PATH = ROUTES.CURL_DOWNLOAD;
5042

5143
interface StaticPath {
@@ -71,12 +63,9 @@ export interface EntityDetailPageProps extends AzulEntityStaticResponse {
7163
const EntityDetailPage = (props: EntityDetailPageProps): JSX.Element => {
7264
const { config: siteConfig } = useConfig();
7365
const isAnVIL = siteConfig.appTitle?.includes("AnVIL");
74-
const isNCPIExportEnabled = useFeatureFlag(FEATURES.NCPI_EXPORT);
7566
const { query } = useRouter();
7667
if (!props.entityListType) return <></>;
7768
if (props.override) return <EntityGuard override={props.override} />;
78-
if (!isNCPIExportEnabled && isNCPIExportRoute(query))
79-
return <NextError statusCode={404} />;
8069
// Curl download requires NRES consent group (AnVIL only)
8170
if (isAnVIL && isCurlDownloadRoute(query) && !isNRESDataset(props.data)) {
8271
return <NextError statusCode={404} />;
@@ -102,19 +91,6 @@ function findOverride(
10291
return overrides.find(({ entryId }) => entryId === entityId);
10392
}
10493

105-
/**
106-
* Returns true if the current route is an NCPI export route.
107-
* @param query - Parsed URL query.
108-
* @returns True if the route matches an NCPI export path.
109-
*/
110-
function isNCPIExportRoute(query: ParsedUrlQuery): boolean {
111-
const params = query.params as string[] | undefined;
112-
const lastParam = params?.[params.length - 1] || "";
113-
return NCPI_EXPORT_PATHS.map((path) => path.replace("/export/", "")).includes(
114-
lastParam
115-
);
116-
}
117-
11894
/**
11995
* Returns true if the current route is a curl download route.
12096
* @param query - Parsed URL query.

pages/export/biodata-catalyst.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { JSX } from "react";
21
import { ExportMethodView } from "@databiosphere/findable-ui/lib/views/ExportMethodView/exportMethodView";
32
import { GetStaticProps } from "next";
4-
import { useFeatureFlag } from "@databiosphere/findable-ui/lib/hooks/useFeatureFlag/useFeatureFlag";
5-
import { FEATURES } from "../../app/shared/entities";
6-
import Error from "next/error";
3+
import { JSX } from "react";
74

85
export const getStaticProps: GetStaticProps = async () => {
96
return {
@@ -18,10 +15,6 @@ export const getStaticProps: GetStaticProps = async () => {
1815
* @returns export method view component.
1916
*/
2017
const ExportMethodPage = (): JSX.Element => {
21-
const isEnabled = useFeatureFlag(FEATURES.NCPI_EXPORT);
22-
23-
if (!isEnabled) return <Error statusCode={404} />;
24-
2518
return <ExportMethodView />;
2619
};
2720

pages/export/cancer-genomics-cloud.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { JSX } from "react";
21
import { ExportMethodView } from "@databiosphere/findable-ui/lib/views/ExportMethodView/exportMethodView";
32
import { GetStaticProps } from "next";
4-
import { useFeatureFlag } from "@databiosphere/findable-ui/lib/hooks/useFeatureFlag/useFeatureFlag";
5-
import { FEATURES } from "../../app/shared/entities";
6-
import Error from "next/error";
3+
import { JSX } from "react";
74

85
export const getStaticProps: GetStaticProps = async () => {
96
return {
@@ -18,10 +15,6 @@ export const getStaticProps: GetStaticProps = async () => {
1815
* @returns export method view component.
1916
*/
2017
const ExportMethodPage = (): JSX.Element => {
21-
const isEnabled = useFeatureFlag(FEATURES.NCPI_EXPORT);
22-
23-
if (!isEnabled) return <Error statusCode={404} />;
24-
2518
return <ExportMethodView />;
2619
};
2720

pages/export/cavatica.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { JSX } from "react";
21
import { ExportMethodView } from "@databiosphere/findable-ui/lib/views/ExportMethodView/exportMethodView";
32
import { GetStaticProps } from "next";
4-
import { useFeatureFlag } from "@databiosphere/findable-ui/lib/hooks/useFeatureFlag/useFeatureFlag";
5-
import { FEATURES } from "../../app/shared/entities";
6-
import Error from "next/error";
3+
import { JSX } from "react";
74

85
export const getStaticProps: GetStaticProps = async () => {
96
return {
@@ -18,10 +15,6 @@ export const getStaticProps: GetStaticProps = async () => {
1815
* @returns export method view component.
1916
*/
2017
const ExportMethodPage = (): JSX.Element => {
21-
const isEnabled = useFeatureFlag(FEATURES.NCPI_EXPORT);
22-
23-
if (!isEnabled) return <Error statusCode={404} />;
24-
2518
return <ExportMethodView />;
2619
};
2720

site-config/anvil-cmg/dev/detail/dataset/export/export.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as C from "../../../../../../app/components";
77
import * as MDX from "../../../../../../app/components/common/MDXContent/anvil-cmg";
88
import { DownloadSection } from "../../../../../../app/components/Export/components/AnVILExplorer/components/ExportEntity/components/DownloadSection/downloadSection";
99
import { ExportSection } from "../../../../../../app/components/Export/components/AnVILExplorer/components/ExportEntity/components/ExportSection/exportSection";
10-
import { ExportMethod } from "../../../../../../app/components/Export/components/AnVILExplorer/platform/ExportMethod/exportMethod";
1110
import { ExportToPlatform } from "../../../../../../app/components/Export/components/AnVILExplorer/platform/ExportToPlatform/exportToPlatform";
1211
import * as V from "../../../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
1312
import { EXPORT_METHODS, EXPORTS } from "../../../export/constants";
@@ -387,23 +386,23 @@ export const exportConfig: ExportConfig = {
387386
viewBuilder: V.buildDatasetExportMethodTerra,
388387
} as ComponentConfig<typeof C.ExportMethod>,
389388
{
390-
component: ExportMethod,
389+
component: C.ExportMethod,
391390
viewBuilder: V.buildDatasetExportToPlatformMethod(
392391
EXPORT_METHODS.BIO_DATA_CATALYST
393392
),
394-
} as ComponentConfig<typeof ExportMethod>,
393+
} as ComponentConfig<typeof C.ExportMethod>,
395394
{
396-
component: ExportMethod,
395+
component: C.ExportMethod,
397396
viewBuilder: V.buildDatasetExportToPlatformMethod(
398397
EXPORT_METHODS.CAVATICA
399398
),
400-
} as ComponentConfig<typeof ExportMethod>,
399+
} as ComponentConfig<typeof C.ExportMethod>,
401400
{
402-
component: ExportMethod,
401+
component: C.ExportMethod,
403402
viewBuilder: V.buildDatasetExportToPlatformMethod(
404403
EXPORT_METHODS.CANCER_GENOMICS_CLOUD
405404
),
406-
} as ComponentConfig<typeof ExportMethod>,
405+
} as ComponentConfig<typeof C.ExportMethod>,
407406
{
408407
component: DownloadSection,
409408
viewBuilder: V.buildDatasetDownloadSectionProps,

0 commit comments

Comments
 (0)