Skip to content

Commit

Permalink
Fix ckeditor wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Aug 14, 2024
1 parent 4915e8c commit f37ac6f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
13 changes: 7 additions & 6 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def time_tag(time)
else
datetime = time.acts_like?(:time) ? time.xmlschema : time.iso8601
content_tag(:time, text, datetime:,
title: format_time(time), class: "timestamp")
title: format_time(time), class: "timestamp")
end
end

Expand Down Expand Up @@ -260,11 +260,12 @@ def simple_format_without_paragraph(text)
end

def lang_options_for_select(blank = true)
auto = if blank && (valid_languages - all_languages) == (all_languages - valid_languages)
[["(auto)", ""]]
else
[]
end
auto =
if blank && (valid_languages - all_languages) == (all_languages - valid_languages)
[["(auto)", ""]]
else
[]
end

mapped_languages = valid_languages.map { |lang| translate_language(lang) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function listenToSettingChanges() {
const settingName = id.replace('lang-for-', '');
const newLang = self.val();
const textArea = jQuery(`#settings-${settingName}`);
const editor = textArea.siblings('ckeditor-augmented-textarea').data('editor');
const editor = textArea.siblings('opce-ckeditor-augmented-textarea').data('editor');

return {
id, settingName, newLang, textArea, editor,
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/global_styles/content/editor/_ckeditor.sass
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@include op-uc-table-header-styles

// Wrapper for full text element
ckeditor-augmented-textarea .op-ckeditor--wrapper
opce-ckeditor-augmented-textarea .op-ckeditor--wrapper
margin-bottom: 2rem

// Ensure same border and min-height for preview
Expand Down Expand Up @@ -128,5 +128,3 @@ ckeditor-augmented-textarea .op-ckeditor--wrapper
.ck-icon_inherit-color
path
fill: var(--body-font-color) !important


Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def wikitoolbar_for(field_id, **context)

# Pass an optional resource to the CKEditor instance
resource = context.fetch(:resource, {})
helpers.angular_component_tag "ckeditor-augmented-textarea",
helpers.angular_component_tag "opce-ckeditor-augmented-textarea",
inputs: {
textareaSelector: "##{field_id}",
editorType: context[:editor_type] || "full",
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/tabular_form_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
context "an id is missing" do
it "outputs the wysiwyg wrapper" do
expect(output).to have_css "textarea"
expect(output).to have_css "ckeditor-augmented-textarea"
expect(output).to have_css "opce-ckeditor-augmented-textarea"
end
end

Expand All @@ -219,7 +219,7 @@

it "outputs the wysiwyg wrapper" do
expect(output).to have_css "textarea"
expect(output).to have_css "ckeditor-augmented-textarea"
expect(output).to have_css "opce-ckeditor-augmented-textarea"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/components/wysiwyg/wysiwyg_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class WysiwygEditor

attr_reader :context_selector, :attachments, :attachments_list

def initialize(context = "#content", attachment_list_selector = "ckeditor-augmented-textarea")
def initialize(context = "#content", attachment_list_selector = "opce-ckeditor-augmented-textarea")
@context_selector = context
@attachments = ::Components::Attachments.new
@attachments_list = ::Components::AttachmentsList.new("#{context} #{attachment_list_selector}")
Expand Down
2 changes: 1 addition & 1 deletion spec/support/pages/admin/system_settings/general.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def welcome_text_editor
end

def welcome_text_selector
'ckeditor-augmented-textarea[data-textarea-selector="\"#settings_welcome_text\""]'
'opce-ckeditor-augmented-textarea[data-textarea-selector="\"#settings_welcome_text\""]'
end
end
end

0 comments on commit f37ac6f

Please sign in to comment.