Compare commits
1 Commits
change-big
...
prevent-fo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d73c86b872 |
9
app/assets/javascripts/directory_files_input.js
Normal file
9
app/assets/javascripts/directory_files_input.js
Normal file
@@ -0,0 +1,9 @@
|
||||
$(document).on("turbolinks:load", function() {
|
||||
$("#upload_directory_files").on('click', function(e){
|
||||
const newFilesCount = $('input[name = "directory[files][]"][type = "hidden"]').length;
|
||||
|
||||
if (newFilesCount === 0){
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -3,6 +3,6 @@
|
||||
<%= render "shared/files_dropzone_fields", form: form, directory: directory %>
|
||||
<% end %>
|
||||
<div class="pt-3">
|
||||
<%= form.submit t(".submit"), class: "btn btn-block btn-success", data: { disable_with: t("shared.disable_with") } %>
|
||||
<%= form.submit t(".submit"), id: "upload_directory_files", class: "btn btn-block btn-success", data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -51,6 +51,13 @@ RSpec.feature "User manages project custom folders", type: :feature do
|
||||
|
||||
expect(page).to have_content("UPLOAD NEW FILES")
|
||||
|
||||
expect do
|
||||
click_button "Upload Files"
|
||||
end.not_to raise_exception
|
||||
|
||||
expect(page).to have_content("UPLOAD NEW FILES")
|
||||
expect(page).not_to have_content("The folder has been updated")
|
||||
|
||||
drop_file Rails.root.join(file_fixture("person_photo.png")), type: :dropzone
|
||||
|
||||
click_button "Upload Files"
|
||||
|
||||
Reference in New Issue
Block a user