Skip to content

Handle negative credit in UI #10814

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

Merged
merged 9 commits into from
Mar 30, 2022
Merged

Handle negative credit in UI #10814

merged 9 commits into from
Mar 30, 2022

Conversation

juliachvyrova
Copy link
Contributor

What

Limit actions for users with negative (negative_max_threshold, negative_beyond_grace_period) credit status

  • Disable Enabled toggle on Connection Status page
  • Disable Sync now button on Connection Status page
  • Disable Launch button and Sync toggle on Connections page
  • Disable New connection button on Connections page
  • Disable Create connection dropdown on Source/Destination pages

Closes #10632

@juliachvyrova juliachvyrova self-assigned this Mar 2, 2022
@juliachvyrova juliachvyrova requested a review from a team as a code owner March 2, 2022 22:43
@github-actions github-actions bot added area/frontend area/platform issues related to the platform labels Mar 2, 2022
@timroes
Copy link
Contributor

timroes commented Mar 9, 2022

I've been thinking about this PR a bit, and think we should rather try to avoid handling this via Features. Our feature service is atm designed to be "static" features of a specific deployment, thus also contributing towards the issue I described in my above comment. We also should try to decouple the FeatureService from the ConfigService (first) imho (see #10974). I think for now it would be better if we simply not use Features for this change, but just have regular utility methods that we can call on the workspace (or a custom hook for it), that will provide us the given information.

@jrhizor jrhizor removed their request for review March 9, 2022 21:01
@jamakase
Copy link
Contributor

@timroes per our discussion during the sync, we are going to leave it in FeatureService for now.

Added few unit tests that make sure there are no cyclic dependencies. Also now it uses useDeepCompareEffect instead of useEffect to get rid of unnecessary rerenders.

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

Tested locally. Disables all described places. LGTM

@jamakase jamakase merged commit df6c8c7 into master Mar 30, 2022
@jamakase jamakase deleted the julia/handle-negative-credits branch March 30, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle negative credit in UI better
3 participants