diff --git a/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js b/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js index 739309ac..1491053e 100644 --- a/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js +++ b/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js @@ -27,7 +27,6 @@ const VersionHistoryPane = ({ onClose, onSelectVersion, hiddenFields = [], - systemUpdatedFields = [], labelsMap, versions, }) => { @@ -144,7 +143,6 @@ VersionHistoryPane.propTypes = { onSelectVersion: PropTypes.func.isRequired, labelsMap: PropTypes.object.isRequired, hiddenFields: PropTypes.arrayOf(PropTypes.string), - systemUpdatedFields: PropTypes.arrayOf(PropTypes.string), versions: PropTypes.arrayOf(PropTypes.object).isRequired, }; diff --git a/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.test.js b/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.test.js index 5f1fe0d4..e371eea0 100644 --- a/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.test.js +++ b/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.test.js @@ -97,22 +97,6 @@ describe('VersionHistoryPane', () => { expect(screen.getByText('stripes-acq-components.fundDistribution.value')).toBeInTheDocument(); }); - it('should display "System maintenance update" label if there is only system changes', () => { - const clonedAuditEvent = Object.assign(cloneDeep(orderLineAuditEvent), { id: TEST_ID }); - - set(clonedAuditEvent.orderLineSnapshot, 'searchLocationId[0]', 'locationId'); - - renderVersionHistoryPane({ - versions: [ - clonedAuditEvent, - orderLineAuditEvent, - ], - systemUpdatedFields: ['searchLocationId'], - }); - - expect(screen.getByText(/systemChange/)).toBeInTheDocument(); - }); - it('should not display version cards without changed fields', () => { const clonedAuditEvent = Object.assign(cloneDeep(orderLineAuditEvent), { id: TEST_ID }); diff --git a/lib/VersionHistory/getFieldLabels.js b/lib/VersionHistory/getFieldLabels.js index ecf68752..34e304bd 100644 --- a/lib/VersionHistory/getFieldLabels.js +++ b/lib/VersionHistory/getFieldLabels.js @@ -8,7 +8,7 @@ export const getFieldLabels = (intl, paths, labelsMap = {}, hiddenFields = []) = return paths.reduce((acc, path) => { const fieldLabel = labelsMapEntries.find(([fieldPath]) => { - const regex = new RegExp(`^${escapeRegExp(fieldPath).replace('\\\\d', '\\d')}$`); + const regex = new RegExp(`^${escapeRegExp(fieldPath).replaceAll('\\\\d', '\\d')}$`); return regex.test(path); })?.[1] || path; diff --git a/lib/VersionHistory/getVersionMetadata.test.js b/lib/VersionHistory/getVersionMetadata.test.js index d887415e..bceeec74 100644 --- a/lib/VersionHistory/getVersionMetadata.test.js +++ b/lib/VersionHistory/getVersionMetadata.test.js @@ -18,7 +18,7 @@ describe('getVersionMetadata', () => { expect(getVersionMetadata(version, entity)).toEqual({ metadataKey: 'metadataValue', updatedByUserId: 'userId', - updatedDate: version.eventDate, + updatedDate: version.actionDate, ...entity.metadata, }); });