[ADF-3850] Create new group cloud component (#4104)

* [ADF-3850]  Create New Cloud Groups Component

* Generated groupCloud component by cli

* * Refactored GroupCloud component
* Added unit tests
* Changed service name and refactored

* * Added Documentation to the groupCloud component * Rebased

* * Create GroupSerach param model* Modified group component/service * Added Validation message

* * Fixed comments* Refactored groupCLoud component* Created GroupInirial pipe

* * Fixed selectedGroups bug

* * Removed showHint flag and used formcontrol error instead

* * After rebase* Change group-cloud to group

* * Added data-automation-id
* Improved fetching groups when appName defined
* Added unit tests

* * Rebased and  updated callCustomApi call signature

* Remove the springboot hardcoded name

* Update group-cloud.component.md

* * Fixed comments * Fixed return of js-api * Updated doc

* Unify the doc and remove useless code
This commit is contained in:
siva kumar
2019-01-14 19:21:33 +05:30
committed by Eugenio Romano
parent f08ad08d0f
commit 581f53da59
19 changed files with 1283 additions and 1 deletions

View File

@@ -0,0 +1,92 @@
---
Title: Group Cloud component
Added: v3.0.0
Status: Active
Last reviewed: 2018-20-11
---
# [Group Cloud component](../../lib/process-services-cloud/src/lib/group-cloud/components/group-cloud.component.ts "Defined in group-cloud.component.ts")
Searches Groups.
## Basic Usage
```html
<adf-cloud-group
[applicationName]="'simple-app'"
[mode]="'multiple'">
</adf-cloud-group>
```
![adf-cloud-group](../docassets/images/group-cloud.component.png)
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| applicationName | `string` | | Name of the application. If specified, shows the groups who have access to the app. |
| mode | `string` | 'single' | Mode of the user selection (single/multiple). |
| preSelectGroups | `GroupModel[]` | Array of groups to be pre-selected. Pre-select all groups in `multiple` mode and only the first group of the array in `single` mode. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| selectGroup | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`GroupModel`](../../lib/process-services-cloud/src/lib/group-cloud/models/group.model.ts)`>` | Emitted when a group selected. |
| removeGroup | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`GroupModel`](../../lib/process-services-cloud/src/lib/group-cloud/models/group.model.ts)`>` | Emitted when selected group is removed in `multiple` mode. |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` |
## Details
### Selection Mode
You can provide selection mode singe(default)/multiple
## Single select
```html
<adf-cloud-group></adf-cloud-group>
```
![adf-cloud-group](../docassets/images/group-cloud.component-single.png)
## Multiple select
```html
<adf-cloud-group
[mode]="'multiple'">
</adf-cloud-group>
```
![adf-cloud-group](../docassets/images/group-cloud.component-multiple-mode.png)
## Pre-select
Usage example:
```ts
import { ObjectDataTableAdapter } from '@alfresco/adf-core';
@Component({...})
export class MyComponent {
groups: any;
constructor() {
this.groups =
[
{id: 1, name: 'Group 1'},
{id: 2, name: 'Group 2'}
];
}
}
```
```html
<adf-cloud-group
[mode]="'multiple'"
[preSelectGroups]="groups">
</adf-cloud-group>
```