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

fix: Empty message in changes modal in local unit #1617

Open
wants to merge 1 commit into
base: project/local-unit-v2
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"confirmChangesContentQuestion": "Are you sure you want to have these changes in this local unit?",
"newLocalUnitDescription": "New local unit",
"latitude": "Latitude",
"longitude": "Longitude"
"longitude": "Longitude",
"noChangesMessage": "You have made no changes to this local unit."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@
const readOnly = readOnlyFromProps
|| localUnitDetailsResponse?.is_locked;

const emptyLocalUnitChangesFormFields = localUnitChangedFormFields
&& localUnitChangedFormFields.length <= 0;

const {
response: localUnitsOptions,
pending: localUnitsOptionsPending,
Expand Down Expand Up @@ -697,7 +700,9 @@
name={undefined}
onClick={handleFormSubmit}
disabled={addLocalUnitsPending
|| updateLocalUnitsPending}
|| updateLocalUnitsPending
|| emptyLocalUnitChangesFormFields
}

Check failure on line 705 in app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx

View workflow job for this annotation

GitHub Actions / Lint JS

Unexpected newline before '}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix Lint error: Unexpected newline before '}'

>
{strings.submitButtonLabel}
</Button>
Expand Down Expand Up @@ -1807,6 +1812,8 @@
onClose={setShowChangesModalFalse}
footerActions={submitButton}
headerDescription={strings.confirmChangesContentQuestion}
empty={emptyLocalUnitChangesFormFields}
emptyMessage={strings.noChangesMessage}
>
<RawList
data={localUnitChangedFormFields}
Expand Down
Loading