Skip to content

Commit c1fc9d1

Browse files
feat: removed verbatim ff #4350
1 parent e2653f5 commit c1fc9d1

File tree

7 files changed

+29
-105
lines changed

7 files changed

+29
-105
lines changed

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

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

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

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ import {
104104
import * as C from "../../../../components";
105105
import * as MDX from "../../../../components/common/MDXContent/anvil-cmg";
106106
import { Description } from "../../../../components/Detail/components/MDX/components/Description/description";
107-
import { ExportMethod } from "../../../../components/Export/components/AnVILExplorer/ExportMethod/exportMethod";
107+
import { ExportMethod } from "@databiosphere/findable-ui/lib/components/Export/components/ExportMethod/exportMethod";
108108
import { METADATA_KEY } from "../../../../components/Index/common/entities";
109109
import { getPluralizedMetadataLabel } from "../../../../components/Index/common/indexTransformer";
110-
import { FEATURE_FLAGS } from "../../../common/contants";
111110
import { Unused, Void } from "../../../common/entities";
112111
import { SUMMARY_DISPLAY_TEXT } from "./summaryMapper/constants";
113112
import { mapExportSummary } from "./summaryMapper/summaryMapper";
@@ -167,31 +166,6 @@ export const buildAlertDatasetManifestDownloadWarning = (
167166
};
168167
};
169168

170-
/**
171-
* Build props for dataset-related export warning Alert component.
172-
* @param _ - Unused.
173-
* @param viewContext - View context.
174-
* @returns model to be used as props for the Alert component.
175-
*/
176-
export const buildAlertDatasetTerraExportWarning = (
177-
_: Unused,
178-
viewContext: ViewContext<Unused>
179-
): React.ComponentProps<typeof MDX.Alert> => {
180-
const {
181-
exploreState: { featureFlagState },
182-
} = viewContext;
183-
const content = featureFlagState?.includes(FEATURE_FLAGS.VERBATIM)
184-
? isUserAuthenticated(viewContext)
185-
? "To export this dataset, please request access."
186-
: "To export this dataset, please sign in and, if necessary, request access."
187-
: "Export functionality is currently under development. Check back soon for updates.";
188-
return {
189-
...ALERT_PROPS.STANDARD_WARNING,
190-
component: C.FluidPaper,
191-
content,
192-
};
193-
};
194-
195169
/**
196170
* Build props for list view access warning Alert component.
197171
* @param _ - Unused.
@@ -1473,50 +1447,6 @@ export const renderWhenUnAuthenticated = (
14731447
};
14741448
};
14751449

1476-
/**
1477-
* Renders dataset export to Terra component when the given datasests response is accessible. Note,
1478-
* this can be removed once the verbatim feature flag is removed (use renderDatasetExport instead).
1479-
* @param datasetsResponse - Response model return from datasets API.
1480-
* @param viewContext - View context.
1481-
* @returns model to be used as props for the ConditionalComponent component.
1482-
* @deprecated
1483-
*/
1484-
export const renderDatasetTerraExport = (
1485-
datasetsResponse: DatasetsResponse,
1486-
viewContext: ViewContext<DatasetsResponse>
1487-
): React.ComponentProps<typeof C.ConditionalComponent> => {
1488-
const {
1489-
exploreState: { featureFlagState },
1490-
} = viewContext;
1491-
return {
1492-
isIn:
1493-
isDatasetAccessible(datasetsResponse) &&
1494-
Boolean(featureFlagState?.includes(FEATURE_FLAGS.VERBATIM)),
1495-
};
1496-
};
1497-
1498-
/**
1499-
* Renders dataset export to Terra warning component when the given datasests response is accessible. Note,
1500-
* this can be removed once the verbatim feature flag is removed (use renderDatasetExportWarning instead).
1501-
* @param datasetsResponse - Response model return from datasets API.
1502-
* @param viewContext - View context.
1503-
* @returns model to be used as props for the ConditionalComponent component.
1504-
* @deprecated
1505-
*/
1506-
export const renderDatasetTerraExportWarning = (
1507-
datasetsResponse: DatasetsResponse,
1508-
viewContext: ViewContext<DatasetsResponse>
1509-
): React.ComponentProps<typeof C.ConditionalComponent> => {
1510-
const {
1511-
exploreState: { featureFlagState },
1512-
} = viewContext;
1513-
return {
1514-
isIn:
1515-
!isDatasetAccessible(datasetsResponse) ||
1516-
Boolean(!featureFlagState?.includes(FEATURE_FLAGS.VERBATIM)),
1517-
};
1518-
};
1519-
15201450
/**
15211451
* Renders dataset export-related components (either the choose export method component,
15221452
* or specific export components) when the given dataset is accessble.

app/viewModelBuilders/common/contants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export const DATE_TIME_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {
66
};
77
export const DATE_TIME_LOCALES = "en-US";
88
export const FEATURE_FLAGS = {
9-
VERBATIM: "verbatim",
9+
VERBATIM: "verbatim", // Deprecated
1010
};

e2e/anvil/anvil-dataset.spec.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import {
1212
MUI_ALERT_ROOT,
1313
MUI_BUTTON_GROUP_ROOT,
14+
MUI_FORM_CONTROL_ROOT,
1415
MUI_TABLE_CELL_ROOT,
1516
MUI_TABLE_ROOT,
1617
MUI_TABLE_ROW_ROOT,
@@ -151,11 +152,26 @@ describe("Dataset", () => {
151152
// Confirm Terra export method is visible and click it.
152153
await clickLink(page, BUTTON_TEXT_ANALYZE_IN_TERRA);
153154

154-
// Confirm the analyze in Terra page is loaded: check the "coming soon"
155-
// message is displayed.
156-
await expect(
157-
page.locator(`${MUI_ALERT_ROOT}:has-text("under development")`)
158-
).toBeVisible();
155+
// Confirm the analyze in Terra page is loaded: check for form elements.
156+
await expect(page.locator(MUI_FORM_CONTROL_ROOT).first()).toBeVisible();
157+
});
158+
159+
test("displays analyze in Terra selected data", async ({ page }) => {
160+
await goToDataset(page, CHIP_TEXT_ACCESS_GRANTED);
161+
162+
// Confirm export button is visible and click it.
163+
await clickLink(page, BUTTON_TEXT_EXPORT);
164+
165+
// Wait for the summary request once the file manifest button is clicked.
166+
const [request] = await Promise.all([
167+
page.waitForRequest((request) =>
168+
request.url().includes(API_ENDPOINT_SUMMARY)
169+
),
170+
clickLink(page, BUTTON_TEXT_ANALYZE_IN_TERRA),
171+
]);
172+
173+
// Confirm summary request has dataset ID request param.
174+
verifySummaryRequest(request);
159175
});
160176
});
161177

e2e/features/common/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const MUI_ALERT_ROOT = ".MuiAlert-root";
22
export const MUI_BUTTON_GROUP_ROOT = ".MuiButtonGroup-root";
3+
export const MUI_FORM_CONTROL_ROOT = ".MuiFormControl-root";
34
export const MUI_TABLE_CELL_ROOT = ".MuiTableCell-root";
45
export const MUI_TABLE_ROOT = ".MuiTable-root";
56
export const MUI_TABLE_ROW_ROOT = ".MuiTableRow-root";

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ export const exportConfig: ExportConfig = {
3636
children: [
3737
{
3838
component: MDX.Alert,
39-
viewBuilder: V.buildAlertDatasetTerraExportWarning,
39+
viewBuilder: V.buildAlertDatasetExportWarning,
4040
} as ComponentConfig<typeof MDX.Alert, DatasetsResponse>,
4141
],
4242
component: C.BackPageContentSingleColumn,
4343
} as ComponentConfig<typeof C.BackPageContentSingleColumn>,
4444
],
4545
component: C.ConditionalComponent,
46-
viewBuilder: V.renderDatasetTerraExportWarning,
46+
viewBuilder: V.renderDatasetExportWarning,
4747
} as ComponentConfig<typeof C.ConditionalComponent, DatasetsResponse>,
4848
/* ------ */
4949
/* Dataset is accessible; render Terra export method */
@@ -63,7 +63,7 @@ export const exportConfig: ExportConfig = {
6363
...exportSideColumn,
6464
],
6565
component: C.ConditionalComponent,
66-
viewBuilder: V.renderDatasetTerraExport,
66+
viewBuilder: V.renderDatasetExport,
6767
} as ComponentConfig<typeof C.ConditionalComponent, DatasetsResponse>,
6868
],
6969
route: ROUTE_EXPORT_TO_TERRA,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
ExportConfig,
44
} from "@databiosphere/findable-ui/lib/config/entities";
55
import * as C from "../../../../app/components";
6-
import { ExportMethod } from "../../../../app/components/Export/components/AnVILExplorer/ExportMethod/exportMethod";
76
import * as V from "../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
87
import { ROUTE_EXPORT_TO_TERRA, ROUTE_MANIFEST_DOWNLOAD } from "./constants";
98
import { mainColumn as exportMainColumn } from "./exportMainColumn";
@@ -73,9 +72,9 @@ export const exportConfig: ExportConfig = {
7372
{
7473
children: [
7574
{
76-
component: ExportMethod,
75+
component: C.ExportMethod,
7776
viewBuilder: V.buildExportMethodTerra,
78-
} as ComponentConfig<typeof ExportMethod>,
77+
} as ComponentConfig<typeof C.ExportMethod>,
7978
{
8079
component: C.ExportMethod,
8180
viewBuilder: V.buildExportMethodManifestDownload,

0 commit comments

Comments
 (0)