Skip to content

feat(search-shortcuts): Group assignee search suggestions #52764

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

Merged
merged 8 commits into from
Jul 13, 2023

Conversation

scttcper
Copy link
Member

@scttcper scttcper commented Jul 12, 2023

  • Splits assignees into two groups "suggested" and "all values". This was challenging because all tags and autocomplete are currently a single list of strings. This lets us use SearchGroups directly.
  • Brings user teams up into suggested
  • Adds teams that the user is not a member of in all values

After this change it will be grouped like this

Suggested
- "me", "[me, my_teams]"
- Teams current user is a member

All Values
- All users
- Teams current user is not a member

image

fixes #52577

@scttcper scttcper requested a review from a team as a code owner July 12, 2023 22:10
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 12, 2023
export function escapeTagValue(value: string): string {
// Wrap in quotes if there is a space
return value.includes(' ') || value.includes('"')
? `"${value.replace(/"/g, '\\"')}"`

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This does not escape backslash characters in the input.
Copy link
Member Author

Choose a reason for hiding this comment

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

dumb

};
}

const searchItems = searchGroupItems as SearchItem[];
Copy link
Member

Choose a reason for hiding this comment

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

Is there no way for searchGroupItems to have a mixed array of SearchItem and SearchGroup? If so maybe the typing should be SearchItem[] | SearchGroup[]?

Copy link
Member Author

Choose a reason for hiding this comment

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

done, its gets a bit weird in places since typescript doesn't like that one property that can be completely different things

@scttcper scttcper merged commit 22cb937 into master Jul 13, 2023
@scttcper scttcper deleted the scttcper/assignee-filter branch July 13, 2023 20:37
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants