[ADF-3812] Add multi selection and roles filtering to adf-cloud-people component (#4068)

* [ADF-3812] Added multiple user selection and user pre-selection

* [ADF-3812] Added tests

* [ADF-3812] Added jsdoc

* [ADF-3812] Improved variable naming

* [ADF-3812] Improved mode selection

* [ADF-3812] Changed input name and emit logic

* [ADF-3812] Used modified emitter name in start task

* [ADF-3812] Improved default role selection

* Use the new strategy to fetch the authorized users

* * Fixed pre-selection in single mode

* * Added invalid selection validation

* * Added start task assignee validation

* * Improved preset loading

* * Improved tests

* * Added test to validate default assignee

* * Added methods to check user has access to an app

* * Added app access to people cloud and start task

* * Refactored methods and removed unused input - showCurrentUser

* * Added tests

* * Changed service names and removed unwated services

* * Used formControl error instead of manual error flag

* * Used new hasError method of people component inside start task

* * Improved tests

* * Updated callCustomApi call signature

* * Added documentation

* * Disabled search until clientId is retrieved

* * Changed realm name

* * Added jsdoc for service methods

* Remove the useless doc
This commit is contained in:
Deepak Paul
2019-01-14 19:20:19 +05:30
committed by Eugenio Romano
parent 46150a65f2
commit f08ad08d0f
10 changed files with 630 additions and 151 deletions

View File

@@ -0,0 +1,45 @@
---
Title: People Cloud Component
Added: v3.0.0
Status: Active
Last reviewed: 2019-09-01
---
# [People Cloud Component](../../lib/process-services-cloud/src/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.ts")
An autosuggest input control that allows single or multiple users to be selected based on the input parameters.
## Contents
- [Basic Usage](#basic-usage)
- [Class members](#class-members)
- [Properties](#properties)
- [Events](#events)
## Basic Usage
```html
<adf-cloud-people
[appName]="'simple-app'"
[mode]="'multiple'">
</adf-cloud-people>
```
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | | Name of the application. If specified, shows the users who have access to the app. |
| mode | `string` | 'single' | Mode of the user selection (single/multiple). |
| roles | `string[]` | | Role names of the users to be listed. |
| preSelectUsers | `IdentityUserModel[]` | | Array of users to be pre-selected. Pre-select all users in `multiple` mode and only the first user of the array in `single` mode. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| selectUser | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`IdentityUserModel`](../../lib/core/userinfo/models/identity-user.model.ts)`>` | Emitted when a user is selected. |
| removeUser | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`IdentityUserModel`](../../lib/core/userinfo/models/identity-user.model.ts)`>` | Emitted when a selected user is removed in `multiple` mode. |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Any>` | Emitted when an error occurs. |