Search board info fields and confirm project device deletion
The distribution-board search also matches board number and location as soon as the boards carry them (distribution-board info card of feature/print-view); the fields are optional in the filter, so the branch works with and without them. Deleting a project device now asks for confirmation like the other delete actions, since the row action is a small trash icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
837b29c7c5
commit
68b9ee850b
3 changed files with 40 additions and 2 deletions
|
|
@ -154,8 +154,16 @@ export function buildSupplyTypeFilterOptions(
|
|||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Board number and location come with the distribution-board info card
|
||||
* (feature/print-view). They are optional here so the filter works with and
|
||||
* without those fields and searches them as soon as the DTO carries them.
|
||||
*/
|
||||
export function filterDistributionBoards<
|
||||
Board extends Pick<DistributionBoardDto, "name" | "floorId" | "supplyType">,
|
||||
Board extends Pick<DistributionBoardDto, "name" | "floorId" | "supplyType"> & {
|
||||
boardNumber?: string | null;
|
||||
location?: string | null;
|
||||
},
|
||||
>(
|
||||
boards: readonly Board[],
|
||||
filters: DistributionBoardFilters,
|
||||
|
|
@ -166,6 +174,8 @@ export function filterDistributionBoards<
|
|||
(board) =>
|
||||
matchesQuery(query, [
|
||||
board.name,
|
||||
board.boardNumber,
|
||||
board.location,
|
||||
board.floorId ? floorNameById.get(board.floorId) : undefined,
|
||||
]) &&
|
||||
matchesSelection(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue