-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ASAP-565] - add compliance dashboard (#4458)
* add compliance dashboard * add tests * add ComplianceTable test * minor fix * update test * update compliance tab condition * Update apps/crn-frontend/src/network/teams/__tests__/TeamProfile.test.tsx Co-authored-by: Gabriela Ueno <gabiayako@gmail.com> --------- Co-authored-by: Gabriela Ueno <gabiayako@gmail.com>
- Loading branch information
Showing
17 changed files
with
767 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { useState } from 'react'; | ||
import { SearchField, ComplianceDashboard } from '@asap-hub/react-components'; | ||
import { | ||
complianceInitialSortingDirection, | ||
ComplianceSortingDirection, | ||
SortCompliance, | ||
} from '@asap-hub/model'; | ||
|
||
import { SearchFrame } from '@asap-hub/frontend-utils'; | ||
import { useManuscripts } from './state'; | ||
|
||
import { usePagination, usePaginationParams, useSearch } from '../../hooks'; | ||
|
||
const Compliance: React.FC = () => { | ||
const { currentPage, pageSize } = usePaginationParams(); | ||
const { filters, searchQuery, setSearchQuery } = useSearch(); | ||
const result = useManuscripts({ | ||
searchQuery, | ||
currentPage, | ||
pageSize, | ||
filters, | ||
}); | ||
const { numberOfPages, renderPageHref } = usePagination( | ||
result.total, | ||
pageSize, | ||
); | ||
|
||
const [sort, setSort] = useState<SortCompliance>('team_asc'); | ||
|
||
const [sortingDirection, setSortingDirection] = | ||
useState<ComplianceSortingDirection>(complianceInitialSortingDirection); | ||
|
||
return ( | ||
<article> | ||
<SearchField | ||
placeholder="Enter team name, ID, assigned users..." | ||
value={searchQuery} | ||
onChange={setSearchQuery} | ||
/> | ||
<SearchFrame title=""> | ||
<ComplianceDashboard | ||
data={result.items} | ||
setSort={setSort} | ||
setSortingDirection={setSortingDirection} | ||
sort={sort} | ||
sortingDirection={sortingDirection} | ||
currentPageIndex={currentPage} | ||
numberOfPages={numberOfPages} | ||
renderPageHref={renderPageHref} | ||
/> | ||
</SearchFrame> | ||
</article> | ||
); | ||
}; | ||
|
||
export default Compliance; |
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
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.