From a0d653c45110326c3c6856e28885ffd2b64fbf86 Mon Sep 17 00:00:00 2001 From: NasgulNexus Date: Wed, 30 Aug 2023 13:00:50 +0200 Subject: [PATCH] feat(Common): added lower case conversion for add Button Position --- src/lib/kit/utils/__tests__/common.test.ts | 4 ++++ src/lib/kit/utils/common.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/lib/kit/utils/__tests__/common.test.ts b/src/lib/kit/utils/__tests__/common.test.ts index 2cdfb964..9becc918 100644 --- a/src/lib/kit/utils/__tests__/common.test.ts +++ b/src/lib/kit/utils/__tests__/common.test.ts @@ -90,6 +90,10 @@ describe('kit/utils/common', () => { viewSpec: {layout: 'row'}, }); + expect(prepareSpec({viewSpec: {addButtonPosition: 'DOWN'}} as any)).toMatchObject({ + viewSpec: {addButtonPosition: 'down'}, + }); + expect(prepareSpec({viewSpec: {themeLabel: 'WARNING'}} as any)).toMatchObject({ viewSpec: {themeLabel: 'warning'}, }); diff --git a/src/lib/kit/utils/common.ts b/src/lib/kit/utils/common.ts index 67f55d0b..68ef1ca0 100644 --- a/src/lib/kit/utils/common.ts +++ b/src/lib/kit/utils/common.ts @@ -95,6 +95,10 @@ export const prepareSpec = ( result.viewSpec.layout = result.viewSpec.layout.toLowerCase(); } + if (_.isString(result.viewSpec?.addButtonPosition)) { + result.viewSpec.addButtonPosition = result.viewSpec.addButtonPosition.toLowerCase(); + } + if (_.isString(result.viewSpec?.themeLabel)) { result.viewSpec.themeLabel = result.viewSpec.themeLabel.toLowerCase(); }