Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Seed Nextcloud / Conduction / Sendent tiles on every new dashboard#40

Merged
rubenvdlinde merged 2 commits into
chore/polish-and-walkthrough-2026-04-29from
feat/seed-tiles-on-new-dashboard
Apr 30, 2026
Merged

Seed Nextcloud / Conduction / Sendent tiles on every new dashboard#40
rubenvdlinde merged 2 commits into
chore/polish-and-walkthrough-2026-04-29from
feat/seed-tiles-on-new-dashboard

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

Every new dashboard (manual create + auto-provisioned default) now ships with three branded link tiles stacked at the right edge below the default widgets:

Tile Position Background Link
Nextcloud (9,5) 3x1 #0082c9 https://nextcloud.com
Conduction (9,6) 3x1 #ffffff https://conduction.nl
Sendent (9,7) 3x1 #ffffff https://sendent.com

Tiles are not compulsory, so users can delete them like any other tile.

Why a separate DashboardSeeder service

Inlining the seed logic in DashboardService pushed PHPMD coupling to 14 (threshold 13). Extracting the config + tile-creation into DashboardSeeder keeps DashboardService boundaries narrow and gives the seed logic an obvious home for future expansion (admin-configurable defaults, conditional seeds per group, etc.).

Scope decisions

  • Manual creates (POST /api/dashboard) → seeded ✅
  • Auto-provisioned default-fallback dashboard (new user, no admin template applies) → seeded ✅ (routes through createDashboard internally)
  • Template-derived dashboards (admin template targets the user's group) → not seeded. Admin's template placements are authoritative there.

Implementation notes

  • IURLGenerator::imagePath resolves icon URLs at seed time so the seeder works under both dev (/custom_apps/...) and prod (/apps/...) install layouts. Tile model uses iconType=url (existing renderer support — <img :src=...>) + linkType=url.
  • Bundled brand SVG/PNG assets live in img/seed-tiles/. Sources: Nextcloud Wikimedia Commons SVG, Conduction's public site logo PNG, Sendent's public site logo PNG.

Tests

  • DashboardSeederTest (5 cases): tile order, grid positions, iconType / linkType, icon URL prefix, company link targets, dashboard ID pass-through.
  • DashboardServiceSeedTilesTest (2 cases): createDashboard invokes the seeder with the persisted dashboard id; returned entity is the persisted one.
  • 113 / 113 passing, 322 assertions. PHPCS / PHPMD / Psalm clean.

Test plan

  • composer phpcs — clean
  • composer phpmd — clean (coupling under threshold thanks to DashboardSeeder)
  • composer psalm — 0 errors
  • phpunit — 113/113 passing
  • End-to-end via API: new dashboard → 3 tiles with correct titles, icons, colors, links
  • Icon URLs resolve (HTTP 200) at /custom_apps/mydash/img/seed-tiles/{file}

Notes

Every new dashboard now ships with three branded link tiles below the
default top-row widgets, stacked at the right edge (cols 9-11, rows 5-7,
3x1 each):

  - Nextcloud  -> https://nextcloud.com  (blue background, white text)
  - Conduction -> https://conduction.nl  (white background, dark text)
  - Sendent    -> https://sendent.com    (white background, dark text)

Tiles are not compulsory, so users can delete them like any other tile.

Implementation
--------------
- New DashboardSeeder service owns the SEED_TILES config and the
  PlacementService + IURLGenerator dependencies. Keeps DashboardService
  coupling unchanged (PHPMD coupling threshold stays under 13).
- DashboardService::createDashboard() invokes DashboardSeeder::seed()
  after the dashboard is persisted. Path covers both manual creates
  (POST /api/dashboard) and the auto-provisioned default-fallback path
  in tryCreateFromTemplate (which already routes through createDashboard).
  Template-derived dashboards intentionally remain unseeded - the admin
  template is authoritative for those.
- Icon URLs resolved through IURLGenerator::imagePath so the seeder
  works under both dev (/custom_apps/...) and prod (/apps/...) install
  layouts. Tile model uses iconType=url + linkType=url.

Assets
------
- img/seed-tiles/nextcloud.svg (Wikimedia Commons official SVG)
- img/seed-tiles/conduction.png
- img/seed-tiles/sendent.png

Tests
-----
- DashboardSeederTest (5 cases): tile order, grid positions, iconType +
  link type, icon URL prefix, company link targets, dashboard ID
  pass-through.
- DashboardServiceSeedTilesTest (2 cases): createDashboard invokes the
  seeder with the persisted dashboard id and returns the persisted
  entity.
- Total: 113 / 113 passing (322 assertions). PHPCS / PHPMD / Psalm clean.
Captured against the feat/seed-tiles-on-new-dashboard branch with the
Marketing Template removed so the user-fallback path runs and seeds
the three tiles. Screenshot shows the expected default state for any
fresh dashboard: Nextcloud / Conduction / Sendent stacked at the right
edge below the standard widgets.

Note: the Nextcloud and Conduction logos render faintly because their
source images use blue-on-transparent / black-on-transparent paths.
Replacing with white-on-transparent (Nextcloud) and a coloured PNG
(Conduction) is a follow-up polish item.
@rubenvdlinde rubenvdlinde merged commit d9ffbb5 into chore/polish-and-walkthrough-2026-04-29 Apr 30, 2026
1 check passed
@rubenvdlinde rubenvdlinde deleted the feat/seed-tiles-on-new-dashboard branch April 30, 2026 20:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant