From 6227e159e1e07bfff2c7f5ff2f8da79639f6e7f4 Mon Sep 17 00:00:00 2001 From: jdickman Date: Fri, 7 Jun 2024 14:15:43 -0400 Subject: [PATCH 1/9] isolate exports for sub-components --- .eslintrc.cjs | 5 ++- .../data-entry/QueryItem/Action.tsx | 6 ++- .../data-entry/QueryItem/Cascader.tsx | 6 ++- .../data-entry/QueryItem/NumberInput.tsx | 38 +++++++++++++++++++ .../data-entry/QueryItem/Qualifier.tsx | 4 +- .../data-entry/QueryItem/QueryItem.tsx | 13 ++++--- src/components/data-entry/QueryItem/Text.tsx | 4 +- .../data-entry/QueryItem/TextInput.tsx | 4 +- .../data-entry/QueryItem/ValueSelector.tsx | 12 ++++-- 9 files changed, 74 insertions(+), 18 deletions(-) create mode 100644 src/components/data-entry/QueryItem/NumberInput.tsx diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 4b749a858..706cf2fa5 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,3 +1,4 @@ +const NumberInput = require('src/components/data-entry/QueryItem/NumberInput.js') module.exports = { env: { browser: true, @@ -108,6 +109,8 @@ module.exports = { 'WorkspaceNoResults', 'WorkspaceSignout', 'NavigationItem', + 'Action', + 'NumberInput', ], }, ], @@ -123,4 +126,4 @@ module.exports = { React: true, expect: true, }, -} +} \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/Action.tsx b/src/components/data-entry/QueryItem/Action.tsx index 72a54cb11..f15a5ba40 100644 --- a/src/components/data-entry/QueryItem/Action.tsx +++ b/src/components/data-entry/QueryItem/Action.tsx @@ -8,7 +8,7 @@ export interface IActionProps { onClick?: () => void } -export const Action = (props: IActionProps) => { +const Action = (props: IActionProps) => { let buttonClassNames: string = 'query-item query-item--action' if ((props.type ?? 'default') === 'default') buttonClassNames += ` query-item--secondary` if ((props.type ?? 'default') === 'disabled') buttonClassNames += ` query-item--disabled` @@ -32,4 +32,6 @@ export const Action = (props: IActionProps) => { ) -} \ No newline at end of file +} + +export default Action \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/Cascader.tsx b/src/components/data-entry/QueryItem/Cascader.tsx index 8db38220f..821937982 100644 --- a/src/components/data-entry/QueryItem/Cascader.tsx +++ b/src/components/data-entry/QueryItem/Cascader.tsx @@ -30,7 +30,7 @@ export interface ICascaderProps { value?: Array } -export const Cascader = (props: ICascaderProps) => { +const Cascader = (props: ICascaderProps) => { type DefaultOptionType = GetProp[number] const options: ICascaderOption[] = [] @@ -177,4 +177,6 @@ export const Cascader = (props: ICascaderProps) => { function getIcon() { return } -} \ No newline at end of file +} + +export default Cascader \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/NumberInput.tsx b/src/components/data-entry/QueryItem/NumberInput.tsx new file mode 100644 index 000000000..398a3da78 --- /dev/null +++ b/src/components/data-entry/QueryItem/NumberInput.tsx @@ -0,0 +1,38 @@ +import './query-item.css' +import { type ChangeEvent } from 'react' +import { Input } from 'src/components' +import { Typography } from 'src/components/general/Typography/Typography' + +interface ITextInputProps { + onChange?: (value: string) => void + value?: string + disabled?: boolean + errorMessage?: string + placeholder?: string +} + +const NumberInput = (props: ITextInputProps) => { + // const isErrorStatus = props.errorMessage && !props.disabled + // + // const _onChange = (e: ChangeEvent) => { + // if (props.onChange) props.onChange(e.target.value) + // } + // + // let inputClasses = `query-item query-item--input-text` + // if (props.errorMessage) inputClasses += ' query-item--error' + // + // return ( + // <> + // + // {props.errorMessage && {props.errorMessage}} + // + // ) +} + +export default NumberInput \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/Qualifier.tsx b/src/components/data-entry/QueryItem/Qualifier.tsx index 604d30f35..aa003da59 100644 --- a/src/components/data-entry/QueryItem/Qualifier.tsx +++ b/src/components/data-entry/QueryItem/Qualifier.tsx @@ -15,7 +15,7 @@ export interface IQueryItemQualifierProps { value?: IQueryItemQualifierOption } -export const Qualifier = (props: IQueryItemQualifierProps) => { +const Qualifier = (props: IQueryItemQualifierProps) => { const [isOpen, setIsOpen] = useState(false) const selectProps: ISelectProps = { defaultValue: props.options?.length ? props.options[0].value : undefined, @@ -45,3 +45,5 @@ export const Qualifier = (props: IQueryItemQualifierProps) => { ) } + +export default Qualifier \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/QueryItem.tsx b/src/components/data-entry/QueryItem/QueryItem.tsx index a25cd8b64..31b829302 100644 --- a/src/components/data-entry/QueryItem/QueryItem.tsx +++ b/src/components/data-entry/QueryItem/QueryItem.tsx @@ -1,12 +1,15 @@ import React from 'react' -import { ValueSelector } from 'src/components/data-entry/QueryItem/ValueSelector' -import { Action } from './Action' -import { Qualifier } from './Qualifier' -import { Text } from './Text' +import ValueSelector from 'src/components/data-entry/QueryItem/ValueSelector' +import Action from 'src/components/data-entry/QueryItem/Action' +import Text from 'src/components/data-entry/QueryItem/Text' +import Qualifier from 'src/components/data-entry/QueryItem/Qualifier' -export const QueryItem = () => { +const QueryItem = () => { return <>DO NOT USE THIS OR YOU WILL BE FIRED! } + +export default QueryItem + QueryItem.Action = Action QueryItem.Qualifier = Qualifier QueryItem.ValueSelector = ValueSelector diff --git a/src/components/data-entry/QueryItem/Text.tsx b/src/components/data-entry/QueryItem/Text.tsx index cc5ef1e33..073a31b76 100644 --- a/src/components/data-entry/QueryItem/Text.tsx +++ b/src/components/data-entry/QueryItem/Text.tsx @@ -5,8 +5,8 @@ export interface ITextProps { text: string } -export const Text = ({ disabled = false, text }: ITextProps) => { +const Text = ({ disabled = false, text }: ITextProps) => { return {text}; } -export default Text +export default Text \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/TextInput.tsx b/src/components/data-entry/QueryItem/TextInput.tsx index 005a4b3e2..8ae62af62 100644 --- a/src/components/data-entry/QueryItem/TextInput.tsx +++ b/src/components/data-entry/QueryItem/TextInput.tsx @@ -11,7 +11,7 @@ interface ITextInputProps { placeholder?: string } -export const TextInput = (props: ITextInputProps) => { +const TextInput = (props: ITextInputProps) => { const isErrorStatus = props.errorMessage && !props.disabled const _onChange = (e: ChangeEvent) => { @@ -34,3 +34,5 @@ export const TextInput = (props: ITextInputProps) => { ) } + +export default TextInput \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/ValueSelector.tsx b/src/components/data-entry/QueryItem/ValueSelector.tsx index 695371157..344c2467f 100644 --- a/src/components/data-entry/QueryItem/ValueSelector.tsx +++ b/src/components/data-entry/QueryItem/ValueSelector.tsx @@ -1,10 +1,14 @@ -import { Cascader } from 'src/components/data-entry/QueryItem/Cascader' -import { TextInput } from 'src/components/data-entry/QueryItem/TextInput' +import Cascader from 'src/components/data-entry/QueryItem/Cascader' +import TextInput from 'src/components/data-entry/QueryItem/TextInput' +import NumberInput from 'src/components/data-entry/QueryItem/NumberInput' -export const ValueSelector = () => { +const ValueSelector = () => { // eslint-disable-next-line react/no-unescaped-entities return <>DON'T USE THIS OR YOU WILL BE FIRED! } +export default ValueSelector + ValueSelector.TextInput = TextInput -ValueSelector.Cascader = Cascader +ValueSelector.NumberInput = NumberInput +ValueSelector.Cascader = Cascader \ No newline at end of file From 00829786935efe96aa3569d32cb116cc16a73b62 Mon Sep 17 00:00:00 2001 From: jdickman Date: Sat, 8 Jun 2024 12:32:33 -0400 Subject: [PATCH 2/9] NumberInput component and stories --- .eslintrc.cjs | 5 +- .../QueryItem/NumberInput.stories.tsx | 55 +++++++++++++++++++ .../data-entry/QueryItem/NumberInput.tsx | 54 +++++++++--------- .../data-entry/QueryItem/QueryItem.tsx | 5 +- .../QueryItem/TextInput.stories.tsx | 6 +- .../data-entry/QueryItem/TextInput.tsx | 17 +++--- .../data-entry/QueryItem/query-item.css | 8 ++- 7 files changed, 107 insertions(+), 43 deletions(-) create mode 100644 src/components/data-entry/QueryItem/NumberInput.stories.tsx diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 706cf2fa5..5427df553 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,4 +1,3 @@ -const NumberInput = require('src/components/data-entry/QueryItem/NumberInput.js') module.exports = { env: { browser: true, @@ -110,7 +109,11 @@ module.exports = { 'WorkspaceSignout', 'NavigationItem', 'Action', + 'QueryItem', 'NumberInput', + 'TextInput', + 'Qualifier', + 'ValueSelector', ], }, ], diff --git a/src/components/data-entry/QueryItem/NumberInput.stories.tsx b/src/components/data-entry/QueryItem/NumberInput.stories.tsx new file mode 100644 index 000000000..cbb73aae0 --- /dev/null +++ b/src/components/data-entry/QueryItem/NumberInput.stories.tsx @@ -0,0 +1,55 @@ +import { type Meta, type StoryObj } from '@storybook/react' +import { QueryItem } from 'src/components' + +const meta: Meta = { + title: 'Aquarium/Data Entry/QueryItem/ValueSelector/NumberInput', + component: QueryItem.ValueSelector.NumberInput, + parameters: { + docs: { + description: { + component: 'This is the "Number Input" component of the QueryItem/ValueSelector component group.', + }, + }, + }, + args: { + onChange: (value: string | number) => { + console.log(value) + }, + }, +} + +export default meta + +type Story = StoryObj + +export const Primary: Story = {} + +export const Default: Story = { + args: { + value: 2, + }, +} + +export const Placeholder: Story = { + args: { + placeholder: 'Enter a Number', + }, +} + +export const ErrorMessage: Story = { + args: { + errorMessage: 'Required field!', + }, +} + +export const Min: Story = { + args: { + min: 0, + }, +} + +export const Max: Story = { + args: { + max: 100, + }, +} \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/NumberInput.tsx b/src/components/data-entry/QueryItem/NumberInput.tsx index 398a3da78..143f71de7 100644 --- a/src/components/data-entry/QueryItem/NumberInput.tsx +++ b/src/components/data-entry/QueryItem/NumberInput.tsx @@ -1,38 +1,42 @@ import './query-item.css' -import { type ChangeEvent } from 'react' -import { Input } from 'src/components' +import { InputNumber } from 'src/components' import { Typography } from 'src/components/general/Typography/Typography' interface ITextInputProps { - onChange?: (value: string) => void - value?: string + value?: number disabled?: boolean errorMessage?: string placeholder?: string + min?: number + max?: number + onChange?: (value: number) => void } const NumberInput = (props: ITextInputProps) => { - // const isErrorStatus = props.errorMessage && !props.disabled - // - // const _onChange = (e: ChangeEvent) => { - // if (props.onChange) props.onChange(e.target.value) - // } - // - // let inputClasses = `query-item query-item--input-text` - // if (props.errorMessage) inputClasses += ' query-item--error' - // - // return ( - // <> - // - // {props.errorMessage && {props.errorMessage}} - // - // ) + const isErrorStatus = props.errorMessage && !props.disabled + + let inputClasses = `query-item query-item--input-number` + if (props.errorMessage) inputClasses += ' query-item--error' + + return ( + <> + { + props.onChange?.(parseFloat(value as string)) + }} + /> + + {props.errorMessage && + {props.errorMessage}} + + ) } export default NumberInput \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/QueryItem.tsx b/src/components/data-entry/QueryItem/QueryItem.tsx index 31b829302..5a504dc09 100644 --- a/src/components/data-entry/QueryItem/QueryItem.tsx +++ b/src/components/data-entry/QueryItem/QueryItem.tsx @@ -4,12 +4,9 @@ import Action from 'src/components/data-entry/QueryItem/Action' import Text from 'src/components/data-entry/QueryItem/Text' import Qualifier from 'src/components/data-entry/QueryItem/Qualifier' -const QueryItem = () => { +export const QueryItem = () => { return <>DO NOT USE THIS OR YOU WILL BE FIRED! } - -export default QueryItem - QueryItem.Action = Action QueryItem.Qualifier = Qualifier QueryItem.ValueSelector = ValueSelector diff --git a/src/components/data-entry/QueryItem/TextInput.stories.tsx b/src/components/data-entry/QueryItem/TextInput.stories.tsx index 845b9aef5..c1bfd03fe 100644 --- a/src/components/data-entry/QueryItem/TextInput.stories.tsx +++ b/src/components/data-entry/QueryItem/TextInput.stories.tsx @@ -22,9 +22,11 @@ export default meta type Story = StoryObj +export const Primary: Story = {} + export const Default: Story = { args: { - value: 'Primary', + value: 'Default', }, } @@ -38,4 +40,4 @@ export const ErrorMessage: Story = { args: { errorMessage: 'Required field!', }, -} +} \ No newline at end of file diff --git a/src/components/data-entry/QueryItem/TextInput.tsx b/src/components/data-entry/QueryItem/TextInput.tsx index 8ae62af62..c9b7f8291 100644 --- a/src/components/data-entry/QueryItem/TextInput.tsx +++ b/src/components/data-entry/QueryItem/TextInput.tsx @@ -4,19 +4,15 @@ import { Input } from 'src/components' import { Typography } from 'src/components/general/Typography/Typography' interface ITextInputProps { - onChange?: (value: string) => void value?: string disabled?: boolean errorMessage?: string placeholder?: string + onChange?: (value: string) => void } const TextInput = (props: ITextInputProps) => { - const isErrorStatus = props.errorMessage && !props.disabled - - const _onChange = (e: ChangeEvent) => { - if (props.onChange) props.onChange(e.target.value) - } + const isErrorStatus: boolean = !!props.errorMessage && !props.disabled let inputClasses = `query-item query-item--input-text` if (props.errorMessage) inputClasses += ' query-item--error' @@ -29,8 +25,13 @@ const TextInput = (props: ITextInputProps) => { className={inputClasses} value={props.value} placeholder={props.placeholder} - onChange={_onChange}> - {props.errorMessage && {props.errorMessage}} + onChange={e => { + props.onChange?.(e.target.value) + }} + /> + + {props.errorMessage && + {props.errorMessage}} ) } diff --git a/src/components/data-entry/QueryItem/query-item.css b/src/components/data-entry/QueryItem/query-item.css index 4081b7c58..e126d1983 100644 --- a/src/components/data-entry/QueryItem/query-item.css +++ b/src/components/data-entry/QueryItem/query-item.css @@ -42,12 +42,14 @@ border-color: var(--mp-query-item-border-color-disabled) !important; } -.query-item.query-item--input-text { +.query-item.query-item--input-text, +.query-item.query-item--input-number { color: var(--mp-query-item-value-selector-color); font-weight: var(--mp-query-item-value-selector-font-weight); } -.query-item.query-item--input-text::placeholder { +.query-item.query-item--input-text::placeholder, +.query-item.query-item--input-number::placeholder { font-weight: normal; } @@ -123,4 +125,4 @@ /* This is a fix for a pre-existing Ant issue with the spacing on input.search */ .query-item__input-search .ant-input-outlined { height: var(--control-height); -} +} \ No newline at end of file From 76ac83fb7e88a564ccd34d34b7b05dc9134b78d5 Mon Sep 17 00:00:00 2001 From: jdickman Date: Sat, 8 Jun 2024 12:39:39 -0400 Subject: [PATCH 3/9] add disabled story, rename prop interface --- .../data-entry/QueryItem/NumberInput.stories.tsx | 7 +++++++ src/components/data-entry/QueryItem/NumberInput.tsx | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/data-entry/QueryItem/NumberInput.stories.tsx b/src/components/data-entry/QueryItem/NumberInput.stories.tsx index cbb73aae0..30bbfad0c 100644 --- a/src/components/data-entry/QueryItem/NumberInput.stories.tsx +++ b/src/components/data-entry/QueryItem/NumberInput.stories.tsx @@ -42,6 +42,13 @@ export const ErrorMessage: Story = { }, } +export const Disabled: Story = { + args: { + disabled: true, + placeholder: 'Disabled', + }, +} + export const Min: Story = { args: { min: 0, diff --git a/src/components/data-entry/QueryItem/NumberInput.tsx b/src/components/data-entry/QueryItem/NumberInput.tsx index 143f71de7..276db7c6e 100644 --- a/src/components/data-entry/QueryItem/NumberInput.tsx +++ b/src/components/data-entry/QueryItem/NumberInput.tsx @@ -2,7 +2,7 @@ import './query-item.css' import { InputNumber } from 'src/components' import { Typography } from 'src/components/general/Typography/Typography' -interface ITextInputProps { +interface INumberInputProps { value?: number disabled?: boolean errorMessage?: string @@ -12,7 +12,7 @@ interface ITextInputProps { onChange?: (value: number) => void } -const NumberInput = (props: ITextInputProps) => { +const NumberInput = (props: INumberInputProps) => { const isErrorStatus = props.errorMessage && !props.disabled let inputClasses = `query-item query-item--input-number` From bbfdb7138e080f583bb2ae7045bb836a1b10093c Mon Sep 17 00:00:00 2001 From: mparticle-automation Date: Sat, 8 Jun 2024 16:46:32 +0000 Subject: [PATCH 4/9] chore(release): 1.16.2-query-select-number.1 [skip ci] ## [1.16.2-query-select-number.1](https://github.com/mParticle/aquarium/compare/v1.16.1...v1.16.2-query-select-number.1) (2024-06-08) --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d02e8d9..9b13cfe2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [1.16.2-query-select-number.1](https://github.com/mParticle/aquarium/compare/v1.16.1...v1.16.2-query-select-number.1) (2024-06-08) + ## [1.16.1](https://github.com/mParticle/aquarium/compare/v1.16.0...v1.16.1) (2024-06-03) diff --git a/package-lock.json b/package-lock.json index dc29e5d79..1f55d3a11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mparticle/aquarium", - "version": "1.16.1", + "version": "1.16.2-query-select-number.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mparticle/aquarium", - "version": "1.16.1", + "version": "1.16.2-query-select-number.1", "license": "Apache-2.0", "dependencies": { "lodash.clonedeep": "4.5.0" diff --git a/package.json b/package.json index 07d4b0a12..b5b6c25b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mparticle/aquarium", - "version": "1.16.1", + "version": "1.16.2-query-select-number.1", "description": "mParticle Component Library", "license": "Apache-2.0", "keywords": [ From c0bf4381f78b082cec26cd635f785e9e15c692bf Mon Sep 17 00:00:00 2001 From: jdickman Date: Sat, 8 Jun 2024 12:46:48 -0400 Subject: [PATCH 5/9] allow releasing from chore and fix branches --- release.config.cjs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/release.config.cjs b/release.config.cjs index dbc44a24f..a9eecf031 100644 --- a/release.config.cjs +++ b/release.config.cjs @@ -1,9 +1,22 @@ module.exports = { - branches: ['main', { - name: 'feat/*', - channel: 'feature', - prerelease: "${name.split('/').slice(1).join('-').toLowerCase()}" - }], + branches: ['main', + { + name: 'feat/*', + channel: 'feature', + prerelease: "${name.split('/').slice(1).join('-').toLowerCase()}" + }, + { + name: 'chore/*', + channel: 'chore', + prerelease: "${name.split('/').slice(1).join('-').toLowerCase()}" + }, + { + name: 'fix/*', + channel: 'fix', + prerelease: "${name.split('/').slice(1).join('-').toLowerCase()}" + }, + + ], tagFormat: 'v${version}', repositoryUrl: 'https://github.com/mParticle/aquarium', plugins: [ @@ -52,4 +65,4 @@ module.exports = { }, ], ], -} +} \ No newline at end of file From 7b3b4aab273d6ee243f34b4fbfac0db77b929faa Mon Sep 17 00:00:00 2001 From: jdickman Date: Mon, 10 Jun 2024 20:14:05 -0400 Subject: [PATCH 6/9] fix type error --- src/components/data-entry/QueryItem/ValueSelector.stories.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/data-entry/QueryItem/ValueSelector.stories.tsx b/src/components/data-entry/QueryItem/ValueSelector.stories.tsx index da7e3cb28..432a381cf 100644 --- a/src/components/data-entry/QueryItem/ValueSelector.stories.tsx +++ b/src/components/data-entry/QueryItem/ValueSelector.stories.tsx @@ -1,5 +1,5 @@ import { type Meta, type StoryObj } from '@storybook/react' -import { ValueSelector } from './ValueSelector' +import ValueSelector from './ValueSelector' const meta: Meta = { title: 'Aquarium/Data Entry/QueryItem/ValueSelector', @@ -19,4 +19,4 @@ export default meta type Story = StoryObj -export const DontUseThisOrYouWillBeFired: Story = {} +export const DontUseThisOrYouWillBeFired: Story = {} \ No newline at end of file From 14621da2c9164c83844fd9b7faddb2467ed71dc8 Mon Sep 17 00:00:00 2001 From: jared-dickman Date: Mon, 10 Jun 2024 20:16:00 -0400 Subject: [PATCH 7/9] Update src/components/data-entry/QueryItem/NumberInput.stories.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gabriel Tibúrcio --- src/components/data-entry/QueryItem/NumberInput.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/data-entry/QueryItem/NumberInput.stories.tsx b/src/components/data-entry/QueryItem/NumberInput.stories.tsx index 30bbfad0c..89e9176a0 100644 --- a/src/components/data-entry/QueryItem/NumberInput.stories.tsx +++ b/src/components/data-entry/QueryItem/NumberInput.stories.tsx @@ -12,7 +12,7 @@ const meta: Meta = { }, }, args: { - onChange: (value: string | number) => { + onChange: (value: number) => { console.log(value) }, }, From 8f3a9382c9df05dc9c2fdbf1a82559b8495438c0 Mon Sep 17 00:00:00 2001 From: jared-dickman Date: Mon, 10 Jun 2024 20:16:19 -0400 Subject: [PATCH 8/9] Update src/components/data-entry/QueryItem/Action.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gabriel Tibúrcio --- src/components/data-entry/QueryItem/Action.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/data-entry/QueryItem/Action.tsx b/src/components/data-entry/QueryItem/Action.tsx index f15a5ba40..a01d04730 100644 --- a/src/components/data-entry/QueryItem/Action.tsx +++ b/src/components/data-entry/QueryItem/Action.tsx @@ -10,8 +10,9 @@ export interface IActionProps { const Action = (props: IActionProps) => { let buttonClassNames: string = 'query-item query-item--action' - if ((props.type ?? 'default') === 'default') buttonClassNames += ` query-item--secondary` - if ((props.type ?? 'default') === 'disabled') buttonClassNames += ` query-item--disabled` + const { type = 'default' } = props.type + if (type === 'default') buttonClassNames += ` query-item--secondary` + if (type === 'disabled') buttonClassNames += ` query-item--disabled` const baseProps: IButtonProps = { className: buttonClassNames, From d580c0ec777b4646865f95564a22ab4b375fb7eb Mon Sep 17 00:00:00 2001 From: jdickman Date: Tue, 11 Jun 2024 10:37:20 -0400 Subject: [PATCH 9/9] revert Action change --- src/components/data-entry/QueryItem/Action.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/data-entry/QueryItem/Action.tsx b/src/components/data-entry/QueryItem/Action.tsx index a01d04730..f15a5ba40 100644 --- a/src/components/data-entry/QueryItem/Action.tsx +++ b/src/components/data-entry/QueryItem/Action.tsx @@ -10,9 +10,8 @@ export interface IActionProps { const Action = (props: IActionProps) => { let buttonClassNames: string = 'query-item query-item--action' - const { type = 'default' } = props.type - if (type === 'default') buttonClassNames += ` query-item--secondary` - if (type === 'disabled') buttonClassNames += ` query-item--disabled` + if ((props.type ?? 'default') === 'default') buttonClassNames += ` query-item--secondary` + if ((props.type ?? 'default') === 'disabled') buttonClassNames += ` query-item--disabled` const baseProps: IButtonProps = { className: buttonClassNames,