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: quota modal usage #10185

Merged
merged 1 commit into from
Dec 19, 2023
Merged

refactor: quota modal usage #10185

merged 1 commit into from
Dec 19, 2023

Conversation

JammingBen
Copy link
Contributor

Description

Before, the state of the quota modal was handled by the outside where it was being used. This caused quite some boilerplate code because it's effectively always the same.

Refactors the quota modal usage so that the modal state handling is done via the quota action instead, meaning the consuming party doesn't need to care about it anymore.

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 15, 2023
Copy link

update-docs bot commented Dec 15, 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.

@JammingBen JammingBen force-pushed the refactor-quota-modals branch 5 times, most recently from 3bc5b1f to f77f3ae Compare December 15, 2023 09:30
@JammingBen JammingBen marked this pull request as ready for review December 15, 2023 10:11
@JammingBen JammingBen force-pushed the refactor-quota-modals branch from f77f3ae to 29cfa98 Compare December 15, 2023 11:33
@JammingBen JammingBen changed the base branch from master to stable-8.0 December 18, 2023 08:28
@JammingBen JammingBen force-pushed the refactor-quota-modals branch from 29cfa98 to ce89493 Compare December 18, 2023 08:29
typeof modal.customComponentAttrs === 'function'
? modal.customComponentAttrs()
: modal.customComponentAttrs
"
Copy link
Member

Choose a reason for hiding this comment

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

We will have this logic in a lot of places in the future I assume - maybe worth adding a helper function for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hate it (the if function then call else use value), that was exactly the reason why I went for always the callback when I adjusted the SideBarPanel interface...

Helper would be ok-ish, but the helper might also advocates such type definitions. I'm also fine without the helper. 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then let's make it always a function, I need to rebase anyway.

@JammingBen JammingBen force-pushed the refactor-quota-modals branch from ce89493 to 7c1a424 Compare December 19, 2023 05:15
Before, the state of the quota modal was handled by the outside where it was being used. This caused quite some boilerplate code because it's effectively always the same.

Refactors the quota modal usage so that the modal state handling is done via the quota action instead, meaning the consuming party doesn't need to care about it anymore.
@JammingBen JammingBen force-pushed the refactor-quota-modals branch from 7c1a424 to b1d875a Compare December 19, 2023 05:25
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

30.77% Condition Coverage on New Code (required ≥ 50%)

See analysis details on SonarCloud

@JammingBen JammingBen merged commit 0614cef into stable-8.0 Dec 19, 2023
2 of 3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the refactor-quota-modals branch December 19, 2023 06:20
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