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

feat(dashboard-sharing): notifications + bulk management + delete cascade#64

Merged
rubenvdlinde merged 1 commit into
developmentfrom
feature/impl-dashboard-sharing-followups
Apr 30, 2026
Merged

feat(dashboard-sharing): notifications + bulk management + delete cascade#64
rubenvdlinde merged 1 commit into
developmentfrom
feature/impl-dashboard-sharing-followups

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

  • Implements REQ-SHARE-008..013: Nextcloud-native push notifications via INotifier (bell + email) when a dashboard is shared or ownership is transferred
  • Adds PUT /api/dashboard/{id}/shares (atomic replace-all) and DELETE /api/sharees/{shareType}/{shareWith} (revoke-all-for-recipient owned by caller)
  • Adds UserDeletedListener on UserDeletedEvent: transfers dashboard ownership to highest-permission sharer (user-type → oldest share first; group fallback → alphabetically first group/member) or cascades deletion when no fallback owner exists
  • DB migration Version001006Date20260430130000 creates mydash_dashboard_shares table with optional orphan-cleanup step gated by mydash.cleanup_orphan_shares admin config

New files

  • lib/Db/DashboardShare.php — Entity
  • lib/Db/DashboardShareMapper.php — QBMapper with deleteNotIn, deleteByOwnerAndRecipient, deleteByRecipientUser
  • lib/Service/DashboardShareService.php — Business logic: replaceShares, revokeAllForRecipient, transferOwnership, notifyShared/notifyOwnershipTransferred
  • lib/Controller/DashboardShareApiController.phpindex, create, destroy, replace, revokeForRecipient
  • lib/Listener/UserDeletedListener.php — Event-driven cascade + admin-pool selection
  • lib/Notification/Notifier.php — Translatable rich notifications
  • lib/Migration/Version001006Date20260430130000.php — Schema migration
  • tests/Unit/ — 15 new PHPUnit tests (all passing)

Test plan

  • Run composer check:strict — PHPCS, PHPMD, Psalm, PHPStan must pass
  • Run PHPUnit: ./vendor/bin/phpunit tests/Unit/Controller/DashboardShareApiControllerFollowupsTest.php tests/Unit/Service/DashboardShareServiceFollowupsTest.php tests/Unit/Listener/UserDeletedListenerTest.php — 15/15 green
  • Manual: share a dashboard with a user → verify Nextcloud bell notification appears
  • Manual: PUT /api/dashboard/{id}/shares with new set → verify diff is applied atomically
  • Manual: DELETE /api/sharees/user/bob → verify only caller-owned shares for bob are removed
  • Manual: delete a user who owns dashboards → verify ownership transferred or dashboards deleted
  • Manual: enable mydash.cleanup_orphan_shares = true → run upgrade → verify orphan rows removed

@rubenvdlinde rubenvdlinde added the ready-for-code-review Build complete — awaiting code reviewer label Apr 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/mydash @ 6558cc1

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 103/103
npm ✅ 342/342
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-30 20:03 UTC

Download the full PDF report from the workflow artifacts.

…cade per REQ-SHARE-008..013

Adds Nextcloud-native push notifications on share events, PUT /api/dashboard/{id}/shares
(atomic replace-all) and DELETE /api/sharees/{shareType}/{shareWith} (revoke-all-for-recipient),
plus UserDeletedListener that transfers dashboard ownership to the highest-permission sharer
or deletes orphaned dashboards when no fallback owner exists.
@rubenvdlinde rubenvdlinde force-pushed the feature/impl-dashboard-sharing-followups branch from acc9455 to f275fa5 Compare April 30, 2026 20:04
@rubenvdlinde rubenvdlinde merged commit c8c3e57 into development Apr 30, 2026
14 of 17 checks passed
@rubenvdlinde rubenvdlinde deleted the feature/impl-dashboard-sharing-followups branch April 30, 2026 20:04
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/mydash @ 99b9639

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 103/103
npm ✅ 342/342
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-30 20:05 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit that referenced this pull request May 3, 2026
…cade per REQ-SHARE-008..013 (#64)

Adds Nextcloud-native push notifications on share events, PUT /api/dashboard/{id}/shares
(atomic replace-all) and DELETE /api/sharees/{shareType}/{shareWith} (revoke-all-for-recipient),
plus UserDeletedListener that transfers dashboard ownership to the highest-permission sharer
or deletes orphaned dashboards when no fallback owner exists.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-for-code-review Build complete — awaiting code reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant