@ieeesa-npm/groups 0.13.6 → 0.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/add-user-roster/add-user-roster.component.mjs +8 -2
- package/esm2022/lib/components/edit-user-roles/edit-user-roles.component.mjs +8 -2
- package/esm2022/lib/models/group-types.model.mjs +1 -1
- package/esm2022/lib/models/roster-type.model.mjs +1 -2
- package/esm2022/lib/services/groups.service.mjs +2 -5
- package/fesm2022/ieeesa-npm-groups.mjs +15 -7
- package/fesm2022/ieeesa-npm-groups.mjs.map +1 -1
- package/lib/models/group-types.model.d.ts +0 -3
- package/lib/models/roster-type.model.d.ts +1 -2
- package/package.json +1 -1
|
@@ -416,7 +416,6 @@ var GroupRosterType;
|
|
|
416
416
|
(function (GroupRosterType) {
|
|
417
417
|
GroupRosterType["INDIVIDUAL"] = "Individual";
|
|
418
418
|
GroupRosterType["SYSTEM_USER"] = "User";
|
|
419
|
-
GroupRosterType["ENTITY"] = "Entity";
|
|
420
419
|
})(GroupRosterType || (GroupRosterType = {}));
|
|
421
420
|
|
|
422
421
|
/* eslint-disable no-unused-vars */
|
|
@@ -1165,10 +1164,7 @@ class GroupsService {
|
|
|
1165
1164
|
* @memberof GroupsService
|
|
1166
1165
|
*/
|
|
1167
1166
|
getBusinessRuleOfSelectedGroup() {
|
|
1168
|
-
|
|
1169
|
-
if (businessRule?.rosterType === GroupRosterType.ENTITY)
|
|
1170
|
-
businessRule.rosterType = GroupRosterType.INDIVIDUAL;
|
|
1171
|
-
return businessRule;
|
|
1167
|
+
return this.getLoadedGroupTypes()?.find((group) => group?.configFieldId === this.getSelectedGroupInfo()?.groupType)?.configFieldValue?.businessRule;
|
|
1172
1168
|
}
|
|
1173
1169
|
/**
|
|
1174
1170
|
* Enables or disables the form submit button based on passed parameters.
|
|
@@ -2672,7 +2668,13 @@ class EditUserRolesComponent {
|
|
|
2672
2668
|
*/
|
|
2673
2669
|
onEditUserRoleFormSubmit(form) {
|
|
2674
2670
|
form[0]?.markAllAsTouched();
|
|
2675
|
-
|
|
2671
|
+
const isAllOtherControlsValid = Object.keys(form[0].controls)
|
|
2672
|
+
.filter((controlName) => controlName !== 'representingOrg')
|
|
2673
|
+
.every((controlName) => form[0].get(controlName)?.status === FormStatus?.VALID);
|
|
2674
|
+
if ((form[0].get('representingOrg')?.status === FormStatus?.INVALID &&
|
|
2675
|
+
isAllOtherControlsValid &&
|
|
2676
|
+
this.representingOrganizations.length > 0) ||
|
|
2677
|
+
form[0].status === FormStatus?.VALID) {
|
|
2676
2678
|
this.groupsService
|
|
2677
2679
|
.editGroupsUserRole(this.getEditUserRolePayload(form[0]?.getRawValue()))
|
|
2678
2680
|
.pipe(takeUntil(this.destroy$))
|
|
@@ -3371,7 +3373,13 @@ class AddUserRosterComponent {
|
|
|
3371
3373
|
*/
|
|
3372
3374
|
onAddUserFormSubmit(form) {
|
|
3373
3375
|
form[0]?.markAllAsTouched();
|
|
3374
|
-
|
|
3376
|
+
const isAllOtherControlsValid = Object.keys(form[0].controls)
|
|
3377
|
+
.filter((controlName) => controlName !== 'representingOrg')
|
|
3378
|
+
.every((controlName) => form[0].get(controlName)?.status === FormStatus?.VALID);
|
|
3379
|
+
if ((form[0].get('representingOrg')?.status === FormStatus?.INVALID &&
|
|
3380
|
+
isAllOtherControlsValid &&
|
|
3381
|
+
this.selectedOrganizations.length > 0) ||
|
|
3382
|
+
form[0].status === FormStatus?.VALID) {
|
|
3375
3383
|
this.groupService
|
|
3376
3384
|
.addNewGroupUser(this.getAddNewUserPayload(form[0]?.getRawValue()))
|
|
3377
3385
|
.pipe(takeUntil$1(this.destroy$))
|