diff --git a/src/visualBuilder/utils/__test__/entryEditRestriction.test.ts b/src/visualBuilder/utils/__test__/entryEditRestriction.test.ts index 45426191..6c220f34 100644 --- a/src/visualBuilder/utils/__test__/entryEditRestriction.test.ts +++ b/src/visualBuilder/utils/__test__/entryEditRestriction.test.ts @@ -55,6 +55,10 @@ describe("getEntryEditRestrictionForField", () => { expect(getEntryEditRestrictionForField(meta())).toBe( ENTRY_RESTRICTION_MESSAGES.unlocalized ); + setEntryEditRestriction(scope, "entryLocked"); + expect(getEntryEditRestrictionForField(meta())).toBe( + ENTRY_RESTRICTION_MESSAGES.entryLocked + ); setEntryEditRestriction(scope, "unsavedVariant"); expect(getEntryEditRestrictionForField(meta())).toBe( ENTRY_RESTRICTION_MESSAGES.unsavedVariant diff --git a/src/visualBuilder/utils/fieldLockIndicator.ts b/src/visualBuilder/utils/fieldLockIndicator.ts index bb435051..7f7aec22 100644 --- a/src/visualBuilder/utils/fieldLockIndicator.ts +++ b/src/visualBuilder/utils/fieldLockIndicator.ts @@ -66,6 +66,8 @@ export function getPeerLockForField( export const ENTRY_RESTRICTION_MESSAGES: Record = { olderVersion: "You're viewing an older version of this entry. Switch to the latest version to edit.", + entryLocked: + "This entry was updated by someone else. Reload the entry to keep editing.", unlocalized: "This entry isn't localized in this language yet. Save it from the form to localize it, then edit here.", unsavedVariant: diff --git a/src/visualBuilder/utils/fieldLockStore.ts b/src/visualBuilder/utils/fieldLockStore.ts index b5b97db4..9a011504 100644 --- a/src/visualBuilder/utils/fieldLockStore.ts +++ b/src/visualBuilder/utils/fieldLockStore.ts @@ -30,6 +30,7 @@ export type EntryFieldLockInfo = Record; /** Why the parent has turned editing off for a whole entry scope. */ export type EntryEditRestriction = | "olderVersion" + | "entryLocked" | "unlocalized" | "unsavedVariant"; @@ -122,6 +123,7 @@ export function getEntryEditRestrictionWriteSeq(): number { const RESTRICTIONS: ReadonlySet = new Set([ "olderVersion", + "entryLocked", "unlocalized", "unsavedVariant", ]);