web: People: Added isUserDisabled selector
This commit is contained in:
parent
f9fe6c800b
commit
217b5f0bed
@ -5,7 +5,7 @@ import { ContentRow, toastr } from "asc-web-components";
|
||||
import UserContent from "./userContent";
|
||||
//import config from "../../../../../../package.json";
|
||||
import { selectUser, deselectUser, setSelection } from "../../../../../store/people/actions";
|
||||
import { isSelected, getUserStatus, getUserRole } from '../../../../../store/people/selectors';
|
||||
import { isSelected, getUserStatus, getUserRole, isUserDisabled } from '../../../../../store/people/selectors';
|
||||
import { isAdmin } from '../../../../../store/auth/selectors';
|
||||
|
||||
class SectionBodyContent extends React.PureComponent {
|
||||
@ -36,8 +36,8 @@ class SectionBodyContent extends React.PureComponent {
|
||||
}
|
||||
|
||||
getUserContextOptions = (user) => {
|
||||
return [
|
||||
{
|
||||
|
||||
const options = [{
|
||||
key: "key1",
|
||||
label: "Send e-mail",
|
||||
onClick: this.onEmailSentClick
|
||||
@ -62,12 +62,16 @@ class SectionBodyContent extends React.PureComponent {
|
||||
key: "key6",
|
||||
label: "Change e-mail",
|
||||
onClick: this.onChangeEmailClick
|
||||
},
|
||||
{
|
||||
}];
|
||||
|
||||
return [...options,
|
||||
!isUserDisabled(user)
|
||||
? {
|
||||
key: "key7",
|
||||
label: "Disable",
|
||||
onClick: this.onDisableClick
|
||||
}
|
||||
: {}
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -122,4 +122,8 @@ export function getUsersBySelected(users, selected) {
|
||||
});
|
||||
|
||||
return newSelection;
|
||||
}
|
||||
};
|
||||
|
||||
export function isUserDisabled(user) {
|
||||
return getUserStatus(user) === "disabled";
|
||||
};
|
Loading…
Reference in New Issue
Block a user