-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Analysis Details to full page view
Related changes: 1. extend BreadCrumbPath component to support non-links 2. refactor CSS styles for SimpleDocumentViewer to support both modal and in-page mode 3. create new route for the analysis details page: /applications/:applicationId/analysis-details/:taskId Reference-Url: #1929 Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
- Loading branch information
Showing
9 changed files
with
122 additions
and
55 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
55 changes: 55 additions & 0 deletions
55
client/src/app/pages/applications/analysis-details/AnalysisDetails.tsx
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,55 @@ | ||
import React from "react"; | ||
import { useParams } from "react-router-dom"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
import { PageSection } from "@patternfly/react-core"; | ||
|
||
import { AnalysisDetailsRoute, Paths } from "@app/Paths"; | ||
import { PageHeader } from "@app/components/PageHeader"; | ||
import { formatPath } from "@app/utils/utils"; | ||
import { SimpleDocumentViewer } from "@app/components/SimpleDocumentViewer"; | ||
import { useFetchApplicationById } from "@app/queries/applications"; | ||
import { useFetchTaskByID } from "@app/queries/tasks"; | ||
|
||
export const AnalysisDetails: React.FC = () => { | ||
// i18 | ||
const { t } = useTranslation(); | ||
|
||
// Router | ||
const { applicationId, taskId } = useParams<AnalysisDetailsRoute>(); | ||
|
||
const { application } = useFetchApplicationById(applicationId); | ||
const { task } = useFetchTaskByID(Number(taskId)); | ||
const taskName = | ||
(typeof task != "string" ? task?.name : taskId) ?? t("terms.unknown"); | ||
const appName = application?.name ?? t("terms.unknown") ?? ""; | ||
|
||
return ( | ||
<> | ||
<PageSection variant="light"> | ||
<PageHeader | ||
title={`Analysis details for ${taskName}`} | ||
breadcrumbs={[ | ||
{ | ||
title: t("terms.applications"), | ||
path: Paths.applications, | ||
}, | ||
{ | ||
title: appName, | ||
}, | ||
{ | ||
title: t("actions.analysisDetails"), | ||
path: formatPath(Paths.applicationsAnalysisDetails, { | ||
applicationId: applicationId, | ||
taskId: taskId, | ||
}), | ||
}, | ||
]} | ||
/> | ||
</PageSection> | ||
<PageSection className="simple-task-viewer-container"> | ||
<SimpleDocumentViewer documentId={Number(taskId)} height="full" /> | ||
</PageSection> | ||
</> | ||
); | ||
}; |
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 @@ | ||
export { AnalysisDetails as default } from "./AnalysisDetails"; |
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