mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Add doc
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
736c830ae9
commit
5c677e70f1
@ -23,7 +23,6 @@ const Collapse = ({ availableActions, isActive, isGrey, label, onClickToggle, pa
|
||||
const mainData = get(modifiedData, pathToData.split('..'), {});
|
||||
// The utils we are using: getCheckboxState, retrieves if all the boolean values of an object in order
|
||||
// to return the state of checkbox. Since the conditions are not related to the property we need to remove the key from the object.
|
||||
// TODO: scope the fields, locales in a properties key to simplify the code
|
||||
const dataWithoutCondition = useMemo(() => {
|
||||
return Object.keys(mainData).reduce((acc, current) => {
|
||||
acc[current] = removeConditionKeyFromData(mainData[current]);
|
||||
|
||||
@ -82,10 +82,10 @@ const reducer = (state, action) =>
|
||||
* 2. Toggle all the end boolean values to the desired one
|
||||
* 3. Update the draftState
|
||||
*
|
||||
* Since the case works well in order to update what we called "dependent" checkbox. We can
|
||||
* Since the case works well in order to update what we called "parent" checkbox. We can
|
||||
* reuse the action when we need to toggle change all the values that depends on this one.
|
||||
* A dependent checkbox is a checkbox which value is not a boolean but depends on its children ones, therefore,
|
||||
* a dependent checkbox does not have a represented value in the draftState, they are just helpers.
|
||||
* A parent checkbox is a checkbox which value is not a boolean but depends on its children ones, therefore,
|
||||
* a parent checkbox does not have a represented value in the draftState, they are just helpers.
|
||||
*
|
||||
* Given the following data:
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user