-
Notifications
You must be signed in to change notification settings - Fork 0
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
Searchable teams filter #61
Conversation
const initialFilterTypeValue = savedSetting?.filterType || 'everyone'; | ||
setTeamFilterType(initialFilterTypeValue); | ||
// fetch selected teams | ||
const teams = await getTeamsByIds(savedSetting.filteredTeamIDs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this can make many API calls all together, but this would be once, in a very in-frequently accused part of the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just few questions
// fetch all teams to populate options | ||
const teams: Team[] = await Client4.getTeams(0, 10000, false) as Team[]; | ||
// getTeams always returns Team[] when includeTotalCount param is set to false | ||
const teams = await Client4.getTeams(0, 20, false) as Team[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this standard way of doing this in this repo. In web we usually have an action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is how we do it in simple plugins, like this one.
const initialFilterTypeValue = savedSetting?.filterType || 'everyone'; | ||
setTeamFilterType(initialFilterTypeValue); | ||
// fetch selected teams | ||
const teams = await getTeamsByIds(savedSetting.filteredTeamIDs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if getTeamsByIds
is only used in this useEffect then cant we define it in this closure itself? 0/5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Summary
Updated team filter dropdown to search all teams on server.
Ticket Link
Fixes https://mattermost.atlassian.net/browse/MM-61902