Priority filter on the approval panel says no definitions exist
Description
Summary
Filtering by priority on the New tab of the approval panel (Jira work item / Confluence page) shows "To start approval, first administrator or space administrator have to add definition." when no definition matches the selected priority. The filter bar disappears with it, so the filter cannot be cleared without reloading the panel. For JSM portal customers the whole panel is hidden instead.
Root cause
The empty state is meant for "no definitions are configured", but its guard listed only the definition filter, so any priority selection with no matches fell through to it. The priority filter was added later (AP-789) without extending the guard.
The backend had the same confusion: the definitions filters were also applied to the "does this work item have ongoing approvals" check, and the panel-hiding rule read the filtered result count.
What changed
-
The empty state now appears only when no filter is applied. A filtered-empty result keeps the filter bar and shows the table's own "No definitions found".
-
hasActiveDefinitionFiltersis now shared between the empty-state guard and the filter bar, so a future filter cannot drift out of sync again. -
The ongoing-approvals check no longer inherits the definitions filters, and the panel is hidden only when there are genuinely no definitions.
Notes for manual tester
Needs at least two definitions available on the work item / page, with different priorities (set on the definition's Basic fields).
-
Open the approval panel on a work item, New tab.
-
Priority filter -> pick a priority that no definition uses.
-
Expect: filter bar still visible with the chip, table shows "No definitions found", count says 0.
-
Must NOT show "administrator or space administrator have to add definition".
-
-
Clear the filter (chip clear, or "Clear filters"). List comes back.
-
Pick a priority that one definition uses -> only that definition is listed, Start still works.
-
Combine with the definition filter -> both chips apply together, still no empty-state message.
-
Delete/disable every definition for that work item, no filter selected -> the "have to add definition" message is expected here. This is the only case that should show it.
-
Same checks on a Confluence page panel.
-
JSM portal (customer view) on a request with no approvals yet: apply a priority filter with no matches -> the panel must stay visible showing "No definitions found", not disappear.
-
Regression: the Approvals tab priority filter and the Manage approvals definitions list priority filter/sorting are untouched but worth a quick pass.