Skip to content

Commit

Permalink
chore: add basic addChild to backoffice template
Browse files Browse the repository at this point in the history
  • Loading branch information
ingmar-stipriaan committed Dec 23, 2024
1 parent 147decf commit 8640bd2
Showing 1 changed file with 60 additions and 1 deletion.
61 changes: 60 additions & 1 deletion src/prefabs/backOffice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ import {
textOptions,
} from './structures';
import { options as formOptions } from './structures/ActionJSForm/options';
import { children as formChildren } from './structures/ActionJSForm/children';
import {
children as formChildren,
inputTypes,
} from './structures/ActionJSForm/children';
import { Properties, IdPropertyProps, ModelProps, ModelQuery } from './types';
import { PermissionType, PropertyStateProps } from './types/types';

Expand Down Expand Up @@ -1299,6 +1302,16 @@ const drawerContainer = DrawerContainer(
},
},
),
addChild: addChild('Add input', {
value: {
children: inputTypes,
addChildWizardType:
'ChildSelector',
},
ref: {
id: '#createFormAddChild',
},
}),
},
ref: { id: '#createForm' },
},
Expand Down Expand Up @@ -2730,6 +2743,16 @@ const drawerContainer = DrawerContainer(
},
},
),
addChild: addChild('AddChild', {
value: {
children: inputTypes,
addChildWizardType:
'ChildSelector',
},
ref: {
id: '#updateFormAddChild',
},
}),
},
ref: { id: '#updateForm' },
},
Expand Down Expand Up @@ -5114,7 +5137,9 @@ const prefabStructure = [
'reconfigureSubView',
'addSubViewChild',
'reconfigureCreateForm',
'addChildCreateForm',
'reconfigureUpdateForm',
'addChildUpdateForm',
],
condition: {
type: 'SHOW',
Expand Down Expand Up @@ -5283,6 +5308,23 @@ const prefabStructure = [
},
},
}),
addChildCreateForm: linked({
label: 'Add input create form',
value: {
ref: {
componentId: '#createForm',
optionId: '#createFormAddChild',
},
},
configuration: {
condition: {
type: 'SHOW',
option: 'shownTab',
comparator: 'EQ',
value: 1,
},
},
}),
createFormAction: linked({
label: 'Create action',
value: {
Expand Down Expand Up @@ -5419,6 +5461,23 @@ const prefabStructure = [
},
},
}),
addChildUpdateForm: linked({
label: 'Add input update form',
value: {
ref: {
componentId: '#updateForm',
optionId: '#updateFormAddChild',
},
},
configuration: {
condition: {
type: 'SHOW',
option: 'shownTab',
comparator: 'EQ',
value: 3,
},
},
}),
updateFormAction: linked({
label: 'Update action',
value: {
Expand Down

0 comments on commit 8640bd2

Please sign in to comment.