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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 'Change the participant initiatives editor toolbars type' to v0.26 #10845

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -45,7 +45,7 @@
</div>

<div class="field">
<%= text_editor_for(f, :description, lines: 8, toolbar: :full) %>
<%= text_editor_for(f, :description, lines: 8, toolbar: :content) %>
</div>

<div class="field">
Expand Down
Expand Up @@ -27,7 +27,7 @@
</div>

<div class="field">
<%= text_editor_for(f, :description, lines: 8, toolbar: :full) %>
<%= text_editor_for(f, :description, lines: 8, toolbar: :content) %>
</div>

<div class="actions">
Expand Down
Expand Up @@ -22,7 +22,7 @@
</div>

<div class="field">
<%= text_editor_for(form, :description, toolbar: :full, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.description)) %>
<%= text_editor_for(form, :description, toolbar: :content, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.description)) %>
</div>

<div class="field">
Expand Down
13 changes: 12 additions & 1 deletion decidim-initiatives/spec/system/create_initiative_spec.rb
Expand Up @@ -206,7 +206,7 @@
find_button("I want to promote this initiative").click
end

it_behaves_like "having a rich text editor", "new_initiative_previous_form", "full"
it_behaves_like "having a rich text editor", "new_initiative_previous_form", "content"
end

describe "creating an initiative" do
Expand Down Expand Up @@ -442,6 +442,17 @@
expect(page).to have_content("Area")
end
end

context "when rich text editor is enabled for participants" do
before do
expect(page).to have_content("Create")
organization.update(rich_text_editor_in_public_views: true)

visit current_path
end

it_behaves_like "having a rich text editor", "new_initiative_form", "content"
end
end
end

Expand Down
15 changes: 15 additions & 0 deletions decidim-initiatives/spec/system/edit_initiative_spec.rb
Expand Up @@ -97,4 +97,19 @@
expect(page).to have_content("not authorized")
end
end

context "when rich text editor is enabled for participants" do
let(:initiative) { create(:initiative, :created, author: user, scoped_type: scoped_type, organization: organization) }
let(:organization) { create(:organization, rich_text_editor_in_public_views: true) }

before do
visit initiative_path

click_link("Edit", href: edit_initiative_path)

expect(page).to have_content "EDIT INITIATIVE"
end

it_behaves_like "having a rich text editor", "edit_initiative", "content"
end
end