From b29e131fdf23092fbe7b453d9b72990c21a3a1a6 Mon Sep 17 00:00:00 2001 From: Pavlo Zhukov Date: Wed, 13 Oct 2021 11:19:51 +0300 Subject: [PATCH 1/3] fix: silence unexpected control type enum for color matchers --- lib/store/src/inferControls.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/store/src/inferControls.ts b/lib/store/src/inferControls.ts index 00c4ec45cf6e..125000740876 100644 --- a/lib/store/src/inferControls.ts +++ b/lib/store/src/inferControls.ts @@ -23,9 +23,14 @@ const inferControl = (argType: StrictInputType, name: string, matchers: Controls return { control: { type: 'color' } }; } - logger.warn( - `Addon controls: Control of type color only supports string, received "${controlType}" instead` - ); + /** + * @see https://github.com/storybookjs/storybook/issues/16322 + */ + if (controlType !== 'enum') { + logger.warn( + `Addon controls: Control of type color only supports string, received "${controlType}" instead` + ); + } } // args that end with date e.g. purchaseDate From cac26cc054cf2a30f719187badb0e9854ff904f4 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 1 Jul 2022 01:14:02 +0200 Subject: [PATCH 2/3] Update lib/store/src/inferControls.ts --- lib/store/src/inferControls.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/store/src/inferControls.ts b/lib/store/src/inferControls.ts index 0c1179edf890..a207711edc06 100644 --- a/lib/store/src/inferControls.ts +++ b/lib/store/src/inferControls.ts @@ -23,8 +23,6 @@ const inferControl = (argType: StrictInputType, name: string, matchers: Controls return { control: { type: 'color' } }; } - /** - * @see https://github.com/storybookjs/storybook/issues/16322 */ if (controlType !== 'enum') { logger.warn( From dac12e565c16b4a980857256626731a71e0f9469 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 1 Jul 2022 01:14:26 +0200 Subject: [PATCH 3/3] Update lib/store/src/inferControls.ts --- lib/store/src/inferControls.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/store/src/inferControls.ts b/lib/store/src/inferControls.ts index a207711edc06..4d7526bbced0 100644 --- a/lib/store/src/inferControls.ts +++ b/lib/store/src/inferControls.ts @@ -23,7 +23,6 @@ const inferControl = (argType: StrictInputType, name: string, matchers: Controls return { control: { type: 'color' } }; } - */ if (controlType !== 'enum') { logger.warn( `Addon controls: Control of type color only supports string, received "${controlType}" instead`