Skip to content

Commit

Permalink
AB#263: Prepare a user interface for archiving reports
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkaganbezgin committed Dec 15, 2021
1 parent 0994cca commit 2bce40f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions client/src/components/ArchiveCenter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Messages from "components/Messages"
import { exportResults } from "exportUtils"
import React, { useState } from "react"
import { Button } from "react-bootstrap"

const ArchiveCenter = () => {
const searchQueryParams = { status: "ACTIVE" }
const queryTypes = ["REPORTS"]

const [error, setError] = useState(null)

return (
<React.Fragment>
<Messages error={error} />
<Button
variant="outline-secondary"
onClick={() => {
exportResults(searchQueryParams, queryTypes, "pdf", setError)
}}
>
Download Reports
</Button>
</React.Fragment>
)
}

export default ArchiveCenter
9 changes: 9 additions & 0 deletions client/src/components/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ const Navigation = ({
Help
</SidebarLink>

<SidebarLink
id="archive-nav"
linkTo="/archive"
handleOnClick={resetPages}
setIsMenuLinksOpened={() => setIsMenuLinksOpened(false)}
>
Archive Center
</SidebarLink>

{(currentUser.isAdmin() || currentUser.isSuperUser()) && (
<NavDropdown title="Insights" id="insights" active={inInsights}>
{INSIGHTS.map(insight => (
Expand Down
2 changes: 2 additions & 0 deletions client/src/pages/Routing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import AppContext from "components/AppContext"
import ArchiveCenter from "components/ArchiveCenter"
import AuthorizationGroupEdit from "pages/admin/authorizationgroup/Edit"
import AuthorizationGroupNew from "pages/admin/authorizationgroup/New"
import AuthorizationGroupShow from "pages/admin/authorizationgroup/Show"
Expand Down Expand Up @@ -55,6 +56,7 @@ const Routing = () => {
<Route exact path={PAGE_URLS.HOME} component={Home} />
<Route path={PAGE_URLS.ROLLUP} component={RollupShow} />
<Route path={PAGE_URLS.HELP} component={Help} />
<Route path={PAGE_URLS.ARCHIVE} component={ArchiveCenter} />
<Route
path={PAGE_URLS.SEARCH}
render={({ match: { url } }) => (
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const PAGE_URLS = {
SEARCH: "/search",
ROLLUP: "/rollup",
HELP: "/help",
ARCHIVE: "/archive",
REPORTS: "/reports",
PEOPLE: "/people",
ORGANIZATIONS: "/organizations",
Expand Down

0 comments on commit 2bce40f

Please sign in to comment.