Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@whitdog47
Copy link
Contributor

@whitdog47 whitdog47 commented Jul 16, 2025

This PR updates the tag picker so that tags are only shown if their tag type is discoverable for the selected model.

  • In fetchTags, the logic now fetches tag type IDs with discoverable_<model> = true and applies them in the API filter before loading tags.
  • Client-side filtering in convertData has been removed, shifting all discoverability checks into the backend query.
  • TagPicker.vue now supports props.project as either a single object or an array and normalizes it in relevant methods. (Fixes issue with case and incident table filters.)

@whitdog47 whitdog47 requested a review from Copilot July 16, 2025 19:45
@whitdog47 whitdog47 self-assigned this Jul 16, 2025
@whitdog47 whitdog47 added the bug Something isn't working label Jul 16, 2025
Copy link
Contributor

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 updates the tag-picker so that tags are only shown if their tag type is discoverable for the selected model.

  • In fetchTags, the logic now fetches tag type IDs with discoverable_<model> = true and applies them in the API filter before loading tags.
  • Client-side filtering in convertData has been removed, shifting all discoverability checks into the backend query.
  • TagPicker.vue now supports props.project as either a single object or an array and normalizes it in relevant methods.

Reviewed Changes

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

File Description
src/dispatch/static/dispatch/src/tag/store.js Add model-specific discoverability filter, rebuild TagApi parameters, and remove old client-side filtering in convertData.
src/dispatch/static/dispatch/src/tag/TagPicker.vue Normalize props.project handling in validateTags, fetchData, and generateSuggestions.
Comments suppressed due to low confidence (2)

src/dispatch/static/dispatch/src/tag/TagPicker.vue:357

  • [nitpick] The variable project_id uses snake_case but the rest of the code uses camelCase. Consider renaming to projectId for consistency with JavaScript naming conventions.
  const project_id = project?.id || 0

src/dispatch/static/dispatch/src/tag/store.js:332

  • The previous implementation used the parameter name descending. Verify that sortDesc is recognized by TagApi.getAll, or switch to descending to match the existing API contract.
        sortDesc: [false],

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: David Whittaker <84562015+whitdog47@users.noreply.github.com>
@whitdog47 whitdog47 merged commit c20916a into main Jul 16, 2025
9 checks passed
@whitdog47 whitdog47 deleted the fix/tag-picker-filter-on-discoverability branch July 16, 2025 23:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants