Repos that we’ll change
...
We’ll have two new fields: “Free addon item” and “Menu items to offer the free item” on the add-on-section-option.ts
:
“Free addon Item”
Label: (to be defined)
Description: (to be defined)
Rules:
Type
reference
to typeitem
(as the “Option” that we already have on the screen)Should be hidden if:
!ctx.isIntl
AND!ctxTest.document.enableAddonAsFreeItem
Required/invalid if:
context?.document?.enableAddonAsFreeItem && !value
(validation prop with custom rule)
...
“Menu items to offer the free item”
Label: (to be defined)
Description: (to be defined)
Rules:
Type
array
to typeaddOnSectionMenuOptions
(suggestion of name… we’ll create the new object that will be used here)Should be hidden if:
!ctx.isIntl
AND!ctxTest.document.enableAddonAsFreeItem
Required/invalid if:
context?.document?.enableAddonAsFreeItem && !value
(validation prop with custom rule)
...
For this object we’ll have:
“Free quantity”
Label: (to be defined)
Description: (to be defined)
Rules:
validation: (Rule: any) => Rule.min(1)
Required (can’t be empty)
initialValue: 1
Type: number
“Menu item”
Label: (to be defined)
Description: (to be defined)
Rules:
Type
reference
to typeitem
(as the “Option” that we already have on the screen)validation: (Rule: any) => Rule.required()
...
Motivation: configure the add-ons free modal. The fieldset will help the organization, by grouping the fields
Label: (to be defined)
Description: (to be defined)
Rules:
The fieldset should not be collapsed when appears (DOC)
All fields should be children of the fieldset
The fieldset should only be visible if the toggle for add-on free items is ON
...
Modal toggle (to show/hide on the Whitelabel App):
Label: (to be defined)
Description: (to be defined)
Modal title field
Label: (to be defined)
Description: (to be defined)
Modal description field
Label: (to be defined)
Description: (to be defined)
Modal primary button field
Label: (to be defined)
Description: (to be defined)
Rules:
If the toggle is ON
The title and primary button should be filled in and are required. This is needed to prevent the user from publishing the document and to not show an empty modal on the Whitelabel App
Description and image fields are optional
...