Project configuration view: manage a project's statuses
New /projects/:id/configure view, linked from a new 'Configure' item on
the project view's Manage menu.
Backend:
- CardStatusRepository/CardStatusController gain full CRUD: create
(appended at the end), reorder (dense positions, like card
ordering), and delete.
- Deleting a status with cards attached is rejected with 409 and
error.details.card_count, rather than hitting the existing FK
RESTRICT constraint -- retrying with { reassign_to: <status id> }
moves those cards to that status first (CardRepository::
reassignStatus, appended after the destination's existing cards)
and deletes in one transaction (CardStatusRepository::transaction,
shared PDO connection across repositories).
- The last status in a project can't be deleted, since a project card
is required to have one.
- Routes: POST/DELETE .../statuses(/:id), PUT .../statuses/order.
- 14 new CardStatusTest cases covering all of the above.
Frontend:
- ProjectConfigureView.vue: header (title, back-to-project link, the
shared Manage menu) + a vuedraggable status list (reorder persists
the whole new order) with a delete button per row and an add-status
form. A row's plain delete either succeeds immediately or, on 409,
opens a modal to choose a different status before retrying the
delete with reassign_to.
- Extracted ProjectManageMenu.vue (the Manage dropdown + delete-project
modal) out of ProjectView so both views share it; it now also has a
Configure link (hidden on the configure page itself).
- ApiError gains a cardCount getter (details.card_count), mirroring
the existing retryAfter getter.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -73,7 +73,7 @@ $authController = new AuthController($users, $session, $verifier, $config->allow
|
||||
$emailController = new EmailVerificationController($users, $verificationTokens, $verifier, $session);
|
||||
$projectController = new ProjectController($projects, $cardStatuses);
|
||||
$cardController = new CardController($projects, $cards, $cardStatuses);
|
||||
$cardStatusController = new CardStatusController($projects, $cardStatuses);
|
||||
$cardStatusController = new CardStatusController($projects, $cardStatuses, $cards);
|
||||
$passkeyController = new PasskeyController($webAuthn, $passkeys, $webauthnChallenges, $users, $session);
|
||||
$authMiddleware = new AuthMiddleware($jwt, $users);
|
||||
|
||||
@@ -120,6 +120,9 @@ $app->group('/api', function (RouteCollectorProxy $group) use (
|
||||
$projects->delete('/{projectId:[0-9]+}', [$projectController, 'destroy']);
|
||||
|
||||
$projects->get('/{projectId:[0-9]+}/statuses', [$cardStatusController, 'index']);
|
||||
$projects->post('/{projectId:[0-9]+}/statuses', [$cardStatusController, 'store']);
|
||||
$projects->put('/{projectId:[0-9]+}/statuses/order', [$cardStatusController, 'reorder']);
|
||||
$projects->delete('/{projectId:[0-9]+}/statuses/{statusId:[0-9]+}', [$cardStatusController, 'destroy']);
|
||||
|
||||
$projects->get('/{projectId:[0-9]+}/cards', [$cardController, 'index']);
|
||||
$projects->post('/{projectId:[0-9]+}/cards', [$cardController, 'store']);
|
||||
|
||||
Reference in New Issue
Block a user