Implement navigation (forward) in interaction sequence
All checks were successful
E2E Testing / test (push) Successful in 1m18s

This commit is contained in:
sebastian 2024-06-17 22:22:12 +02:00
parent 3d899251eb
commit 189b77b8ef
3 changed files with 17 additions and 2 deletions

View File

@ -40,7 +40,7 @@
<th mat-header-cell *matHeaderCellDef>Label</th> <th mat-header-cell *matHeaderCellDef>Label</th>
<td mat-cell *matCellDef="let interaction"> <td mat-cell *matCellDef="let interaction">
@if(interaction != editedElement) { @if(interaction != editedElement) {
{{interaction.interactionLabel}} <a class="navigation-link" (click)="onNavigateToInteraction(interaction)"> {{interaction.interactionLabel}}</a>
} @else { } @else {
<mat-form-field appearance="fill" class="long-form"> <mat-form-field appearance="fill" class="long-form">
<mat-label>Label</mat-label> <mat-label>Label</mat-label>

View File

@ -53,3 +53,13 @@ tr.example-element-row:not(.example-expanded-row):active {
.warning { .warning {
color: red; color: red;
} }
.navigation-link {
text-decoration: none;
color: white;
}
.navigation-link:hover {
text-decoration: underline;
}

View File

@ -38,12 +38,12 @@ export class InteractionSequenceEditorComponent implements OnInit{
} }
ngOnInit() { ngOnInit() {
if(this.interactionSequence != undefined) { if(this.interactionSequence != undefined) {
this.currentInteractionNode = this.interactionSequence!.rootInteraction.root;
this.assignData(); this.assignData();
} }
} }
private assignData() { private assignData() {
this.currentInteractionNode = this.interactionSequence!.rootInteraction.root;
if(this.currentInteractionNode != undefined) { if(this.currentInteractionNode != undefined) {
this.sequenceDatasource.data = this.interactionSequence!.findInteraction(this.currentInteractionNode)!.children.map(node => node.root); this.sequenceDatasource.data = this.interactionSequence!.findInteraction(this.currentInteractionNode)!.children.map(node => node.root);
} }
@ -106,4 +106,9 @@ export class InteractionSequenceEditorComponent implements OnInit{
interaction.removeAction(action); interaction.removeAction(action);
} }
} }
onNavigateToInteraction(interaction: Interaction) {
this.currentInteractionNode = interaction;
this.assignData();
}
} }