diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fc6d834c..b1b85dd0d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -84,6 +84,7 @@
* Add auto focus to textarea on staff and patron info modal. Fixes UIU-2932.
* ECS - Filter users by "User Type". Refs UIU-2943.
* Users App: Consume {{FormattedDate}} and {{FormattedTime}} via stripes-component. Refs UIU-1860.
+* ECS - Prevent editing of specific shadow user data. Refs UIU-2951.
## [9.0.0](https://github.com/folio-org/ui-users/tree/v9.0.0) (2023-02-20)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v8.1.0...v9.0.0)
diff --git a/src/components/EditSections/EditContactInfo/EditContactInfo.js b/src/components/EditSections/EditContactInfo/EditContactInfo.js
index 4dbcda651..9c793b684 100644
--- a/src/components/EditSections/EditContactInfo/EditContactInfo.js
+++ b/src/components/EditSections/EditContactInfo/EditContactInfo.js
@@ -25,6 +25,7 @@ const EditContactInfo = ({
addressTypes,
preferredContactTypeId,
intl,
+ disabled,
}) => {
const contactTypeOptions = (contactTypes || []).map(g => {
return (
@@ -64,6 +65,7 @@ const EditContactInfo = ({
component={TextField}
required
fullWidth
+ disabled={disabled}
/>
@@ -73,6 +75,7 @@ const EditContactInfo = ({
id="adduser_phone"
component={TextField}
fullWidth
+ disabled={disabled}
/>
@@ -82,6 +85,7 @@ const EditContactInfo = ({
id="adduser_mobilePhone"
component={TextField}
fullWidth
+ disabled={disabled}
/>
@@ -93,6 +97,7 @@ const EditContactInfo = ({
fullWidth
aria-required="true"
required
+ disabled={disabled}
defaultValue={selectedContactTypeId}
>
@@ -108,6 +113,7 @@ const EditContactInfo = ({
fieldComponents={addressFields}
canDelete
formType="final-form"
+ disabled={disabled}
/>
);
@@ -120,6 +126,7 @@ EditContactInfo.propTypes = {
addressTypes: PropTypes.arrayOf(PropTypes.object),
preferredContactTypeId: PropTypes.string,
intl: PropTypes.object.isRequired,
+ disabled: PropTypes.bool,
};
export default injectIntl(EditContactInfo);
diff --git a/src/components/EditSections/EditContactInfo/EditContactInfo.test.js b/src/components/EditSections/EditContactInfo/EditContactInfo.test.js
index 53a58a9a4..fd0c44be7 100644
--- a/src/components/EditSections/EditContactInfo/EditContactInfo.test.js
+++ b/src/components/EditSections/EditContactInfo/EditContactInfo.test.js
@@ -1,12 +1,13 @@
-import { screen } from '@folio/jest-config-stripes/testing-library/react';
-import userEvent from '@folio/jest-config-stripes/testing-library/user-event';
import { Form } from 'react-final-form';
-import '__mock__/stripesComponents.mock';
+import { screen } from '@folio/jest-config-stripes/testing-library/react';
+import userEvent from '@folio/jest-config-stripes/testing-library/user-event';
import renderWithRouter from 'helpers/renderWithRouter';
import EditContactInfo from './EditContactInfo';
+jest.unmock('@folio/stripes/components');
+
const onSubmit = jest.fn();
const arrayMutators = {
@@ -28,7 +29,8 @@ const renderEditContactInfo = (props) => {
>
);
- renderWithRouter(
+
+ return renderWithRouter(