Skip to content

Instantly share code, notes, and snippets.

@qmateub
Last active January 14, 2019 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qmateub/ee39d9c5cb396c5da312468a30cb0789 to your computer and use it in GitHub Desktop.
Save qmateub/ee39d9c5cb396c5da312468a30cb0789 to your computer and use it in GitHub Desktop.
Form conversions
{
[group]: { // group is products, categories, customers (each collapsible panel in the designs contains a group data)
auxiliaryValues: { // this values are just for the form behaviours that's why is called auxiliar
enabled: Boolean, // Computed if in the permissions object you have `manage${group}` or `view${group}`
viewOnly: Boolean, // you check for `manage${group}` false and `view${group}` true
viewAndEdit: Boolean, // you check only form `manage${group}` true
},
actionRights: {
// publishProducts, unpublishProducts,etc. All the stuff computed from `allSupportedActionRights` and the data from the CORE API.
}
}
}
// The idea is to end with N groups in the form values so each panel knows what data contains
// and to which group belongs so then is easily to map to the doc again for submitting values. Thougts?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment