Web: People: Disabled editing of UserType and Group in MyProfile with action=edit
This commit is contained in:
parent
3db2963106
commit
d7d22a9369
@ -6,7 +6,7 @@ import UpdateUserForm from "./updateUserForm";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { withRouter } from "react-router";
|
||||
|
||||
const SectionUserBody = ({ avatarEditorIsOpen, match }) => {
|
||||
const SectionUserBody = ({ avatarEditorIsOpen, match, isMy }) => {
|
||||
const { type } = match.params;
|
||||
return type ? (
|
||||
avatarEditorIsOpen ? (
|
||||
@ -17,7 +17,7 @@ const SectionUserBody = ({ avatarEditorIsOpen, match }) => {
|
||||
) : avatarEditorIsOpen ? (
|
||||
<AvatarEditorPage />
|
||||
) : (
|
||||
<UpdateUserForm />
|
||||
<UpdateUserForm isMy={isMy} />
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -548,6 +548,7 @@ class UpdateUserForm extends React.Component {
|
||||
//avatarMax,
|
||||
disableProfileType,
|
||||
isAdmin,
|
||||
isMy,
|
||||
} = this.props;
|
||||
const {
|
||||
guestCaption,
|
||||
@ -775,7 +776,7 @@ class UpdateUserForm extends React.Component {
|
||||
{ value: "true", label: guestCaption },
|
||||
{ value: "false", label: userCaption },
|
||||
]}
|
||||
radioIsDisabled={isLoading || disableProfileType}
|
||||
radioIsDisabled={isLoading || disableProfileType || isMy}
|
||||
radioOnChange={this.onUserTypeChange}
|
||||
tooltipContent={tooltipTypeContent}
|
||||
helpButtonHeaderContent={t("UserType")}
|
||||
@ -810,6 +811,7 @@ class UpdateUserForm extends React.Component {
|
||||
inputOnChange={this.onInputChange}
|
||||
inputTabIndex={9}
|
||||
/>
|
||||
{!isMy && (
|
||||
<DepartmentField
|
||||
labelText={`${groupCaption}:`}
|
||||
isDisabled={isLoading || !isAdmin}
|
||||
@ -824,6 +826,7 @@ class UpdateUserForm extends React.Component {
|
||||
selectorOnSearchGroups={this.onSearchGroups}
|
||||
selectorOnSelectGroups={this.onSelectGroups}
|
||||
/>
|
||||
)}
|
||||
</MainFieldsContainer>
|
||||
</MainContainer>
|
||||
<InfoFieldContainer headerText={t("Comments")}>
|
||||
|
@ -71,7 +71,7 @@ class ProfileAction extends React.Component {
|
||||
console.log("ProfileAction render");
|
||||
|
||||
this.loaded = false;
|
||||
const { profile, match } = this.props;
|
||||
const { profile, match, isMy } = this.props;
|
||||
const { userId, type } = match.params;
|
||||
|
||||
if (type) {
|
||||
@ -100,7 +100,7 @@ class ProfileAction extends React.Component {
|
||||
|
||||
<PageLayout.SectionBody>
|
||||
{this.loaded ? (
|
||||
<SectionUserBody />
|
||||
<SectionUserBody isMy={isMy} />
|
||||
) : (
|
||||
<Loaders.ProfileView isEdit={false} />
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user