Skip to content
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

#10753: Improve the way group names are visualized in user settings by showing tooltip for selected items #10757

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions web/client/components/manager/users/UserGroups.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ import PropTypes from 'prop-types';

import React from 'react';

// const Message = require('../I18N/Message').default;
import Select from 'react-select';

import Message from '../../I18N/Message';
import { findIndex } from 'lodash';
import SecurityUtils from '../../../utils/SecurityUtils';

// const ConfirmModal = require('./modals/ConfirmModal');
// const GroupManager = require('./GroupManager');

import { OverlayTrigger, Tooltip } from 'react-bootstrap';
class UserCard extends React.Component {
static propTypes = {
// props
Expand Down Expand Up @@ -55,7 +51,13 @@ class UserCard extends React.Component {
clearableValue: group.groupName !== SecurityUtils.USER_GROUP_ALL
}));
};

customValueRenderer = (option) => {
return ( <OverlayTrigger
placement="top"
overlay={<Tooltip id={`tooltip-${option.value}`}>{option.label}</Tooltip>}
><div className="Select-value-label" data-tip={option.label}> {option.label}</div>
</OverlayTrigger>);
};
renderGroupsSelector = () => {
return (<Select key="groupSelector"
clearable={false}
Expand All @@ -66,6 +68,8 @@ class UserCard extends React.Component {
options={this.getOptions()}
onChange={this.onChange}
style={{marginTop: "10px"}}
// * NOTE: valueRenderer: is responsible for custom rendering for shown selected values in react-select version 1.3.0
valueRenderer={this.customValueRenderer}
/>);
};

Expand Down
Loading