-
Notifications
You must be signed in to change notification settings - Fork 23
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
Adding attribute by team name #40
Adding attribute by team name #40
Conversation
@aaronrothschild I would like to hear you thoughts on this feature proposal. |
@nathanaelhoun Thank you for your contribution! Just to confirm, this new feature will allow custom attributes to be added to all user that belongs to the configured team(s)?
To update the image, you can either update it directly in Github and upload the image that you would want (you can drag and drop) or you can create a |
Thanks for the tip @marianunez ! Yes exactly: every member of the team will have the team attribute. We use it because we don't have the AD groups in our Mattermost instance. |
How does this work when you belong to 20+ teams @nathanaelhoun ? Could you post some screenshots here? |
@aaronrothschild This looks like this with one team for each letter in the alphabet. Looks pretty messy I guess. But it looks normal if a reasonable number of custom attributes are set up (only for two teams and one personal attribute here) A little clarification: the custom attribute only shows when it's configured for the specified team (it is not automatic for all the teams) |
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.
@nathanaelhoun overall changes look good. However, I would suggest we rely on saving the teamId
in the configuration instead of team name in order for the check to be more robust and to be consistent with how we handle user and groups saved by id.
On the UI side, they could still select by team name if you implement a selector for team like we have there for user_input
.
Thanks for the feeback @marianunez! It took me some time (React is totally new to me, I had to understand a few things), and I force-pushed as I rewrote everything I had changed previously. Now there is a team selector in the UI, and teams are compared with their ids. Let me know if it theses changes seems better to you 😄 |
// TeamsInput searches and selects teams displayed by display_name. | ||
// Teams prop can handle the team object or strings directly if the team object is not available. | ||
// Returns the selected team ids in the `OnChange` value parameter. | ||
export default class TeamsInput extends React.Component { |
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.
Not in scope with this PR, but it would be interesting to see if we can generalize this input component. Beside formatOptionLabel
and getOptionValue
, everything else is identical. It would be great if we would pass those as props and it can be reused for both teams and users. It could also possibly solve #28
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.
@nathanaelhoun would you be interested in giving #28 a shot in a separate PR and possibly exploring the approach above that would apply for users, groups and teams?
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.
Great work @nathanaelhoun! The team selector looks great! 👍
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.
Thanks @nathanaelhoun! I have some requests, mostly regarding style in the javascript side.
webapp/src/components/admin_settings/custom_attribute/custom_attribute.jsx
Outdated
Show resolved
Hide resolved
webapp/src/components/admin_settings/custom_attribute/custom_attribute.jsx
Outdated
Show resolved
Hide resolved
webapp/src/components/admin_settings/teams_input/teams_input.jsx
Outdated
Show resolved
Hide resolved
webapp/src/components/admin_settings/teams_input/teams_input.jsx
Outdated
Show resolved
Hide resolved
webapp/src/components/admin_settings/teams_input/teams_input.jsx
Outdated
Show resolved
Hide resolved
Thanks for the review @mickmister 😄 |
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.
LGTM 👍 One non-blocking request on error string formatting
webapp/src/components/admin_settings/teams_input/teams_input.jsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Kochell <[email protected]>
@aaronrothschild any concerns product-wise with moving forward with this feature? |
Hi! Is there any news on this? |
@nathanaelhoun apologies on the delay on this. @aaronrothschild gentle ping to |
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.
@nathanaelhoun Sorry for the delay, catching up on holiday relatyed backlog. Looks good, I am worried about too many Teams when there is a bunch setup, but that can be conquered later.
Thanks for your contribution!
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.
Tested and passed
- Confirmed members of the team specified are given the custom attributed as expected
- Tested adding / removing teams as well as assigning custom attribute to members of multiple teams
- Users team membership updated custom attribute as expected
- Tested various combination of Team with the existing user grouping.
No issues found
LGTM!
@nathanaelhoun sorry for the delay in testing. Huge thanks for this enhancement!
@aaronrothschild Do you think this needs its own ticket? Thanks so much @nathanaelhoun! |
Summary
I didn't tested if it doesn't break the GroupID version, because I don't have access to an E20 server, but I tested the others cases.
Inspired by #15
Ticket Link
No ticket