Skip to content

ISSUE #5299 - Ticket Filters in Tabular View #5539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 68 commits into
base: ISSUE_5545
Choose a base branch
from

Conversation

The-Daniel
Copy link
Contributor

This fixes #5299

Description

  • Added ticket filters to tabular view
  • Tickets card in the viewer should work the same as before

Acceptance Criteria

  • Make sure the properties selection list includes all available options from all ticket template, regardless of status (active or deprecated), except this property: ticket template.
  • Once the filter is applied, that property option is not available in the properties selection list anymore.
  • If the filter is removed, that property option should reappear in the properties selection list.
  • User able to add/remove/update filters.
  • Applied filter should appear on the filter bar as a pill.
  • Make sure the filtering displaying on the pill is correct.
  • If the number of pills exceeding the length limit of the filter bar, user should be able to view all pills using scrollbar.
  • The filter bar is collapsible.
  • Update the table or all tables if grouping applied when applying/removing/updating filters.
  • Make sure the filtering works as intended such that the filtered tickets inside the tables match with the result.
  • Make sure the "Clear all" button removes all pills and updates the table or all tables if grouping applied.
  • Existing functions which update the tables such as add/remove models, group by, filter completed tickets, add tickets must continue to work as before while the tables are filtered.
  • Refresh the page/Re-enter the tabular view should restore everything back to default state. (e.g. Display all tickets of the selected ticket type with selected models and no grouping/filtering.)

@The-Daniel The-Daniel requested a review from Copilot June 12, 2025 14:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces ticket filter functionality to the tabular view, ensuring that the properties selection list is updated based on applied filters and integrates smoothly with existing ticket table updates.

  • Added ticket filters in tabular view with corresponding filter pill UI and collapsible filter bar
  • Updated selectors, sagas, and components to support filtering across both container and federation models
  • Refactored and cleaned up related styles and helper functions

Reviewed Changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/src/v5/ui/routes/dashboard/projects/tickets/ticketsTable/newTicketMenu/useSelectedModels.ts Introduces a new hook to conditionally select model IDs based on viewer context
frontend/src/v5/ui/routes/dashboard/projects/tickets/ticketsList/slides/ticketSlide.component.tsx Minor cleanup by removing an extra blank line
frontend/src/v5/ui/routes/dashboard/projects/tickets/ticketsContent.component.tsx Passes an extra parameter to fetchTemplates for enhanced detail fetching
frontend/src/v5/ui/routes/dashboard/projects/tickets/tickets.styles.ts Renames container component and adjusts spacing along with removing unused chip styling
frontend/src/v5/ui/routes/dashboard/projects/tickets/ticketsContent.component.tsx Updates API usage in saga to support multiple model IDs
Multiple UI components and helpers Adjust imports and update logic to support new filter functionality and models selection
Comments suppressed due to low confidence (1)

frontend/src/v5/store/tickets/card/ticketsCard.sagas.ts:65

  • The code calls isFederation as a function (isFederation(modelId)), but isFed is obtained from a selector and likely returns a boolean instead of a function. Update the logic to check the boolean value directly (e.g. use (isFederation ? API.Tickets.fetchFederationTickets : API.Tickets.fetchContainerTickets)).
const fetchModelTickets = await isFederation(modelId) ? API.Tickets.fetchFederationTickets : API.Tickets.fetchContainerTickets;

@The-Daniel
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link

@Didi-Kwan Didi-Kwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 testing is complete. Here is the test summary report with bug report inside.

@@ -143,9 +133,10 @@ export const TicketsTable = () => {
return pathname + (ticketId ? `?ticketId=${ticketId}` : '');
};

useSetDefaultTicketFilters([selectedTemplate]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think it should be getNonCompletedTicketFilters but as a hook.
useSetDefaultTicketFilters currently uses the routing for the viewer.

So rename getNonCompletedTicketFilters to useSetDefaultTicketFilters

Rename useViewerTicketFilterParams to useBindTicketFiltersData make it receive any param like the one from needed in the tickets table to reuse that in both places. Add any necessary logic (like the filtersInitialised) the idea is to have a hook that orchestrates how tickets filters data is fetched.

and rename
useSetDefaultTicketFilters to useViewerTicketFilterParams

const [groupBy,, setGroupByParam] = useSearchParam('groupBy');
const [groupByValue,, setGroupByValue] = useSearchParam('groupByValue');
const [containerOrFederation,, setContainerOrFederation] = useSearchParam('containerOrFederation');
const models = useSelectedModels();

const [filtersInitialised, setFiltersInitialised] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can be up till 3 horizontal scrolls. The idea is that only just one should be there and if scrolling is necessary should be showing, not scrolling all the way to the bottom to scroll to the right.

image

@sanmont3drepo sanmont3drepo changed the base branch from staging to ISSUE_5545 July 3, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants