From 6ad21beb8d7b175618fc3be7b025b605517e4979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hornych?= Date: Sun, 17 Dec 2023 15:47:18 +0100 Subject: [PATCH] feat: display different types of attribute uniqueness even in attribute flags --- src/services/lab.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/lab.service.ts b/src/services/lab.service.ts index 2a05ffda..f0919932 100644 --- a/src/services/lab.service.ts +++ b/src/services/lab.service.ts @@ -148,10 +148,14 @@ export class LabService { if (entityAttribute && (schema as EntityAttributeSchema).representative) { flags.push('representative') } - if (globalAttribute && (schema as GlobalAttributeSchema).globalUniquenessType != GlobalAttributeUniquenessType.NotUnique) { + if (globalAttribute && (schema as GlobalAttributeSchema).globalUniquenessType === GlobalAttributeUniquenessType.UniqueWithinCatalog) { flags.push('globally unique') - } else if (schema.uniquenessType != AttributeUniquenessType.NotUnique) { + } else if (globalAttribute && (schema as GlobalAttributeSchema).globalUniquenessType === GlobalAttributeUniquenessType.UniqueWithinCatalogLocale) { + flags.push('globally unique per locale') + } else if (schema.uniquenessType === AttributeUniquenessType.UniqueWithinCollection) { flags.push('unique') + } else if (schema.uniquenessType === AttributeUniquenessType.UniqueWithinCollectionLocale) { + flags.push('unique per locale') } if ((globalAttribute && (schema as GlobalAttributeSchema).globalUniquenessType != GlobalAttributeUniquenessType.NotUnique) || schema.uniquenessType != AttributeUniquenessType.NotUnique ||