Repository navigation
feat(tracking-page): settings screen for the customer tracking page - #357
Merged
Merged
Conversation
…page Add the settings backend for the customer tracking page refactor (PR 2): - TrackingPageConfig: the company config's shape, defaults and sanitizing (pages, branding, access, what verified visitors see), instance defaults for the generic page, slug rules with a reserved list, and accent contrast helpers (ink colour and WCAG ratio). - SettingController: get/save tracking-page-settings, a live slug check, and admin defaults. Saved slugs are indexed in fleet-ops.tracking-page-slugs.* so the public page resolves a company in one read; an enabled organization page refuses an invalid, reserved or taken slug. The read-back includes the slug status, the accent's ink and contrast, whether SMS is configured (Twilio counts only with credentials), and whether the customer portal is installed. - Routes under settings/, and a tracking-page-settings permission resource.
PR 4 of the tracking pages refactor: FleetOps -> Settings -> Tracking Page. - Pages: own page on/off, its address under /t/ with a live availability check, copy and open links, shared-page opt-out, and which page emails and labels link to. - Branding: display name, accent with a live contrast check (the text colour on it is derived), an optional dark-mode accent, support contacts, Powered by Fleetbase, light/dark behaviour, default and enabled languages. - Access: status without verification, SMS and email codes (SMS disabled with a reason when the instance has no SMS provider), session length, and customer sign-in and account upsell when the customer portal is installed. - What verified customers see, with the privacy rules that always apply. - A live light and dark preview themed from the same tokens the page will use (utils/tracking-page-theme). - Admin panel 'Tracking Page' under Fleet-Ops Config for the generic page's instance defaults; sidebar item, settings hub card, and translation keys in all 10 locales (English text until translated). Settings load in the route's model hook, not a controller constructor.
filter_var(null, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) returns false, not null, so every unset toggle (generic page allowed, powered by, the visibility defaults) came out false instead of its default.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
============================================
Coverage 100.00% 100.00%
- Complexity 12379 12452 +73
============================================
Files 600 601 +1
Lines 46496 46696 +200
============================================
+ Hits 46496 46696 +200
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 4 of the customer tracking pages refactor. It adds the settings screen at FleetOps → Settings → Tracking Page, plus an admin panel for the generic page's instance defaults.
Depends on #355 (the settings endpoints). This branch contains #355's commit, so until that merges this diff also shows the server change. I didn't stack the PRs, because merging a stacked PR's base closes it.
The screen
/t/, with a live availability check (debounced call tovalidate-slug) and copy and open links;utils/tracking-page-theme. The tracking page itself (PR 5) will use the same tokens.Settings load in the route's
model()hook, not in a controller constructor.Admin
A new "Tracking Page" panel under Fleet-Ops Config sets the generic page's instance defaults: on or off, display name, accent, support contacts and powered-by.
Also
tracking-page.settings.*translation keys in all 10 locales. Non-English files carry the English text until they're translated.Not in this PR