From 18135bfa62a7ba453bad76aca420cb16947f4e0c Mon Sep 17 00:00:00 2001 From: GaelleA Date: Wed, 18 Dec 2024 14:50:18 -0500 Subject: [PATCH] feat(variants): SKFP-1410 remove export tsv --- .env.schema | 3 -- src/locales/en.ts | 6 --- .../VariantsTable/index.module.css | 4 -- .../PageContent/VariantsTable/index.tsx | 45 ++----------------- .../PageContent/VariantsTable/utils.tsx | 21 --------- 5 files changed, 3 insertions(+), 76 deletions(-) diff --git a/.env.schema b/.env.schema index 50d72daab..acb2c36ff 100644 --- a/.env.schema +++ b/.env.schema @@ -49,9 +49,6 @@ REACT_APP_FT_DASHBOARD_BANNER=true REACT_APP_FT_DASHBOARD_BANNER_TYPE=info REACT_APP_FT_DASHBOARD_BANNER_MSG="A wonderful notification" -# FEATURE TOGGLE Variant -REACT_APP_FT_VARIANTS_EXPORT=true - # MOCK REACT_MOCK_AUTORIZE_STUDIES=true REACT_MOCK_LOGIN=true diff --git a/src/locales/en.ts b/src/locales/en.ts index a294007c8..8b8052ea8 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1238,12 +1238,6 @@ const en = { variant: 'Variant', variant_class: 'Variant class', variant_id: 'Variant ID', - exportModal: { - title: 'Maximum number exceeded', - content: - 'A maximum of 10,000 items can be exported at a time. Please narrow your selection and try again.', - button: 'Close', - }, }, summary: { summary: 'Summary', diff --git a/src/views/Variants/components/PageContent/VariantsTable/index.module.css b/src/views/Variants/components/PageContent/VariantsTable/index.module.css index 0d9bdd27c..2655f519e 100644 --- a/src/views/Variants/components/PageContent/VariantsTable/index.module.css +++ b/src/views/Variants/components/PageContent/VariantsTable/index.module.css @@ -87,7 +87,3 @@ .partCell { padding-left: 4px; } - -.okButtonConfirmModal { - display: none; -} diff --git a/src/views/Variants/components/PageContent/VariantsTable/index.tsx b/src/views/Variants/components/PageContent/VariantsTable/index.tsx index 922b39bf2..4b065e24c 100644 --- a/src/views/Variants/components/PageContent/VariantsTable/index.tsx +++ b/src/views/Variants/components/PageContent/VariantsTable/index.tsx @@ -2,7 +2,6 @@ import { useEffect, useState } from 'react'; import intl from 'react-intl-universal'; import { useDispatch } from 'react-redux'; import { Link } from 'react-router-dom'; -import { ExclamationCircleOutlined } from '@ant-design/icons'; import ConsequencesCell from '@ferlab/ui/core/components/Consequences/Cell'; import ExternalLink from '@ferlab/ui/core/components/ExternalLink'; import FixedSizeTable from '@ferlab/ui/core/components/FixedSizeTable'; @@ -22,7 +21,7 @@ import { } from '@ferlab/ui/core/graphql/types'; import { numberWithCommas, toExponentialNotation } from '@ferlab/ui/core/utils/numberUtils'; import GridCard from '@ferlab/ui/core/view/v2/GridCard'; -import { Modal, Space, Tooltip } from 'antd'; +import { Space, Tooltip } from 'antd'; import { INDEXES } from 'graphql/constants'; import { hydrateResults } from 'graphql/models'; import { @@ -34,8 +33,7 @@ import { IVariantInternalFrequencies, IVariantStudyEntity, } from 'graphql/variants/models'; -import { getFTEnvVarByKey } from 'helpers/EnvVariables'; -import { capitalize, isEmpty } from 'lodash'; +import { capitalize } from 'lodash'; import SetsManagementDropdown from 'views/DataExploration/components/SetsManagementDropdown'; import { DATA_EXPLORATION_QB_ID, DEFAULT_PAGE_INDEX } from 'views/DataExploration/utils/constant'; @@ -43,7 +41,6 @@ import { TABLE_EMPTY_PLACE_HOLDER } from 'common/constants'; import ExternalLinkIcon from 'components/Icons/ExternalLinkIcon'; import ManeCell from 'components/ManeCell'; import { SetType } from 'services/api/savedSet/models'; -import { fetchTsvReport } from 'store/report/thunks'; import { useUser } from 'store/user'; import { updateUserConfig } from 'store/user/thunks'; import { formatQuerySortList, scrollToTop } from 'utils/helper'; @@ -53,12 +50,10 @@ import { getProTableDictionary } from 'utils/translation'; import { SCROLL_WRAPPER_ID, VARIANT_SAVED_SETS_FIELD } from '../../../utils/constants'; -import { exportTsvColumns, GnomadCircle, renderClinvar, renderOmim } from './utils'; +import { GnomadCircle, renderClinvar, renderOmim } from './utils'; import styles from './index.module.css'; -const EXPORT_TSV_LIMIT = 10000; - interface OwnProps { pageIndex: number; sqon?: ISqonGroupFilter; @@ -465,8 +460,6 @@ const VariantsTable = ({ const [selectedRows, setSelectedRows] = useState([]); const [selectedAllResults, setSelectedAllResults] = useState(false); - const variantsExport = getFTEnvVarByKey('VARIANTS_EXPORT'); - const getCurrentSqon = (): any => selectedAllResults || !selectedKeys.length ? sqon @@ -521,7 +514,6 @@ const VariantsTable = ({ total: results.total, }, enableColumnSort: true, - enableTableExport: variantsExport === 'true' ? true : false, onColumnSortChange: (newState) => dispatch( updateUserConfig({ @@ -539,37 +531,6 @@ const VariantsTable = ({ setSelectedKeys(keys); setSelectedRows(selectedRows); }, - onTableExportClick: () => { - if ( - selectedRows.length > EXPORT_TSV_LIMIT || - (isEmpty(selectedRows) && - !selectedAllResults && - results.total > EXPORT_TSV_LIMIT) || - (selectedAllResults && results.total > EXPORT_TSV_LIMIT) - ) { - Modal.confirm({ - title: intl.get('screen.variants.table.exportModal.title'), - icon: , - content: intl.get('screen.variants.table.exportModal.content'), - cancelText: intl.get('screen.variants.table.exportModal.button'), - okButtonProps: { className: styles.okButtonConfirmModal }, - cancelButtonProps: { type: 'primary' }, - type: 'warn', - }); - } else { - dispatch( - fetchTsvReport({ - columnStates: exportTsvColumns, - columns: getDefaultColumns( - queryBuilderId, - results.data.length === 0 ? true : false, - ), - index: INDEXES.VARIANTS, - sqon: getCurrentSqon(), - }), - ); - } - }, extra: [ ( )} /> ); - -export const exportTsvColumns: TColumnStates = [ - { index: 0, key: 'hgvsg', visible: true }, - { index: 1, key: 'variant_class', visible: true }, - { index: 2, key: 'rsnumber', visible: true }, - { index: 3, key: 'genes.symbol', visible: true }, - { index: 4, key: 'genes.consequences.consequence', visible: true }, - { index: 5, key: 'genes.consequences.aa_change', visible: true }, - { index: 6, key: 'genes.omim_gene_id', visible: true }, - { index: 7, key: 'genes.omim.inheritance', visible: true }, - { index: 8, key: 'clinvar.clin_sig', visible: true }, - { index: 9, key: 'external_frequencies.gnomad_genomes_3.af', visible: true }, - { index: 10, key: 'external_frequencies.gnomad_genomes_3.ac', visible: true }, - { index: 11, key: 'internal_frequencies.total.pc', visible: true }, - { index: 12, key: 'studies.study_code', visible: true }, - { index: 13, key: 'genes.consequences.predictions.cadd_phred', visible: true }, - { index: 14, key: 'genes.consequences.predictions.revel_score', visible: true }, - { index: 15, key: 'internal_frequencies.total.ac', visible: true }, - { index: 16, key: 'internal_frequencies.total.hom', visible: true }, -];