Skip to content

Commit db380ef

Browse files
authored
Merge pull request #2830 from irontec/PROVIDER-2098-disabled-edit-button-for-contacts-with-non-null-userId
Disabled edit button for contacts with non-null userId
2 parents 9987cb3 + 51e3fda commit db380ef

File tree

1 file changed

+6
-5
lines changed
  • web/portal/client/src/entities/Contact

1 file changed

+6
-5
lines changed

web/portal/client/src/entities/Contact/Form.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { useStoreState } from 'store';
1010

1111
const Form = (props: EntityFormProps): JSX.Element => {
1212
const { entityService, row, match, initialValues, create } = props;
13-
const userContact = row?.user !== undefined;
13+
const edit = props.edit || false;
14+
const isEditable = row?.user !== null && edit;
1415

1516
const fkChoices = useFkChoices({
1617
foreignKeyGetter,
@@ -27,10 +28,10 @@ const Form = (props: EntityFormProps): JSX.Element => {
2728
}
2829

2930
const readOnlyProperties = {
30-
name: userContact,
31-
lastname: userContact,
32-
email: userContact,
33-
otherPhone: userContact,
31+
name: isEditable,
32+
lastname: isEditable,
33+
email: isEditable,
34+
otherPhone: isEditable,
3435
};
3536

3637
const groups: Array<FieldsetGroups> = [

0 commit comments

Comments
 (0)