generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORV2-2823 - FE: Add rejectionHistory to Application response data type (
#1655) Signed-off-by: glen-aot <[email protected]> Co-authored-by: GlenAOT <[email protected]>
- Loading branch information
Showing
7 changed files
with
103 additions
and
1 deletion.
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
21 changes: 21 additions & 0 deletions
21
...atures/permits/pages/Application/components/review/ReviewApplicationRejectionHistory.scss
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,21 @@ | ||
@use "../../../../../../themes/orbcStyles"; | ||
|
||
@include orbcStyles.permit-main-box-style(".rejection-history"); | ||
@include orbcStyles.permit-left-box-style(".rejection-history__header"); | ||
@include orbcStyles.permit-right-box-style(".rejection-history__body"); | ||
|
||
.rejection-history { | ||
&__info { | ||
padding-top: 1.5rem; | ||
} | ||
|
||
&__item, .item { | ||
|
||
padding-bottom: 1.5rem; | ||
|
||
&__row { | ||
&--flex { | ||
display: flex; | ||
} | ||
}} | ||
} |
52 changes: 52 additions & 0 deletions
52
...eatures/permits/pages/Application/components/review/ReviewApplicationRejectionHistory.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,52 @@ | ||
import { Box, Typography } from "@mui/material"; | ||
import { ApplicationRejectionHistory } from "../../../../types/ApplicationRejectionHistory"; | ||
import "./ReviewApplicationRejectionHistory.scss"; | ||
import { | ||
DATE_FORMATS, | ||
toLocal, | ||
} from "../../../../../../common/helpers/formatDate"; | ||
import { canViewApplicationQueue } from "../../../../../queue/helpers/canViewApplicationQueue"; | ||
import { useContext } from "react"; | ||
import OnRouteBCContext from "../../../../../../common/authentication/OnRouteBCContext"; | ||
|
||
export const ReviewApplicationRejectionHistory = ({ | ||
applicationRejectionHistory, | ||
}: { | ||
applicationRejectionHistory: ApplicationRejectionHistory[]; | ||
}) => { | ||
const { idirUserDetails } = useContext(OnRouteBCContext); | ||
return ( | ||
<Box className="rejection-history"> | ||
<Box className="rejection-history__header"> | ||
<Typography | ||
variant={"h3"} | ||
className="rejection-history__title" | ||
data-testid="rejection-history-title" | ||
> | ||
Rejection History | ||
</Typography> | ||
</Box> | ||
<Box className="rejection-history__body"> | ||
<Box className="rejection-history__info"> | ||
{applicationRejectionHistory.map((item) => ( | ||
<Box | ||
className="rejection-history__item item" | ||
key={item.caseActivityId} | ||
> | ||
<div className="item__row item__row--flex"> | ||
<Typography> | ||
{canViewApplicationQueue(idirUserDetails?.userRole) | ||
? `${item.userName}, ${toLocal(item.dateTime, DATE_FORMATS.LONG)}` | ||
: toLocal(item.dateTime, DATE_FORMATS.LONG)} | ||
</Typography> | ||
</div> | ||
<div className="item__row"> | ||
<Typography>{item.caseNotes}</Typography> | ||
</div> | ||
</Box> | ||
))} | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
}; |
6 changes: 6 additions & 0 deletions
6
frontend/src/features/permits/types/ApplicationRejectionHistory.ts
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,6 @@ | ||
export interface ApplicationRejectionHistory { | ||
caseActivityId: number; | ||
userName: string; | ||
dateTime: string; | ||
caseNotes: string; | ||
} |
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