diff --git a/src/common/hooks/useComplexLookup.ts b/src/common/hooks/useComplexLookup.ts index a64e51b3..2def26c4 100644 --- a/src/common/hooks/useComplexLookup.ts +++ b/src/common/hooks/useComplexLookup.ts @@ -30,8 +30,8 @@ export const useComplexLookup = ({ const { setComplexValue, resetComplexValue: resetMarcPreviewData, - metaData: marcPreviewMetadata, - resetMetaData: resetMarcPreviewMetadata, + metadata: marcPreviewMetadata, + resetMetadata: resetMarcPreviewMetadata, } = useMarcPreviewState(); const { resetIsMarcPreviewOpen } = useUIState(); const { isModalOpen, setIsModalOpen, openModal } = useModalControls(); diff --git a/src/common/hooks/useContainerEvents.ts b/src/common/hooks/useContainerEvents.ts index 9cb5fc27..88691f7c 100644 --- a/src/common/hooks/useContainerEvents.ts +++ b/src/common/hooks/useContainerEvents.ts @@ -14,7 +14,7 @@ type IUseContainerEvents = export const useContainerEvents = ({ onTriggerModal, watchEditedState = false }: IUseContainerEvents = {}) => { const { hasNavigationOrigin } = useConfigState(); - const { isEditedRecord: isEdited } = useStatusState(); + const { isRecordEdited: isEdited } = useStatusState(); const { customEvents } = useConfigState(); const { BLOCK_NAVIGATION, diff --git a/src/common/hooks/useProfileSchema.ts b/src/common/hooks/useProfileSchema.ts index 83fc3c63..9daa48ae 100644 --- a/src/common/hooks/useProfileSchema.ts +++ b/src/common/hooks/useProfileSchema.ts @@ -6,7 +6,7 @@ export const useProfileSchema = () => { const { selectedEntriesService, schemaWithDuplicatesService } = useServicesContext() as Required; const { setCollapsibleEntries } = useUIState(); const { setUserValues, setSelectedEntries } = useInputsState(); - const { setIsEditedRecord: setIsEdited } = useStatusState(); + const { setIsRecordEdited: setIsEdited } = useStatusState(); const { schema, setSchema } = useProfileState(); const getSchemaWithCopiedEntries = (entry: SchemaEntry, selectedEntries: string[]) => { diff --git a/src/common/hooks/useRecordControls.ts b/src/common/hooks/useRecordControls.ts index 75071152..97f3abdf 100644 --- a/src/common/hooks/useRecordControls.ts +++ b/src/common/hooks/useRecordControls.ts @@ -53,7 +53,7 @@ export const useRecordControls = () => { const { setSelectedProfile } = useProfileState(); const { setIsDuplicateImportedResourceModalOpen, setCurrentlyEditedEntityBfid, setCurrentlyPreviewedEntityBfid } = useUIState(); - const { setRecordStatus, setLastSavedRecordId, setIsEditedRecord: setIsEdited, addStatusMessagesItem } = useStatusState(); + const { setRecordStatus, setLastSavedRecordId, setIsRecordEdited: setIsEdited, addStatusMessagesItem } = useStatusState(); const profile = PROFILE_BFIDS.MONOGRAPH; const currentRecordId = getRecordId(record); const { getProfiles } = useConfig(); diff --git a/src/components/ComplexLookupField/MarcPreviewComplexLookup.tsx b/src/components/ComplexLookupField/MarcPreviewComplexLookup.tsx index 89add550..57ef62d0 100644 --- a/src/components/ComplexLookupField/MarcPreviewComplexLookup.tsx +++ b/src/components/ComplexLookupField/MarcPreviewComplexLookup.tsx @@ -15,7 +15,7 @@ type MarcPreviewComplexLookupProps = { export const MarcPreviewComplexLookup: FC = ({ onClose }) => { const { onAssignRecord } = useSearchContext(); const { isMarcPreviewOpen } = useUIState(); - const { complexValue: marcPreviewData, metaData: marcPreviewMetadata } = useMarcPreviewState(); + const { complexValue: marcPreviewData, metadata: marcPreviewMetadata } = useMarcPreviewState(); const renderCloseButton = () => ( diff --git a/src/store/stores/marcPreview.ts b/src/store/stores/marcPreview.ts index 87fafd1e..d44a82d1 100644 --- a/src/store/stores/marcPreview.ts +++ b/src/store/stores/marcPreview.ts @@ -6,7 +6,7 @@ type MarcPreviewMetaData = MarcPreviewMetadata | null; export type MarcPreviewState = SliceState<'basicValue', any> & SliceState<'complexValue', MarcPreviewData> & - SliceState<'metaData', MarcPreviewMetaData>; + SliceState<'metadata', MarcPreviewMetaData>; const STORE_NAME = 'MarcPreview'; @@ -17,7 +17,7 @@ const sliceConfigs: SliceConfigs = { complexValue: { initialValue: null, }, - metaData: { + metadata: { initialValue: null, }, }; diff --git a/src/store/stores/status.ts b/src/store/stores/status.ts index cb52e866..41bd4c35 100644 --- a/src/store/stores/status.ts +++ b/src/store/stores/status.ts @@ -4,7 +4,7 @@ import { type SliceState } from '../utils/slice'; type LastSavedRecordId = string | null; export type StatusState = SliceState<'lastSavedRecordId', LastSavedRecordId> & - SliceState<'isEditedRecord', boolean> & + SliceState<'isRecordEdited', boolean> & SliceState<'recordStatus', RecordStatus> & SliceState<'statusMessages', StatusEntry[], StatusEntry>; @@ -14,7 +14,7 @@ const sliceConfigs: SliceConfigs = { lastSavedRecordId: { initialValue: null, }, - isEditedRecord: { + isRecordEdited: { initialValue: false, }, recordStatus: { diff --git a/src/test/__tests__/common/hooks/useContainerEvents.test.ts b/src/test/__tests__/common/hooks/useContainerEvents.test.ts index f1a27ca1..51a0a75b 100644 --- a/src/test/__tests__/common/hooks/useContainerEvents.test.ts +++ b/src/test/__tests__/common/hooks/useContainerEvents.test.ts @@ -17,13 +17,13 @@ const mockEvents = { jest.mock('@common/constants/build.constants', () => ({ IS_EMBEDDED_MODE: true })); describe('useContainerEvents', () => { - const renderUseContainerEventsHook = (isEditedRecord: boolean) => { + const renderUseContainerEventsHook = (isRecordEdited: boolean) => { (domHelper.dispatchEventWrapper as jest.Mock) = mockDispatchEventWrapper; setInitialGlobalState([ { store: useStatusStore, - state: { isEditedRecord }, + state: { isRecordEdited }, }, { store: useConfigStore, diff --git a/src/test/__tests__/components/MarcPreviewComplexLookup.test.tsx b/src/test/__tests__/components/MarcPreviewComplexLookup.test.tsx index 93923c1a..36f3095b 100644 --- a/src/test/__tests__/components/MarcPreviewComplexLookup.test.tsx +++ b/src/test/__tests__/components/MarcPreviewComplexLookup.test.tsx @@ -36,7 +36,7 @@ describe('MarcPreviewComplexLookup', () => { setInitialGlobalState([ { store: useMarcPreviewStore, - state: { complexValue: marcPreviewData, metaData: marcPreviewMetadata }, + state: { complexValue: marcPreviewData, metadata: marcPreviewMetadata }, }, { store: useUIStore, diff --git a/src/test/__tests__/components/SaveRecord.test.tsx b/src/test/__tests__/components/SaveRecord.test.tsx index 895dbc7c..dd05d671 100644 --- a/src/test/__tests__/components/SaveRecord.test.tsx +++ b/src/test/__tests__/components/SaveRecord.test.tsx @@ -6,11 +6,11 @@ import { useStatusStore } from '@src/store'; import { setInitialGlobalState } from '@src/test/__mocks__/store'; describe('SaveRecord', () => { - function renderSaveRecordComponent(isEditedRecord = true) { + function renderSaveRecordComponent(isRecordEdited = true) { setInitialGlobalState([ { store: useStatusStore, - state: { isEditedRecord }, + state: { isRecordEdited }, }, ]);