-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add option to display message context (#889)
* feat: Add option to display message context * fix failing github actions * newline in ts * apply feedback changes * track key instead of whole key value pair
- Loading branch information
Showing
9 changed files
with
80 additions
and
0 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
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
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
13 changes: 13 additions & 0 deletions
13
src/app/shared/components/messagecontext-table/messagecontext-table.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,13 @@ | ||
<div class="d-flex flex-column mb-2"> | ||
@if (messageContextData.length > 0) { | ||
<div class="title">MessageContext:</div> | ||
<div data-cy-metadata-table="table" class="metadata-table"> | ||
@for (entry of messageContextData; track entry[0]) { | ||
<div class="table-col first-table-col"> | ||
<div class="key">{{ entry[0] }}</div> | ||
<div class="value" [appCopyTooltip]="entry[1]">{{ entry[1] }}</div> | ||
</div> | ||
} | ||
</div> | ||
} | ||
</div> |
37 changes: 37 additions & 0 deletions
37
src/app/shared/components/messagecontext-table/messagecontext-table.component.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,37 @@ | ||
import { Component, Input, OnInit, OnChanges, SimpleChanges } from '@angular/core'; | ||
import { ClipboardModule } from '@angular/cdk/clipboard'; | ||
import { MatTooltipModule } from '@angular/material/tooltip'; | ||
import { CommonModule } from '@angular/common'; | ||
import { CopyTooltipDirective } from '../../directives/copy-tooltip.directive'; | ||
import { Report } from '../../interfaces/report'; | ||
import { Checkpoint } from '../../interfaces/checkpoint'; | ||
import { ReportUtil } from '../../util/report-util'; | ||
|
||
@Component({ | ||
selector: 'app-messagecontext-table', | ||
templateUrl: './messagecontext-table.component.html', | ||
styleUrls: ['./../metadata-table/metadata-table.component.css'], | ||
standalone: true, | ||
imports: [ClipboardModule, MatTooltipModule, CopyTooltipDirective, CommonModule], | ||
}) | ||
export class MessagecontextTableComponent implements OnInit, OnChanges { | ||
protected readonly ReportUtil = ReportUtil; | ||
|
||
@Input({ required: true }) report!: Report | Checkpoint; | ||
messageContextData: [string, string][] = []; | ||
|
||
ngOnInit() { | ||
this.updateMessageContextData(); | ||
} | ||
|
||
ngOnChanges(changes: SimpleChanges) { | ||
if (changes.report) { | ||
this.updateMessageContextData(); | ||
} | ||
} | ||
|
||
private updateMessageContextData() { | ||
const messageContext = ReportUtil.isCheckPoint(this.report) ? this.report.messageContext : null; | ||
this.messageContextData = messageContext ? Object.entries(messageContext) : []; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -58,3 +58,7 @@ table { | |
background-color: rgba(154, 152, 152, 0.5); | ||
} | ||
} | ||
|
||
.title { | ||
font-weight: bold; | ||
} |
1 change: 1 addition & 0 deletions
1
src/app/shared/components/metadata-table/metadata-table.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
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