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

Upload File - Console warns js file included more than once #6756

Closed
mheppler opened this issue Mar 20, 2020 · 1 comment
Closed

Upload File - Console warns js file included more than once #6756

mheppler opened this issue Mar 20, 2020 · 1 comment

Comments

@mheppler
Copy link
Contributor

After adding a file via the upload file component on the Upload Files pg or the New Dataset pg, you will find warnings dropins.js included more than once in the console view of the browser developer tools.

There are a few things to look into improving on editFilesFragment.xhtml in order to resolve these warnings. First is the placement of the dropins.js script tag at the bottom of the page. Is there a better way to include these types of files in the code? Also, the path to this js file should also include the version number query string workaround ?version=#{systemConfig.getVersion()} to update cached versions of resource files that could cause broken functionality when new updates are added.

<script src="/resources/js/dropins.js" id="dropboxjs" data-app-key="#{EditDatafilesPage.dropBoxKey}"/>

Second bit of code to look into refractoring is the root cause of these warnings. In the "dual-mode" issue #4610 the @form value was added to the update attribute of this hidden "AllUploadsFinished" commandButton (8dffc46).

<p:commandButton id="AllUploadsFinished" action="#{EditDatafilesPage.uploadFinished()}" update="@form,datasetForm:fileUpload, ... "/>

That was intended to update the view of the Done btn vs Save Changes and Cancel btns at the bottom of the form on the Upload Files pg. I tried adding an id "formBottomButtons" to that block of buttons, and datasetForm:formBottomButtons to the update attribute, but that did not work, as it couldn't find component with that id.

This issue can add noise to the server logs and was broken out from the S3 direct uploads issue #6489.

@mheppler
Copy link
Contributor Author

Lots of changes have been made to this code in 5.0, with issues #7176 and #4813. There will be more opportunity in Dataset Page - File-Level Action Kebab Btn 🍡 #7081 to check if this has been resolved or needs fixing still. Closing in favor of that issue, and will make note to revisit this console warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant