mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-9019] - People/Group cloud with HxP (#7658)
* Cover the use cases by mocking them * Replace the mock with real stream and remove useless code * Provide new service to fetch groups * Fix group tests * Use the interface and token injection * [AAE-8870] add unit test and mock for new service * Improve roles condifion * initialize the stream as part of NgOnInit to be sure it relies on the correct FormControl instance(input) * Rollback tmp change for roles * [AAE-8641] people abstraction mock * [AAE-8641] revert angular.json changes * [AAE-8641] few conditions and code improvements * [AAE-8641] revert change input controls name * [AAE-8641] initialize the stream as part of ngOnInit * [AAE-8641] people abstraction improvements * [AAE-8870] cherry pick people abstraction * [AAE-8641] fix people-group e2es * fix lint * remove hardcoded identityHost * Use the identityhost api in case of cloud * Solve issue with returnType array string * Rebase and use GroupModel from cloud * Rebase and use GroupModel from cloud * Use the bpmHost instead of identityFor * Add identity ingress for user access service * Rename test * Fix linting issues * Fix playwright storybook e2e for people and group * Trigger travis * Fix people group e2e * improved formatting * Remove not needed travis var override * Remove unused import after rebase * Make roles in filter optional + remove comments Co-authored-by: Tomasz <tomasz.gnyp@hyland.com> Co-authored-by: arditdomi <ardit.domi@hyland.com>
This commit is contained in:
@@ -12,20 +12,22 @@
|
||||
'PEOPLE_GROUPS_CLOUD.MULTI' | translate }}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<div class="app-people-control-options">
|
||||
<mat-radio-group (change)="onChangePeopleFilterMode($event)">
|
||||
<mat-radio-button [checked]="true" class="app-people-single-mode" value="appName">{{
|
||||
'PEOPLE_GROUPS_CLOUD.APP_FILTER_MODE' | translate }}</mat-radio-button>
|
||||
<mat-radio-button class="app-people-multiple-mode" data-automation-id="app-people-filter-role" value="role">{{
|
||||
'PEOPLE_GROUPS_CLOUD.ROLE_FILTER_MODE' | translate }}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<mat-form-field *ngIf="!isPeopleAppNameSelected()" class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.ROLE' | translate }} ["ACTIVITI_ADMIN", "ACTIVITI_USER"]</mat-label>
|
||||
<input matInput (input)="setPeopleRoles($any($event).target?.value)" data-automation-id="app-people-roles-input" />
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="isPeopleAppNameSelected()" class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.APP_NAME' | translate }}</mat-label>
|
||||
<input matInput (input)="setPeopleAppName($any($event).target?.value)" data-automation-id="app-people-app-input" />
|
||||
</mat-form-field>
|
||||
<mat-form-field class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.ROLE' | translate }} ["ACTIVITI_ADMIN", "ACTIVITI_USER"]</mat-label>
|
||||
<input matInput
|
||||
(input)="setPeopleRoles($any($event).target?.value)"
|
||||
data-automation-id="app-people-roles-input"/>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.GROUPS_RESTRICTION' | translate }} ["hr", "sales"]</mat-label>
|
||||
<input matInput
|
||||
(input)="setPeopleGroupsRestriction($any($event).target?.value)"
|
||||
data-automation-id="app-people-groups-restriction-input"/>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="app-preselect-value-full">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.PRESELECTED_VALUE' | translate }} {{ defaultPeoplePlaceholder }}</mat-label>
|
||||
<input matInput (input)="setPeoplePreselectValue($any($event).target?.value)" data-automation-id="app-people-preselect-input" />
|
||||
@@ -42,6 +44,7 @@
|
||||
[validate]="peoplePreselectValidation"
|
||||
[appName]="peopleAppName"
|
||||
[roles]="peopleRoles"
|
||||
[groupsRestriction]="groupsRestriction"
|
||||
[title]="'ADF_TASK_LIST.START_TASK.FORM.LABEL.ASSIGNEE'"
|
||||
[mode]="peopleMode"
|
||||
(warning)="onUsersWarning($event)"></adf-cloud-people>
|
||||
@@ -83,24 +86,18 @@
|
||||
'PEOPLE_GROUPS_CLOUD.MULTI' | translate }}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<div class="app-groups-control-options">
|
||||
<mat-radio-group (change)="onChangeGroupsFilterMode($event)">
|
||||
<mat-radio-button [checked]="true" class="app-people-single-mode" value="appName">{{
|
||||
'PEOPLE_GROUPS_CLOUD.APP_FILTER_MODE' | translate }}</mat-radio-button>
|
||||
<mat-radio-button class="app-people-multiple-mode" data-automation-id="app-group-filter-role" value="role">{{
|
||||
'PEOPLE_GROUPS_CLOUD.ROLE_FILTER_MODE' | translate }}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<mat-form-field *ngIf="!isGroupAppNameSelected()" class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.ROLE' | translate }} ["ACTIVITI_ADMIN", "ACTIVITI_USER"]</mat-label>
|
||||
<input matInput
|
||||
(input)="setGroupRoles($any($event).target?.value)"
|
||||
data-automation-id="app-group-roles-input"/>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="isGroupAppNameSelected()" class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.APP_NAME' | translate }}</mat-label>
|
||||
<input matInput
|
||||
(input)="setGroupAppName($any($event).target?.value)"
|
||||
data-automation-id="app-group-app-input"/>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="app-preselect-value">
|
||||
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.ROLE' | translate }} ["ACTIVITI_ADMIN", "ACTIVITI_USER"]</mat-label>
|
||||
<input matInput
|
||||
(input)="setGroupRoles($any($event).target?.value)"
|
||||
data-automation-id="app-group-roles-input"/>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="app-preselect-value-full">
|
||||
<mat-label>Preselect: {{ defaultGroupPlaceholder }}</mat-label>
|
||||
<input matInput
|
||||
|
@@ -16,10 +16,9 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { ComponentSelectionMode } from '@alfresco/adf-process-services-cloud';
|
||||
import { ComponentSelectionMode, IdentityUserModel, IdentityGroupModel } from '@alfresco/adf-process-services-cloud';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatRadioChange } from '@angular/material/radio';
|
||||
import { IdentityGroupModel, IdentityUserModel } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-people-groups-cloud',
|
||||
@@ -37,6 +36,7 @@ export class PeopleGroupCloudDemoComponent {
|
||||
preSelectUsers: IdentityUserModel[] = [];
|
||||
invalidUsers: IdentityUserModel[] = [];
|
||||
peopleRoles: string[] = [];
|
||||
groupsRestriction: string[] = [];
|
||||
peopleAppName: string;
|
||||
peopleFilterMode: string = this.defaultFilterMode;
|
||||
peoplePreselectValidation = false;
|
||||
@@ -75,6 +75,10 @@ export class PeopleGroupCloudDemoComponent {
|
||||
this.groupAppName = value;
|
||||
}
|
||||
|
||||
setPeopleGroupsRestriction(value: string): void {
|
||||
this.groupsRestriction = this.getArrayFromString(value);
|
||||
}
|
||||
|
||||
onChangePeopleMode(event: MatRadioChange): void {
|
||||
this.peopleMode = event.value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user