-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ask for confirmation before deleting users #31
Conversation
Signed-off-by: AAJELLAL <ali.ajellalod@gmail.com>
…o add_confirmation_before_deleting_users # Conflicts: # src/translations/en.json # src/translations/fr.json
Signed-off-by: AAJELLAL <ali.ajellalod@gmail.com>
src/pages/users/UsersPage.tsx
Outdated
}, [gridContext, rowsSelection, snackError]); | ||
const deleteUsersDisabled = useMemo( | ||
() => rowsSelection.length <= 0, | ||
[rowsSelection.length] | ||
); | ||
|
||
const handleDeletion = (value: boolean) => { |
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.
you can directly call show(DeletionDialog) instead of handleDeletion. It would be more descriptive.
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.
I always prefer to use a separate method instead of calling the setXX directly. This way it's easy to maintain and we can add other verification as well if needed.
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, it makes sense too.
src/pages/users/UsersPage.tsx
Outdated
<FormattedMessage id="ok" /> | ||
</Button> | ||
</DialogActions> | ||
</Dialog> |
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.
UserPage was a big componant ... and is now more bigger.
We should split it in several part, like ProfilePages. Maybe not in this PR.
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.
Indeed the component is too big. However the file naming must be harmonized.
Example: UsersPage.tsx and profiles-page.tsx
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.
the global naming in GridSuite is more my-component.tsx rather than MyComponent.tsx
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.
ok, thanks for DeleteUserDialog
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.
code: ok, just minor remarks about naming
tests: works fine. Minor issue: en/fr titles are different.
Signed-off-by: AAJELLAL <ali.ajellalod@gmail.com>
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.
code: ok (except a missing header)
tests: ok
Signed-off-by: AAJELLAL <ali.ajellalod@gmail.com>
No description provided.