User tests: Successful: Unsuccessful:
Pull Request for Issue #34885 (comment)
Try edit some image and hit the reset button
No
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
Also when I put the crop plugin on the second position and resize first and open the edit page the canvas from the crop plugin is shown initially.
Also when I put the crop plugin on the second position and resize first and open the edit page the canvas from the crop plugin is shown initially.
Yeah, the whole thing is supposed to be asynchronous now but I guess I have to redo the activation/deactivation parts more efficiently. I Will update this PR later
Reset event is triggered, but when I resize first and then do a reset it jumps to the first tab but does not revert the resize.
Hmm, weird are the width/height values correct after reset (eg the initial ones)? If so it's just the preview image...
Perhaps it has to do with the async, let you do the fix there and then we see if it still is an issue.
Labels |
Added:
NPM Resource Changed
?
|
@dgrammatiko I've tested this PR and the fix works. I noticed that after pressing reset, I get redirected to the first tab. Is this intended behavior?
It works better and the events are fired. I have the same behavior as @RickR2H that it jumps to the first tab. The form controls are also not reset (not sure if this should be part of this pr). In the following image I rotated and then hit reset, the image is like the original, but the form control angle not:
The problem I have is that my plugins depend on the form controls, so reset has basically no effect as on activate I do read them again.
Nice solution would be when the core would reset the form controls to the initial value, not so nice would be when each plugin has to do that by its own.
I get redirected to the first tab. Is this intended behavior?
I have the same behavior as @RickR2H that it jumps to the first tab.
This is intended behavior. There is an open PR that adds undo and redo, which will let you stay in the same tab
The form controls are also not reset (not sure if this should be part of this pr)
Nice solution would be when the core would reset the form controls to the initial value
@wilsonge and I had a quick chat on this and we decided to skip the resetting of the forms (it wasn't implemented also before all these changes).
Unfortunately, the Edit class is just orchestrating things so having it to hold the state of the form elements would be a big stretch and it probably fail miserably in many cases (Web Components with shadow DOM, fields that are just an entry point for Vue, React, Svelte, etc). I think the easier solution is to have each plugin register its own initial state and have one more function in the API (eg Reset) that when called it will restore all the initial values to the respected form elements. Automation comes with limitations...
Anyways if George is ok I can add these here or in another PR, it's not much code anyways
@laoneo @RickR2H With respect to @dgrammatiko 's answer and if everything else was ok, would you say your test was a successful test? If so, please mark your test result in the issue tracker. Thanks in advance.
I'm fine with a Reset function in the API. But switching to the first tab should definitely be fixed as it is cleearly a disturbing behavior. @richard67 till then for me no successful test.
@dgrammatiko The js linter complains about missing semicolon: https://ci.joomla.org/joomla/joomla-cms/46304/1/21
/********/src/build/media_source/com_media/js/edit-images.es6.js
145:9 error Missing semicolon semi
I have tested this item
"Reset" button works fine for "rotate" and "resize", and active tab stays the same when using it.
For "crop" the "reset" button does nothing, but I think that's by design because there is nothing really cropped as long as the change is not saved.
I have tested this item
Pressing reset button will reset the original preview of the image for rotation and scaling.
Values in the text boxes are not updated as stated before.
Pressing reset will leave you in the current tab.
Status | Pending | ⇒ | Ready to Commit |
RTC
Yes it is up to date...
@dgrammatiko are these errors related to the recent changes or something old?
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-08-10 19:38:59 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
?
Removed: ? |
Thanks!
Reset event is triggered, but when I resize first and then do a reset it jumps to the first tab but does not revert the resize.