Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DT-788] Footer: Apply for Access to selected Studies and Datasets #2723

Merged
merged 9 commits into from
Nov 14, 2024
Merged
51 changes: 51 additions & 0 deletions src/components/dac_dataset_table/DACDatasetConstants.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {Styles} from '../../libs/theme';

export const styles = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another approach to this is to use modular css. We have several examples in the codebase for this. If the style objects are being manipulated by components, then I think that approach wouldn't work.

baseStyle: {
fontFamily: 'Montserrat',
fontSize: '1.6rem',
fontWeight: 400,
display: 'flex',
padding: '1rem 2%',
justifyContent: 'space-between',
alignItems: 'center',
whiteSpace: 'pre-wrap',
backgroundColor: 'white',
border: '1px solid #DEDEDE',
borderRadius: '4px',
margin: '0.5% 0'
},
columnStyle: Object.assign({}, Styles.TABLE.HEADER_ROW, {
justifyContent: 'space-between',
color: '#7B7B7B',
fontFamily: 'Montserrat',
fontSize: '1.2rem',
fontWeight: 'bold',
letterSpacing: '0.2px',
textTransform: 'uppercase',
backgroundColor: 'B8CDD3',
border: 'none'
}),
cellWidths: {
duosId: '10%',
phsId: '10%',
datasetName: '15%',
studyName: '15%',
dataSubmitter: '15%',
dataCustodian: '15%',
dataUse: '10%',
status: '10%'
},
color: {
dataUseGroup: '#000000',
votes: '#000000',
numberOfDatasets: '#000000',
datasets: '#000000',
},
fontSize: {
dataUseGroup: '1.4rem',
votes: '1.4rem',
numberOfDatasets: '1.4rem',
datasets: '1.4rem',
},
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import style from '../../pages/DACDatasets.module.css';
import {styles} from './DACDatasetsTable';
import {styles} from './DACDatasetConstants';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing circular dependency discovered when testing

import DACDatasetApprovalStatus from './DACDatasetApprovalStatus';
import ReactTooltip from 'react-tooltip';

Expand Down
52 changes: 1 addition & 51 deletions src/components/dac_dataset_table/DACDatasetsTable.jsx
Original file line number Diff line number Diff line change
@@ -1,63 +1,13 @@
import React, { useState, useEffect } from 'react';
import { Styles } from '../../libs/theme';
import { Storage } from '../../libs/storage';
import PaginationBar from '../PaginationBar';
import SimpleTable from '../SimpleTable';
import cellData from './DACDatasetTableCellData';
import {styles} from './DACDatasetConstants';
import {isNil} from 'lodash/fp';
import {goToPage as updatePage, recalculateVisibleTable} from '../../libs/utils';
import {useCallback} from 'react';

export const styles = {
baseStyle: {
fontFamily: 'Montserrat',
fontSize: '1.6rem',
fontWeight: 400,
display: 'flex',
padding: '1rem 2%',
justifyContent: 'space-between',
alignItems: 'center',
whiteSpace: 'pre-wrap',
backgroundColor: 'white',
border: '1px solid #DEDEDE',
borderRadius: '4px',
margin: '0.5% 0'
},
columnStyle: Object.assign({}, Styles.TABLE.HEADER_ROW, {
justifyContent: 'space-between',
color: '#7B7B7B',
fontFamily: 'Montserrat',
fontSize: '1.2rem',
fontWeight: 'bold',
letterSpacing: '0.2px',
textTransform: 'uppercase',
backgroundColor: 'B8CDD3',
border: 'none'
}),
cellWidths: {
duosId: '10%',
phsId: '10%',
datasetName: '15%',
studyName: '15%',
dataSubmitter: '15%',
dataCustodian: '15%',
dataUse: '10%',
status: '10%'
},
color: {
dataUseGroup: '#000000',
votes: '#000000',
numberOfDatasets: '#000000',
datasets: '#000000',
},
fontSize: {
dataUseGroup: '1.4rem',
votes: '1.4rem',
numberOfDatasets: '1.4rem',
datasets: '1.4rem',
},
};

export const DACDatasetTableColumnOptions = {
DUOS_ID: 'duosId',
PHS_ID: 'phsId',
Expand Down
Loading