mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-24456] aps with adw multi user and group fields do not accept multiple values (#10636)
* [MNT-24456] Allow to select multiple users and groups for task form * [MNT-24456] Inputs styling * [MNT-24456] Unit tests, fixed issue for selecting single group * [MNT-24456] Fixed issue when completing forms with null instead of empty array * [MNT-24456] Used UnitTestingUtils where possible
This commit is contained in:
@@ -221,6 +221,40 @@ describe('FormFieldModel', () => {
|
||||
expect(field.hasEmptyValue).toBe(false);
|
||||
});
|
||||
|
||||
it('should detect multiple values when multiple property of params is true', () => {
|
||||
const field = new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.DROPDOWN,
|
||||
options: [
|
||||
{ id: 'fake-option-1', name: 'fake label 1' },
|
||||
{ id: 'fake-option-2', name: 'fake label 2' },
|
||||
{ id: 'fake-option-3', name: 'fake label 3' }
|
||||
],
|
||||
value: [],
|
||||
params: {
|
||||
multiple: true
|
||||
}
|
||||
});
|
||||
|
||||
expect(field.hasMultipleValues).toBeTrue();
|
||||
});
|
||||
|
||||
it('should not detect multiple values when multiple property of params is false', () => {
|
||||
const field = new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.DROPDOWN,
|
||||
options: [
|
||||
{ id: 'fake-option-1', name: 'fake label 1' },
|
||||
{ id: 'fake-option-2', name: 'fake label 2' },
|
||||
{ id: 'fake-option-3', name: 'fake label 3' }
|
||||
],
|
||||
value: [],
|
||||
params: {
|
||||
multiple: false
|
||||
}
|
||||
});
|
||||
|
||||
expect(field.hasMultipleValues).toBeFalse();
|
||||
});
|
||||
|
||||
describe('should leave not resolved value (in case of delayed options)', () => {
|
||||
it('when string', () => {
|
||||
const field = new FormFieldModel(new FormModel(), {
|
||||
|
@@ -141,7 +141,7 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
}
|
||||
|
||||
get hasMultipleValues() {
|
||||
return this.selectionType === 'multiple';
|
||||
return this.selectionType === 'multiple' || this.params.multiple;
|
||||
}
|
||||
|
||||
markAsInvalid() {
|
||||
|
@@ -90,6 +90,7 @@
|
||||
--adf-secondary-button-background: $adf-secondary-button-background,
|
||||
--adf-secondary-modal-text-color: $adf-secondary-modal-text-color,
|
||||
--adf-disabled-button-background: $adf-disabled-button-background,
|
||||
--adf-chip-border-color: $adf-chip-border-color,
|
||||
|
||||
--adf-display-external-property-widget-preview-selection-color: mat.get-color-from-palette($foreground, secondary-text)
|
||||
);
|
||||
|
@@ -29,3 +29,4 @@ $adf-error-color: #ba1b1b;
|
||||
$adf-secondary-button-background: #2121210d;
|
||||
$adf-secondary-modal-text-color: #212121;
|
||||
$adf-disabled-button-background: rgba(0, 0, 0, 0.12);
|
||||
$adf-chip-border-color: #757575;
|
||||
|
Reference in New Issue
Block a user