diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cc29ae13f..0d936f212 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -197,6 +197,7 @@ import { SuccessOrgServiceComponent } from './pages/buyer/success-org-service/su import { ManageGroupErrorComponent } from './pages/manage-group/manage-group-error/manage-group-error.component'; import { VerifyUserComponent } from './pages/manage-user/verify-user/verify-user.component'; import { VerifyUserStatusComponent } from './pages/manage-user/verify-user-status/verify-user-status.component'; +import { AccordionComponent } from './components/accordion/accordion.component'; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http); @@ -359,7 +360,8 @@ export function createTranslateLoader(http: HttpClient) { SuccessOrgServiceComponent, ManageGroupErrorComponent, VerifyUserComponent, - VerifyUserStatusComponent + VerifyUserStatusComponent, + AccordionComponent ], imports: [ // BrowserModule, diff --git a/src/app/components/accordion/accordion.component.html b/src/app/components/accordion/accordion.component.html new file mode 100644 index 000000000..59834a2e3 --- /dev/null +++ b/src/app/components/accordion/accordion.component.html @@ -0,0 +1,113 @@ +
+ + + + + + + + + + + + + +
{{headerText}} +

{{groupShow == + true ? 'hide all assigned' : (groupShow == false ? 'show all assigned' : '')}} + ({{data.length}})

+

{{groupShow == + true ? 'hide all unassigned' : (groupShow == false ? 'show all unassigned' : '')}} + ({{data.length}})

+
+
+
+ + + +
+
+
{{getElementStatus(groupdata.groupId)}}
+ +
+
+ {{headerText}} +
+
+ + {{!noDataGroupsMemberMessage? 'This user is not + member of any group.':noDataGroupsMemberMessage}} + + {{!noDatanoneGroupsMemberMessage? 'There are no unassigned groups for + this user.':noDatanoneGroupsMemberMessage}} + + +
+
+
+
+
+ + + + + + + + + + + + + +
Group name
{{groupdata[headerTextKeys]}} + + {{getElementStatus(groupdata.groupId)}}
+ +
+
+ {{headerText}} +
+
+ + {{!noDataGroupsMemberMessage? 'This user is not + member of any group.':noDataGroupsMemberMessage}} +
+
+
+
\ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss new file mode 100644 index 000000000..825909aa4 --- /dev/null +++ b/src/app/components/accordion/accordion.component.scss @@ -0,0 +1,28 @@ +.govuk-list--bullet { + padding-left: 35px; + list-style-type: disc; +} +.border-bottom-0 { + border-bottom: 0; +} + +.border-top-1 { + border-top: 1px solid #b1b4b6; +} +.govuk-table__header.govuk-text-align-right,.govuk-table__cell.govuk-text-align-right { + text-align: right; +} +.custom_strong { + font-weight: 700; + font-family: "GDS Transport", arial, sans-serif; + font-size: 1.1875rem; + line-height: 1.3157894737; +} +.none_span { + font-size: 1.1875rem; + line-height: 1.3157894737; +} +.gov_uk_fieldset { + // margin-top: 50px; + margin-bottom: 30px; +} \ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.spec.ts b/src/app/components/accordion/accordion.component.spec.ts new file mode 100644 index 000000000..326d21bac --- /dev/null +++ b/src/app/components/accordion/accordion.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccordionComponent } from './accordion.component'; + +describe('AccordionComponent', () => { + let component: AccordionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AccordionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AccordionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/accordion/accordion.component.ts b/src/app/components/accordion/accordion.component.ts new file mode 100644 index 000000000..4316a624b --- /dev/null +++ b/src/app/components/accordion/accordion.component.ts @@ -0,0 +1,78 @@ +import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'app-accordion', + templateUrl: './accordion.component.html', + styleUrls: ['./accordion.component.scss'] +}) +export class AccordionComponent implements OnInit, OnChanges { + + @Input() data!: any[]; + @Input() headerText!: string + @Input() headerTextKeys!: string + @Input() isAdmin!: boolean + @Input() accessTable!: string + @Input() groupShow!: boolean + + @Input() noRoleMessage!: string + @Input() noDataGroupsMemberMessage!: string + @Input() noDatanoneGroupsMemberMessage!: string + + + @Output() checkBoxRemoveRoles = new EventEmitter(); + @Output() checkBoxAddRoles = new EventEmitter(); + public routeData: any = {}; + public isEdit: boolean = false; + + + // public groupShow: boolean = false; + constructor(private activatedRoute: ActivatedRoute,) { } + + ngOnChanges(): void { + } + + ngOnInit(): void { + } + + public onTopToggle(): void { + this.groupShow = !this.groupShow + } + + public onBottomToggle(id: string): void { + const el: any = document.getElementById(id); + el.style.display = (el.style.display === 'block') ? 'none' : 'block'; + } + + public getElementStatus(id: string) { + const el: any = document.getElementById(id); + return el.style.display === 'block' ? 'Hide services' : 'Show services' + } + + public onCheckBoxClick(data: any, checkValue: any): void { + const eventName = checkValue ? 'checkBoxRemoveRoles' : 'checkBoxAddRoles'; + this[eventName].emit(data); + } + + public toggleRoleForUser(id: string): void { + const el: any = document.getElementById(id); + el.style.display = (el.style.display === 'block') ? 'none' : 'block'; + } + + public goToEditGroup(groupId: any) { + let queryParams = this.activatedRoute.snapshot.queryParams; + if(queryParams.data) + { + this.routeData = JSON.parse(atob(queryParams.data)); + this.isEdit = this.routeData['isEdit']; + } + let data = { + isEdit: true, + groupId: groupId, + accessFrom: "users", + isUserAccess: true, + userEditStatus: this.isEdit + }; + window.open('manage-groups/view?data=' + JSON.stringify(data)); + } +} diff --git a/src/app/components/govuk-table/govuk-table.component.html b/src/app/components/govuk-table/govuk-table.component.html index c46b12c5e..4d6968afc 100644 --- a/src/app/components/govuk-table/govuk-table.component.html +++ b/src/app/components/govuk-table/govuk-table.component.html @@ -37,6 +37,9 @@
{{ dataRow[dataKey] }} + + {{ 'PENDING_LABEL' | translate }} +
{{dataRow['description']}}
diff --git a/src/app/models/organisationGroup.ts b/src/app/models/organisationGroup.ts index f0fa4219b..6c8eafc04 100644 --- a/src/app/models/organisationGroup.ts +++ b/src/app/models/organisationGroup.ts @@ -1,4 +1,6 @@ export interface Group { + serviceRoleGroups: any; + checked ?: boolean; groupId: number; mfaEnabled: boolean; groupName: string; diff --git a/src/app/models/user.ts b/src/app/models/user.ts index fd859afb9..2040482a2 100644 --- a/src/app/models/user.ts +++ b/src/app/models/user.ts @@ -70,8 +70,8 @@ export interface ServicePermissionInfo { name: string; key: string; id: number, - serviceClientId ?: string; - serviceClientName ?: string; + serviceClientId?: string; + serviceClientName?: string; } export interface UserProfileRequestInfo extends UserDetail { @@ -132,14 +132,25 @@ export interface OrgUserListResponse extends PaginationInfo { export interface PendingApproveRole { userName: string; - detail : PendingApproveRoleDetail + detail: PendingApproveRoleDetail } export interface PendingApproveRoleDetail { - roleIds : [] + roleIds: [] } export interface acceptRejectRequestDetail { - pendingRoleIds : [] + pendingRoleIds: [] status: number +} +export interface userGroupTableDetail { + isAdmin: boolean + headerTextKey: string + headerText: string, + accessTable: string + groupShow: boolean + noRoleMessage?: string | any + noDataGroupsMemberMessage?: string | any + noDatanoneGroupsMemberMessage?: string | any + data: any[] } \ No newline at end of file diff --git a/src/app/pages/manage-group/manage-group-edit-users/manage-group-edit-users-component.ts b/src/app/pages/manage-group/manage-group-edit-users/manage-group-edit-users-component.ts index 978bad30e..2cccc9e58 100644 --- a/src/app/pages/manage-group/manage-group-edit-users/manage-group-edit-users-component.ts +++ b/src/app/pages/manage-group/manage-group-edit-users/manage-group-edit-users-component.ts @@ -95,7 +95,8 @@ export class ManageGroupEditUsersComponent this.organisationId, this.searchingUserName, this.currentPage, - this.pageSize + this.pageSize, + true ) .subscribe({ next: (userListResponse: UserListResponse) => { diff --git a/src/app/pages/manage-user/manage-user-add-single-user-detail/manage-user-add-single-user-detail.component.html b/src/app/pages/manage-user/manage-user-add-single-user-detail/manage-user-add-single-user-detail.component.html index 3266cf585..7954a4314 100644 --- a/src/app/pages/manage-user/manage-user-add-single-user-detail/manage-user-add-single-user-detail.component.html +++ b/src/app/pages/manage-user/manage-user-add-single-user-detail/manage-user-add-single-user-detail.component.html @@ -159,8 +159,20 @@

+
+ + {{ 'GROUPS'| translate }} (Optional) + + +
+ -
+ +
@@ -288,30 +300,81 @@

-
{{ 'SERVICES'| translate }} -

{{ 'ACCESS_TO_USER'| translate }}

-
-
- - - - Pending Approval - -

{{orgRole.description}}

+

{{ 'ACCESS_TO_USER_ROLE'| translate }}

+ +
+

+ testing +

+ +
+
+
+ +

{{ 'ACCESS_TO_USER_SERVICE'| translate }}

+ +
+
+ + + + Pending Approval + +

{{orgRole.description}}

+
+
+
+
+
+

{{ 'ACCESS_TO_GROUP_SEVICE'| translate }}

+

{{ 'NO_GROUP_ROLE_ACCESS_ADDUSER'| translate }}

+ +
+
+ + + + Pending Approval + +

{{orgRole.description}}

+
+
+ +
+
+
(); + const orgGrpList = await this.organisationGroupService.getOrganisationGroupsWithRoles(this.organisationId).toPromise(); this.orgGroups = orgGrpList.groupList; - this.orgGroups.forEach((group) => { - let isGroupOfUser = - this.userProfileResponseInfo.detail && - this.userProfileResponseInfo.detail.userGroups && - this.userProfileResponseInfo.detail.userGroups.some( - (ug) => ug.groupId == group.groupId - ); - this.formGroup.addControl( - 'orgGroupControl_' + group.groupId, - this.formBuilder.control(isGroupOfUser ? true : '') - ); - }); + for (const group of this.orgGroups) { + const isGroupOfUser:any = this.userProfileResponseInfo?.detail?.userGroups?.find((ug) => ug.groupId === group.groupId); + if(isGroupOfUser){ + // if(isGroupOfUser.approvalStatus === 0){ + // const pendingApproveRole = group?.serviceRoleGroups?.find((pg:any)=>pg.id === isGroupOfUser.accessServiceRoleGroupId) + // group.serviceRoleGroups.map((fc:any)=>{ + // if(pendingApproveRole.id === fc.id){ + // fc.isPendingApproval = true + // fc = pendingApproveRole + // } + // }) + // } + group.serviceRoleGroups.map((fc:any)=>{ + var serviceGroupApprovalDetails:any = this.userProfileResponseInfo?.detail?.userGroups?.find((ug: any) => ug.groupId === group.groupId && ug.accessServiceRoleGroupId === fc.id); + fc.approvalStatus = serviceGroupApprovalDetails?.approvalStatus; + }); + + group.checked = true + group.serviceRoleGroups = group.serviceRoleGroups.filter((item: any) => item.approvalStatus === 0 || item.approvalStatus === 1); + this.groupsMember.data.push(group) + this.selectedGroupCheckboxes.push(group.groupId) + + group.serviceRoleGroups.forEach((element: any) => { + let groupRoles = this.orgUserGroupRoles.filter(e=> { return e.id == element.id}); + if(groupRoles.length <= 0 && (element.approvalStatus == 0 || element.approvalStatus ==1)){ + this.orgUserGroupRoles.push(element); + } + }); + } else { + this.noneGroupsMember.data.push(group) + } + } } async getOrgRoles() { @@ -413,8 +456,8 @@ export class ManageUserAddSingleUserDetailComponent this.userProfileRequestInfo.mfaEnabled = form.get('mfaEnabled')?.value; this.userProfileRequestInfo.detail.identityProviderIds = this.getSelectedIdpIds(form); - this.userProfileRequestInfo.detail.groupIds = - this.getSelectedGroupIds(form); + // this.userProfileRequestInfo.detail.groupIds = + // this.getSelectedGroupIds(form); this.userProfileRequestInfo.detail.roleIds = this.getSelectedRoleIds(form); this.checkApproveRolesSelected() @@ -447,15 +490,15 @@ export class ManageUserAddSingleUserDetailComponent return selectedIdpIds; } - getSelectedGroupIds(form: FormGroup) { - let selectedGroupIds: number[] = []; - this.orgGroups.map((group) => { - if (form.get('orgGroupControl_' + group.groupId)?.value === true) { - selectedGroupIds.push(group.groupId); - } - }); - return selectedGroupIds; - } + // getSelectedGroupIds(form: FormGroup) { + // let selectedGroupIds: number[] = []; + // this.orgGroups.map((group) => { + // if (form.get('orgGroupControl_' + group.groupId)?.value === true) { + // selectedGroupIds.push(group.groupId); + // } + // }); + // return selectedGroupIds; + // } @@ -581,6 +624,9 @@ export class ManageUserAddSingleUserDetailComponent } updateUser(form: FormGroup) { + console.log("selectedCheckboxes",this.selectedGroupCheckboxes) + debugger + this.userProfileRequestInfo.detail.groupIds = this.selectedGroupCheckboxes this.wrapperUserService .updateUser( this.userProfileRequestInfo.userName, @@ -617,6 +663,7 @@ export class ManageUserAddSingleUserDetailComponent } createUser(form: FormGroup) { + this.userProfileRequestInfo.detail.groupIds = this.selectedGroupCheckboxes this.wrapperUserService.createUser(this.userProfileRequestInfo).subscribe({ next: (userEditResponseInfo: UserEditResponseInfo) => { this.submitted = false; @@ -708,94 +755,94 @@ export class ManageUserAddSingleUserDetailComponent this.inputs.toArray()[1].nativeElement.focus(); } } - onGroupViewClick(groupId: any) { - var formData: UserProfileResponseInfo = { - title: this.formGroup.get('userTitle')?.value, - firstName: this.formGroup.get('firstName')?.value, - lastName: this.formGroup.get('lastName')?.value, - userName: this.formGroup.get('userName')?.value, - mfaEnabled: this.formGroup.get('mfaEnabled')?.value, - isAdminUser: false, - detail: { - id: this.userProfileResponseInfo.detail.id, - canChangePassword: - this.userProfileResponseInfo.detail.canChangePassword, - identityProviders: [], - userGroups: [], - rolePermissionInfo: [], - }, - organisationId: this.organisationId, - }; - - // Filter the selected identity providers and keep it in route change - let selectedIdpIds = this.getSelectedIdpIds(this.formGroup); - selectedIdpIds.forEach((selectedIdpId) => { - if ( - !formData.detail.identityProviders?.some( - (ug) => ug.identityProviderId == selectedIdpId - ) - ) { - formData.detail.identityProviders && - formData.detail.identityProviders.push({ - identityProviderId: selectedIdpId, - }); - } - }); - - // Filter the selected groups and keep it in route change - let selectedGroupIds = this.getSelectedGroupIds(this.formGroup); - selectedGroupIds.forEach((selectedGroupId) => { - if ( - !( - formData.detail.userGroups && - formData.detail.userGroups.some((ug) => ug.groupId == selectedGroupId) - ) - ) { - formData.detail.userGroups && - formData.detail.userGroups.push({ - groupId: selectedGroupId, - group: '', - accessRole: '', - accessRoleName: '', - serviceClientId: '', - }); - } - }); - - // Filter the selected roles and keep it in route change - let selectedRoleIds = this.getSelectedRoleIds(this.formGroup); - selectedRoleIds.forEach((selectedRoleId) => { - if ( - !( - formData.detail.rolePermissionInfo && - formData.detail.rolePermissionInfo.some( - (ug) => ug.roleId == selectedRoleId - ) - ) - ) { - formData.detail.rolePermissionInfo && - formData.detail.rolePermissionInfo.push({ - roleId: selectedRoleId, - roleKey: '', - roleName: '', - serviceClientId: '', - serviceClientName: '', - }); - } - }); - - let data = { - isEdit: false, - groupId: groupId, - accessFrom: "users", - userEditStatus: this.isEdit, - isUserAccess: true - }; - this.router.navigateByUrl( - 'manage-groups/view?data=' + JSON.stringify(data), - { state: { formData: formData, routeUrl: this.router.url } } - ); - } + // onGroupViewClick(groupId: any) { + // var formData: UserProfileResponseInfo = { + // title: this.formGroup.get('userTitle')?.value, + // firstName: this.formGroup.get('firstName')?.value, + // lastName: this.formGroup.get('lastName')?.value, + // userName: this.formGroup.get('userName')?.value, + // mfaEnabled: this.formGroup.get('mfaEnabled')?.value, + // isAdminUser: false, + // detail: { + // id: this.userProfileResponseInfo.detail.id, + // canChangePassword: + // this.userProfileResponseInfo.detail.canChangePassword, + // identityProviders: [], + // userGroups: [], + // rolePermissionInfo: [], + // }, + // organisationId: this.organisationId, + // }; + + // // Filter the selected identity providers and keep it in route change + // let selectedIdpIds = this.getSelectedIdpIds(this.formGroup); + // selectedIdpIds.forEach((selectedIdpId) => { + // if ( + // !formData.detail.identityProviders?.some( + // (ug) => ug.identityProviderId == selectedIdpId + // ) + // ) { + // formData.detail.identityProviders && + // formData.detail.identityProviders.push({ + // identityProviderId: selectedIdpId, + // }); + // } + // }); + + // // Filter the selected groups and keep it in route change + // let selectedGroupIds = this.getSelectedGroupIds(this.formGroup); + // selectedGroupIds.forEach((selectedGroupId) => { + // if ( + // !( + // formData.detail.userGroups && + // formData.detail.userGroups.some((ug) => ug.groupId == selectedGroupId) + // ) + // ) { + // formData.detail.userGroups && + // formData.detail.userGroups.push({ + // groupId: selectedGroupId, + // group: '', + // accessRole: '', + // accessRoleName: '', + // serviceClientId: '', + // }); + // } + // }); + + // // Filter the selected roles and keep it in route change + // let selectedRoleIds = this.getSelectedRoleIds(this.formGroup); + // selectedRoleIds.forEach((selectedRoleId) => { + // if ( + // !( + // formData.detail.rolePermissionInfo && + // formData.detail.rolePermissionInfo.some( + // (ug) => ug.roleId == selectedRoleId + // ) + // ) + // ) { + // formData.detail.rolePermissionInfo && + // formData.detail.rolePermissionInfo.push({ + // roleId: selectedRoleId, + // roleKey: '', + // roleName: '', + // serviceClientId: '', + // serviceClientName: '', + // }); + // } + // }); + + // let data = { + // isEdit: false, + // groupId: groupId, + // accessFrom: "users", + // userEditStatus: this.isEdit, + // isUserAccess: true + // }; + // this.router.navigateByUrl( + // 'manage-groups/view?data=' + JSON.stringify(data), + // { state: { formData: formData, routeUrl: this.router.url } } + // ); + // } onUserRoleChecked(obj: any, isChecked: boolean) { var roleKey = obj.roleKey; @@ -807,7 +854,6 @@ export class ManageUserAddSingleUserDetailComponent } else if (isChecked == false) { this.setMfaStatus(roleKey,false) - this.addPendingRole(obj) } } @@ -829,15 +875,7 @@ export class ManageUserAddSingleUserDetailComponent } } - // Removed below logic to avoid approval required seperate delete api call. Delete pending role will be handled in normal role put call. - private addPendingRole(obj:any){ - // if (obj.pendingStatus === true) { - // let filterRole = this.pendingRoledeleteDetails.find((element: number) => element == obj.roleId) - // if (filterRole === undefined) { - // this.pendingRoledeleteDetails.push(obj.roleId) - // } - // } - } + public ResetAdditionalSecurity(): void { if (this.MFA_Enabled) { @@ -867,4 +905,55 @@ export class ManageUserAddSingleUserDetailComponent } } + + + public groupsMemberCheckBoxAddRoles(data:any){ + this.selectedGroupCheckboxes.push(data.groupId); + this.IsChangeInGroupSelection(this.userProfileResponseInfo?.detail?.userGroups?.map(x => x.groupId)); + + } + + public groupsMemberCheckBoxRemoveRoles(data:any){ + this.selectedGroupCheckboxes = this.removeObjectById(this.selectedGroupCheckboxes,data.groupId); + this.IsChangeInGroupSelection(this.userProfileResponseInfo?.detail?.userGroups?.map(x => x.groupId)); + } + + public noneGroupsMemberCheckBoxAddRoles(data:any){ + this.selectedGroupCheckboxes.push(data.groupId); + this.IsChangeInGroupSelection(this.userProfileResponseInfo?.detail?.userGroups?.map(x => x.groupId)); + } + + public noneGroupsMemberCheckBoxRemoveRoles(data:any){ + this.selectedGroupCheckboxes = this.removeObjectById(this.selectedGroupCheckboxes,data.groupId); + this.IsChangeInGroupSelection(this.userProfileResponseInfo?.detail?.userGroups?.map(x => x.groupId)); + } + + private removeObjectById(arr:any, id:any) { + return arr.filter((item: any) => item !== id); + } + + public tabChanged(activetab: string): void { + if (activetab === 'userservices') { + this.tabConfig.userservices = true + this.tabConfig.groupservices = false + } else { + this.tabConfig.groupservices = true + this.tabConfig.userservices = false + } + } + + public IsChangeInGroupSelection(responseGroups: any): void + { + var isSelectedAndResponseGroupsSame = !this.selectedGroupCheckboxes.every((groupId: any) => responseGroups.includes(groupId)); + var isResponseGroupsSame = !responseGroups.every((groupId: any) => this.selectedGroupCheckboxes.includes(groupId)); + if(isSelectedAndResponseGroupsSame || isResponseGroupsSame) + { + this.formChanged = true; + } + else + { + this.formChanged = false; + } + } + } diff --git a/src/app/pages/manage-user/verify-user-status/verify-user-status.component.html b/src/app/pages/manage-user/verify-user-status/verify-user-status.component.html index 1ceb34925..6085a94d2 100644 --- a/src/app/pages/manage-user/verify-user-status/verify-user-status.component.html +++ b/src/app/pages/manage-user/verify-user-status/verify-user-status.component.html @@ -1,59 +1,60 @@
-
- +
\ No newline at end of file diff --git a/src/app/pages/user-profile/user-profile-component.html b/src/app/pages/user-profile/user-profile-component.html index 02cbbbbb2..e0705108f 100644 --- a/src/app/pages/user-profile/user-profile-component.html +++ b/src/app/pages/user-profile/user-profile-component.html @@ -18,22 +18,26 @@

{{ 'MANAGE_MY_ACCOUNT' | translate }}

- +

@@ -129,154 +134,255 @@

Have an issue?

-
-

{{ 'GROUPS' | translate }}

- -

{{'NONE'| translate}} -

-

-
+

{{ 'GROUPS' | translate }}

-
- +
+ + +
-

{{ 'ROLES' | translate }}

+

{{ 'ROLES' | translate }}

-

{{ 'SERVICES' | translate }}

-

{{groupHint}}

-
+

{{ 'SERVICES' | translate }}

+

{{groupHint}}

+

{{'NONE'| translate}}

-
-
-
-

{{ 'ROLES' | translate }}

- -
- To help you choose the correct roles use the table below: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For whomTaskRoles to tick
- Organisational Administrators of Public Procurement Gateway (PPG) - Add an additional PPG administrator -
    -
  • Organisation Administrator - Dashboard Service
  • -
-
Add user to PPG -
    -
  • Organisation User - Dashboard Service
  • -
-
- Buyers - Enable Contract Award Service -
    -
  • eSourcing Service as a buyer
  • -
  • Contract Award Service (CAS) - add service
  • -
  • Contract Award Service (CAS) - add to dashboard
  • -
  • eSourcing Service - add service
  • -
-
Enable eSourcing -
    -
  • eSourcing Service as a buyer -
  • -
  • eSourcing Service - add service -
  • -
  • eSourcing Service - add to dashboard -
  • -
-
SuppliersEnable eSourcing -
    -
  • eSourcing Service as a supplier
  • -
  • eSourcing Service - add service
  • -
  • eSourcing Service - add to dashboard
  • -
-
-
+
+
+
+

{{ 'ROLES' | translate }}

+ +
+ To help you choose the correct roles use the table + below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
For whomTaskRoles to tick
+ Organisational Administrators of Public Procurement Gateway (PPG) + Add an additional PPG administrator +
    +
  • Organisation Administrator - Dashboard Service
  • +
+
Add user to PPG +
    +
  • Organisation User - Dashboard Service
  • +
+
+ Buyers + Enable Contract Award Service +
    +
  • eSourcing Service as a buyer
  • +
  • Contract Award Service (CAS) - add service
  • +
  • Contract Award Service (CAS) - add to dashboard
  • +
  • eSourcing Service - add service
  • +
+
Enable eSourcing +
    +
  • eSourcing Service as a buyer +
  • +
  • eSourcing Service - add service +
  • +
  • eSourcing Service - add to dashboard +
  • +
+
SuppliersEnable eSourcing +
    +
  • eSourcing Service as a supplier
  • +
  • eSourcing Service - add service
  • +
  • eSourcing Service - add to dashboard
  • +
+
+
+
+
+
+

{{ 'SERVICES' | translate }}

+

{{groupHint}}

+
+
-
-

{{ 'SERVICES' | translate }}

-

{{groupHint}}

-
-
-
-
-
-
- -
-
- +
+

+ testing +

+ +
+
+
+ +

{{ 'ACCESS_TO_USER_SERVICE'| translate }}

+

{{ 'ACCESS_TO_REGULAR_USER_SERVICE'| translate }}

+ +
+
+ +
+
+ +
+
+
+
+
+ + + + + Pending Approval + +

{{orgRole.description}}

+
+
+
+ +
+
-
-
-
-
- - - - - Pending Approval - -

{{orgRole.description}}

+
+

{{ + 'ORG_ADMIN_GROUP_ACCESS'| translate }}

+

{{ + 'ORG_USER_GROUP_ACCESS'| translate }}

+ +

{{ + 'ORG_ADMIN_GROUP_ACCESS_NONE'| translate }}

+

{{ + 'ORG_USER_GROUP_ACCESS_NONE'| translate }}

+ +
+
+ +
+
+ +
+
+ +
+
+ + + + Pending Approval + +

{{orgRole.description}} +

+
-
+ +
+ + + +

{{ 'CONTACT_DETAILS' | translate }}

@@ -296,9 +402,9 @@

{{ 'CONTACT_DETAILS' | translate }}< {{ 'ADD_ANOTHER_CONTACT_BTN' | translate }} + class="govuk-button govuk-button--secondary" data-module="govuk-button"> + {{ 'ADD_REMOVE_ORG_CONTACT_BTN' | translate }} + -->

diff --git a/src/app/pages/user-profile/user-profile-component.scss b/src/app/pages/user-profile/user-profile-component.scss index edde89117..428989d32 100644 --- a/src/app/pages/user-profile/user-profile-component.scss +++ b/src/app/pages/user-profile/user-profile-component.scss @@ -175,4 +175,10 @@ table { } .govuk-item-custom .govuk-checkboxes__input + .govuk-checkboxes__label::after { top: 18px; -} \ No newline at end of file +} +.govuk-checkboxes-custom-input .govuk-checkboxes__input:disabled + .govuk-checkboxes__label { + opacity: 1; + } + .govuk-checkboxes-custom-input .govuk-checkboxes__input:disabled + .govuk-checkboxes__label::after , .govuk-checkboxes-custom-input .govuk-checkboxes__input:disabled + .govuk-checkboxes__label::before { + opacity: 0.5; + } \ No newline at end of file diff --git a/src/app/pages/user-profile/user-profile-component.ts b/src/app/pages/user-profile/user-profile-component.ts index 7ac527ad7..c1ba62d1d 100644 --- a/src/app/pages/user-profile/user-profile-component.ts +++ b/src/app/pages/user-profile/user-profile-component.ts @@ -4,7 +4,7 @@ import { Store } from '@ngrx/store'; import { LocationStrategy, ViewportScroller } from '@angular/common'; import { UIState } from 'src/app/store/ui.states'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { UserEditResponseInfo, UserGroup, UserProfileRequestInfo } from 'src/app/models/user'; +import { UserEditResponseInfo, UserGroup, UserProfileRequestInfo, userGroupTableDetail } from 'src/app/models/user'; import { WrapperUserService } from 'src/app/services/wrapper/wrapper-user.service'; import { WrapperUserContactService } from 'src/app/services/wrapper/wrapper-user-contact.service'; import { @@ -15,7 +15,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { OperationEnum } from 'src/app/constants/enum'; import { ScrollHelper } from 'src/app/services/helper/scroll-helper.services'; import { WrapperOrganisationGroupService } from 'src/app/services/wrapper/wrapper-org--group-service'; -import { Role } from 'src/app/models/organisationGroup'; +import { Group, GroupList, Role } from 'src/app/models/organisationGroup'; import { ContactHelper } from 'src/app/services/helper/contact-helper.service'; import { AuthService } from 'src/app/services/auth/auth.service'; import { AuditLoggerService } from 'src/app/services/postgres/logger.service'; @@ -30,14 +30,16 @@ import { WrapperOrganisationService } from 'src/app/services/wrapper/wrapper-org styleUrls: ['./user-profile-component.scss'], }) export class UserProfileComponent extends FormBaseComponent implements OnInit { - public showRoleView:boolean = environment.appSetting.hideSimplifyRole + public showRoleView: boolean = environment.appSetting.hideSimplifyRole submitted!: boolean; formGroup!: FormGroup; - userGroupTableHeaders = ['GROUPS','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.']; - userGroupColumnsToDisplay = ['group','','','','','','','','','','','','','','','','']; userServiceTableHeaders = ['NAME']; userRoleTableHeaders = ['ROLES', 'SERVICE']; + userServiceGroupTableHeaders = ['NAME']; userServiceColumnsToDisplay = ['accessRoleName',] + userServiceGroupColumnsToDisplay = [ + 'name' + ]; userRoleColumnsToDisplay = [ 'accessRoleName', 'serviceName', @@ -60,11 +62,15 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { 'fax', 'webUrl', ]; + public tabConfig = { + userservices: true, + groupservices: false + } public detailsData: any = []; public isAdminUser: boolean = false; userGroups: UserGroup[] = []; public approveRequiredRole: Role[]; - public pendingRoleDetails: any =[] + public pendingRoleDetails: any = [] public selectedApproveRequiredRole: any = [] public pendingRoledeleteDetails: any = [] public organisationDetails: any = {} @@ -78,11 +84,35 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { roleDataList: any[] = []; assignedRoleDataList: any[] = []; routeStateData: any = {}; - hasGroupViewPermission: boolean = false; isOrgAdmin: boolean = false; - private selectedRoleIds:number[] = []; - public groupHint:string='' - private adminRoleKey:string= 'ORG_ADMINISTRATOR'; + private selectedRoleIds: number[] = []; + public groupHint: string = '' + private adminRoleKey: string = 'ORG_ADMINISTRATOR'; + public selectedGroupCheckboxes: any[] = []; + public orgGroups: Group[] = []; + public orgUserGroupRoles: any[] = []; + + public groupsMember: userGroupTableDetail = { + isAdmin: false, + headerText: "Groups assigned", + headerTextKey: "groupName", + accessTable: "groupsMember", + noRoleMessage: "You do not have access to any service through membership of this group.", + noDataGroupsMemberMessage: "You are not member of any group.", + groupShow: true, + data: [], + } + public noneGroupsMember: userGroupTableDetail = { + isAdmin: false, + headerText: "Groups unassigned", + headerTextKey: "groupName", + accessTable: "noneGroupsMember", + noRoleMessage: "You do not have access to any service through membership of this group.", + noDatanoneGroupsMemberMessage: "There are no unassiged groups available for you.", + groupShow: false, + data: [] + } + @ViewChildren('input') inputs!: QueryList; constructor( @@ -98,7 +128,8 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { private contactHelper: ContactHelper, private authService: AuthService, private auditLogService: AuditLoggerService, - private organisationService: WrapperOrganisationService + private organisationService: WrapperOrganisationService, + ) { super( viewportScroller, @@ -115,6 +146,7 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { this.locationStrategy.onPopState(() => { this.onCancelClick(); }); + this.orgGroups = []; } async ngOnInit() { @@ -139,12 +171,7 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { this.identityProviderDisplayName = 'User ID and password' } this.userGroups = user.detail.userGroups || []; - this.userGroups = this.userGroups.filter( - (group, index, self) => - self.findIndex( - (t) => t.groupId === group.groupId && t.group === group.group - ) === index - ); + if (this.routeStateData != undefined) { this.formGroup.setValue({ firstName: this.routeStateData.firstName, @@ -161,48 +188,49 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { } await this.getApprovalRequriedRoles() await this.getPendingApprovalUserRole(); - await this.getOrgDetails() + await this.getOrgDetails(); + //await this.getOrgGroups(); await this.orgGroupService .getOrganisationRoles(this.organisationId) .toPromise() .then((orgRoles: Role[]) => { - orgRoles.map((r:Role,index) =>{ - let userRole = - user.detail.rolePermissionInfo && - user.detail.rolePermissionInfo.some( - (rp) => rp.roleId == r.roleId - ); - if(userRole){ - if ( r.roleKey == this.adminRoleKey && this.isAdminUser == false) { - this.isAdminUser = true; - } - this.formGroup.addControl( - 'orgRoleControl_' + r.roleId, - this.formBuilder.control(this.assignedRoleDataList ? true : '') - ); - } else { - let PendinguserRole = this.pendingRoleDetails.some( - (pendingRole: any) => pendingRole.roleKey == r.roleKey - ); - this.formGroup.addControl( - 'orgRoleControl_' + r.roleId, - this.formBuilder.control(userRole ? true : PendinguserRole ? true : '') - ); - if(userRole){ - r.enabled = true - } - } - }); + orgRoles.map((r: Role, index) => { + let userRole = + user.detail.rolePermissionInfo && + user.detail.rolePermissionInfo.some( + (rp) => rp.roleId == r.roleId + ); + if (userRole) { + if (r.roleKey == this.adminRoleKey && this.isAdminUser == false) { + this.isAdminUser = true; + } + this.formGroup.addControl( + 'orgRoleControl_' + r.roleId, + this.formBuilder.control(this.assignedRoleDataList ? true : '') + ); + } else { + let PendinguserRole = this.pendingRoleDetails.some( + (pendingRole: any) => pendingRole.roleKey == r.roleKey + ); + this.formGroup.addControl( + 'orgRoleControl_' + r.roleId, + this.formBuilder.control(userRole ? true : PendinguserRole ? true : '') + ); + if (userRole) { + r.enabled = true + } + } + }); //bind Roles based on User Type if (this.isAdminUser == true) { - orgRoles.forEach((element:any) => { + orgRoles.forEach((element: any) => { this.roleDataList.push({ roleId: element.roleId, roleKey: element.roleKey, accessRoleName: element.roleName, serviceName: element.serviceName, - description:element.description + description: element.description }); this.formGroup.addControl( 'orgRoleControl_' + element.roleId, @@ -219,11 +247,11 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { }); } }); - this.groupHint = "Select the services that you need access to." + this.groupHint = "Select the services that you need access to." } else { user.detail.rolePermissionInfo && user.detail.rolePermissionInfo.map((roleInfo) => { - var orgRole:any = orgRoles.find((r) => r.roleId == roleInfo.roleId); + var orgRole: any = orgRoles.find((r) => r.roleId == roleInfo.roleId); if (orgRole) { switch (orgRole.roleKey) { case 'CAT_USER': { @@ -258,22 +286,32 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { this.roleDataList.push({ accessRoleName: orgRole.roleName, serviceName: orgRole.serviceName, - description:orgRole.description, - serviceView:!this.showRoleView + description: orgRole.description, + serviceView: !this.showRoleView, + approvalStatus: 1 + }); + } + }); + + //Adding the pending approval service to the user role list with label pending approval + this.pendingRoleDetails && this.pendingRoleDetails.map((roleInfo: any) => { + var orgRole: any = orgRoles.find((r) => r.roleId == roleInfo.roleId); + if (orgRole) { + this.roleDataList.push({ + accessRoleName: orgRole.roleName, + serviceName: orgRole.serviceName, + description: orgRole.description, + serviceView: !this.showRoleView, + approvalStatus: roleInfo.approvalStatus }); } }); - this.groupHint = "These are the services that you have access to." - } - }); - this.authService - .hasPermission('MANAGE_GROUPS') - .toPromise() - .then((hasPermission: boolean) => { - this.hasGroupViewPermission = hasPermission; + this.groupHint = "These are the services that you have access to." + } }); + this.getUserContact(this.userName); this.onFormValueChange(); @@ -292,6 +330,8 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { 'Send messages to multiple contacts in your organisation. You can also send targeted communications to specific users.', ]; } + + await this.getOrgGroups(); } ngAfterViewChecked() { @@ -319,9 +359,10 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { } async getOrgDetails() { - if(this.isOrgAdmin){ - this.organisationDetails = await this.organisationService.getOrganisation(this.organisationId).toPromise().catch(e => { - });} + if (this.isOrgAdmin) { + this.organisationDetails = await this.organisationService.getOrganisation(this.organisationId).toPromise().catch(e => { + }); + } } async getPendingApprovalUserRole() { @@ -395,6 +436,7 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { detail: { id: 0, roleIds: this.getSelectedRoleIds(form), + groupIds: this.selectedGroupCheckboxes }, firstName: form.get('firstName')?.value, lastName: form.get('lastName')?.value, @@ -416,27 +458,10 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { this.router.navigateByUrl('home'); } - onGroupViewClick(event: any) { - var formData = { - firstName: this.formGroup.get('firstName')?.value, - lastName: this.formGroup.get('lastName')?.value, - }; - let data = { - isEdit: false, - groupId: event.groupId, - url: this.router.url, - accessFrom:"users", - isUserAccess:false - }; - this.router.navigateByUrl( - 'manage-groups/view?data=' + JSON.stringify(data), - { state: { formData: formData, routeUrl: this.router.url } } - ); - } getSelectedRoleIds(form: FormGroup) { - if(this.organisationDetails.detail == undefined){ + if (this.organisationDetails.detail == undefined) { return } this.selectedRoleIds = []; @@ -450,7 +475,7 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { if (filterRole === undefined) { this.selectedRoleIds.push(role.roleId) } else { - this.checkPendingRoleDetails(role) + this.checkPendingRoleDetails(role) } } else { this.selectedRoleIds.push(role.roleId) @@ -462,32 +487,32 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { return this.selectedRoleIds; } - private checkPendingRoleDetails(role:any){ + private checkPendingRoleDetails(role: any) { let filterAlreadyExistRole = this.pendingRoleDetails.find((element: { roleKey: any; }) => element.roleKey == role.roleKey) if (this.pendingRoleDetails.length == 0) { this.updateSelectedRoleIds(role) - } else if(filterAlreadyExistRole?.roleKey != role.roleKey) { + } else if (filterAlreadyExistRole?.roleKey != role.roleKey) { this.selectedApproveRequiredRole.push(role.roleId) } // Remove below line to seperate normal and approval required role. It is added as we will not be using seperate api. Only user update api will be used - else if(filterAlreadyExistRole?.roleKey == role.roleKey){ + else if (filterAlreadyExistRole?.roleKey == role.roleKey) { this.selectedRoleIds.push(role.roleId) } - } + } - private updateSelectedRoleIds(role:any){ - if(role.enabled === true){ + private updateSelectedRoleIds(role: any) { + if (role.enabled === true) { this.selectedRoleIds.push(role.roleId) } else { this.selectedApproveRequiredRole.push(role.roleId) } - } + } /** * checking approve required roles are availble */ private checkApproveRolesSelected() { - if(this.organisationDetails.detail == undefined){ + if (this.organisationDetails.detail == undefined) { this.updateUser() return } @@ -509,13 +534,13 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { }) }) localStorage.setItem('user_approved_role', JSON.stringify(matchRoles)); - localStorage.setItem('user_access_name',this.userName); + localStorage.setItem('user_access_name', this.userName); } this.submitPendingApproveRole(superAdminDomain === userDomain); } - private submitPendingApproveRole(isValidDomain:boolean): void { + private submitPendingApproveRole(isValidDomain: boolean): void { let selectedRolesDetails = { userName: this.userName, organisationId: this.organisationDetails.detail.organisationId, @@ -526,32 +551,32 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { if (this.selectedApproveRequiredRole.length != 0 && !isValidDomain) { this.userService.createPendingApproveRole(selectedRolesDetails).subscribe({ next: (roleInfo: UserEditResponseInfo) => { - this.checkDeleteStatusForPendingRole() + this.checkDeleteStatusForPendingRole() }, error: (err: any) => { console.log(err) }, }); } else { - this.checkDeleteStatus() + this.checkDeleteStatus() } } - private checkDeleteStatusForPendingRole(){ - if (this.pendingRoledeleteDetails.length === 0) { - this.updateUser() - } else { - this.deleteApprovePendingRole() - } + private checkDeleteStatusForPendingRole() { + if (this.pendingRoledeleteDetails.length === 0) { + this.updateUser() + } else { + this.deleteApprovePendingRole() } + } - private checkDeleteStatus(){ - if (this.pendingRoledeleteDetails.length != 0) { - this.deleteApprovePendingRole() - } else { - this.updateUser() - } + private checkDeleteStatus() { + if (this.pendingRoledeleteDetails.length != 0) { + this.deleteApprovePendingRole() + } else { + this.updateUser() } + } private updateUser(): void { @@ -581,17 +606,17 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { // } // } } - - private removePendingRole(obj:any){ + + private removePendingRole(obj: any) { let pendingRole = this.pendingRoledeleteDetails.find((element: number) => element == obj.roleId) - if (pendingRole != undefined) { - this.pendingRoledeleteDetails.forEach((pRole: any, index: any) => { - if (pRole === obj.roleId) { - this.pendingRoledeleteDetails.splice(index, 1) - } - }) + if (pendingRole != undefined) { + this.pendingRoledeleteDetails.forEach((pRole: any, index: any) => { + if (pRole === obj.roleId) { + this.pendingRoledeleteDetails.splice(index, 1) } - } + }) + } + } private deleteApprovePendingRole(): void { const deleteRoleIds = this.pendingRoledeleteDetails.join(); @@ -628,11 +653,80 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit { } } - public getDisbleRole(orgRole:any){ - if(orgRole === 'ORG_DEFAULT_USER' || orgRole === 'ORG_ADMINISTRATOR'){ - return true - } else { - return null - } + async getOrgGroups() { + const orgGrpList = await this.orgGroupService.getOrganisationGroupsWithRoles(this.organisationId).toPromise(); + this.orgGroups = orgGrpList.groupList; + for (const group of this.orgGroups) { + const isGroupOfUser: any = this.userGroups?.find((ug) => ug.groupId === group.groupId); + if (isGroupOfUser) { + + group.serviceRoleGroups.map((fc: any) => { + var serviceGroupApprovalDetails: any = this.userGroups?.find((ug: any) => ug.groupId === group.groupId && ug.accessServiceRoleGroupId === fc.id); + fc.approvalStatus = serviceGroupApprovalDetails?.approvalStatus; + }); + + group.checked = true + group.serviceRoleGroups = group.serviceRoleGroups.filter((item: any) => item.approvalStatus === 0 || item.approvalStatus === 1); + this.groupsMember.data.push(group) + this.selectedGroupCheckboxes.push(group.groupId) + + group.serviceRoleGroups.forEach((element: any) => { + let groupRoles = this.orgUserGroupRoles.filter(e => { return e.id == element.id }); + if (groupRoles.length <= 0 && (element.approvalStatus == 0 || element.approvalStatus == 1)) { + element.serviceView = true; + this.orgUserGroupRoles.push(element); + } + }); + } else { + if (this.isAdminUser) { + this.noneGroupsMember.data.push(group) + } + } + } + this.groupsMember.isAdmin = this.isAdminUser; + this.noneGroupsMember.isAdmin = this.isAdminUser; + } + + public groupsMemberCheckBoxAddRoles(data: any) { + this.formChanged = true; + this.selectedGroupCheckboxes.push(data.groupId); + } + + public groupsMemberCheckBoxRemoveRoles(data: any) { + this.formChanged = true; + this.selectedGroupCheckboxes = this.removeObjectById(this.selectedGroupCheckboxes, data.groupId) + } + + public noneGroupsMemberCheckBoxAddRoles(data: any) { + this.formChanged = true; + this.selectedGroupCheckboxes.push(data.groupId); + } + + public noneGroupsMemberCheckBoxRemoveRoles(data: any) { + this.formChanged = true; + this.selectedGroupCheckboxes = this.removeObjectById(this.selectedGroupCheckboxes, data.groupId) + } + + private removeObjectById(arr: any, id: any) { + return arr.filter((item: any) => item !== id); + } + + public getDisbleRole(orgRole: any) { + if (orgRole === 'ORG_DEFAULT_USER' || orgRole === 'ORG_ADMINISTRATOR') { + return true + } else { + return null + } + } + + public tabChanged(activetab: string): void { + if (activetab === 'userservices') { + this.tabConfig.userservices = true + this.tabConfig.groupservices = false + } else { + this.tabConfig.groupservices = true + this.tabConfig.userservices = false + } } -} + +} \ No newline at end of file diff --git a/src/app/services/wrapper/wrapper-org--group-service.ts b/src/app/services/wrapper/wrapper-org--group-service.ts index 54a646eef..a958e92cf 100644 --- a/src/app/services/wrapper/wrapper-org--group-service.ts +++ b/src/app/services/wrapper/wrapper-org--group-service.ts @@ -44,6 +44,17 @@ export class WrapperOrganisationGroupService { ); } + getOrganisationGroupsWithRoles(organisationId: string, searchString: string = ''): Observable { + const url = `${this.url}/${organisationId}/groups/servicerolegroups?search-string=${encodeURIComponent(searchString)}`; + return this.http.get(url).pipe( + map((data: GroupList) => { + return data; + }), catchError(error => { + return throwError(error); + }) + ); + } + getOrganisationGroup(organisationId: string, groupId: number): Observable { if (!environment.appSetting.hideSimplifyRole) { const url = `${this.url}/${organisationId}/groups/${groupId}/servicerolegroups`; diff --git a/src/app/services/wrapper/wrapper-user.service.ts b/src/app/services/wrapper/wrapper-user.service.ts index 9c58bf19f..93098ed36 100644 --- a/src/app/services/wrapper/wrapper-user.service.ts +++ b/src/app/services/wrapper/wrapper-user.service.ts @@ -135,6 +135,7 @@ export class WrapperUserService { roleId: role.id, roleKey:role.key, roleName: role.name, + approvalStatus: role.status } roleInfo.push(structureObj) }) diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index b7aaede0f..24c4a161d 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -372,5 +372,16 @@ "CONFIRM_EMAIL":"Confirm email address", "NOTIFICATION_SENT":"Notification sent", "DUP_ORG":"Duplicate organisations", - "ACCESS_TO_USER":"Select the services that this user needs access to." + "ACCESS_TO_USER":"Select the services that this user needs access to.", + "ACCESS_TO_USER_SERVICE": "Select the services that this user needs access to as an individual, rather than through their membership of a group.", + "ACCESS_TO_GROUP_SEVICE": "This user has access to the following services through their membership of one or more groups. You can manage group membership, and access to services, through the dashboard.", + "ACCESS_TO_USER_ROLE": "Select the services that this user needs access to. You can also view the services that this user has access to through their membership of any groups.", + "NO_GROUP_ROLE_ACCESS_ADDUSER": "This user does not have access to any service through their membership of a group. You can manage group membership, and access to services, through the dashboard.", + "ORG_USER_INDIVIDUAL_ACCESS": "These services are assigned to you as an individual, rather than through your membership of a group.", + "ORG_USER_GROUP_ACCESS": "You have access to the following services through your membership of one or more groups.", + "ORG_USER_GROUP_ACCESS_NONE": "You do not have access to any service through your membership of a group.", + "ORG_ADMIN_GROUP_ACCESS": "You have access to the following services through your membership of one or more groups. You can manage group membership, and access to services, through the dashboard.", + "ORG_ADMIN_GROUP_ACCESS_NONE": "You do not have access to any service through your membership of a group. You can manage group membership, and access to services, through the dashboard.", + "PENDING_LABEL" : "Pending Approval", + "ACCESS_TO_REGULAR_USER_SERVICE": "These services are assigned to you as an individual, rather than through your membership of a group." }