Remove the assigned-user and label filters
Build package / php-lint (8.4) (push) Successful in 1m33s
Build package / php-lint (8.5) (push) Successful in 49s
Build package / xml-lint (push) Successful in 13s
Build package / unit-tests (push) Successful in 38s
Build package / package (push) Successful in 1m44s

Workflows now move every overdue card of their source stack. A new
migration drops filter_user_ids and filter_label_ids; workflows that
had a filter keep running unfiltered. The version goes to 35.1.0 so
the migration runs on update.

Removed along with the filters: the labels and participants endpoints
and their Deck lookups, the dead-filter warnings and markers, and
CardService::enrichCards() in the card read. enrichCards() only added
labels, assignees and comment counts, and ran a permission check
against Deck's frozen uid.
This commit is contained in:
Patrick Niebeling committed 2026-09-30 09:55:54 +02:00
1 parent e84123654e
commit 0904292c73
14 files changed
+122 -651

No files matched your search

+2 -34
View File
@@ -49,18 +49,12 @@ class WorkflowController extends OCSController {
return new DataResponse(array_map(static fn (Workflow $w) => $w->jsonSerialize(), $workflows));
}
/**
* @param string[] $filterUserIds
* @param int[] $filterLabelIds
*/
#[NoAdminRequired]
public function create(
string $title,
int $boardId,
int $sourceStackId,
int $targetStackId,
array $filterUserIds = [],
array $filterLabelIds = [],
bool $notifyEmail = false,
bool $enabled = true,
): DataResponse {
@@ -68,16 +62,12 @@ class WorkflowController extends OCSController {
$workflow = new Workflow();
$workflow->setUserId($this->currentUserId());
$this->applyFields($workflow, $title, $boardId, $sourceStackId, $targetStackId, $filterUserIds, $filterLabelIds, $notifyEmail, $enabled);
$this->applyFields($workflow, $title, $boardId, $sourceStackId, $targetStackId, $notifyEmail, $enabled);
$workflow = $this->workflowMapper->insert($workflow);
return new DataResponse($workflow->jsonSerialize(), Http::STATUS_CREATED);
}
/**
* @param string[] $filterUserIds
* @param int[] $filterLabelIds
*/
#[NoAdminRequired]
public function update(
int $id,
@@ -85,8 +75,6 @@ class WorkflowController extends OCSController {
int $boardId,
int $sourceStackId,
int $targetStackId,
array $filterUserIds = [],
array $filterLabelIds = [],
bool $notifyEmail = false,
bool $enabled = true,
): DataResponse {
@@ -96,7 +84,7 @@ class WorkflowController extends OCSController {
// Kept in step with the board owner so the job runs as, and mails,
// the right user; validate() made sure the editor owns the board.
$workflow->setUserId($this->currentUserId());
$this->applyFields($workflow, $title, $boardId, $sourceStackId, $targetStackId, $filterUserIds, $filterLabelIds, $notifyEmail, $enabled);
$this->applyFields($workflow, $title, $boardId, $sourceStackId, $targetStackId, $notifyEmail, $enabled);
$workflow = $this->workflowMapper->update($workflow);
return new DataResponse($workflow->jsonSerialize());
@@ -121,18 +109,6 @@ class WorkflowController extends OCSController {
return new DataResponse($this->deckService->listStacks($boardId));
}
#[NoAdminRequired]
public function labels(int $boardId): DataResponse {
$this->assertDeck();
return new DataResponse($this->deckService->listLabels($boardId));
}
#[NoAdminRequired]
public function participants(int $boardId): DataResponse {
$this->assertDeck();
return new DataResponse($this->deckService->listParticipants($boardId));
}
private function findOwnWorkflow(int $id): Workflow {
try {
$workflow = $this->workflowMapper->findById($id);
@@ -216,18 +192,12 @@ class WorkflowController extends OCSController {
}
}
/**
* @param string[] $filterUserIds
* @param int[] $filterLabelIds
*/
private function applyFields(
Workflow $workflow,
string $title,
int $boardId,
int $sourceStackId,
int $targetStackId,
array $filterUserIds,
array $filterLabelIds,
bool $notifyEmail,
bool $enabled,
): void {
@@ -235,8 +205,6 @@ class WorkflowController extends OCSController {
$workflow->setBoardId($boardId);
$workflow->setSourceStackId($sourceStackId);
$workflow->setTargetStackId($targetStackId);
$workflow->setFilterUserIds($filterUserIds === [] ? null : json_encode(array_values($filterUserIds)));
$workflow->setFilterLabelIds($filterLabelIds === [] ? null : json_encode(array_values($filterLabelIds)));
$workflow->setNotifyEmail($notifyEmail);
$workflow->setEnabled($enabled);
}