Skip to content

CS-633 fix: Cannot delete a custom filter - #1586

Open
yuryyas wants to merge 5 commits into
mainfrom
CS-633_Cannot_Delete_a_Custom_Filter
Open

yuryyas wants to merge 5 commits into
mainfrom
CS-633_Cannot_Delete_a_Custom_Filter

Conversation

@yuryyas

@yuryyas yuryyas commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes CS-633: deleting a custom filter shows "Something went wrong".

Summary

Two bugs on the same delete path in the list view side bar:

 <FilterGroup>
   <FilterItem
-    id={getIndex(groupIndex, index)}   // "1/1" - tree position, also sent to the server
+    itemId={getIndex(groupIndex, index)}
+    id={filter.id}                      // saved filter id
   />
 SideBar.onDeleteFilter(id, entity)
-  deleteFilter(id, entity)                  // AbstractInvoice on the invoice list
+  deleteFilter(id, filterEntity || entity)  // Invoice, same as saving
     EpicDeleteCustomFilter
       DELETE /v1/filter/{id}?entity=…
       GET    /v1/filter?entity=…           // reload; empty result drops the Custom Filters group
  1. Since CS-574 the tree item id ("group/index") was also used as the filter id, so delete requested DELETE /v1/filter/1/1. That returns 404 ("Something went wrong"; against a local dev server it shows up as a CORS preflight failure).
  2. The invoice list saves and loads its filters under Invoice (filterEntity) but deleted under AbstractInvoice. The reload after the delete came back empty and removed the whole Custom Filters group until a page refresh.

Evidence

  • Before: OPTIONS/GET /a/v1/filter/1/1?entity=AbstractInvoice → 404. Local DB has filters saved under Invoice only (none under AbstractInvoice), so the post-delete reload returned [].
    After: the request goes to /a/v1/filter/{id} (preflight 200), and the reload uses Invoice.
  • New tests (client-html/src/tests/list-view/):
    • filterItemIds.test.tsx: clicking delete on the 2nd filter of group 1 → deleteFilter(7, …), not "1/1".
    • sideBarDeleteFilter.test.tsx: invoice list → deleteFilter(312, 'Invoice', …); no filterEntity → 'AbstractInvoice'.
  • tsc --noEmit passes; ESLint clean on changed sources. Jest runs in CI.

Merge Danger

Door: two-way

Blast Radius: small

Client only: custom filter delete in the list view side bar and the timetable custom filters, which share FilterGroup. Tree item ids and selection are unchanged.

🤖 Generated with Claude Code

yuryyas and others added 3 commits November 19, 2026 13:30
…he wrong entity

- FilterItem now takes the tree position as `itemId` and the saved filter id as `id`.
  Delete used the "group/index" tree id, so it requested DELETE /v1/filter/1/1, which
  404s ("Something went wrong"; locally a CORS preflight error).
- SideBar deletes against `filterEntity` when the list has one, the same as saving.
  The reload after deleting an invoice filter asked for AbstractInvoice, came back
  empty, and dropped the whole Custom Filters group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… connected side bar children

The delete button is visibility: hidden until hover, so role queries need hidden: true.
Importing SideBar on its own loaded constants/Config through ChecklistsFilters and hit an
import cycle back into the list view; the connected children are mocked instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… by its aria-label

A visibility: hidden element has an empty accessible name, so a role query filtered by name
never matches it, hidden: true or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Unit Test Results

361 tests  +3   361 ✔️ +3   14m 58s ⏱️ + 4m 11s
242 suites +1       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit e79ada4. ± Comparison against base commit d00f9be.

♻️ This comment has been updated with latest results.

@claude

claude Bot commented Nov 20, 2026

Copy link
Copy Markdown

Claude review

Jira: CS-633. The Jira lookup isn't available in this run, so I didn't check the change against the ticket in this pass.

Reviewed range: 9ce3f0fcd8..e79ada4ac0

Assessment: The only change in this range is a merge of main. It adds the "Show Claude error" step to .github/workflows/claude-review.yml, which was already reviewed on main. The PR's own changes to custom filter deletion in the client and its tests have not changed since the previous head, so there is nothing new in them to review.

No issues found.

Reviewed up to e79ada4

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant