-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
BUGFIX: Prevent multiple imports of the same remote asset in the frontend #5117
BUGFIX: Prevent multiple imports of the same remote asset in the frontend #5117
Conversation
- `select.js`: add data attribute `data-import-in-process` to asset once import process has started and remove it when import is done - `select.js`: check for new data attribute and only start import process if attribute does not exist - `select.js`: add notification to inform user that asset is being imported - `select.js`: add notification as warning for user if import is already in process - `Main.xlf`: add new notification messages for english - `Default.html`: add id for notification container to be able to send notifications to it via js - `Configuration.js`: update `hasConfiguration` after configuration object was created, because otherwise it will always be false and the translations don't work Issue: neos#5116
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.
+1 by reading
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.
Thx! Also for fixing the configuration issue.
We should just, when we anyway adjust the code not use more jQuery, but replace where its easy.
0c2bee9
to
649ae4e
Compare
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.
Thank you for this. Looks good to me by reading.
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.
⭐️⭐️⭐️⭐️⭐️
I noticed something strange today relating to this bugfix. In this PR I made changes to the Neos.Media.Browser package, but also to the Neos.Neos package. I assumed that assets would be bundled automatically via pipeline, so I didn't bundle them. Now I noticed that the Neos.Media.Browser changes are working just fine (because the are included directly and don't need bundling), but the Neos.Neos changes are not working, because they need to be bundled and that didn't happen. Without it, the notification messages don't show any text. |
Very likely this change caused a bug in the selection of images out of the list view: |
This is a frontend fix for #5116 and prevents users from triggering multiple import processes for the same remote asset. It is not a sufficient fix to only prevent this in the frontend though, since it doesn't catch it, if two or more different users trigger the import for the same asset at the same time.
Changes:
select.js
: add data attributedata-import-in-process
to asset once import process has started and remove it when import is doneselect.js
: check for new data attribute and only start import process if attribute does not existselect.js
: add notification to inform user that asset is being importedselect.js
: add notification as warning for user if import is already in processMain.xlf
: add new notification messages for englishDefault.html
: add id for notification container to be able to send notifications to it via jsConfiguration.js
: updatehasConfiguration
after configuration object was created, because otherwise it will always be false and the translations don't workrelated:
#5116Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructionsInfo for testing:
You need to bundle the Neos.Neos assets to get the text for the notification messages.
yarn
yarn build