-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1482 from bcgov/feat/daniel-legacy-report-view-1396
feat: Add Legacy Report View
- Loading branch information
Showing
22 changed files
with
1,155 additions
and
267 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
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
40 changes: 40 additions & 0 deletions
40
frontend/src/views/ComplianceReports/ComplianceReportViewSelector.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,40 @@ | ||
import { useGetComplianceReport } from '@/hooks/useComplianceReports.js' | ||
import { useCurrentUser } from '@/hooks/useCurrentUser.js' | ||
import Loading from '@/components/Loading.jsx' | ||
import { ViewLegacyComplianceReport } from '@/views/ComplianceReports/ViewLegacyComplianceReport.jsx' | ||
import { useParams } from 'react-router-dom' | ||
import { EditViewComplianceReport } from '@/views/ComplianceReports/EditViewComplianceReport.jsx' | ||
|
||
export const ComplianceReportViewSelector = () => { | ||
const { complianceReportId } = useParams() | ||
const { data: currentUser, isLoading: isCurrentUserLoading } = | ||
useCurrentUser() | ||
|
||
const { | ||
data: reportData, | ||
isLoading: isReportLoading, | ||
isError, | ||
error | ||
} = useGetComplianceReport( | ||
currentUser?.organization?.organizationId, | ||
complianceReportId | ||
) | ||
|
||
if (isReportLoading || isCurrentUserLoading) { | ||
return <Loading /> | ||
} | ||
|
||
return reportData.report.legacyId ? ( | ||
<ViewLegacyComplianceReport | ||
reportData={reportData} | ||
error={error} | ||
isError={isError} | ||
/> | ||
) : ( | ||
<EditViewComplianceReport | ||
reportData={reportData} | ||
error={error} | ||
isError={isError} | ||
/> | ||
) | ||
} |
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.