Skip to content

Commit

Permalink
#10753: Improve the way group names are visualized in user settings b…
Browse files Browse the repository at this point in the history
…y showing tooltip for selected items
  • Loading branch information
mahmoudadel54 committed Jan 15, 2025
1 parent 779416d commit e517be1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions web/client/components/manager/users/UserGroups.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ 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 +52,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 +69,7 @@ class UserCard extends React.Component {
options={this.getOptions()}
onChange={this.onChange}
style={{marginTop: "10px"}}
valueRenderer={this.customValueRenderer}
/>);
};

Expand Down

0 comments on commit e517be1

Please sign in to comment.