-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[52233] Allow % Complete edition in work-based mode #16041
Draft
cbliard
wants to merge
31
commits into
dev
Choose a base branch
from
feature/52233-allow-to-edit-p-complete-in-work-based-mode
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[52233] Allow % Complete edition in work-based mode #16041
cbliard
wants to merge
31
commits into
dev
from
feature/52233-allow-to-edit-p-complete-in-work-based-mode
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One class for work-based mode, one for status-based mode (strategy pattern).
- `work` over `estimated_hours` - `remaining_work` over `remaining_hours` - `percent_complete` over `done_ratio`
Saves ~140ms. Get flamegraph of rspec boot time by prepending `TEST_STACK_PROF_IGNORE_GC=1 TEST_STACK_PROF_FORMAT=json TEST_STACK_PROF=boot` to rspec command.
Saves ~25ms. (Yeah, not the most impactful, but low-hanging fruit anyway). Get flamegraph of rspec boot time by prepending `TEST_STACK_PROF_IGNORE_GC=1 TEST_STACK_PROF_FORMAT=json TEST_STACK_PROF=boot` to rspec command.
It floowos the extraction of `UpdateProgressValuesStatusBased` and `UpdateProgressValuesWorkBased` classes for a better separation of concerns.
Rounding to 2 decimals, and then using the value to set `work_package.done_ratio` acts like taking the floor value without any rounding, which is inaccurate.
The check for invalid values is done once instead of being done in each update method, and the value is updated only if the attribute can be derived. An attribute can only be derived if the user did not set it and some value from the 2 other attributes have changed.
Still incomplete and some tests are failing, but this is usable first draft.
Part of wp 52233
Because now we can set it.
- It's allowed to set only one progress value while the two others are unset. - It's not allowed to have two progress values set while the other one is unset. - Do not output "inconsistent % complete" error if work < remaining work to avoid having too many errors displayed at the same time.
No need to wait 5 secs to check if the selector is present or not.
The values were not retained between modifications of percent values, so a new parameter `initial` was introduced to "save" the entered values between edits. It also fixed the progress modal having empty values when opening it a second time in the create work package page.
- Hide some less important errors when some of the progress values are invalid. - Provide a more meaningful error message when % complete is not in the 0-100 range. (previous message was "is not included in the list.". It is now "must be between 0 and 100.") - The error messages are now the same for work and remaining work when they are negative.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://community.openproject.org/wp/52233