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

[DUOS-2641][risk=no] Submitted Datasets Subtab #2322

Merged
merged 31 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b281aec
initial plumbing for new data submitter console
rushtong Aug 29, 2023
b0d4ce6
add new api call
rushtong Aug 30, 2023
09d9b01
fix generic dataset filter
rushtong Aug 30, 2023
a477b09
add filter and dataset loading
rushtong Aug 30, 2023
612cd65
use title style
rushtong Aug 30, 2023
2e8bfd5
Merge branch 'develop' into gr-DUOS-2641-ds-datasets
rushtong Aug 30, 2023
f00775f
Merge branch 'develop' into gr-DUOS-2641-ds-datasets
rushtong Sep 6, 2023
0aa02b8
show table with dataset identifiers
rushtong Sep 7, 2023
0d23d7b
show table with dataset identifiers
rushtong Sep 7, 2023
2c97792
Merge branch 'develop' into gr-DUOS-2641-ds-datasets
rushtong Sep 12, 2023
fc5ce42
use sortable table and add columns
rushtong Sep 12, 2023
5d97573
populate dac name
rushtong Sep 12, 2023
6226e4b
Merge branch 'develop' into gr-DUOS-2641-ds-datasets
rushtong Sep 12, 2023
68e61d0
use dataset index instead of custodian api
rushtong Sep 13, 2023
8f35d81
rm unused
rushtong Sep 13, 2023
dca4d22
show data use codes
rushtong Sep 13, 2023
074f753
add edit button
rushtong Sep 13, 2023
51bd404
add a default sort, react cleanup
rushtong Sep 13, 2023
f61b743
allow for overrides to defaults
rushtong Sep 14, 2023
48b52bd
edit linking and button styling
rushtong Sep 14, 2023
30a19f9
new search filter for dataset terms; variable refactoring
rushtong Sep 14, 2023
ee053c4
formatting, compile fix
rushtong Sep 14, 2023
ae818eb
handle custodian emails in query and display
rushtong Sep 14, 2023
5ebfde3
handle custodian emails in filter
rushtong Sep 14, 2023
82e213e
minor null safe refactoring
rushtong Sep 15, 2023
c4ed071
Merge branch 'develop' into gr-DUOS-2641-ds-datasets
rushtong Sep 15, 2023
7a7577e
unused
rushtong Sep 15, 2023
eb06553
move to researcher console
rushtong Sep 15, 2023
3cfd29f
library card requirement
rushtong Sep 15, 2023
dc5de61
Merge branch 'develop' into gr-DUOS-2641-ds-datasets
rushtong Sep 19, 2023
6b3c9a5
extract inline css to module
rushtong Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Home from './pages/Home';
import NotFound from './pages/NotFound';
import NIHICWebform from './pages/NIHicWebform';
import PrivacyPolicy from './pages/PrivacyPolicy';
import ResearcherConsole from './pages/ResearcherConsole';
import ResearcherConsole from './pages/researcher_console/ResearcherConsole';
import UserProfile from './pages/user_profile/UserProfile';
import RequestRole from './pages/user_profile/RequestRole';
import SigningOfficialResearchers from './pages/signing_official_console/SigningOfficialResearchers';
Expand All @@ -33,6 +33,7 @@ import AdminManageDarCollections from './pages/AdminManageDarCollections';
import {AdminEditUser} from './pages/AdminEditUser';
import ChairConsole from './pages/ChairConsole';
import MemberConsole from './pages/MemberConsole';
import DatasetSubmissions from './pages/researcher_console/DatasetSubmissions';
import TermsOfService from './pages/TermsOfService';
import TermsOfServiceAcceptance from './pages/TermsOfServiceAcceptance';
import {HealthCheck} from './pages/HealthCheck';
Expand Down Expand Up @@ -87,6 +88,7 @@ const Routes = (props) => (
<AuthenticatedRoute path="/signing_official_console/researchers" component={ensureSoHasDaaAcknowledgement(SigningOfficialResearchers)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />
<AuthenticatedRoute path="/signing_official_console/dar_requests" component={ensureSoHasDaaAcknowledgement(SigningOfficialDarRequests)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />
{checkEnv(envGroups.NON_STAGING) && <AuthenticatedRoute path="/signing_official_console/data_submitters" component={ensureSoHasDaaAcknowledgement(SigningOfficialDataSubmitters, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />}
<AuthenticatedRoute path="/dataset_submissions" component={DatasetSubmissions} props={props} rolesAllowed={[USER_ROLES.dataSubmitter]}/>
<AuthenticatedRoute path="/dataset_registration/:datasetId" component={DatasetRegistration} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path="/dataset_update/:datasetId" component={DatasetUpdateForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path="/dataset_registration" component={DatasetRegistration} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
Expand Down
17 changes: 6 additions & 11 deletions src/components/DuosHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,14 @@ export const headerTabsConfig = [
],
isRendered: (user) => user.isMember
},
{
label: 'DS Console',
link: '/data_submission_form',
search: 'data_submission_form',
children: [
{ label: 'Datasets', link: '/data_submission_form' }
],
isRendered: (user) => user.isDataSubmitter
},
{
label: 'Researcher Console',
link: '/dataset_catalog',
search: 'dataset_catalog',
children: [
{ label: 'Data Catalog', link: '/dataset_catalog' },
{ label: 'DAR Requests', link: '/researcher_console' }
{ label: 'DAR Requests', link: '/researcher_console' },
{ label: 'Submitted Datasets', link: '/dataset_submissions', isRenderedForUser: (user) => user?.isDataSubmitter }
],
isRendered: (user) => user.isResearcher && !isOnlySigningOfficial(user)
}
Expand Down Expand Up @@ -321,7 +313,10 @@ const NavigationTabsComponent = (props) => {
const isRendered = (!isFunction(tab.isRendered) || isNil(tab.isRendered())) ?
true :
tab.isRendered();
return isRendered ? h(Tab, {
const isRenderedForUser = (!isFunction(tab.isRenderedForUser) || isNil(tab.isRenderedForUser(currentUser))) ?
true :
tab.isRenderedForUser(currentUser);
return (isRendered && isRenderedForUser) ? h(Tab, {
key: `${tab.link}_${tabIndex}`,
label: tab.label,
style: selectedSubTab === tabIndex ? styles.subTabActive : styles.subTab,
Expand Down
20 changes: 11 additions & 9 deletions src/components/sortable_table/SortableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Step 3: Pass both arrays into the headCells and rows props

*/

import React from 'react';
import React, {useState, useMemo} from 'react';
import Box from '@mui/material/Box';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
Expand Down Expand Up @@ -84,14 +84,16 @@ export default function SortableTable(props) {

const {
rows,
headCells
headCells,
defaultSort = 'darCode',
cellAlignment = 'center'
} = props;

const [order, setOrder] = React.useState('asc');
const [orderBy, setOrderBy] = React.useState('darCode');
const [selected, setSelected] = React.useState([]);
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);
const [order, setOrder] = useState('asc');
const [orderBy, setOrderBy] = useState(defaultSort);
const [selected, setSelected] = useState([]);
const [page, setPage] = useState(0);
const [rowsPerPage, setRowsPerPage] = useState(10);

const handleRequestSort = (event, property) => {
const isAsc = orderBy === property && order === 'asc';
Expand Down Expand Up @@ -135,7 +137,7 @@ export default function SortableTable(props) {
const emptyRows =
page > 0 ? Math.max(0, (1 + page) * rowsPerPage - rows.length) : 0;

const visibleRows = React.useMemo(
const visibleRows = useMemo(
() =>
stableSort(rows, getComparator(order, orderBy)).slice(
page * rowsPerPage,
Expand Down Expand Up @@ -187,7 +189,7 @@ export default function SortableTable(props) {
id={labelId}
scope='row'
padding='none'
align='center'>
align={cellAlignment}>
{row[category]}
</TableCell>
))}
Expand Down
Loading
Loading