mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
* [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
93 lines
2.3 KiB
Markdown
93 lines
2.3 KiB
Markdown
---
|
|
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>
|
|
```
|
|
|
|

|
|
|
|
## 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>
|
|
```
|
|
|
|

|
|
|
|
## Multiple select
|
|
|
|
```html
|
|
<adf-cloud-group
|
|
[mode]="'multiple'">
|
|
</adf-cloud-group>
|
|
```
|
|
|
|

|
|
|
|
## 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>
|
|
```
|