Skip to content

Commit

Permalink
Deactivate ckeditor file uploads feature
Browse files Browse the repository at this point in the history
This feature was not working so its better to disable it completely.

By removing attachment_files endpoints related buttons and tabs from ckeditor UI are not shown to users anymore.
  • Loading branch information
Senen committed Apr 18, 2020
1 parent 526d161 commit 7466148
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/assets/javascripts/ckeditor/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ CKEDITOR.editorConfig = function( config )

config.forcePasteAsPlainText = true;

config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
config.filebrowserImageUploadUrl = "/ckeditor/pictures";
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
config.filebrowserUploadMethod = "form";

config.allowedContent = true;
Expand Down
11 changes: 11 additions & 0 deletions spec/features/ckeditor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@

expect(page).to have_css "img[src$='clippy.jpg']"
end

scenario "cannot upload attachments through link tab", :js do
login_as(create(:administrator).user)
visit new_admin_site_customization_page_path

find(".cke_button__link").click

expect(page).to have_css(".cke_dialog")
expect(page).not_to have_link "Upload"
expect(page).not_to have_link "Browse Server"
end
end

0 comments on commit 7466148

Please sign in to comment.