mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 2074: fix(remission): Implementation of Abort Remission Logic
fix(remission): Implementation of Abort Remission Logic Ref: #5489
This commit is contained in:
committed by
Lorenz Hilpert
parent
7200eaefbf
commit
ccc5285602
@@ -63,6 +63,18 @@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
uiButton
|
||||
color="tertiary"
|
||||
size="large"
|
||||
(click)="abortRemission()"
|
||||
class="fixed right-[15rem] bottom-6"
|
||||
>
|
||||
Warenbegleitschein abbrechen
|
||||
</button>
|
||||
|
||||
@if (!returnLoading() && !returnData()?.completed) {
|
||||
<lib-remission-return-receipt-complete
|
||||
[returnId]="returnId()"
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
getPackageNumbersFromReturn,
|
||||
getReceiptItemsFromReturn,
|
||||
getReceiptNumberFromReturn,
|
||||
RemissionStore,
|
||||
} from '@isa/remission/data-access';
|
||||
import { EmptyStateComponent } from '@isa/ui/empty-state';
|
||||
import { EMPTY_WBS_DESCRIPTION, EMPTY_WBS_TITLE } from './constants';
|
||||
@@ -24,6 +25,8 @@ import {
|
||||
RemissionReturnReceiptActionsComponent,
|
||||
RemissionReturnReceiptCompleteComponent,
|
||||
} from '@isa/remission/shared/return-receipt-actions';
|
||||
import { Router } from '@angular/router';
|
||||
import { injectTabId } from '@isa/core/tabs';
|
||||
|
||||
@Component({
|
||||
selector: 'remi-remission-return-receipt-details',
|
||||
@@ -53,6 +56,15 @@ export class RemissionReturnReceiptDetailsComponent {
|
||||
/** Angular Location service for navigation */
|
||||
location = inject(Location);
|
||||
|
||||
/** Remission store for managing remission state */
|
||||
#store = inject(RemissionStore);
|
||||
|
||||
/** Angular Router for navigation */
|
||||
#router = inject(Router);
|
||||
|
||||
/** Injects the current activated tab ID as a signal. */
|
||||
#tabId = injectTabId();
|
||||
|
||||
/**
|
||||
* Required input for the return ID.
|
||||
* Automatically coerced to a number from string input.
|
||||
@@ -111,4 +123,9 @@ export class RemissionReturnReceiptDetailsComponent {
|
||||
const returnData = this.returnData();
|
||||
return getPackageNumbersFromReturn(returnData!) !== '';
|
||||
});
|
||||
|
||||
async abortRemission() {
|
||||
this.#store.clearState();
|
||||
await this.#router.navigate(['/', this.#tabId(), 'remission']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user