From 3b9bc35e518dd3038738baea4aa0e1ed60d2d658 Mon Sep 17 00:00:00 2001 From: Bello Babakolo Date: Thu, 24 Oct 2024 11:10:52 +0100 Subject: [PATCH] feat(fulfilment): add trigger fulfilment button in detail page --- .../fulfillment-view-details.component.html | 3 +++ .../fulfillment-view-details.component.ts | 7 +------ .../template/fulfillment-template.component.html | 1 + .../template/fulfillment-template.component.ts | 13 +++++++++++++ .../organisms/crud/crud-main.component.html | 14 ++++++++++++++ .../organisms/crud/crud-main.component.ts | 7 +++++++ 6 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.html diff --git a/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.html b/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.html new file mode 100644 index 00000000..d2d9b84b --- /dev/null +++ b/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.html @@ -0,0 +1,3 @@ +
+  {{ fulfillment | json }}
+
diff --git a/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.ts b/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.ts index e70b7541..04acc93a 100644 --- a/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.ts +++ b/packages/modules/fulfillment/src/lib/components/fulfillment-view-details.component.ts @@ -4,12 +4,7 @@ import { IFulfillment } from '@console-core/types'; @Component({ selector: 'app-module-fulfillment-view-details', - template: ` -
-      {{ fulfillment | json }}
-    
- `, + templateUrl: './fulfillment-view-details.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) export class FulfillmentViewDetailsComponent { diff --git a/packages/modules/fulfillment/src/lib/components/template/fulfillment-template.component.html b/packages/modules/fulfillment/src/lib/components/template/fulfillment-template.component.html index eb68ce3d..12599009 100644 --- a/packages/modules/fulfillment/src/lib/components/template/fulfillment-template.component.html +++ b/packages/modules/fulfillment/src/lib/components/template/fulfillment-template.component.html @@ -8,6 +8,7 @@ [triggerRead]="triggerRead" [triggerSelectId]="triggerSelectId" [triggerRemove]="triggerRemove" + [triggerSubmitFulfillment]="triggerSubmitFulfillment" >
(null); + readonly triggerSubmitFulfillment$ = this.triggerSubmitFulfillment + .asObservable() + .pipe( + tap((id) => { + if (id === null) { + return; + } + + // this.orderFacade.createFulfilment(id); + }) + ); + readonly triggerRead = new BehaviorSubject(null); readonly triggerRead$ = this.triggerRead .asObservable() diff --git a/packages/modules/ui/src/lib/components/organisms/crud/crud-main.component.html b/packages/modules/ui/src/lib/components/organisms/crud/crud-main.component.html index 52e928fd..6ee9691f 100644 --- a/packages/modules/ui/src/lib/components/organisms/crud/crud-main.component.html +++ b/packages/modules/ui/src/lib/components/organisms/crud/crud-main.component.html @@ -123,6 +123,20 @@ + +