Organization Unit Set Create Form
This component is a ready-made form for creating a Custom or AdHoc Organization Unit Set (with validation). It can be used in any container component: Box, Card, Dialog, etc.
#
UsageAll you need to define for this component are the onCreated
(fires when a set is created) and the onCancel
(fires when the user clicks the "Cancel" button) callbacks
import { Box, Card } from '@springtree/eva-suite-ui';import { CreateOUSetForm } from '@springtree/eva-suite-composite';
const Example = () => ( <Card> <Box> <CreateOUSetForm onCancel={() => console.log('The user canceled the operation')} onCreated={(newOUSetID) => console.log(`Organization set created with ID: ${newOUSetID}`)} /> </Box> </Card>);
#
TranslationsPlace these lines in your translations file(s) (remove duplicates)
{ "generic.action.cancel": "Cancel", "generic.action.create": "Create", "create-ouset-form.name.label": "Name", "create-ouset-form.name.required": "Name is required", "create-ouset-form.title": "Create organization unit set", "create-ouset-form.ouset-type.required": "Type is required", "create-ouset-form.subsets.created": "Organization unit subsets added", "create-ouset-form.ousets-link-tooltip": "Go to organization unit sets", "create-ouset-form.included-sets.label": "Include organization unit set", "create-ouset-form.excluded-sets.label": "Exclude organization unit set", "create-ouset-form.ouset-type.custom.label": "Reuse custom organization unit set (save)", "create-ouset-form.subsets.included-error": "Failed to include organization unit: {organizationUnit}", "create-ouset-form.subsets.excluded-error": "Failed to exclude organization unit: {organizationUnit}", "create-ouset-form.ouset-type.ad-hoc.label": "Only use custom organization unit set for this selection",}