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

fix(FR-386): add max value for User/Project setting modal #3050

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

nowgnuesLee
Copy link
Contributor

@nowgnuesLee nowgnuesLee commented Jan 20, 2025

resolves #3055 (FR-386)

  • Set the max value for each time in the setting modal on the Resource Policypage
  • Display error messages using usePainkilerr

changes

  • add error handling on onCompleted
  • add const values MAX_CPU_QUOTA, SIGNED_32BIT_MAX_INT
  • In the case of MAX_CPU_QUOTA, since the CPU type is a float, we limited the range to 1e16 after consulting with @fregataa.

Checklist: (if applicable)

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link

graphite-app bot commented Jan 20, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added the size:L 100~500 LoC label Jan 20, 2025
@nowgnuesLee nowgnuesLee changed the title fix: add max value for User/Project setting modal fix(FR-386): add max value for User/Project setting modal Jan 20, 2025
Copy link

github-actions bot commented Jan 20, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
4.63% (+0.01% 🔼)
405/8739
🔴 Branches
4.01% (-0.02% 🔻)
240/5984
🔴 Functions 2.8% 79/2819
🔴 Lines
4.56% (+0.01% 🔼)
390/8550

Test suite run success

124 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 79bd3c3

@nowgnuesLee nowgnuesLee marked this pull request as ready for review January 21, 2025 02:06
@github-actions github-actions bot added area:ux UI / UX issue. area:i18n Localization labels Feb 3, 2025
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

please resolve the conflicts

Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

There seems to be a conflict in the const-vars.ts file.

Copy link
Contributor Author

I resolved that conflict in latest commit.

Copy link
Contributor

lizable commented Feb 21, 2025

@nowgnuesLee Still I have conflicts. Would you resolve it and re-request review again?

Copy link
Contributor

@lizable lizable left a comment

Choose a reason for hiding this comment

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

Please resolve the conflicts.

@@ -1194,6 +1194,7 @@
"Name": "Name",
"AllowedHosts": "Allowed hosts",
"CannotCreateResourcePolicy": "Cannot create Resource Policy. Please check input values.",
"CannotUpdateResourcePolicy": "Cannot update Resource Policy. Please check input values.",
Copy link
Member

Choose a reason for hiding this comment

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

We couldn't say "Please check input values" because this PR might display this message even when the user input is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I expect the detailed error message to be provided in err.message from the response. If not, I assume it would be an error that occurs in such cases. So, what do you think about simply displaying ‘Cannot update Resource Policy.’? I will check whether the backend provides sufficient error explanations.

message.success(t('resourcePolicy.SuccessfullyCreated'));
onRequestClose(true);
if (errors && errors.length > 0) {
errors.forEach((error) => message.error(error.message, 2.5));
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason to set it to 2.5 only here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set it to 2.5 seconds since it was set that way in the UserResourcePolicyList. What would be an appropriate duration?

Copy link
Contributor Author

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

I couldn’t find any conflicts on my side. I have updated the branch, but if you still encounter any conflicts, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:i18n Localization area:ux UI / UX issue. size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to add rule for max value in User/Project Resource Policy setting modal
4 participants