Replace link with button in flag unflag actions
This commit is contained in:
@@ -1811,9 +1811,12 @@ table {
|
|||||||
color: $delete;
|
color: $delete;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-pane a {
|
.dropdown-pane {
|
||||||
|
a,
|
||||||
|
button {
|
||||||
color: $text-medium;
|
color: $text-medium;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 17. Activity
|
// 17. Activity
|
||||||
// ------------
|
// ------------
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<span class="icon-flag flag-disable"></span>
|
<span class="icon-flag flag-disable"></span>
|
||||||
</button>
|
</button>
|
||||||
<span class="dropdown-pane" id="flag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
|
<span class="dropdown-pane" id="flag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
|
||||||
<%= link_to t("shared.flag"), polymorphic_path(flaggable, action: :flag), method: :put, remote: true %>
|
<%= button_to t("shared.flag"), polymorphic_path(flaggable, action: :flag),
|
||||||
|
method: :put, remote: true %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
<span class="icon-flag flag-active"></span>
|
<span class="icon-flag flag-active"></span>
|
||||||
</button>
|
</button>
|
||||||
<span class="dropdown-pane" id="unflag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
|
<span class="dropdown-pane" id="unflag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
|
||||||
<%= link_to t("shared.unflag"), polymorphic_path(flaggable, action: :unflag), method: :put, remote: true %>
|
<%= button_to t("shared.unflag"), polymorphic_path(flaggable, action: :unflag),
|
||||||
|
method: :put, remote: true %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -27,18 +27,18 @@ shared_examples "flaggable" do |factory_name, admin: false|
|
|||||||
|
|
||||||
within "##{dom_id(flaggable)} .flag-content" do
|
within "##{dom_id(flaggable)} .flag-content" do
|
||||||
click_button "Flag as inappropriate"
|
click_button "Flag as inappropriate"
|
||||||
click_link "Flag as inappropriate"
|
within("form") { click_button "Flag as inappropriate" }
|
||||||
|
|
||||||
expect(page).to have_button "Unflag"
|
expect(page).to have_button "Unflag"
|
||||||
expect(page).to have_link "Unflag", visible: :hidden
|
expect(page).to have_button "Unflag", visible: :hidden
|
||||||
expect(page).not_to have_link "Flag as inappropriate", visible: :all
|
expect(page).not_to have_button "Flag as inappropriate", visible: :all
|
||||||
end
|
end
|
||||||
|
|
||||||
refresh
|
refresh
|
||||||
|
|
||||||
within "##{dom_id(flaggable)} .flag-content" do
|
within "##{dom_id(flaggable)} .flag-content" do
|
||||||
expect(page).to have_link "Unflag", visible: :hidden
|
expect(page).to have_button "Unflag", visible: :hidden
|
||||||
expect(page).not_to have_link "Flag as inappropriate", visible: :all
|
expect(page).not_to have_button "Flag as inappropriate", visible: :all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -52,18 +52,18 @@ shared_examples "flaggable" do |factory_name, admin: false|
|
|||||||
expect(page).to have_button "Unflag"
|
expect(page).to have_button "Unflag"
|
||||||
|
|
||||||
click_button "Unflag"
|
click_button "Unflag"
|
||||||
click_link "Unflag"
|
within("form") { click_button "Unflag" }
|
||||||
|
|
||||||
expect(page).not_to have_button "Unflag"
|
expect(page).not_to have_button "Unflag"
|
||||||
expect(page).to have_link "Flag as inappropriate", visible: :hidden
|
expect(page).to have_button "Flag as inappropriate", visible: :hidden
|
||||||
expect(page).not_to have_link "Unflag", visible: :all
|
expect(page).not_to have_button "Unflag", visible: :all
|
||||||
end
|
end
|
||||||
|
|
||||||
visit path
|
visit path
|
||||||
|
|
||||||
within "##{dom_id(flaggable)} .flag-content" do
|
within "##{dom_id(flaggable)} .flag-content" do
|
||||||
expect(page).to have_link "Flag as inappropriate", visible: :hidden
|
expect(page).to have_button "Flag as inappropriate", visible: :hidden
|
||||||
expect(page).not_to have_link "Unflag", visible: :all
|
expect(page).not_to have_button "Unflag", visible: :all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -73,12 +73,12 @@ shared_examples "flaggable" do |factory_name, admin: false|
|
|||||||
|
|
||||||
within "##{dom_id(flaggable)} .flag-content" do
|
within "##{dom_id(flaggable)} .flag-content" do
|
||||||
click_button "Flag as inappropriate"
|
click_button "Flag as inappropriate"
|
||||||
click_link "Flag as inappropriate"
|
within("form") { click_button "Flag as inappropriate" }
|
||||||
|
|
||||||
expect(page).to have_button "Unflag"
|
expect(page).to have_button "Unflag"
|
||||||
|
|
||||||
click_button "Unflag"
|
click_button "Unflag"
|
||||||
click_link "Unflag"
|
within("form") { click_button "Unflag" }
|
||||||
|
|
||||||
expect(page).not_to have_button "Unflag"
|
expect(page).not_to have_button "Unflag"
|
||||||
end
|
end
|
||||||
@@ -86,8 +86,8 @@ shared_examples "flaggable" do |factory_name, admin: false|
|
|||||||
visit path
|
visit path
|
||||||
|
|
||||||
within "##{dom_id(flaggable)} .flag-content" do
|
within "##{dom_id(flaggable)} .flag-content" do
|
||||||
expect(page).to have_link "Flag as inappropriate", visible: :hidden
|
expect(page).to have_button "Flag as inappropriate", visible: :hidden
|
||||||
expect(page).not_to have_link "Unflag", visible: :all
|
expect(page).not_to have_button "Unflag", visible: :all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ shared_examples "flaggable" do |factory_name, admin: false|
|
|||||||
|
|
||||||
within "##{dom_id(flaggable)} > .comment-body .flag-content" do
|
within "##{dom_id(flaggable)} > .comment-body .flag-content" do
|
||||||
click_button "Flag as inappropriate"
|
click_button "Flag as inappropriate"
|
||||||
click_link "Flag as inappropriate"
|
within("form") { click_button "Flag as inappropriate" }
|
||||||
|
|
||||||
expect(page).to have_button "Unflag"
|
expect(page).to have_button "Unflag"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user