Skip to content

Commit

Permalink
Ppg 289 create log in delegation (#1384)
Browse files Browse the repository at this point in the history
* #

* api call updated

* P3sprint10 (#1369)

* Implemented tasks 5544 and 5596. Fixed bug 5632 (#1327)

* dependabot issue has been fixed (#1328)

* Task 5597: PPG-41 - Error validation UI issues (red line next to fields) (#1330)

* Task 5597: PPG-41 - Error validation UI issues (red line next to fields)

* Modified-toolkit.css

* Updated-toolkit.css

---------

Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>

* task has been completed (#1333)

* changes are done (#1334)

* Fixed changes from 5544 and 5596 (#1336)

* Implemented tasks 5544 and 5596. Fixed bug 5632

* Fixed Issues from task 5544 PPG-266 New content for 'Additional security' checkbox and 5596 PPG-257 - User type selector - manage groups/MSE

* PPG 257 UI changes (#1340)

* common component functionlity is completed

* Task 5595: PPG-257 - User type selector - Brijesh's task

* Task 5595: PPG-257 - User type selector - profile changes

* User type implementation for manage users

* Task 5595: PPG-257 - User type selector - Brijesh's task

* Task 5595: PPG-257 - User type selector - Brijesh's task

---------

Co-authored-by: ajithmuthukumar-bc <ajith.muthukumar@brickendon.com>
Co-authored-by: chudasama brijrajsinh <chudasama.brijrajsinh@brickendon.com>

* Feature/ppg 41 task 5597 errorvalidation (#1346)

* Task 5597: PPG-41 - Error validation UI issues (red line next to fields)

* Modified-toolkit.css

* Updated-toolkit.css

* ChangesUpdated-PPG-41

---------

Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>

* Fixed Bug 5652: Incorrect content is displaying in Manage users(Add/Edit) (#1347)

* Implemented tasks 5544 and 5596. Fixed bug 5632

* Fixed Issues from task 5544 PPG-266 New content for 'Additional security' checkbox and 5596 PPG-257 - User type selector - manage groups/MSE

* Fixed Bug Bug 5652: Incorrect content is displaying in Manage users(Add/Edit)

* mfa issue fixed (#1350)

* Hide default users from groups, Cosmatic bugs (#1353)

* issues has been fixed (#1362)

* changes are updated into p3sprint10 (#1367)

---------

Co-authored-by: jukibaskar-bc <130968637+jukibaskar-bc@users.noreply.github.com>
Co-authored-by: saranyadevi-bc <131144031+saranyadevi-bc@users.noreply.github.com>
Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>
Co-authored-by: brijeshpatel-bc <108462846+brijeshpatel-bc@users.noreply.github.com>
Co-authored-by: chudasama brijrajsinh <chudasama.brijrajsinh@brickendon.com>
Co-authored-by: brijrajsinh-bc <109584978+brijrajsinh-bc@users.noreply.github.com>

* P3sprint10 (#1371)

* Implemented tasks 5544 and 5596. Fixed bug 5632 (#1327)

* dependabot issue has been fixed (#1328)

* Task 5597: PPG-41 - Error validation UI issues (red line next to fields) (#1330)

* Task 5597: PPG-41 - Error validation UI issues (red line next to fields)

* Modified-toolkit.css

* Updated-toolkit.css

---------

Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>

* task has been completed (#1333)

* changes are done (#1334)

* Fixed changes from 5544 and 5596 (#1336)

* Implemented tasks 5544 and 5596. Fixed bug 5632

* Fixed Issues from task 5544 PPG-266 New content for 'Additional security' checkbox and 5596 PPG-257 - User type selector - manage groups/MSE

* PPG 257 UI changes (#1340)

* common component functionlity is completed

* Task 5595: PPG-257 - User type selector - Brijesh's task

* Task 5595: PPG-257 - User type selector - profile changes

* User type implementation for manage users

* Task 5595: PPG-257 - User type selector - Brijesh's task

* Task 5595: PPG-257 - User type selector - Brijesh's task

---------

Co-authored-by: ajithmuthukumar-bc <ajith.muthukumar@brickendon.com>
Co-authored-by: chudasama brijrajsinh <chudasama.brijrajsinh@brickendon.com>

* Feature/ppg 41 task 5597 errorvalidation (#1346)

* Task 5597: PPG-41 - Error validation UI issues (red line next to fields)

* Modified-toolkit.css

* Updated-toolkit.css

* ChangesUpdated-PPG-41

---------

Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>

* Fixed Bug 5652: Incorrect content is displaying in Manage users(Add/Edit) (#1347)

* Implemented tasks 5544 and 5596. Fixed bug 5632

* Fixed Issues from task 5544 PPG-266 New content for 'Additional security' checkbox and 5596 PPG-257 - User type selector - manage groups/MSE

* Fixed Bug Bug 5652: Incorrect content is displaying in Manage users(Add/Edit)

* mfa issue fixed (#1350)

* Hide default users from groups, Cosmatic bugs (#1353)

* issues has been fixed (#1362)

* changes are updated into p3sprint10 (#1367)

---------

Co-authored-by: jukibaskar-bc <130968637+jukibaskar-bc@users.noreply.github.com>
Co-authored-by: saranyadevi-bc <131144031+saranyadevi-bc@users.noreply.github.com>
Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>
Co-authored-by: brijeshpatel-bc <108462846+brijeshpatel-bc@users.noreply.github.com>
Co-authored-by: chudasama brijrajsinh <chudasama.brijrajsinh@brickendon.com>
Co-authored-by: brijrajsinh-bc <109584978+brijrajsinh-bc@users.noreply.github.com>

* Ppg 235 237 239 changes (#1373)

* issue fixes

* task completed

* #

* #

* task completed buddy check done with satha

---------

Co-authored-by: jukibaskar-bc <130968637+jukibaskar-bc@users.noreply.github.com>
Co-authored-by: saranyadevi-bc <131144031+saranyadevi-bc@users.noreply.github.com>
Co-authored-by: SARANYA <SARANYA@DESKTOP-1G4R5OO>
Co-authored-by: brijeshpatel-bc <108462846+brijeshpatel-bc@users.noreply.github.com>
Co-authored-by: chudasama brijrajsinh <chudasama.brijrajsinh@brickendon.com>
Co-authored-by: brijrajsinh-bc <109584978+brijrajsinh-bc@users.noreply.github.com>
  • Loading branch information
7 people authored May 18, 2023
1 parent 5155a88 commit 0fb82b1
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="table-scroll">
<div class="table_custom" *ngIf="pageName != 'eventLog'">
<table class="govuk-table" *ngIf="tableVisibleData.length != 0; else no_results">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
Expand All @@ -23,6 +24,41 @@
</tr>
</tbody>
</table>
</div>
<div class="table_custom" *ngIf="pageName == 'eventLog'">
<table class="govuk-table" *ngIf="tableVisibleData.length != 0; else no_results">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header app-custom-class">Owner</th>
<th scope="col" class="govuk-table__header app-custom-class">Event</th>
<th scope="col" class="govuk-table__header app-custom-class">Date</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row" *ngFor="let dataRow of tableVisibleData; let index = index">
<td class="govuk-table__cell">
<div *ngIf="dataRow.actionedBy === 'Admin'">
<span>{{dataRow.actionedByFirstName}} {{dataRow.actionedByLastName}}</span><br>
<span>{{dataRow.actionedByUserName}}</span>
</div>
<div *ngIf="dataRow.actionedBy != 'Admin'">
<span>Automatic</span>
</div>
</td>
<td class="govuk-table__cell">
<span>{{dataRow.eventLog.name}}</span>
<div *ngFor="let columnData of dataRow.eventLog.column">
<span >{{columnData.name}} : {{ columnData.date | date: 'dd/MM/yyyy'}}</span>
</div>
</td>
<td class="govuk-table__cell">
<span> {{dataRow.actionedOnUtc | date: 'dd/MM/yyyy'}}</span><br>
<span >{{ dataRow.actionedOnUtc | date: 'HH:mm'}}</span>
</td>
</tr>
</tbody>
</table>
</div>
<ng-template #no_results>
<p class="govuk-body govuk-!-font-weight-bold">
There are no matching results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,21 @@ <h1 class="govuk-fieldset__heading govuk-!-font-size-24">
</fieldset>
</div>
<!-- user permission -->
<div class="span-group govuk-!-margin-top-4" *ngIf="pageAccessMode == 'edit'">
<h2 class="govuk-heading-m">Event log</h2>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="user-table">
<app-custom-govuk-table [headerTextKeys]="eventLogForActiveUser.usersTableHeaders"
[data]="eventLogForActiveUser.delegationAuditEventDetails.delegationAuditEventServiceRoleGroupList"
[dataKeys]="eventLogForActiveUser.usersColumnsToDisplay" [isHyperLinkVisible]="false"
[useServerPagination]="true" [serverPageCount]="eventLogForActiveUser.pageCount"
[serverPageCurrentPage]="eventLogForActiveUser.currentPage" [pageName]="eventLogForActiveUser.pageName"
(changeCurrentPageEvent)="setPageOrganisationEventLogs($event)"></app-custom-govuk-table>
</div>
</div>
</div>
</div>
<br>
<a *ngIf="pageAccessMode == 'edit' && !delegationAccepted" href="javascript:;"
class="navigation-text" (click)="Resentactivation()"> Resend activation link </a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,44 @@ export class DelegatedAccessUserComponent implements OnInit {
private RoleInfo: any = []
private userSelectedFormData: any;
public hideSimplifyRole = environment.appSetting.hideSimplifyRole;
private userId:number= 0
public eventLogForActiveUser: any = {
delegationAuditEventDetails: {
currentPage: 0,
pageCount: 0,
rowCount: 0,
organisationId: '',
delegationAuditEventServiceRoleGroupList: [],
},
usersTableHeaders: ['Owner', 'Event', 'Date'],
usersColumnsToDisplay: ['owner', 'event', 'date'],
currentPage: 1,
pageCount: 0,
pageName:"eventLog",
pageSize: environment.listPageSize,
};
public isStartDateDisabled:boolean=false;

@ViewChildren('input') inputs!: QueryList<ElementRef>;
constructor(
private route: Router,
private DelegatedService: WrapperUserDelegatedService,
private DelegatedApiService: WrapperUserDelegatedService,
private formbuilder: FormBuilder,
private ManageDelegateService: ManageDelegateService,
private orgRoleService: WrapperOrganisationGroupService,
protected scrollHelper: ScrollHelper,
private ActivatedRoute: ActivatedRoute,
private titleService: Title
private titleService: Title,
private DelegatedService: ManageDelegateService,
) {
this.organisationId = localStorage.getItem('cii_organisation_id') || '';
this.userSelectedFormData = sessionStorage.getItem('deleagted_user_details')
this.eventLogForActiveUser.delegationAuditEventDetails = {
currentPage: this.eventLogForActiveUser.currentPage,
pageCount: 0,
rowCount: 0,
organisationId: this.organisationId,
delegationAuditEventServiceRoleGroupList: [],
};
}

ngOnInit(): void {
Expand All @@ -57,12 +80,14 @@ export class DelegatedAccessUserComponent implements OnInit {
this.ActivatedRoute.queryParams.subscribe((para: any) => {
this.userDetails = JSON.parse(atob(para.data));
this.userDetails.userName = decodeURIComponent(unescape(this.userDetails.userName));
this.userId = this.userDetails.id
this.pageAccessMode = this.userDetails.pageaccessmode
if (this.userSelectedFormData) {
this.userSelectedData(this.userDetails.userName, this.organisationId)
}
else if (this.pageAccessMode === 'edit') {
this.getUserDetails(this.userDetails.userName, this.organisationId, this.userDetails.startDate, this.userDetails.endDate, this.userDetails.delegationAccepted)
this.getEventLogDetailsForActiveUser()
this.titleService.setTitle(
`${'Edit current delegated access'} - CCS`
);
Expand Down Expand Up @@ -104,7 +129,7 @@ export class DelegatedAccessUserComponent implements OnInit {
let data = JSON.parse(this.userSelectedFormData)
this.userSelectedFormData = JSON.parse(data)
setTimeout(() => {
this.DelegatedService.getEdituserDetails(userId, delegatedOrgId).subscribe({
this.DelegatedApiService.getEdituserDetails(userId, delegatedOrgId).subscribe({
next: (response: any) => {
this.getOrgRoles()
this.RoleInfo = this.userSelectedFormData
Expand Down Expand Up @@ -139,7 +164,7 @@ export class DelegatedAccessUserComponent implements OnInit {
*/
public getUserDetails(userId: string, delegatedOrgId: string, startDateFromListPage: any, endDateFromListPage: any, delegationAcceptedFromListPage: any) {
setTimeout(() => {
this.DelegatedService.getEdituserDetails(userId, delegatedOrgId).subscribe({
this.DelegatedApiService.getEdituserDetails(userId, delegatedOrgId).subscribe({
next: (response: any) => {
this.getOrgRoles()
this.RoleInfo = response
Expand Down Expand Up @@ -529,4 +554,16 @@ export class DelegatedAccessUserComponent implements OnInit {
this.route.navigateByUrl(path)
sessionStorage.removeItem('deleagted_user_details')
}

public setPageOrganisationEventLogs(pageNumber: any) {
this.eventLogForActiveUser.currentPage = pageNumber;
this.getEventLogDetailsForActiveUser();
}

private getEventLogDetailsForActiveUser(): void {
this.DelegatedApiService.getDelegatedEventLogs(this.eventLogForActiveUser.pageSize, this.eventLogForActiveUser.currentPage, this.userId).subscribe((response) => {
this.eventLogForActiveUser.delegationAuditEventDetails.delegationAuditEventServiceRoleGroupList = this.DelegatedService.matchDelegatedDetailsOne(response.delegationAuditEventServiceRoleGroupList)
this.eventLogForActiveUser.pageCount = response.pageCount;
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ <h1 class="govuk-fieldset__heading govuk-!-font-size-24">
</fieldset>
</div>
<!-- user permission -->
<div class="span-group govuk-!-margin-top-4">
<h2 class="govuk-heading-m">Event log</h2>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="user-table">
<app-custom-govuk-table [headerTextKeys]="eventLog.usersTableHeaders"
[data]="eventLog.delegationAuditEventDetails.delegationAuditEventServiceRoleGroupList"
[dataKeys]="eventLog.usersColumnsToDisplay" [isHyperLinkVisible]="false"
[useServerPagination]="true" [serverPageCount]="eventLog.pageCount"
[serverPageCurrentPage]="eventLog.currentPage" [pageName]="eventLog.pageName"
(changeCurrentPageEvent)="setPageOrganisationEventLogs($event)"></app-custom-govuk-table>
</div>
</div>
</div>
</div>

<button type="button" class="govuk-button govuk-button--secondary" data-module="govuk-button"
(click)="Back()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Role } from 'src/app/models/organisationGroup';
import { WrapperOrganisationGroupService } from 'src/app/services/wrapper/wrapper-org--group-service';
import { WrapperUserDelegatedService } from 'src/app/services/wrapper/wrapper-user-delegated.service';
import { environment } from 'src/environments/environment';
import { ManageDelegateService } from '../service/manage-delegate.service';

@Component({
selector: 'app-delegated-user-status',
Expand All @@ -23,25 +24,50 @@ export class DelegatedUserStatusComponent implements OnInit {
Breadcrumb: '',
status: '',
};

public eventLog: any = {
usersTableHeaders: ['Owner', 'Event', 'Date'],
usersColumnsToDisplay: ['owner', 'event', 'date'],
currentPage: 1,
pageCount: 0,
pageName: 'eventLog',
pageSize: environment.listPageSize,
delegationAuditEventDetails: {
currentPage: 0,
pageCount: 0,
rowCount: 0,
organisationId: '',
delegationAuditEventServiceRoleGroupList: [],
},
};
hideSimplifyRole: boolean = environment.appSetting.hideSimplifyRole;

constructor(
private route: ActivatedRoute,
private router: Router,
private orgRoleService: WrapperOrganisationGroupService,
private formbuilder: FormBuilder,
private DelegatedService: WrapperUserDelegatedService,
private titleService: Title,
private DelegatedService: ManageDelegateService,
private DelegationApiService: WrapperUserDelegatedService,
private titleService: Title
) {
this.organisationId = localStorage.getItem('cii_organisation_id') || '';
this.eventLog.delegationAuditEventDetails = {
currentPage: this.eventLog.currentPage,
pageCount: 0,
rowCount: 0,
organisationId: this.organisationId,
delegationAuditEventServiceRoleGroupList: [],
};
}

ngOnInit(): void {
this.route.queryParams.subscribe((para: any) => {
let RouteData: any = JSON.parse(atob(para.data));
if (RouteData.event) {
RouteData.event.userName = decodeURIComponent(unescape(RouteData.event.userName));
console.log('RouteData.event', RouteData.event);
RouteData.event.userName = decodeURIComponent(
unescape(RouteData.event.userName)
);
}
switch (RouteData.status) {
case '001': {
Expand All @@ -53,9 +79,7 @@ export class DelegatedUserStatusComponent implements OnInit {
}
case '002': {
this.UserStatus = RouteData;
this.titleService.setTitle(
`${'User not found'} - CCS`
);
this.titleService.setTitle(`${'User not found'} - CCS`);
break;
}
case '003': {
Expand All @@ -73,7 +97,7 @@ export class DelegatedUserStatusComponent implements OnInit {
this.titleService.setTitle(
`${'View expired delegated access'} - CCS`
);
this.getUserDetails(RouteData)
this.getUserDetails(RouteData);
//statements;
break;
}
Expand All @@ -83,43 +107,51 @@ export class DelegatedUserStatusComponent implements OnInit {
}
}
});
this.getEventLogDetails();
}


public getUserDetails(response: any) {
const startDate = response.event.startDate.split('-')
const endDate = response.event.endDate.split('-')
const startDate = response.event.startDate.split('-');
const endDate = response.event.endDate.split('-');
this.formGroup.patchValue({
startday: startDate[2].slice(0, 2),
startmonth: startDate[1],
startyear: startDate[0],
endday: endDate[2].slice(0, 2),
endmonth: endDate[1],
endyear: endDate[0]
endyear: endDate[0],
});
this.getOrgRoles(response)
this.getOrgRoles(response);
}
public getOrgRoles(roleResponse: any): void {
this.orgRoleService.getOrganisationRoles(this.organisationId).toPromise().then((response: Role[]) => {
let orgRoles = response
orgRoles.forEach((f) => {
roleResponse.event.rolePermissionInfo.forEach((element: any) => {
if (element.roleId === f.roleId) {
this.roleDataList.push({
roleId: f.roleId,
roleKey: f.roleKey,
accessRoleName: f.roleName,
serviceName: f.serviceName,
description: f.description
});
this.formGroup.addControl(
'orgRoleControl_' + element.roleId,
this.formbuilder.control(true)
);
}
this.orgRoleService
.getOrganisationRoles(this.organisationId)
.toPromise()
.then((response: Role[]) => {
let orgRoles = response;
orgRoles.forEach((f) => {
roleResponse.event.rolePermissionInfo.forEach((element: any) => {
if (element.roleId === f.roleId) {
this.roleDataList.push({
roleId: f.roleId,
roleKey: f.roleKey,
accessRoleName: f.roleName,
serviceName: f.serviceName,
description: f.description,
});
this.formGroup.addControl(
'orgRoleControl_' + element.roleId,
this.formbuilder.control(true)
);
}
});
});
})
})
});
}

public setPageOrganisationEventLogs(pageNumber: any) {
this.eventLog.currentPage = pageNumber;
this.getEventLogDetails();
}

public BackToDelegated(): void {
Expand All @@ -129,11 +161,27 @@ export class DelegatedUserStatusComponent implements OnInit {
this.router.navigateByUrl('home');
}
public Back(): void {
sessionStorage.setItem('activetab', 'expiredusers')
sessionStorage.setItem('activetab', 'expiredusers');
window.history.back();
}
public goToDelegatedAccessPage() {
sessionStorage.setItem('activetab', 'expiredusers')
sessionStorage.setItem('activetab', 'expiredusers');
this.router.navigateByUrl('delegated-access');
}

private getEventLogDetails(): void {
this.DelegationApiService.getDelegatedEventLogs(
this.eventLog.pageSize,
this.eventLog.currentPage,
this.UserStatus.event.id
).subscribe((response) => {
this.eventLog.delegationAuditEventDetails = response;
this.eventLog.delegationAuditEventDetails.delegationAuditEventServiceRoleGroupList
=
this.DelegatedService.matchDelegatedDetailsOne(
response.delegationAuditEventServiceRoleGroupList
);
this.eventLog.pageCount = response.pageCount;
});
}
}
Loading

0 comments on commit 0fb82b1

Please sign in to comment.