Skip to content

Commit

Permalink
add edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong committed Sep 13, 2023
1 parent dca4d22 commit 074f753
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/data_submitter_console/DataSubmitterDatasetsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Notifications} from '../../libs/utils';
import loadingIndicator from '../../images/loading-indicator.svg';
import SortableTable from '../../components/sortable_table/SortableTable';
import {concat, isNil, join} from 'lodash/fp';
import Button from '@mui/material/Button';


export default function DataSubmitterDatasetsTable(props) {
Expand Down Expand Up @@ -73,6 +74,14 @@ export default function DataSubmitterDatasetsTable(props) {
const status = isNil(dataset.dacApproval) ? 'Pending' : (dataset.dacApproval ? 'Accepted' : 'Rejected');
const primaryCodes = dataset.dataUse?.primary.map(du => du.code);
const secondaryCodes = dataset.dataUse?.secondary.map(du => du.code);
const editButton = (status === 'Accepted') ?
<div/> :
<div>
<Button
onClick={() => {}}>
Edit
</Button>
</div>;
return {
datasetIdentifier: dataset.datasetIdentifier,
datasetName: dataset.datasetName,
Expand All @@ -81,7 +90,7 @@ export default function DataSubmitterDatasetsTable(props) {
dac: dataset.dacName,
dataUse: join(', ')(concat(primaryCodes)(secondaryCodes)),
status: status,
actions: ''
actions: editButton
};
});
setRows(rows);
Expand Down

0 comments on commit 074f753

Please sign in to comment.