mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4048] PeopleCloudComponent - improve preselect input functionality (#4286)
* fix conflicts * [ADF-4048] - fix add same user on multiple selection * [ADF-4048] PeopleCloudComponent change validation users functionality * [ADF-4048] PeopleCloudComponent - focus input when preselected user exists * [ADF-4048] PeopleCloudComponent - pull request changes * [ADF-4048] - lint * [ADF-4048] PeopleCloud - PR changes * [ADF-4048] - fix conflicts * [ADF-4048] fx lint
This commit is contained in:
committed by
Maurizio Vitale
parent
5d3f47eacf
commit
f7a399c3e8
@@ -296,7 +296,8 @@
|
||||
"ROLE": "Roles: ",
|
||||
"APP_NAME": "Aplication Name",
|
||||
"APP_FILTER_MODE": "Filter by application name",
|
||||
"ROLE_FILTER_MODE": "Filter by role"
|
||||
"ROLE_FILTER_MODE": "Filter by role",
|
||||
"PRESELECT_VALIDATION": "Preselect validation"
|
||||
},
|
||||
"ABOUT": {
|
||||
"TITLE": "Plugins",
|
||||
|
@@ -30,9 +30,17 @@
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.PRESELECTED_VALUE' | translate }}: {{ DEFAULT_PEOPLE_PLACEHOLDER }}</mat-label>
|
||||
<input matInput (input)="setPeoplePreselectValue($event)" data-automation-id="adf-people-preselect-input" />
|
||||
</mat-form-field>
|
||||
<mat-checkbox class="adf-preselect-value" (change)="onChangePeopleValidation($event)">{{
|
||||
'PEOPLE_GROUPS_CLOUD.PRESELECT_VALIDATION' | translate }}</mat-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<adf-cloud-people [preSelectUsers]="preSelectUsers" [appName]="peopleAppName" [roles]="peopleRoles" [mode]="peopleMode"></adf-cloud-people>
|
||||
<adf-cloud-people
|
||||
[preSelectUsers]="preSelectUsers"
|
||||
[validate]="peoplePreselectValidation"
|
||||
[appName]="peopleAppName"
|
||||
[roles]="peopleRoles"
|
||||
[appName]="peopleAppName"
|
||||
[mode]="peopleMode"></adf-cloud-people>
|
||||
</div>
|
||||
|
||||
<div class="adf-people-list" *ngIf="canShowPeopleList()">
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { PeopleCloudComponent, GroupCloudComponent, GroupModel } from '@alfresco/adf-process-services-cloud';
|
||||
import { MatRadioChange } from '@angular/material';
|
||||
import { MatRadioChange, MatCheckboxChange } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-people-groups-cloud',
|
||||
@@ -29,13 +29,14 @@ export class PeopleGroupCloudDemoComponent {
|
||||
|
||||
DEFAULT_FILTER_MODE: string = 'appName';
|
||||
DEFAULT_GROUP_PLACEHOLDER: string = `[{"id": "1", "name":"activitiUserGroup"}]`;
|
||||
DEFAULT_PEOPLE_PLACEHOLDER: string = `[{"email": "example@alfresco.com", "firstName":"Administrator", "lastName": "ADF"}]`;
|
||||
DEFAULT_PEOPLE_PLACEHOLDER: string = `[{"id": "1", email": "user@user.com", "firstName":"user", "lastName": "lastName", "username": "user"}]`;
|
||||
|
||||
peopleMode: string = PeopleCloudComponent.MODE_SINGLE;
|
||||
preSelectUsers: string[] = [];
|
||||
peopleRoles: string[] = [];
|
||||
peopleAppName: string;
|
||||
peopleFilterMode: string = this.DEFAULT_FILTER_MODE;
|
||||
peoplePreselectValidation: Boolean = false;
|
||||
|
||||
groupMode: string = GroupCloudComponent.MODE_SINGLE;
|
||||
preSelectGroup: GroupModel[] = [];
|
||||
@@ -112,6 +113,11 @@ export class PeopleGroupCloudDemoComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onChangePeopleValidation(event: MatCheckboxChange) {
|
||||
this.peoplePreselectValidation = event.checked;
|
||||
this.preSelectUsers = [...this.preSelectUsers];
|
||||
}
|
||||
|
||||
isStringArray(str: string) {
|
||||
try {
|
||||
const result = JSON.parse(str);
|
||||
|
Reference in New Issue
Block a user