mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1152] Add People and Group component in the AAE Forms (#5314)
* firt version groupo component widget * fix group * fix compilation issue * fix compilation issue * fix compilation issue * fix compilation issue * fix problem update script * multiple browser ps cloud * add field assignment * add field in form model * no need subobject we need an issue to refactor the field model * no need subobject we need an issue to refactor the field model * fix unit test * remove title modify * revert * fix lint * exclude AAE-1179 * exclude tooltip e2e
This commit is contained in:
@@ -79,6 +79,11 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
emptyOption: FormFieldOption;
|
||||
validationSummary: ErrorMessageModel;
|
||||
|
||||
// People and Group Options
|
||||
appName: string;
|
||||
roles: string[];
|
||||
mode: string;
|
||||
|
||||
get value(): any {
|
||||
return this._value;
|
||||
}
|
||||
@@ -168,6 +173,11 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
this._value = this.parseValue(json);
|
||||
this.validationSummary = new ErrorMessageModel();
|
||||
|
||||
// People and Group Options
|
||||
this.appName = json.appName;
|
||||
this.roles = json.roles;
|
||||
this.mode = json.mode;
|
||||
|
||||
if (json.placeholder && json.placeholder !== '' && json.placeholder !== 'null') {
|
||||
this.placeholder = json.placeholder;
|
||||
}
|
||||
@@ -344,9 +354,9 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
This is needed due to Activiti issue related to reading radio button values as value string
|
||||
but saving back as object: { id: <id>, name: <name> }
|
||||
*/
|
||||
const rbEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value);
|
||||
if (rbEntry.length > 0) {
|
||||
this.form.values[this.id] = rbEntry[0];
|
||||
const radioButton: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value);
|
||||
if (radioButton.length > 0) {
|
||||
this.form.values[this.id] = radioButton[0];
|
||||
}
|
||||
break;
|
||||
case FormFieldTypes.UPLOAD:
|
||||
@@ -358,9 +368,9 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
}
|
||||
break;
|
||||
case FormFieldTypes.TYPEAHEAD:
|
||||
const taEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value || opt.name === this.value);
|
||||
if (taEntry.length > 0) {
|
||||
this.form.values[this.id] = taEntry[0];
|
||||
const typeAheadEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value || opt.name === this.value);
|
||||
if (typeAheadEntry.length > 0) {
|
||||
this.form.values[this.id] = typeAheadEntry[0];
|
||||
} else if (this.options.length > 0) {
|
||||
this.form.values[this.id] = null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user