-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AdminUI: Display of the Identity deletion audit log for deleted ident…
…ities (#684) * feat: add components template * feat: add template for endpoint * feat: add query to retrieve audit logs of identity * test: add unit tests for new audti log query * feat: add endpoint for identity deletion process audit logs * test: update sdk and integration tests * test: refactor and add test for multiple deletion processes * feat: add deletion process audit logs for an identity page * chore: run prettier * fix: change the type * chore: make the table present correct data * fix: audit logs of deleted identities should be returned * fix: should not check for identity existence since behavior should work for deleted identities * refactor: remove unnecessary produces error attribute * chore: add deletion process cancellation to admin api sdk * refactor: hash identity outside repository * test: create test data generator method to create cancelled deletion process * test: add deletion processes in different statuses to test * refactor: order audit log entries by created at * fix: the header title and remove expansion panel * fix: formatting * fix: minimize the top margin * fix: remove uneccasary sorting * test: refactor unit tests to use fake dbcontext * test: simplify Handler tests * refactor: change order of CreateDbContexts return values * refactor: extract common code into private method * refactor: add IEventBus parameter to DevicesDbContext --------- Co-authored-by: Daniel Almeida <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Timo Notheisen <[email protected]>
- Loading branch information
1 parent
4bf6548
commit 28a36ac
Showing
36 changed files
with
857 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
AdminApi.Sdk/Endpoints/Identities/Types/IdentityDeletionProcessAuditLogEntryDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Backbone.AdminApi.Sdk.Endpoints.Identities.Types; | ||
|
||
public class IdentityDeletionProcessAuditLogEntryDTO | ||
{ | ||
public required string Id { get; set; } | ||
public required DateTime CreatedAt { get; set; } | ||
public required string MessageKey { get; set; } | ||
public required string? OldStatus { get; set; } | ||
public required string NewStatus { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
AdminApi.Sdk/Endpoints/Identities/Types/Responses/CancelDeletionProcessAsSupport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Backbone.AdminApi.Sdk.Endpoints.Identities.Types.Responses; | ||
|
||
public class CancelDeletionAsSupportResponse | ||
{ | ||
public required string Id { get; set; } | ||
public required string Status { get; set; } | ||
public required DateTime CancelledAt { get; set; } | ||
} |
5 changes: 5 additions & 0 deletions
5
....Sdk/Endpoints/Identities/Types/Responses/ListIdentityDeletionProcessAuditLogsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Backbone.BuildingBlocks.SDK.Endpoints.Common.Types; | ||
|
||
namespace Backbone.AdminApi.Sdk.Endpoints.Identities.Types.Responses; | ||
|
||
public class ListIdentityDeletionProcessAuditLogsResponse : EnumerableResponseBase<IdentityDeletionProcessAuditLogEntryDTO>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
...udit-logs/dp-audit-logs-details/dp-audit-logs-details/dp-audit-logs-details.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
.container { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.column { | ||
flex: 1; | ||
} | ||
|
||
.action-buttons { | ||
margin-top: 20px; | ||
display: flex; | ||
justify-content: flex-end; | ||
} | ||
|
||
.header-description { | ||
color: #fff; | ||
} | ||
|
||
.action-buttons button { | ||
margin: 10px; | ||
} | ||
|
||
.form-card { | ||
margin-bottom: 20px; | ||
} | ||
|
||
.loading { | ||
text-align: center; | ||
} | ||
|
||
.form-details { | ||
padding: 20px; | ||
} | ||
|
||
.mat-list-item { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.form-card { | ||
margin-top: 30px; | ||
min-height: 150px; | ||
} | ||
|
||
.loading { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
z-index: 999; | ||
position: absolute; | ||
margin-top: -60px; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.card-header { | ||
border-radius: 3px; | ||
padding: 15px; | ||
background-color: #17428d; | ||
position: relative; | ||
z-index: 1; | ||
margin: 15px 15px -50px 15px; | ||
} | ||
|
||
.header-title { | ||
color: #fff; | ||
} | ||
|
||
.identity-accordion { | ||
margin: 0px 0px 0px 5px !important; | ||
} | ||
|
||
.details-expansion-panel-header { | ||
background: #17428d !important; | ||
} | ||
|
||
.details-expansion-panel-header:hover { | ||
background: #11337a !important; | ||
} | ||
|
||
.details-expansion-panel-header.mat-expansion-panel-header.mat-expanded { | ||
border-radius: 4px 4px 0px 0px; | ||
} | ||
|
||
.details-panel-header-title { | ||
color: white !important; | ||
} | ||
|
||
.details-panel-header-desc { | ||
color: rgba(255, 255, 255, 0.54) !important; | ||
} | ||
|
||
:host ::ng-deep .details-expansion-panel-header > .mat-expansion-indicator::after { | ||
color: white !important; | ||
} | ||
|
||
@media screen and (max-width: 960px) { | ||
.mat-mdc-table .mat-mdc-header-row { | ||
display: none; | ||
} | ||
|
||
.mat-mdc-table .mat-mdc-row { | ||
display: flex; | ||
flex-wrap: wrap; | ||
height: auto; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
.mat-mdc-table .mat-mdc-cell { | ||
width: 100%; | ||
border-bottom: 0px solid #ddd; | ||
font-size: 1em; | ||
min-height: 30px; | ||
margin-bottom: 4%; | ||
word-break: break-all; | ||
white-space: pre-wrap; | ||
} | ||
|
||
.mat-mdc-table .mat-mdc-cell:before { | ||
content: attr(data-label); | ||
float: left; | ||
font-weight: 500; | ||
} | ||
|
||
.mat-mdc-table .mat-mdc-cell:first-child { | ||
margin-top: 25px; | ||
} | ||
|
||
.mat-mdc-table .mat-mdc-row:last-child { | ||
border-bottom: 0px; | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
...dit-logs/dp-audit-logs-details/dp-audit-logs-details/dp-audit-logs-details.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<div class="card-header"> | ||
<h2 class="header-title">{{ headerDeletionProcessAuditLog }}</h2> | ||
<p class="header-description">{{ headerDeletionProcessAuditLogDescription }}</p> | ||
</div> | ||
<div [ngClass]="{ 'disabled-container': loading }" *ngIf="identityDeletionProcessAuditLogs.length"> | ||
<mat-card> | ||
<mat-card-content class="form-card"> | ||
<div *ngIf="loading" class="loading"> | ||
<mat-progress-spinner color="primary" mode="indeterminate"> </mat-progress-spinner> | ||
</div> | ||
<div class="form-details" *ngIf="!loading"> | ||
<mat-list> | ||
<div class="container"> | ||
<div class="column"> | ||
<mat-list-item> | ||
<span matListItemTitle>Identity Address</span> | ||
<span matListItemLine>{{ identityAddress }}</span> | ||
</mat-list-item> | ||
</div> | ||
</div> | ||
</mat-list> | ||
<table mat-table class="responsive" [dataSource]="identityDeletionProcessAuditLogs"> | ||
<ng-container matColumnDef="id"> | ||
<th mat-header-cell *matHeaderCellDef>ID</th> | ||
<td mat-cell *matCellDef="let AuditLog" data-label="ID:"> | ||
{{ AuditLog.id }} | ||
</td> | ||
</ng-container> | ||
<ng-container matColumnDef="createdAt"> | ||
<th mat-header-cell *matHeaderCellDef>Created At</th> | ||
<td mat-cell *matCellDef="let AuditLog" data-label="Created At:"> | ||
{{ AuditLog.createdAt | date }} | ||
</td> | ||
</ng-container> | ||
<ng-container matColumnDef="message"> | ||
<th mat-header-cell *matHeaderCellDef>Message</th> | ||
<td mat-cell *matCellDef="let AuditLog" data-label="Message:"> | ||
{{ replaceMessageKeyWithCorrespondingText(AuditLog.messageKey) }} | ||
</td> | ||
</ng-container> | ||
<ng-container matColumnDef="oldStatus"> | ||
<th mat-header-cell *matHeaderCellDef>Old Status</th> | ||
<td mat-cell *matCellDef="let AuditLog" data-label="Old Status:"> | ||
{{ styleStatus(AuditLog.oldStatus) }} | ||
</td> | ||
</ng-container> | ||
<ng-container matColumnDef="newStatus"> | ||
<th mat-header-cell *matHeaderCellDef>New Status</th> | ||
<td mat-cell *matCellDef="let AuditLog" data-label="New Status:"> | ||
{{ styleStatus(AuditLog.newStatus) }} | ||
</td> | ||
</ng-container> | ||
<ng-container matColumnDef="identityDeletionProcessId"> | ||
<th mat-header-cell *matHeaderCellDef>Identity Deletion Process Id</th> | ||
<td mat-cell *matCellDef="let AuditLog" data-label="Identity Deletion Process Id:"> | ||
{{ AuditLog.identityDeletionProcessId }} | ||
</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="deletionProcessesAuditLogTableDisplayedColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: deletionProcessesAuditLogTableDisplayedColumns"></tr> | ||
|
||
<tr class="mat-row" *matNoDataRow> | ||
<td class="mat-cell no-data" [attr.colspan]="deletionProcessesAuditLogTableDisplayedColumns.length">No deletion process audit logs found.</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> |
22 changes: 22 additions & 0 deletions
22
...-logs/dp-audit-logs-details/dp-audit-logs-details/dp-audit-logs-details.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from "@angular/core/testing"; | ||
|
||
import { DeletionProcessAuditLogsDetailsComponent } from "./dp-audit-logs-details.component"; | ||
|
||
describe("DeletionProcessAuditLogsDetailsComponent", () => { | ||
let component: DeletionProcessAuditLogsDetailsComponent; | ||
let fixture: ComponentFixture<DeletionProcessAuditLogsDetailsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [DeletionProcessAuditLogsDetailsComponent] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DeletionProcessAuditLogsDetailsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", async () => { | ||
await expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.