feat(portal-frontend): implement case-actions component
Renders record-assessment as a link only in redirect mode (otherwise a form-trigger slot, filled in once record-assessment-form exists), and take-ownership/release-ownership buttons purely off presence of their optional action key. Emits requests upward rather than calling the API itself - the actual take/release-ownership handling lands in a later commit.
This commit is contained in:
@@ -1 +1,19 @@
|
|||||||
<p>case-actions works!</p>
|
@if (actions().recordAssessment.mode === 'redirect') {
|
||||||
|
<a data-testid="record-assessment-link" [href]="actions().recordAssessment.href">Beoordeling vastleggen (in legacy)</a>
|
||||||
|
} @else {
|
||||||
|
<div data-testid="record-assessment-form">
|
||||||
|
<!-- app-record-assessment-form is embedded here once it exists -->
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (actions().takeOwnership; as takeOwnership) {
|
||||||
|
<button type="button" data-testid="take-ownership-button" (click)="takeOwnershipRequested.emit(takeOwnership)">
|
||||||
|
In eigen beheer nemen
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (actions().releaseOwnership; as releaseOwnership) {
|
||||||
|
<button type="button" data-testid="release-ownership-button" (click)="releaseOwnershipRequested.emit(releaseOwnership)">
|
||||||
|
Eigenaarschap teruggeven
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, input } from '@angular/core';
|
import { Component, input, output } from '@angular/core';
|
||||||
|
|
||||||
import { CaseDetailActions } from '../case-detail.types';
|
import { ActionLink, CaseDetailActions } from '../case-detail.types';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-case-actions',
|
selector: 'app-case-actions',
|
||||||
@@ -10,4 +10,7 @@ import { CaseDetailActions } from '../case-detail.types';
|
|||||||
})
|
})
|
||||||
export class CaseActions {
|
export class CaseActions {
|
||||||
readonly actions = input.required<CaseDetailActions>();
|
readonly actions = input.required<CaseDetailActions>();
|
||||||
|
|
||||||
|
readonly takeOwnershipRequested = output<ActionLink>();
|
||||||
|
readonly releaseOwnershipRequested = output<ActionLink>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user