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

prevent duplicate initialization of the dropzone. #1332

Merged
merged 3 commits into from
Jul 21, 2023
Merged

Conversation

jensens
Copy link
Member

@jensens jensens commented Jul 21, 2023

@jensens jensens requested a review from thet July 21, 2023 14:35
@jensens jensens marked this pull request as ready for review July 21, 2023 14:39
Copy link
Member

@thet thet left a comment

Choose a reason for hiding this comment

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

all in all LGTM, except two suggestions:

  1. see my comment in the code
    2)‌ Please change the commit message to:
fix(pat-upload): Prevent duplicate initialization of the dropzone.

Fixes: https://github.com/plone/Products.CMFPlone/issues/3814

This would add this change automatically with the next release.

@@ -61,6 +61,11 @@ export default Base.extend({

var self = this;

if (self.$el.find(".upload-area").length) {
console.warn("Found already a dropzone on element, skipping!");
Copy link
Member

Choose a reason for hiding this comment

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

I'd use the info level, otherwise people might get scared of a warning which is harmless.
Also, please use the logging infrastructure. I'd change it to:

import logger from "@patternslib/patternslib/src/core/logging";

const log = logger.getLogger("pat-upload");

[...]

        if (self.$el.find(".upload-area").length) {
            logger.info("Found already a dropzone on element, skipping!");

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, done

@thet thet merged commit 5e15a78 into master Jul 21, 2023
2 checks passed
@thet thet deleted the fix-upload-dup-dropzone branch July 21, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RelatedItems Widget upload broken if used twice
2 participants