Skip to content

Commit 3a10615

Browse files
authored
Merge pull request #575 from rvsia/removeTabItem
fix(renderer): tab children do not need component anymore
2 parents c0bf3b2 + 0c7da0c commit 3a10615

File tree

5 files changed

+7
-15
lines changed

5 files changed

+7
-15
lines changed

packages/pf4-component-mapper/demo/demo-schemas/sandbox.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ const output = {
133133
],
134134
component: components.SUB_FORM
135135
}
136-
],
137-
component: components.TAB_ITEM
136+
]
138137
},
139138
{
140139
title: 'Tab 2',
@@ -240,8 +239,7 @@ const output = {
240239
],
241240
component: components.SUB_FORM
242241
}
243-
],
244-
component: components.TAB_ITEM
242+
]
245243
},
246244
{
247245
title: 'Tab 3',
@@ -418,8 +416,7 @@ const output = {
418416
],
419417
component: components.SUB_FORM
420418
}
421-
],
422-
component: components.TAB_ITEM
419+
]
423420
},
424421
{
425422
title: 'Tab 4',
@@ -464,8 +461,7 @@ const output = {
464461
],
465462
component: components.SUB_FORM
466463
}
467-
],
468-
component: components.TAB_ITEM
464+
]
469465
},
470466
{
471467
title: 'Mixed',
@@ -555,8 +551,7 @@ const output = {
555551
],
556552
component: components.SUB_FORM
557553
}
558-
],
559-
component: components.TAB_ITEM
554+
]
560555
}
561556
],
562557
component: components.TABS,

packages/react-form-renderer/src/files/default-schema-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ const iterateOverFields = (fields, componentMapper, validatorTypes, actionTypes,
245245
return iterateOverFields(field, componentMapper, validatorTypes, actionTypes, schemaValidatorMapper);
246246
}
247247

248-
if (parent.component !== componentTypes.WIZARD) {
248+
if (![componentTypes.WIZARD, componentTypes.TABS].includes(parent.component)) {
249249
if (parent.component !== componentTypes.WIZARD && !field.hasOwnProperty('component')) {
250250
throw new DefaultSchemaError(`Each fields item must have "component" property!`);
251251
}

packages/react-renderer-demo/src/components/navigation/examples-definitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const baseExamples = [
4848
{
4949
component: componentTypes.TABS,
5050
link: componentTypes.TABS,
51-
linkText: 'Tabs / Tab item'
51+
linkText: 'Tabs'
5252
},
5353
{
5454
component: componentTypes.SUB_FORM,

packages/react-renderer-demo/src/pages/component-example/tabs.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const schema = {
1212
name: 'tabs',
1313
fields: [
1414
{
15-
component: componentTypes.TAB_ITEM,
1615
validateFields: ['apple'],
1716
name: '1',
1817
title: 'Fruits',
@@ -32,7 +31,6 @@ const schema = {
3231
]
3332
},
3433
{
35-
component: componentTypes.TAB_ITEM,
3634
name: '2',
3735
title: 'Vegetables',
3836
description: 'Here you can find vegetables',

packages/react-renderer-demo/src/pages/renderer/component-mapping.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const componentTypes = {
2323
[componentTypes.SUB_FORM]: 'sub-form',
2424
[componentTypes.RADIO]: 'radio',
2525
[componentTypes.TABS]: 'tabs',
26-
[componentTypes.TAB_ITEM]: 'tab-item',
2726
[componentTypes.DATE_PICKER]: 'date-picker',
2827
[componentTypes.TIME_PICKER]: 'time-picker',
2928
[componentTypes.WIZARD]: 'wizard',

0 commit comments

Comments
 (0)