Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmotta committed Jan 10, 2025
1 parent b71be9b commit c01f8e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Form__HRInterview: React.FC<any> = (props: any) => {
const [interview__hire, set__interview__hire] = useState<boolean>(false);
const [interview__hiringDate, set__interview__hiringDate] =
useState<string>();
const [friends, set__friends] = useState<any[]>([]);
const [friends, set__friends] = useState<string[]>([]);
/* Utility function that fills the form with the data received from the kogito runtime */
const setFormData = (data) => {
if (!data) {
Expand Down Expand Up @@ -574,7 +574,7 @@ const Form__HRInterview: React.FC<any> = (props: any) => {
</FormGroup>
</CardBody>
</Card>
<div fieldId={'uniforms-0000-000x'}>
<div>
<Split hasGutter>
<SplitItem>
{'Friends' && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

exports[`<ListField> tests <ListField> 1`] = `
<div>
{"ref":{"binding":"friends","stateName":"friends","stateSetter":"set__friends","dataType":{"name":"string[]","defaultValue":"[]"}},"pfImports":["Split","SplitItem","Button","Card","CardBody","TextInput","FormGroup","SelectOption","SelectOptionObject","Select","SelectVariant","Checkbox","DatePicker","Flex","FlexItem","InputGroup","TimePicker"],"pfIconImports":["PlusCircleIcon","MinusCircleIcon"],"reactImports":["useState"],"jsxCode":"&lt;div fieldId={'id'}&gt;\\n &lt;Split hasGutter&gt;\\n &lt;SplitItem&gt;\\n {'Friends' && (\\n &lt;label className={\\"pf-c-form__label\\"}&gt;\\n &lt;span className={\\"pf-c-form__label-text\\"}&gt;\\n Friends\\n &lt;/span&gt;\\n &lt;/label&gt;\\n )}\\n &lt;/SplitItem&gt;\\n &lt;SplitItem isFilled /&gt;\\n &lt;SplitItem&gt;\\n &lt;Button\\n name='$'\\n variant='plain'\\n style={{ paddingLeft: '0', paddingRight: '0' }}\\n disabled={false}\\n onClick={() =&gt; {\\n !false && set__friends((friends ?? []).concat([undefined]));\\n }}\\n &gt;\\n &lt;PlusCircleIcon color='#0088ce' /&gt;\\n &lt;/Button&gt;\\n &lt;/SplitItem&gt;\\n &lt;/Split&gt;\\n &lt;div&gt;\\n {friends?.map((_, itemIndex) =&gt;\\n (&lt;div\\n key={itemIndex}\\n style={{\\n marginBottom: '1rem',\\n display: 'flex',\\n justifyContent: 'space-between',\\n }}\\n &gt;\\n &lt;div style={{ width: '100%', marginRight: '10px' }}&gt;&lt;Card&gt;\\n &lt;CardBody className=\\"pf-c-form\\"&gt;\\n \\n &lt;FormGroup\\n fieldId={'uniforms-0000-0003'}\\n label={'Name'}\\n isRequired={true}\\n &gt;\\n &lt;TextInput\\n name={\`friends.\${itemIndex}.name\`}\\n id={'uniforms-0000-0003'}\\n isDisabled={false}\\n placeholder={''}\\n type={'text'}\\n value={friends[itemIndex].name}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].name = newValue;\\n return newState;\\n })\\n }}\\n /&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-0005'}\\n label={'Age'}\\n isRequired={true}\\n &gt;\\n &lt;TextInput\\n type={'number'}\\n name={\`friends.\${itemIndex}.age\`}\\n isDisabled={false}\\n id={'uniforms-0000-0005'}\\n placeholder={''}\\n step={0.01} \\n value={friends[itemIndex].age}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].age = Number(newValue);\\n return newState;\\n })\\n }}\\n /&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-0007'}\\n label={'Country'}\\n isRequired={true}\\n &gt;&lt;Select\\n id={'uniforms-0000-0007'}\\n name={\`friends.\${itemIndex}.country\`}\\n variant={SelectVariant.single}\\n isDisabled={false}\\n placeholderText={''}\\n isOpen={friends__$__country__expanded}\\n selections={friends__$__country}\\n onToggle={(isOpen) =&gt; set__friends__$__country__expanded(isOpen)}\\n onSelect={\\n (event, value, isPlaceHolder) =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].country = handleSelect(value, isPlaceHolder, friends__$__country, set__friends__$__country, set__friends__$__country__expanded);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].country}\\n &gt;\\n &lt;SelectOption key={'US'} value={'US'}&gt;US&lt;/SelectOption&gt;\\n&lt;SelectOption key={'Brazil'} value={'Brazil'}&gt;Brazil&lt;/SelectOption&gt;\\n &lt;/Select&gt;&lt;/FormGroup&gt;\\n&lt;FormGroup fieldId='uniforms-0000-0009'&gt;\\n &lt;Checkbox\\n isChecked={friends[itemIndex].married}\\n isDisabled={false}\\n id={'uniforms-0000-0009'}\\n name={\`friends.\${itemIndex}.married\`}\\n label={'Married'}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].married = newValue;\\n return newState;\\n })\\n }}\\n /&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-000b'}\\n label={'Know'}\\n isRequired={true}\\n &gt;\\n &lt;Checkbox\\n key={'uniforms-0000-000b-Java'}\\n id={'uniforms-0000-000b-Java'}\\n name={\`friends.\${itemIndex}.know\`}\\n aria-label={'friends.$.know'}\\n label={'Java'} \\n isDisabled={false} \\n isChecked={friends__$__know.indexOf('Java') !== -1}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].know = handleCheckboxGroupChange('Java', friends__$__know, set__friends__$__know);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].know}\\n/&gt;\\n&lt;Checkbox\\n key={'uniforms-0000-000b-Node'}\\n id={'uniforms-0000-000b-Node'}\\n name={\`friends.\${itemIndex}.know\`}\\n aria-label={'friends.$.know'}\\n label={'Node'} \\n isDisabled={false} \\n isChecked={friends__$__know.indexOf('Node') !== -1}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].know = handleCheckboxGroupChange('Node', friends__$__know, set__friends__$__know);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].know}\\n/&gt;\\n&lt;Checkbox\\n key={'uniforms-0000-000b-Docker'}\\n id={'uniforms-0000-000b-Docker'}\\n name={\`friends.\${itemIndex}.know\`}\\n aria-label={'friends.$.know'}\\n label={'Docker'} \\n isDisabled={false} \\n isChecked={friends__$__know.indexOf('Docker') !== -1}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].know = handleCheckboxGroupChange('Docker', friends__$__know, set__friends__$__know);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].know}\\n/&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-000d'}\\n label={'Areas'}\\n isRequired={true}\\n &gt;&lt;Select\\n id={'uniforms-0000-000d'}\\n name={\`friends.\${itemIndex}.areas\`}\\n variant={SelectVariant.single}\\n isDisabled={false}\\n placeholderText={''}\\n isOpen={friends__$__areas__expanded}\\n selections={friends__$__areas}\\n onToggle={(isOpen) =&gt; set__friends__$__areas__expanded(isOpen)}\\n onSelect={\\n (event, value, isPlaceHolder) =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].areas = handleSelect(value, isPlaceHolder, friends__$__areas, set__friends__$__areas, set__friends__$__areas__expanded);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].areas}\\n &gt;\\n &lt;SelectOption key={'Developer'} value={'Developer'}&gt;Developer&lt;/SelectOption&gt;\\n&lt;SelectOption key={'HR'} value={'HR'}&gt;HR&lt;/SelectOption&gt;\\n&lt;SelectOption key={'UX'} value={'UX'}&gt;UX&lt;/SelectOption&gt;\\n &lt;/Select&gt;&lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-000f'}\\n label={'Birthday'}\\n isRequired={true}\\n &gt;\\n &lt;Flex\\n direction={{ default: 'column' }}\\n id={'uniforms-0000-000f'}\\n &gt;\\n &lt;FlexItem&gt;\\n &lt;InputGroup style={{ background: 'transparent' }}&gt;\\n &lt;DatePicker\\n id={'date-picker-uniforms-0000-000f'}\\n isDisabled={false}\\n name={\`friends.\${itemIndex}.birthday\`}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].birthday = onDateChange(newValue, set__friends__$__birthday, friends__$__birthday);\\n return newState;\\n })\\n }}\\n value={parseDate(friends[itemIndex].birthday)}\\n /&gt;\\n &lt;TimePicker\\n id={'time-picker-uniforms-0000-000f'}\\n isDisabled={false}\\n name={\`friends.\${itemIndex}.birthday\`}\\n onChange={\\n (time, hours?, minutes?) =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].birthday = onTimeChange(time, set__friends__$__birthday, friends__$__birthday, hours, minutes);\\n return newState;\\n })\\n }}\\n style={{ width: '120px' }}\\n time={parseTime(friends[itemIndex].birthday)}\\n /&gt;\\n &lt;/InputGroup&gt;\\n &lt;/FlexItem&gt;\\n &lt;/Flex&gt;\\n &lt;/FormGroup&gt;\\n &lt;/CardBody&gt;&lt;/Card&gt;&lt;/div&gt;\\n &lt;div&gt;\\n &lt;Button\\n disabled={false}\\n variant='plain'\\n style={{ paddingLeft: '0', paddingRight: '0' }}\\n onClick={() =&gt; {\\n const value = [...friends]\\n value.splice(itemIndex, 1);\\n !false && set__friends(value);\\n }}\\n &gt;\\n &lt;MinusCircleIcon color='#cc0000' /&gt;\\n &lt;/Button&gt;\\n &lt;/div&gt;\\n &lt;/div&gt;)\\n )}\\n &lt;/div&gt;\\n &lt;/div&gt;","stateCode":"const [ friends, set__friends ] = useState&lt;any[]&gt;([]);","isReadonly":false}
{"ref":{"binding":"friends","stateName":"friends","stateSetter":"set__friends","dataType":{"name":"string[]","defaultValue":"[]"}},"pfImports":["Split","SplitItem","Button","Card","CardBody","TextInput","FormGroup","SelectOption","SelectOptionObject","Select","SelectVariant","Checkbox","DatePicker","Flex","FlexItem","InputGroup","TimePicker"],"pfIconImports":["PlusCircleIcon","MinusCircleIcon"],"reactImports":["useState"],"jsxCode":"&lt;div&gt;\\n &lt;Split hasGutter&gt;\\n &lt;SplitItem&gt;\\n {'Friends' && (\\n &lt;label className={\\"pf-c-form__label\\"}&gt;\\n &lt;span className={\\"pf-c-form__label-text\\"}&gt;\\n Friends\\n &lt;/span&gt;\\n &lt;/label&gt;\\n )}\\n &lt;/SplitItem&gt;\\n &lt;SplitItem isFilled /&gt;\\n &lt;SplitItem&gt;\\n &lt;Button\\n name='$'\\n variant='plain'\\n style={{ paddingLeft: '0', paddingRight: '0' }}\\n disabled={false}\\n onClick={() =&gt; {\\n !false && set__friends((friends ?? []).concat([undefined]));\\n }}\\n &gt;\\n &lt;PlusCircleIcon color='#0088ce' /&gt;\\n &lt;/Button&gt;\\n &lt;/SplitItem&gt;\\n &lt;/Split&gt;\\n &lt;div&gt;\\n {friends?.map((_, itemIndex) =&gt;\\n (&lt;div\\n key={itemIndex}\\n style={{\\n marginBottom: '1rem',\\n display: 'flex',\\n justifyContent: 'space-between',\\n }}\\n &gt;\\n &lt;div style={{ width: '100%', marginRight: '10px' }}&gt;&lt;Card&gt;\\n &lt;CardBody className=\\"pf-c-form\\"&gt;\\n \\n &lt;FormGroup\\n fieldId={'uniforms-0000-0003'}\\n label={'Name'}\\n isRequired={true}\\n &gt;\\n &lt;TextInput\\n name={\`friends.\${itemIndex}.name\`}\\n id={'uniforms-0000-0003'}\\n isDisabled={false}\\n placeholder={''}\\n type={'text'}\\n value={friends[itemIndex].name}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].name = newValue;\\n return newState;\\n })\\n }}\\n /&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-0005'}\\n label={'Age'}\\n isRequired={true}\\n &gt;\\n &lt;TextInput\\n type={'number'}\\n name={\`friends.\${itemIndex}.age\`}\\n isDisabled={false}\\n id={'uniforms-0000-0005'}\\n placeholder={''}\\n step={0.01} \\n value={friends[itemIndex].age}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].age = Number(newValue);\\n return newState;\\n })\\n }}\\n /&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-0007'}\\n label={'Country'}\\n isRequired={true}\\n &gt;&lt;Select\\n id={'uniforms-0000-0007'}\\n name={\`friends.\${itemIndex}.country\`}\\n variant={SelectVariant.single}\\n isDisabled={false}\\n placeholderText={''}\\n isOpen={friends__$__country__expanded}\\n selections={friends__$__country}\\n onToggle={(isOpen) =&gt; set__friends__$__country__expanded(isOpen)}\\n onSelect={\\n (event, value, isPlaceHolder) =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].country = handleSelect(value, isPlaceHolder, friends__$__country, set__friends__$__country, set__friends__$__country__expanded);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].country}\\n &gt;\\n &lt;SelectOption key={'US'} value={'US'}&gt;US&lt;/SelectOption&gt;\\n&lt;SelectOption key={'Brazil'} value={'Brazil'}&gt;Brazil&lt;/SelectOption&gt;\\n &lt;/Select&gt;&lt;/FormGroup&gt;\\n&lt;FormGroup fieldId='uniforms-0000-0009'&gt;\\n &lt;Checkbox\\n isChecked={friends[itemIndex].married}\\n isDisabled={false}\\n id={'uniforms-0000-0009'}\\n name={\`friends.\${itemIndex}.married\`}\\n label={'Married'}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].married = newValue;\\n return newState;\\n })\\n }}\\n /&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-000b'}\\n label={'Know'}\\n isRequired={true}\\n &gt;\\n &lt;Checkbox\\n key={'uniforms-0000-000b-Java'}\\n id={'uniforms-0000-000b-Java'}\\n name={\`friends.\${itemIndex}.know\`}\\n aria-label={'friends.$.know'}\\n label={'Java'} \\n isDisabled={false} \\n isChecked={friends__$__know.indexOf('Java') !== -1}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].know = handleCheckboxGroupChange('Java', friends__$__know, set__friends__$__know);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].know}\\n/&gt;\\n&lt;Checkbox\\n key={'uniforms-0000-000b-Node'}\\n id={'uniforms-0000-000b-Node'}\\n name={\`friends.\${itemIndex}.know\`}\\n aria-label={'friends.$.know'}\\n label={'Node'} \\n isDisabled={false} \\n isChecked={friends__$__know.indexOf('Node') !== -1}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].know = handleCheckboxGroupChange('Node', friends__$__know, set__friends__$__know);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].know}\\n/&gt;\\n&lt;Checkbox\\n key={'uniforms-0000-000b-Docker'}\\n id={'uniforms-0000-000b-Docker'}\\n name={\`friends.\${itemIndex}.know\`}\\n aria-label={'friends.$.know'}\\n label={'Docker'} \\n isDisabled={false} \\n isChecked={friends__$__know.indexOf('Docker') !== -1}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].know = handleCheckboxGroupChange('Docker', friends__$__know, set__friends__$__know);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].know}\\n/&gt;\\n &lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-000d'}\\n label={'Areas'}\\n isRequired={true}\\n &gt;&lt;Select\\n id={'uniforms-0000-000d'}\\n name={\`friends.\${itemIndex}.areas\`}\\n variant={SelectVariant.single}\\n isDisabled={false}\\n placeholderText={''}\\n isOpen={friends__$__areas__expanded}\\n selections={friends__$__areas}\\n onToggle={(isOpen) =&gt; set__friends__$__areas__expanded(isOpen)}\\n onSelect={\\n (event, value, isPlaceHolder) =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].areas = handleSelect(value, isPlaceHolder, friends__$__areas, set__friends__$__areas, set__friends__$__areas__expanded);\\n return newState;\\n })\\n }}\\n value={friends[itemIndex].areas}\\n &gt;\\n &lt;SelectOption key={'Developer'} value={'Developer'}&gt;Developer&lt;/SelectOption&gt;\\n&lt;SelectOption key={'HR'} value={'HR'}&gt;HR&lt;/SelectOption&gt;\\n&lt;SelectOption key={'UX'} value={'UX'}&gt;UX&lt;/SelectOption&gt;\\n &lt;/Select&gt;&lt;/FormGroup&gt;\\n&lt;FormGroup\\n fieldId={'uniforms-0000-000f'}\\n label={'Birthday'}\\n isRequired={true}\\n &gt;\\n &lt;Flex\\n direction={{ default: 'column' }}\\n id={'uniforms-0000-000f'}\\n &gt;\\n &lt;FlexItem&gt;\\n &lt;InputGroup style={{ background: 'transparent' }}&gt;\\n &lt;DatePicker\\n id={'date-picker-uniforms-0000-000f'}\\n isDisabled={false}\\n name={\`friends.\${itemIndex}.birthday\`}\\n onChange={\\n newValue =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].birthday = onDateChange(newValue, set__friends__$__birthday, friends__$__birthday);\\n return newState;\\n })\\n }}\\n value={parseDate(friends[itemIndex].birthday)}\\n /&gt;\\n &lt;TimePicker\\n id={'time-picker-uniforms-0000-000f'}\\n isDisabled={false}\\n name={\`friends.\${itemIndex}.birthday\`}\\n onChange={\\n (time, hours?, minutes?) =&gt; {\\n set__friends(s =&gt; {\\n const newState = [...s];\\n newState[itemIndex].birthday = onTimeChange(time, set__friends__$__birthday, friends__$__birthday, hours, minutes);\\n return newState;\\n })\\n }}\\n style={{ width: '120px' }}\\n time={parseTime(friends[itemIndex].birthday)}\\n /&gt;\\n &lt;/InputGroup&gt;\\n &lt;/FlexItem&gt;\\n &lt;/Flex&gt;\\n &lt;/FormGroup&gt;\\n &lt;/CardBody&gt;&lt;/Card&gt;&lt;/div&gt;\\n &lt;div&gt;\\n &lt;Button\\n disabled={false}\\n variant='plain'\\n style={{ paddingLeft: '0', paddingRight: '0' }}\\n onClick={() =&gt; {\\n const value = [...friends]\\n value.splice(itemIndex, 1);\\n !false && set__friends(value);\\n }}\\n &gt;\\n &lt;MinusCircleIcon color='#cc0000' /&gt;\\n &lt;/Button&gt;\\n &lt;/div&gt;\\n &lt;/div&gt;)\\n )}\\n &lt;/div&gt;\\n &lt;/div&gt;","stateCode":"const [ friends, set__friends ] = useState&lt;string[]&gt;([]);","isReadonly":false}
</div>
`;
Loading

0 comments on commit c01f8e8

Please sign in to comment.