group
diff --git a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts
index 6dd41084b9..31084620c2 100644
--- a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts
+++ b/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts
@@ -34,17 +34,18 @@ export class PeopleGroupCloudDemoComponent {
peopleMode: string = PeopleCloudComponent.MODE_SINGLE;
preSelectUsers: IdentityUserModel[] = [];
- invalidUsers: IdentityGroupModel[] = [];
+ invalidUsers: IdentityUserModel[] = [];
peopleRoles: string[] = [];
peopleAppName: string;
peopleFilterMode: string = this.DEFAULT_FILTER_MODE;
peoplePreselectValidation: Boolean = false;
groupPreselectValidation = false;
+ peopleReadonly = false;
+ groupReadonly = false;
groupMode: string = GroupCloudComponent.MODE_SINGLE;
preSelectGroup: IdentityGroupModel[] = [];
invalidGroups: IdentityGroupModel[] = [];
- selectedGroupList: IdentityGroupModel[] = [];
groupRoles: string[];
groupAppName: string;
groupFilterMode: string = this.DEFAULT_FILTER_MODE;
@@ -75,12 +76,18 @@ export class PeopleGroupCloudDemoComponent {
onChangePeopleMode(event: MatRadioChange) {
this.peopleMode = event.value;
- this.preSelectUsers = [...this.preSelectUsers];
+ }
+
+ onChangePeopleReadonly(event: MatCheckboxChange) {
+ this.peopleReadonly = event.checked;
+ }
+
+ onChangeGroupReadonly(event: MatCheckboxChange) {
+ this.groupReadonly = event.checked;
}
onChangeGroupsMode(event: MatRadioChange) {
this.groupMode = event.value;
- this.preSelectGroup = [...this.preSelectGroup];
}
onChangePeopleFilterMode(event: MatRadioChange) {
@@ -119,18 +126,10 @@ export class PeopleGroupCloudDemoComponent {
onChangePeopleValidation(event: MatCheckboxChange) {
this.peoplePreselectValidation = event.checked;
- this.preSelectUsers = [...this.preSelectUsers];
- if (!this.peoplePreselectValidation) {
- this.invalidUsers = [];
- }
}
onChangeGroupValidation(event: MatCheckboxChange) {
this.groupPreselectValidation = event.checked;
- this.preSelectGroup = [...this.preSelectGroup];
- if (!this.groupPreselectValidation) {
- this.invalidGroups = [];
- }
}
onGroupsWarning(warning: any) {
@@ -167,22 +166,6 @@ export class PeopleGroupCloudDemoComponent {
return this.groupMode === GroupCloudComponent.MODE_MULTIPLE;
}
- onRemoveGroup(group: IdentityGroupModel) {
- this.preSelectGroup = this.preSelectGroup.filter((value: any) => value.id !== group.id);
- }
-
- onSelectUser(user: IdentityUserModel) {
- if (this.peopleMode === PeopleCloudComponent.MODE_MULTIPLE) {
- this.preSelectUsers.push(user);
- }
- }
-
- onSelectGroup(group: IdentityGroupModel) {
- if (this.groupMode === GroupCloudComponent.MODE_MULTIPLE) {
- this.preSelectGroup.push(group);
- }
- }
-
get peopleSingleMode() {
return PeopleCloudComponent.MODE_SINGLE;
}
diff --git a/docs/process-services-cloud/components/group-cloud.component.md b/docs/process-services-cloud/components/group-cloud.component.md
index d2cb38e0e1..9131edfba8 100644
--- a/docs/process-services-cloud/components/group-cloud.component.md
+++ b/docs/process-services-cloud/components/group-cloud.component.md
@@ -26,9 +26,10 @@ Searches Groups.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
-| appName | `string` | | Name of the application. If specified this shows the users who have access to the app. |
+| appName | `string` | | Name of the application. If specified this shows the groups who have access to the app. |
+| readOnly | `boolean` | false | readOnly mode (true/false). |
| mode | `string` | | User selection mode (single/multiple). |
-| preSelectGroups | [`IdentityGroupModel`](../../../lib/core/models/identity-group.model.ts)`[]` | \[] | Array of users to be pre-selected. This pre-selects all users in multi selection mode and only the first user of the array in single selection mode. |
+| preSelectGroups | [`IdentityGroupModel`](../../../lib/core/models/identity-group.model.ts)`[]` | \[] | Array of groups to be pre-selected. This pre-selects all groups in multi selection mode and only the first group of the array in single selection mode. |
| roles | `string[]` | \[] | Role names of the groups to be listed. |
| searchGroupsControl | `FormControl` | new FormControl() | FormControl to search the group |
| title | `string` | | Title of the field |
@@ -95,6 +96,20 @@ export class MyComponent {
### Read-only
+You can use `readonly` property to set the component in `readonly` mode. Readonly mode will disable any interaction with the component.
+
+```html
+
+
+```
+
+If you want to manage each group seperately you can set their readonly property at your preference.
+You need to have component's readonly property set to false. Component's readonly mode overwrites groups level.
+
You can use `readonly` property to make preselected groups read-only in `multiple` mode.
Usage example:
diff --git a/docs/process-services-cloud/components/people-cloud.component.md b/docs/process-services-cloud/components/people-cloud.component.md
index 42062794e4..3a3a1272e7 100644
--- a/docs/process-services-cloud/components/people-cloud.component.md
+++ b/docs/process-services-cloud/components/people-cloud.component.md
@@ -25,6 +25,7 @@ Allows one or more users to be selected (with auto-suggestion) based on the inpu
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | | Name of the application. If specified, this shows the users who have access to the app. |
+| readOnly | `boolean` | false | readOnly mode (true/false). |
| mode | `string` | | User selection mode (single/multiple). |
| preSelectUsers | [`IdentityUserModel`](../../../lib/core/models/identity-user.model.ts)`[]` | | Array of users to be pre-selected. All users in the array are pre-selected in multi selection mode, but only the first user is pre-selected in single selection mode. Mandatory properties are: id, email, username |
| roles | `string[]` | | Role names of the users to be listed. |
@@ -44,7 +45,19 @@ Allows one or more users to be selected (with auto-suggestion) based on the inpu
### Read-only
-You can use `readonly` property to make preselected users read-only in `multiple` mode.
+You can use `readonly` property to set the component in `readonly` mode. Readonly mode will disable any interaction with the component.
+
+```html
+
+
+```
+
+If you want to manage each user seperately you can set their readonly property at your preference.
+You need to have component's readonly property set to false. Component's readonly mode overwrites users level.
```ts
const preSelectUsers = [
@@ -55,7 +68,7 @@ const preSelectUsers = [
```
```html
```
diff --git a/e2e/process-services-cloud/people-group-cloud-component.e2e.ts b/e2e/process-services-cloud/people-group-cloud-component.e2e.ts
index a0ba972012..1a959ad183 100644
--- a/e2e/process-services-cloud/people-group-cloud-component.e2e.ts
+++ b/e2e/process-services-cloud/people-group-cloud-component.e2e.ts
@@ -193,21 +193,22 @@ describe('People Groups Cloud Component', () => {
await peopleGroupCloudComponentPage.clickPeopleCloudSingleSelection();
await peopleGroupCloudComponentPage.checkPeopleCloudSingleSelectionIsSelected();
+
+ await peopleGroupCloudComponentPage.enterPeoplePreselect('[{"id":"12345","username":"someUsername","email":"someEmail"}]');
+ await expect(await peopleCloudComponent.checkSelectedPeople('someUsername'));
+
await peopleGroupCloudComponentPage.clickPreselectValidation();
await expect(await peopleGroupCloudComponentPage.getPreselectValidationStatus()).toBe('true');
- await peopleGroupCloudComponentPage.enterPeoplePreselect('[{"id":"12345","username":"someUsername","email":"someEmail"}]');
- await expect(await peopleCloudComponent.getAssigneeFieldContent()).toBe('');
-
await expect(await peopleGroupCloudComponentPage.getPreselectValidationStatus()).toBe('true');
await peopleGroupCloudComponentPage.enterPeoplePreselect(`[{"id":"${noRoleUser.idIdentityService}"}]`);
- await expect(await peopleCloudComponent.getAssigneeFieldContent()).toBe(`${noRoleUser.firstName} ${noRoleUser.lastName}`);
+ await expect(await peopleCloudComponent.checkSelectedPeople(`${noRoleUser.firstName} ${noRoleUser.lastName}`));
await peopleGroupCloudComponentPage.enterPeoplePreselect(`[{"email":"${apsUser.email}"}]`);
- await expect(await peopleCloudComponent.getAssigneeFieldContent()).toBe(`${apsUser.firstName} ${apsUser.lastName}`);
+ await expect(await peopleCloudComponent.checkSelectedPeople(`${apsUser.firstName} ${apsUser.lastName}`));
await peopleGroupCloudComponentPage.enterPeoplePreselect(`[{"username":"${testUser.username}"}]`);
- await expect(await peopleCloudComponent.getAssigneeFieldContent()).toBe(`${testUser.firstName} ${testUser.lastName}`);
+ await expect(await peopleCloudComponent.checkSelectedPeople(`${testUser.firstName} ${testUser.lastName}`));
});
it('[C309676] Should fetch the preselect users based on the Validate flag set to True in Multiple mode selection', async () => {
@@ -254,18 +255,6 @@ describe('People Groups Cloud Component', () => {
});
- it('[C309678] Should not fetch the preselect users when mandatory parameters Id, Email and username are missing', async () => {
- await peopleGroupCloudComponentPage.clickPeopleCloudMultipleSelection();
- await peopleGroupCloudComponentPage.checkPeopleCloudMultipleSelectionIsSelected();
- await peopleGroupCloudComponentPage.clickPreselectValidation();
- await expect(await peopleGroupCloudComponentPage.getPreselectValidationStatus()).toBe('true');
-
- await peopleGroupCloudComponentPage.enterPeoplePreselect(`[{"firstName":"${apsUser.firstName}","lastName":"${apsUser.lastName},"` +
- `{"firstName":"${testUser.firstName}","lastName":"${testUser.lastName}",{"firstName":"${noRoleUser.firstName}","lastName":"${noRoleUser.lastName}"]`);
- await browser.sleep(200);
- await expect(await peopleCloudComponent.getAssigneeFieldContent()).toBe('');
- });
-
});
});
diff --git a/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts b/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts
index 54d1767e5a..bc79bacd89 100644
--- a/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts
+++ b/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts
@@ -90,7 +90,7 @@ describe('People Groups Cloud Component', () => {
await peopleCloudComponent.checkUserIsDisplayed(`${testUser.firstName} ${testUser.lastName}`);
await peopleCloudComponent.selectAssigneeFromList(`${testUser.firstName} ${testUser.lastName}`);
await browser.sleep(100);
- await expect(await peopleCloudComponent.getAssigneeFieldContent()).toBe(`${testUser.firstName} ${testUser.lastName}`);
+ await expect(await peopleCloudComponent.checkSelectedPeople(`${testUser.firstName} ${testUser.lastName}`));
});
it('[C305041] Should filter the People Multiple Selection with the Application name filter', async () => {
@@ -118,7 +118,7 @@ describe('People Groups Cloud Component', () => {
await groupCloudComponentPage.searchGroups(hrGroup.name);
await groupCloudComponentPage.checkGroupIsDisplayed(hrGroup.name);
await groupCloudComponentPage.selectGroupFromList(hrGroup.name);
- await expect(await groupCloudComponentPage.getGroupsFieldContent()).toBe(hrGroup.name);
+ await expect(await groupCloudComponentPage.checkSelectedGroup(hrGroup.name));
});
it('[C305041] Should filter the Groups Multiple Selection with the Application name filter', async () => {
diff --git a/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts
index cf3566a3eb..25c951cbf8 100644
--- a/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts
@@ -106,7 +106,7 @@ describe('Start Task', () => {
it('[C297675] Should create a task unassigned when assignee field is empty in Start Task form', async () => {
await tasksCloudDemoPage.openNewTaskForm();
await startTask.checkFormIsDisplayed();
- await peopleCloudComponent.clearAssignee();
+ await peopleCloudComponent.clearAssigneeFromChip(testUser.username);
await startTask.addName(unassignedTaskName);
await startTask.clickStartButton();
await tasksCloudDemoPage.editTaskFilterCloudComponent();
@@ -125,7 +125,7 @@ describe('Start Task', () => {
it('[C291956] Should be able to create a new standalone task without assignee', async () => {
await tasksCloudDemoPage.openNewTaskForm();
await startTask.checkFormIsDisplayed();
- await peopleCloudComponent.clearAssignee();
+ await peopleCloudComponent.clearAssigneeFromChip(testUser.username);
await startTask.addName(unassignedTaskName);
await startTask.checkStartButtonIsEnabled();
await startTask.clickStartButton();
@@ -203,7 +203,7 @@ describe('Start Task', () => {
it('[C291953] Assignee field should display the logged user as default', async () => {
await tasksCloudDemoPage.openNewTaskForm();
await startTask.checkFormIsDisplayed();
- await expect(await peopleCloudComponent.getAssignee()).toContain(testUser.firstName, 'does not contain Admin');
+ await expect(await peopleCloudComponent.checkSelectedPeople(testUser.firstName));
await startTask.clickCancelButton();
});
@@ -212,7 +212,7 @@ describe('Start Task', () => {
await startTask.checkFormIsDisplayed();
await startTask.addName(reassignTaskName);
- await expect(await peopleCloudComponent.getAssignee()).toBe(`${testUser.firstName} ${testUser.lastName}`);
+ await peopleCloudComponent.checkSelectedPeople(`${testUser.firstName} ${testUser.lastName}`);
await peopleCloudComponent.searchAssignee(apsUser.username);
await peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
await peopleCloudComponent.selectAssigneeFromList(`${apsUser.firstName} ${apsUser.lastName}`);
diff --git a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.html b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.html
index 155e0d0425..91b995f1d2 100644
--- a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.html
+++ b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.html
@@ -1,61 +1,71 @@
-