-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add revert changes button in local unit form #1588
Conversation
|
...ewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/i18n.json
Outdated
Show resolved
Hide resolved
...ewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx
Outdated
Show resolved
Hide resolved
...ewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx
Outdated
Show resolved
Hide resolved
...ewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx
Outdated
Show resolved
Hide resolved
...ewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx
Show resolved
Hide resolved
{readOnly && isDefined(actionsContainerRef.current) && ( | ||
{!localUnitDetailsResponse?.is_locked | ||
&& readOnlyFromProps | ||
&& isNotDefined(localUnitDetailsResponse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be isDefined(localUnitDetailsResponse)
?
Also, this check should come before !localUnitDetailsResponse?.is_locked
@@ -592,6 +660,15 @@ function LocalUnitsForm(props: Props) { | |||
&& (environment !== 'production') | |||
&& ( | |||
<div className={styles.actions}> | |||
{localUnitDetailsResponse?.is_locked && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop optional chaining.
Also, shouldn't the logic be inverted? Do we show "revert" button if the localUnit is locked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we do show revert button if localunit is locked
2aefe40
to
153f5c4
Compare
3ea145e
to
f04c03b
Compare
36763c9
to
0c4bffc
Compare
f04c03b
to
87ac5d5
Compare
87ac5d5
to
d729c79
Compare
Addresses:
Depends on:
Changes
This PR doesn't introduce:
console.log
meant for debugging