Skip to content
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

feat: 1610 notification for greyed out submission button #1747

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading