mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Some links does not include _panel suffix. Add if needed.
Yep. Sounds like a hack. + Use the right URL anchor with `_panel` in href for each tab + update specs
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
.columns.small-12.large-8
|
||||
- shop_tabs.each do |tab|
|
||||
.page
|
||||
%a{ id: tab[:name], href: "##{tab[:name]}", data: { action: "tabs-and-panels#changeActivePanel tabs-and-panels#changeActiveTab", "tabs-and-panels-target": "tab" }, class: ("selected" if tab[:default]) }=tab[:title]
|
||||
%a{ id: tab[:name], href: "##{tab[:name]}_panel", data: { action: "tabs-and-panels#changeActivePanel tabs-and-panels#changeActiveTab", "tabs-and-panels-target": "tab" }, class: ("selected" if tab[:default]) }=tab[:title]
|
||||
.columns.large-4.show-for-large-up
|
||||
= render partial: "shopping_shared/order_cycles"
|
||||
- shop_tabs.each do |tab|
|
||||
|
||||
@@ -23,7 +23,10 @@ export default class extends Controller {
|
||||
if (anchor[0] == "/") {
|
||||
anchor = anchor.slice(1);
|
||||
}
|
||||
|
||||
// Add _panel to the anchor to match the panel id if needed
|
||||
if (!anchor.includes("_panel")) {
|
||||
anchor = `${anchor}_panel`;
|
||||
}
|
||||
this.updateActivePanel(anchor);
|
||||
|
||||
// tab
|
||||
|
||||
@@ -183,7 +183,7 @@ describe 'White label setting' do
|
||||
|
||||
it "shows the groups tab" do
|
||||
visit main_app.enterprise_shop_path(distributor)
|
||||
expect(page).to have_selector "a[href='#groups']"
|
||||
expect(page).to have_selector "a[href='#groups_panel']"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user