-
Notifications
You must be signed in to change notification settings - Fork 6
Feature 2220/stepper review status admin #2270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8c9ea91
[2220] Review Period Stepper component
S78901 77dda03
[2220] Review Period Stepper test
S78901 9e53d79
[2220] Review Period Stepper Story
S78901 25f0cad
[2220] Fix gradle build issue
S78901 14b439a
[2220] Update snapshot
S78901 535e331
Merge remote-tracking branch 'origin/develop' into feature-2220/stepp…
S78901 4b3c90a
[2220] Adjust naming of component
S78901 69d7507
[2220] New changes for reviewStatus
S78901 40556e6
[2220] Adjust story
S78901 26cc5e9
[2220] Adjust test
S78901 e6a7316
[2220] Adjust parameters of test/story data
S78901 0296983
[2220] Finalize Stepper component
S78901 6cd8689
Merge branch 'develop' into feature-2220/stepper-review-status-admin
S78901 14fa92b
Merge branch 'develop' into feature-2220/stepper-review-status-admin
S78901 b13943f
[2220] PR Changes
S78901 6ac99cd
[2220] Update snapshot
S78901 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
28 changes: 28 additions & 0 deletions
28
web-ui/src/components/reviews/periods/ReviewPeriodStepper.jsx
This file contains hidden or 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,28 @@ | ||
| import React, { useEffect, useState } from 'react'; | ||
| import Box from '@mui/material/Box'; | ||
| import Stepper from '@mui/material/Stepper'; | ||
| import Step from '@mui/material/Step'; | ||
| import StepLabel from '@mui/material/StepLabel'; | ||
| import optionsArr from './reviewStatus.json'; | ||
|
|
||
| export default function ReviewPeriodStepper({ reviewPeriod }) { | ||
| const [activeIndex, setActiveIndex] = useState(0); | ||
|
|
||
| useEffect(() => { | ||
| let revPeriod = reviewPeriod?.reviewStatus; | ||
| const index = optionsArr.findIndex(opt => opt.option === revPeriod); | ||
| setActiveIndex(index); | ||
| }, [reviewPeriod]); | ||
|
|
||
| return ( | ||
| <Box sx={{ width: '100%' }}> | ||
| <Stepper activeStep={activeIndex} alternativeLabel> | ||
| {optionsArr.map(({ label, option }) => ( | ||
| <Step key={option}> | ||
| <StepLabel>{label}</StepLabel> | ||
| </Step> | ||
| ))} | ||
| </Stepper> | ||
| </Box> | ||
| ); | ||
| } | ||
36 changes: 36 additions & 0 deletions
36
web-ui/src/components/reviews/periods/ReviewPeriodStepper.stories.jsx
This file contains hidden or 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,36 @@ | ||
| import React from 'react'; | ||
| import ReviewPeriodStepper from './ReviewPeriodStepper'; | ||
|
|
||
| export default { | ||
| component: ReviewPeriodStepper, | ||
| title: 'Check Ins/Review Period Stepper', | ||
| decorators: [ | ||
| ReviewPeriodStepper => ( | ||
| <div style={{ width: '400px', height: '400px' }}> | ||
| <ReviewPeriodStepper /> | ||
| </div> | ||
| ) | ||
| ] | ||
| }; | ||
|
|
||
| const Template = args => { | ||
| return <ReviewPeriodStepper {...args} />; | ||
| }; | ||
|
|
||
| const reviewPeriodStepperData = { | ||
| reviewPeriod: { | ||
| id: "b0b8a6f3-2d15-4923-8552-2f729f58ea0f", | ||
| name: "Test", | ||
| reviewStatus: "OPEN", | ||
| launchDate: "2024-05-03T15:53:56.673Z", | ||
| selfReviewCloseDate: "2024-05-03T15:53:56.673Z", | ||
| closeDate: "2024-05-03T15:53:56.673Z", | ||
| reviewTemplateId: "d1e94b60-47c4-4945-87d1-4dc88f088e57", | ||
| selfReviewTemplateId: "d1e94b60-47c4-4945-87d1-4dc88f088e57" | ||
| } | ||
| }; | ||
|
|
||
| export const ReviewPeriodSteppers = Template.bind({}); | ||
| ReviewPeriodSteppers.args = { | ||
| ...reviewPeriodStepperData | ||
| }; |
21 changes: 21 additions & 0 deletions
21
web-ui/src/components/reviews/periods/ReviewPeriodStepper.test.jsx
This file contains hidden or 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 @@ | ||
| import React from 'react'; | ||
| import ReviewPeriodStepper from './ReviewPeriodStepper'; | ||
| import { AppContextProvider } from '../../../context/AppContext'; | ||
|
|
||
| const reviewPeriod = { | ||
| id: "b0b8a6f3-2d15-4923-8552-2f729f58ea0f", | ||
| name: "Test", | ||
| reviewStatus: 'OPEN', | ||
| launchDate: "2024-05-03T15:53:56.673Z", | ||
| selfReviewCloseDate: "2024-05-03T15:53:56.673Z", | ||
| closeDate: "2024-05-03T15:53:56.673Z", | ||
| reviewTemplateId: "d1e94b60-47c4-4945-87d1-4dc88f088e57", | ||
| selfReviewTemplateId: "d1e94b60-47c4-4945-87d1-4dc88f088e57" | ||
| } | ||
| it('renders correctly', () => { | ||
| snapshot( | ||
| <AppContextProvider> | ||
| <ReviewPeriodStepper reviewPeriod={reviewPeriod} /> | ||
| </AppContextProvider> | ||
| ); | ||
| }); |
183 changes: 183 additions & 0 deletions
183
web-ui/src/components/reviews/periods/__snapshots__/ReviewPeriodStepper.test.jsx.snap
This file contains hidden or 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,183 @@ | ||
| // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
|
||
| exports[`renders correctly 1`] = ` | ||
| <div> | ||
| <div | ||
| class="MuiBox-root css-8atqhb" | ||
| > | ||
| <div | ||
| class="MuiStepper-root MuiStepper-horizontal MuiStepper-alternativeLabel css-10mg1vw-MuiStepper-root" | ||
| > | ||
| <div | ||
| class="MuiStep-root MuiStep-horizontal MuiStep-alternativeLabel Mui-completed css-n7tliy-MuiStep-root" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-root MuiStepLabel-horizontal MuiStepLabel-alternativeLabel css-ascpo7-MuiStepLabel-root" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-iconContainer Mui-completed MuiStepLabel-alternativeLabel css-vnkopk-MuiStepLabel-iconContainer" | ||
| > | ||
| <svg | ||
| aria-hidden="true" | ||
| class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiStepIcon-root Mui-completed css-1u4zpwo-MuiSvgIcon-root-MuiStepIcon-root" | ||
| data-testid="CheckCircleIcon" | ||
| focusable="false" | ||
| viewBox="0 0 24 24" | ||
| > | ||
| <path | ||
| d="M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z" | ||
| /> | ||
| </svg> | ||
| </span> | ||
| <span | ||
| class="MuiStepLabel-labelContainer MuiStepLabel-alternativeLabel css-1vyamtt-MuiStepLabel-labelContainer" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-label Mui-completed MuiStepLabel-alternativeLabel css-1hv8oq8-MuiStepLabel-label" | ||
| > | ||
| Planning | ||
| </span> | ||
| </span> | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="MuiStep-root MuiStep-horizontal MuiStep-alternativeLabel Mui-completed css-n7tliy-MuiStep-root" | ||
| > | ||
| <div | ||
| class="MuiStepConnector-root MuiStepConnector-horizontal MuiStepConnector-alternativeLabel Mui-completed css-zpcwqm-MuiStepConnector-root" | ||
| > | ||
| <span | ||
| class="MuiStepConnector-line MuiStepConnector-lineHorizontal css-z7uhs0-MuiStepConnector-line" | ||
| /> | ||
| </div> | ||
| <span | ||
| class="MuiStepLabel-root MuiStepLabel-horizontal MuiStepLabel-alternativeLabel css-ascpo7-MuiStepLabel-root" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-iconContainer Mui-completed MuiStepLabel-alternativeLabel css-vnkopk-MuiStepLabel-iconContainer" | ||
| > | ||
| <svg | ||
| aria-hidden="true" | ||
| class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiStepIcon-root Mui-completed css-1u4zpwo-MuiSvgIcon-root-MuiStepIcon-root" | ||
| data-testid="CheckCircleIcon" | ||
| focusable="false" | ||
| viewBox="0 0 24 24" | ||
| > | ||
| <path | ||
| d="M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z" | ||
| /> | ||
| </svg> | ||
| </span> | ||
| <span | ||
| class="MuiStepLabel-labelContainer MuiStepLabel-alternativeLabel css-1vyamtt-MuiStepLabel-labelContainer" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-label Mui-completed MuiStepLabel-alternativeLabel css-1hv8oq8-MuiStepLabel-label" | ||
| > | ||
| Awaiting Approval | ||
| </span> | ||
| </span> | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="MuiStep-root MuiStep-horizontal MuiStep-alternativeLabel css-n7tliy-MuiStep-root" | ||
| > | ||
| <div | ||
| class="MuiStepConnector-root MuiStepConnector-horizontal MuiStepConnector-alternativeLabel Mui-active css-zpcwqm-MuiStepConnector-root" | ||
| > | ||
| <span | ||
| class="MuiStepConnector-line MuiStepConnector-lineHorizontal css-z7uhs0-MuiStepConnector-line" | ||
| /> | ||
| </div> | ||
| <span | ||
| class="MuiStepLabel-root MuiStepLabel-horizontal MuiStepLabel-alternativeLabel css-ascpo7-MuiStepLabel-root" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-iconContainer Mui-active MuiStepLabel-alternativeLabel css-vnkopk-MuiStepLabel-iconContainer" | ||
| > | ||
| <svg | ||
| aria-hidden="true" | ||
| class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiStepIcon-root Mui-active css-1u4zpwo-MuiSvgIcon-root-MuiStepIcon-root" | ||
| focusable="false" | ||
| viewBox="0 0 24 24" | ||
| > | ||
| <circle | ||
| cx="12" | ||
| cy="12" | ||
| r="12" | ||
| /> | ||
| <text | ||
| class="MuiStepIcon-text css-117w1su-MuiStepIcon-text" | ||
| dominant-baseline="central" | ||
| text-anchor="middle" | ||
| x="12" | ||
| y="12" | ||
| > | ||
| 3 | ||
| </text> | ||
| </svg> | ||
| </span> | ||
| <span | ||
| class="MuiStepLabel-labelContainer MuiStepLabel-alternativeLabel css-1vyamtt-MuiStepLabel-labelContainer" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-label Mui-active MuiStepLabel-alternativeLabel css-1hv8oq8-MuiStepLabel-label" | ||
| > | ||
| Open | ||
| </span> | ||
| </span> | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="MuiStep-root MuiStep-horizontal MuiStep-alternativeLabel css-n7tliy-MuiStep-root" | ||
| > | ||
| <div | ||
| class="MuiStepConnector-root MuiStepConnector-horizontal MuiStepConnector-alternativeLabel Mui-disabled css-zpcwqm-MuiStepConnector-root" | ||
| > | ||
| <span | ||
| class="MuiStepConnector-line MuiStepConnector-lineHorizontal css-z7uhs0-MuiStepConnector-line" | ||
| /> | ||
| </div> | ||
| <span | ||
| class="MuiStepLabel-root MuiStepLabel-horizontal Mui-disabled MuiStepLabel-alternativeLabel css-ascpo7-MuiStepLabel-root" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-iconContainer Mui-disabled MuiStepLabel-alternativeLabel css-vnkopk-MuiStepLabel-iconContainer" | ||
| > | ||
| <svg | ||
| aria-hidden="true" | ||
| class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiStepIcon-root css-1u4zpwo-MuiSvgIcon-root-MuiStepIcon-root" | ||
| focusable="false" | ||
| viewBox="0 0 24 24" | ||
| > | ||
| <circle | ||
| cx="12" | ||
| cy="12" | ||
| r="12" | ||
| /> | ||
| <text | ||
| class="MuiStepIcon-text css-117w1su-MuiStepIcon-text" | ||
| dominant-baseline="central" | ||
| text-anchor="middle" | ||
| x="12" | ||
| y="12" | ||
| > | ||
| 4 | ||
| </text> | ||
| </svg> | ||
| </span> | ||
| <span | ||
| class="MuiStepLabel-labelContainer MuiStepLabel-alternativeLabel css-1vyamtt-MuiStepLabel-labelContainer" | ||
| > | ||
| <span | ||
| class="MuiStepLabel-label Mui-disabled MuiStepLabel-alternativeLabel css-1hv8oq8-MuiStepLabel-label" | ||
| > | ||
| Closed | ||
| </span> | ||
| </span> | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `; |
This file contains hidden or 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 @@ | ||
| [ | ||
| { "label": "Planning", "option": "PLANNING" }, | ||
| { "label": "Awaiting Approval", "option": "AWAITING_APPROVAL" }, | ||
| { "label": "Open", "option": "OPEN" }, | ||
| { "label": "Closed", "option": "CLOSED" } | ||
| ] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.