From 284475afb2e7b498bde5aaf141cb9d2070d42b91 Mon Sep 17 00:00:00 2001 From: Sridhar Bala Date: Fri, 11 Sep 2026 14:46:11 +0530 Subject: [PATCH] Give every channel its own settings page The Features page was split into one card per channel and shipped. The settings behind those cards were not, and the code said so: All five point at the one channels page for now. The Features page is split; the settings pages behind it are not, yet. So every card opened the same combined screen, still headed "Sales Channels" - our reporting word, not a shopkeeper's. From the console that is indistinguishable from a deploy that never landed. Four panes now, each with its own sidebar entry gated on its own feature switch: Online Ordering storefront, branding, payment, new orders Kiosk Machine the printer, and a line saying the rest is shared Delivery Partners the aggregators and what they keep Webshop a shop the owner runs themselves Venues and delivery charges went to Restaurant, beside the serving periods. A hotel is reachable from the QR code, the phone and every aggregator, and a delivery charge belongs to how the food travels rather than to which app the order came through; both would have been copied into the next channel within a month. Two things the split could have broken, and did not: The "ways this shop takes orders" checkboxes went, because the Features cards choose channels now. collect() read them into sales_channels_enabled, so every save would then have posted an empty list and cleared the value the item channel picker reads. The key is left unsent, the way menu_dayparts already is. Every channel screen still saves the whole group. The panes are hidden rather than removed and collect() reads the DOM by class, so a save from any of them writes every channel's rows wherever they sit. The products screen is one copy that moves into whichever channel is open, with that channel preselected. Four copies would have meant four sets of the same ids. tests/channel-panes-split.test.js pins all of it, including the generic rule that no feature card may point at a section that does not exist - openSection falls back to Core Settings for an unknown key, which is why the old code aimed all five at one page rather than at pages it wanted. Run against the pre-split files, three of the four channels share a page and none has a pane of its own. --- frontend/layouts/sidebar.html | 31 +- frontend/modules/settings_write.html | 569 ++++++++++++------ frontend/static/script/js/core/PosnicPro.js | 8 +- .../static/script/js/modules/js/settings.js | 173 ++++-- languages/_english.json | 10 +- tests/channel-panes-split.test.js | 229 +++++++ 6 files changed, 774 insertions(+), 246 deletions(-) create mode 100644 tests/channel-panes-split.test.js diff --git a/frontend/layouts/sidebar.html b/frontend/layouts/sidebar.html index 7367880b5..577a4119e 100644 --- a/frontend/layouts/sidebar.html +++ b/frontend/layouts/sidebar.html @@ -491,11 +491,32 @@