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

refactor: user action modals #10180

Merged
merged 3 commits into from
Dec 15, 2023
Merged

refactor: user action modals #10180

merged 3 commits into from
Dec 15, 2023

Conversation

JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Dec 14, 2023

Description

Move several modal action handlers from Users.vue into their own components where they belong. This a) cleans up the component nicely and b) prevents the logic from being spread all over the place.

Affected actions:

  • "Create user"-action moved into useUserActionsCreateUser.ts. It opens the CreateUserModal.vue which holds all the logic
  • "Edit login"-action handler move into EditLoginModal.vue
  • "Add to groups"-action handler move into AddToGroupsModal.vue
  • "Remove from groups"-action handler move into RemoveFromGroupsModal.vue

Also adds unit test for all these things.

This PR is best reviewed by its individual commits.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

@JammingBen JammingBen self-assigned this Dec 14, 2023
Copy link

update-docs bot commented Dec 14, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

7 New issues
0 Security Hotspots
75.6% Coverage on New Code
28.2% Duplication on New Code

See analysis details on SonarCloud

@JammingBen JammingBen changed the title refactor: user modals refactor: user action modals Dec 14, 2023
Copy link
Member

@dschmidt dschmidt left a comment

Choose a reason for hiding this comment

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

Great!

It can be another iteration, but I would like to get rid of the store actions triggering in the dialog components, I think the modal should handle that automatically based on promises returned from onCancel and onConfirm.

@JammingBen JammingBen marked this pull request as ready for review December 14, 2023 15:54
@JammingBen
Copy link
Contributor Author

Great!

It can be another iteration, but I would like to get rid of the store actions triggering in the dialog components, I think the modal should handle that automatically based on promises returned from onCancel and onConfirm.

You mean store.dispatch('hideModal') right? I agree that this would be nice, probably easy to do as well. I'd rather do in in a follow-up though.

@dschmidt
Copy link
Member

yep, as I said - can be in another iteration

Copy link
Contributor

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

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

🤩

@JammingBen JammingBen merged commit 82ed990 into master Dec 15, 2023
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the refactor-user-modals branch December 15, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants