Skip to content

feat(drivers): add card view layout for Drivers Management - #299

Open
janni1288 wants to merge 8 commits into
fleetbase:dev-v0.6.61from
janni1288:feat/drivers-card-view
Open

feat(drivers): add card view layout for Drivers Management#299
janni1288 wants to merge 8 commits into
fleetbase:dev-v0.6.61from
janni1288:feat/drivers-card-view

Conversation

@janni1288

Copy link
Copy Markdown
Contributor

Summary

Adds a "Card View" layout to Drivers Management, mirroring the existing Vehicles Management implementation. Users can now toggle between table and card views, with the preference persisted via appCache.

Changes

  • Add Driver::Card component (addon/components/driver/card.{hbs,js}), modeled directly on Vehicle::Card. Displays avatar (via avatar-url helper with driver image fallback), name, phone, status badge (color-mapped the same way as cell/driver-identity), assigned vehicle, and lost modified timestamp. View/edit/delete actions wired to the driverActions service.
  • Update ManagementDriversIndexController to persist the layout preference (fleetops:drivers:layout) via appCache, and add a table/grid toggle to the action buttons, mirroring the Vehicles controller.
  • Update the drivers index template to conditionally render Layout::Ressource::Tabular (table) or Layout::Resource::CardsGrid + Driver::Card (grid), matching the Vehicles index template structure.

Commits

  1. feat(driver): add driver card component
  2. feat(drivers): persist card/table layout preference
  3. feat(drivers): add card view layout toggle to drivers index

Testing

  • Card view renders avatar, name, phone, status, assigned vehicle, and last modified correctly
  • View/Edit/Delete actions work from the card
  • Toggle between table and grid view works
  • Layout preference persists across page reload
  • Filter and pagination state preserved when switching views

Reference

Mirrors the existing card view implementation in Vehicles Management (Vehicle::Card, Layout::Resource::CardsGrid).

Closes #178

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4e0fc5f) to head (4f6a78b).
⚠️ Report is 2 commits behind head on dev-v0.6.61.

Additional details and impacted files
@@               Coverage Diff               @@
##             dev-v0.6.61      #299   +/-   ##
===============================================
  Coverage         100.00%   100.00%           
  Complexity          9815      9815           
===============================================
  Files                523       523           
  Lines              37888     37888           
===============================================
  Hits               37888     37888           
Flag Coverage Δ
backend 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Inlining the layout switch into the actionButtons getter put `this.layout =`
inside a computed property, which ember/no-side-effects rejects — four errors,
and lint:js took the Ember CI build down. Put the assignment back behind the
`changeLayout` action the getter had replaced, now persisting the choice to
appCache, and let both menu items call it.

Also strip the trailing whitespace and restore the final newlines that prettier
flagged in card.js and this file.
@roncodes roncodes mentioned this pull request Aug 23, 2026
@roncodes
roncodes changed the base branch from main to dev-v0.6.61 August 23, 2026 03:48
A local symlink into a sibling checkout slipped into the previous commit and
broke `pnpm install` in CI with ENOTDIR. .gitignore's `/node_modules/` has a
trailing slash, so it matches the directory but not a symlink of that name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GFI] Add Card View for Drivers Management

2 participants