-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix(Performance): limit task duration display to prevent Select2 performance issues #21392
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
base: 10.0/bugfixes
Are you sure you want to change the base?
Conversation
@cconard96 You deleted a comment of you for this PR ? @stonebuzz If there is no special option in this dropdown, please, replace it completely by an |
Better than an |
Ok after searching a bit, both ideas are not ideal in fact. So in fine, atm, I don't have more idea with a native control, so maybe let's continue with the original thing (set the duration as read-only) |
Setting it to |
I did, but decided it was probably more a general complaint than constructive on this particular PR.
|
As it stands, does this work for you @orthagh? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
'rand' => $rand, | ||
]); | ||
} else { | ||
echo Html::timestampToString($default_delay, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form will no longer contain a plan[_duration]
input, so I guess the value will not be submitted and the created event will not have the expected duration.
echo Html::timestampToString($default_delay, false); | |
echo Html::timestampToString($default_delay, false); | |
echo Html::hidden('plan[_duration]', ['value' => $default_delay]); |
Checklist before requesting a review
Please delete options that are not relevant.
Description
Although the duration (
actiontime
) of a task is limited to 100 hoursIf a user decides to schedule this task over, for example, one year, the duration will be automatically updated according to the chosen schedule.
However, if one attempts to update the task afterward, we observe significant browser latency—particularly with Select2, which tries to load all the necessary options into the dropdown.
To mitigate this issue, I propose simply displaying the duration and period as text if it exceeds the maximum allowed value.
If the user wishes to modify the duration, they would need to unschedule the task first and then reschedule it.
Screenshots (if appropriate):