-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'task/digital-rocks' into WC-129-Dataset-form-redirect-fix
- Loading branch information
Showing
42 changed files
with
811 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
client/src/components/DataFiles/DataFilesModals/DataFilesPublicationAuthorsModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import InfiniteScrollTable from '_common/InfiniteScrollTable'; | ||
import React, { useCallback, useEffect, useState } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { Modal, ModalHeader, ModalBody } from 'reactstrap'; | ||
import styles from './DataFilesPublicationAuthorsModal.module.scss'; | ||
|
||
const DataFilesPublicationAuthorsModal = () => { | ||
const dispatch = useDispatch(); | ||
const isOpen = useSelector((state) => state.files.modals.publicationAuthors); | ||
const props = useSelector( | ||
(state) => state.files.modalProps.publicationAuthors | ||
); | ||
|
||
const columns = [ | ||
{ | ||
Header: 'Name', | ||
accessor: (el) => el, | ||
Cell: (el) => { | ||
const { first_name, last_name } = el.value; | ||
return ( | ||
<span className={styles.content}> | ||
{first_name} {last_name} | ||
</span> | ||
); | ||
}, | ||
}, | ||
{ | ||
Header: 'Email', | ||
accessor: 'email', | ||
}, | ||
]; | ||
|
||
const toggle = useCallback(() => { | ||
dispatch({ | ||
type: 'DATA_FILES_TOGGLE_MODAL', | ||
payload: { operation: 'publicationAuthors', props: {} }, | ||
}); | ||
}, [dispatch]); | ||
|
||
return ( | ||
<Modal | ||
size="lg" | ||
isOpen={isOpen} | ||
toggle={toggle} | ||
className={styles['modal-dialog']} | ||
> | ||
<ModalHeader toggle={toggle} charCode=""> | ||
Authors | ||
</ModalHeader> | ||
<ModalBody className={styles['modal-body']}> | ||
<InfiniteScrollTable | ||
tableColumns={columns} | ||
tableData={props?.authors || []} | ||
className={styles['author-listing']} | ||
/> | ||
</ModalBody> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default DataFilesPublicationAuthorsModal; |
12 changes: 12 additions & 0 deletions
12
client/src/components/DataFiles/DataFilesModals/DataFilesPublicationAuthorsModal.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.author-listing { | ||
/* title */ | ||
th:nth-child(1), | ||
td:nth-child(1) { | ||
width: 50%; | ||
} | ||
/* date */ | ||
th:nth-child(2), | ||
td:nth-child(2) { | ||
width: 50%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.