MM-49214 : Filter out bot users shown in Apps modal form user pickers(#22631)

This issue involves updating the user picker functionality in the Mattermost web app's app framework. Currently, bot users are being displayed in the user picker for forms, which is not desired. The goal is to hide bot users from the user picker dropdown and only show real users. This can be achieved by filtering out any user that is a bot using the user.is_bot property. The necessary changes have been made in the apps_form_select_field.tsx file, specifically in the loadDynamicUserOptions function, which has been updated to filter out bot users using .filter((user) => !user.is_bot).
Этот коммит содержится в:
Martin Qvarnström
2023-04-19 08:25:57 +02:00
коммит произвёл GitHub
родитель 7b9d43e308
Коммит b46f5db8b2

Просмотреть файл

@@ -90,7 +90,7 @@ export default class AppsFormSelectField extends React.PureComponent<Props, Stat
loadDynamicUserOptions = async (userInput: string): Promise<AppSelectOption[]> => {
const usersSearchResults: UserAutocomplete = await this.props.actions.autocompleteUsers(userInput.toLowerCase());
return usersSearchResults.users.map((user) => {
return usersSearchResults.users.filter((user) => !user.is_bot).map((user) => {
const label = this.props.teammateNameDisplay ? displayUsername(user, this.props.teammateNameDisplay) : user.username;
return {...user, label, value: user.id, icon_data: imageURLForUser(user.id)};