Skip to content

Commit

Permalink
feat: adding new info banner
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaseta committed Nov 22, 2024
1 parent de21c62 commit ca0df3c
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions frontend/src/views/Seedlot/SeedlotRegFormClassA/RegPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const RegPage = () => {

const { isTscAdmin } = useContext(AuthContext);

const disableSubmit = !allStepCompleted
|| saveStatus === 'conflict'
|| !seedlotData
|| (seedlotData.seedlotStatus.seedlotStatusCode !== 'PND'
&& seedlotData.seedlotStatus.seedlotStatusCode !== 'INC');

return (
<div className="seedlot-registration-page">
<FlexGrid fullWidth>
Expand Down Expand Up @@ -176,6 +182,21 @@ const RegPage = () => {
</Column>
</Row>
<Row className="seedlot-registration-button-row">
{
formStep === 5 && disableSubmit
? (
<Column sm={4} md={8} lg={16} xlg={12}>
<InlineNotification
lowContrast
kind="warning"
title="Missing fields:"
subtitle="Submit registration is disabled until mandatory fields are filled in
correctly. You can check for blank or invalid fields on every step."
/>
</Column>
)
: null
}
<Grid narrow>
<Column sm={4} md={3} lg={3} xlg={4}>
{
Expand Down Expand Up @@ -237,13 +258,7 @@ const RegPage = () => {
<SubmitModal
btnText="Submit Registration"
renderIconName="CheckmarkOutline"
disableBtn={
!allStepCompleted
|| saveStatus === 'conflict'
|| !seedlotData
|| (seedlotData.seedlotStatus.seedlotStatusCode !== 'PND'
&& seedlotData.seedlotStatus.seedlotStatusCode !== 'INC')
}
disableBtn={disableSubmit}
submitFn={() => {
submitSeedlot.mutate(
getSeedlotPayload(
Expand Down

0 comments on commit ca0df3c

Please sign in to comment.