ui/components/admin/form-fields

ui/components/admin/form-fields

Methods

(static) exports.convertICE(obj)

Source:

Convert ICE values from three fields to a single 'ice' field with an object value.

Parameters:
Name Type Description
obj

The data object holding ICE values as three separate fields.

(static) exports.getSchemaDataFromEvent(schema, event) → {Object}

Source:

Return the data from the submitted form corresponding to the fields in the passed schema.

Parameters:
Name Type Description
schema

The simple schema.

event

The event holding the form data.

Returns:

An object whose keys are the schema keys and whose values are the corresponding form values.

Type
Object

(static) exports.indicateError(instance)

Source:

If a form submission was not validated, update template state to indicate error.

Parameters:
Name Type Description
instance

The template instance.

(static) exports.indicateSuccess(instance, event)

Source:

After a form submission has completed successfully, update template state to indicate success.

Parameters:
Name Type Description
instance

The template instance.

event

The event holding the form data.

(static) exports.renameKey(obj, oldKey, newKey)

Source:

Rename oldKey in obj to newKey.

Parameters:
Name Type Description
obj

The object containing oldKey

oldKey

The oldKey (a string).

newKey

The newKey (a string).

(static) exports.setupFormWidget(instance, schema)

Source:

Add successClass, errorClass, and context to the template.

Parameters:
Name Type Description
instance

The template instance.

schema

The schema associated with the form in this instance.

(static) exports.slugFieldValidator()

Source:

Custom validator for the slug field.

Throws:

Error if there are no Slugs in the SlugCollection.

Returns:

True if the slug value is not previously defined, otherwise errorType 'duplicateSlug'.

(static) isSchemaFieldArray(schema, field) → {boolean}

Source:

Given a Simple Schema and a field, return true if that field is of type Array.

Parameters:
Name Type Description
schema

The simple schema definition.

field

The field of interest.

Returns:

True if the field is of type array.

Type
boolean