@isaiahiroko/tilmart-ngx-apps-admin 0.2.9 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-sbSJXda_.mjs +92 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-sbSJXda_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-EooAWVy_.mjs +73 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-EooAWVy_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs +605 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-u5VyaNWX.mjs +97 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-u5VyaNWX.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs → isaiahiroko-tilmart-ngx-apps-admin-claims.module-CLtalsnJ.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-CLtalsnJ.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-BCkLIQta.mjs +88 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-BCkLIQta.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs → isaiahiroko-tilmart-ngx-apps-admin-customers.module-BohEH2SB.mjs} +2 -2
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-customers.module-BohEH2SB.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-z6apTF3A.mjs +86 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-z6apTF3A.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-homepage.module-ClHkgqXm.mjs → isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs} +38 -12
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs → isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-Dnh9hEz_.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-Dnh9hEz_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs +1579 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs → isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs} +29 -5
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-aIW0jRhm.mjs +239 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-aIW0jRhm.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-overview.module-C6gjcJ84.mjs +105 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-overview.module-C6gjcJ84.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs → isaiahiroko-tilmart-ngx-apps-admin-payments.module-Bej9cdwM.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-Bej9cdwM.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs +634 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs +88 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs +81 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs → isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-fjoFzY6t.mjs +137 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-fjoFzY6t.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs → isaiahiroko-tilmart-ngx-apps-admin-returns.module-D0RKEzAr.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-D0RKEzAr.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BWZ9OBPH.mjs +84 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BWZ9OBPH.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-settings.module-CFVgAQ2f.mjs → isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs} +37 -7
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs +200 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs → isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs} +2 -2
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs +66 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs +178 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs → isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs} +2 -2
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs +70 -48
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs.map +1 -1
- package/package.json +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-ClIiV2uK.mjs +0 -76
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-ClIiV2uK.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-CSp0tWes.mjs +0 -70
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-CSp0tWes.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs +0 -562
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-uKkUREjb.mjs +0 -94
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-uKkUREjb.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-Dcu1nJBW.mjs +0 -85
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-Dcu1nJBW.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs +0 -83
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-ClHkgqXm.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs +0 -190
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs +0 -94
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-D8H6ujoy.mjs +0 -78
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-D8H6ujoy.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs +0 -104
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-fYKd3AOq.mjs +0 -81
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-fYKd3AOq.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-CFVgAQ2f.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs +0 -131
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs +0 -140
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BSAe0CfZ.mjs +0 -102
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BSAe0CfZ.mjs.map +0 -1
|
@@ -3,6 +3,7 @@ import { Component, NgModule } from '@angular/core';
|
|
|
3
3
|
import * as i1$1 from '@angular/router';
|
|
4
4
|
import { RouterModule } from '@angular/router';
|
|
5
5
|
import { BaseDirective, titleCase, using, notify, SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
+
import { e as emptyValueFor, J as JsonBuilderComponent } from './isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs';
|
|
6
7
|
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
8
|
import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
9
|
import { BehaviorSubject, firstValueFrom, takeUntil, map } from 'rxjs';
|
|
@@ -101,11 +102,34 @@ class SettingsComponent extends BaseDirective {
|
|
|
101
102
|
{ key: 'estimateDaysMin', label: 'Estimate — min days', type: 'number' },
|
|
102
103
|
{ key: 'estimateDaysMax', label: 'Estimate — max days', type: 'number' },
|
|
103
104
|
{ key: 'enabled', label: 'Enabled', type: 'boolean' },
|
|
105
|
+
// index/DELIVERY.md §4.2 — a carrier-backed method is priced live by the carrier.
|
|
106
|
+
// Leave "Carrier" on Manual for a rate-card method (never a fallback for a failed carrier call).
|
|
107
|
+
{
|
|
108
|
+
key: 'provider',
|
|
109
|
+
label: 'Carrier',
|
|
110
|
+
type: 'select',
|
|
111
|
+
options: [
|
|
112
|
+
{ value: '', label: 'Manual (rate rules below)' },
|
|
113
|
+
{ value: 'auto', label: 'Default carrier (GIG)' },
|
|
114
|
+
{ value: 'gig', label: 'GIG Logistics' },
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: 'fulfilment',
|
|
119
|
+
label: 'Customer choice',
|
|
120
|
+
type: 'select',
|
|
121
|
+
options: [
|
|
122
|
+
{ value: 'home', label: 'Home delivery' },
|
|
123
|
+
{ value: 'pickup', label: 'Pickup (collect from a GIG location)' },
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
{ key: 'markupPercent', label: 'Markup on the carrier price (%)', type: 'number' },
|
|
127
|
+
{ key: 'freeOverSubtotal', label: 'Free delivery over order value (₦)', type: 'number' },
|
|
104
128
|
{
|
|
105
129
|
key: 'rateRules',
|
|
106
|
-
label: 'Rate rules
|
|
107
|
-
type: '
|
|
108
|
-
|
|
130
|
+
label: 'Rate rules — manual methods only',
|
|
131
|
+
type: 'builder',
|
|
132
|
+
builder: 'rateRules',
|
|
109
133
|
},
|
|
110
134
|
],
|
|
111
135
|
data$: new BehaviorSubject(null),
|
|
@@ -248,7 +272,7 @@ class SettingsComponent extends BaseDirective {
|
|
|
248
272
|
this.editing = true;
|
|
249
273
|
const draft = {};
|
|
250
274
|
for (const field of this.activeSection.fields) {
|
|
251
|
-
draft[field.key] = field
|
|
275
|
+
draft[field.key] = emptyValueFor(field);
|
|
252
276
|
}
|
|
253
277
|
this.draft = draft;
|
|
254
278
|
}
|
|
@@ -281,6 +305,9 @@ class SettingsComponent extends BaseDirective {
|
|
|
281
305
|
else if (field.type === 'boolean') {
|
|
282
306
|
payload[field.key] = !!raw;
|
|
283
307
|
}
|
|
308
|
+
else if (field.type === 'builder') {
|
|
309
|
+
payload[field.key] = raw ?? emptyValueFor(field);
|
|
310
|
+
}
|
|
284
311
|
else if (field.type === 'json') {
|
|
285
312
|
try {
|
|
286
313
|
payload[field.key] = raw && `${raw}`.trim() ? JSON.parse(raw) : undefined;
|
|
@@ -328,19 +355,21 @@ class SettingsComponent extends BaseDirective {
|
|
|
328
355
|
}
|
|
329
356
|
}
|
|
330
357
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: SettingsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
331
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: SettingsComponent, isStandalone: false, selector: "x-settings", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Settings</div>\n <div class=\"x-page-subtitle\">\n Channels, shipping and returns configuration.\n </div>\n</div>\n\n<nav class=\"x-settings-tabs\">\n @for (s of sections; track s.key) {\n <button\n type=\"button\"\n class=\"x-settings-tab\"\n [class.is-active]=\"active === s.key\"\n (click)=\"selectTab(s.key)\"\n >\n {{ s.title }}\n </button>\n }\n</nav>\n\n@for (s of sections; track s.key) {\n @if (active === s.key) {\n @if (!editing) {\n <div class=\"x-settings-toolbar\">\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" (click)=\"startCreate()\">\n + New {{ s.singularLabel }}\n </button>\n </div>\n @if (s.data$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n } @else if (draft) {\n <div class=\"x-settings-editor\">\n <div class=\"x-settings-editor-head\">\n <div class=\"x-settings-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ s.singularLabel }}</div>\n <div class=\"x-settings-editor-actions\">\n @if (draft['id']) {\n <button type=\"button\" class=\"x-settings-btn x-settings-danger\" (click)=\"remove()\">Delete</button>\n }\n <button type=\"button\" class=\"x-settings-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-settings-grid\">\n @for (f of s.fields; track f.key) {\n <label class=\"x-settings-f\" [class.x-settings-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-settings-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of f.options; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-settings-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n </div>\n </div>\n }\n }\n}\n\n<div class=\"x-settings-more\">\n <p>\n <strong>Users & roles</strong> \u2014\n <a routerLink=\"/admin/users\">manage accounts</a>.\n </p>\n <p>\n <strong>Notifications</strong> \u2014 transactional and marketing templates\n are seeded per environment (NotificationTemplates); per-customer\n preferences are on the customer record.\n </p>\n <p class=\"x-settings-audit\">\n <strong>Audit log</strong> \u2014 every privileged action is recorded\n (ntx-apps-audit); <a routerLink=\"/admin/audit\">open the viewer</a>.\n </p>\n</div>\n", styles: [".x-page-head{margin-bottom:16px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-settings-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px;border-bottom:1px solid var(--color-border)}.x-settings-tab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;padding:8px 12px;font-size:13.5px;font-weight:600;color:var(--color-text-muted);cursor:pointer}.x-settings-tab.is-active{color:var(--color-text);border-bottom-color:var(--color-brand)}.x-settings-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-settings-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-settings-btn:disabled{opacity:.5;cursor:default}.x-settings-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-settings-danger{color:var(--color-danger, #c0362c)}.x-settings-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-settings-editor-head{display:flex;align-items:center;justify-content:space-between}.x-settings-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-settings-editor-actions{display:flex;gap:8px}.x-settings-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-settings-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-settings-f-wide{grid-column:1/-1}.x-settings-f input,.x-settings-f select,.x-settings-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-settings-f input[type=checkbox]{width:18px;height:18px}.x-settings-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-settings-required{color:var(--color-danger, #c0362c)}.x-settings-more{margin-top:28px;padding-top:18px;border-top:1px solid var(--color-border);font-size:13px;line-height:1.6;color:var(--color-text-muted)}.x-settings-more a{color:var(--color-brand)}.x-settings-audit{margin-bottom:0}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
358
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: SettingsComponent, isStandalone: false, selector: "x-settings", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Settings</div>\n <div class=\"x-page-subtitle\">\n Channels, shipping and returns configuration.\n </div>\n</div>\n\n<nav class=\"x-settings-tabs\">\n @for (s of sections; track s.key) {\n <button\n type=\"button\"\n class=\"x-settings-tab\"\n [class.is-active]=\"active === s.key\"\n (click)=\"selectTab(s.key)\"\n >\n {{ s.title }}\n </button>\n }\n</nav>\n\n@for (s of sections; track s.key) {\n @if (active === s.key) {\n @if (!editing) {\n <div class=\"x-settings-toolbar\">\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" (click)=\"startCreate()\">\n + New {{ s.singularLabel }}\n </button>\n </div>\n @if (s.data$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n } @else if (draft) {\n <div class=\"x-settings-editor\">\n <div class=\"x-settings-editor-head\">\n <div class=\"x-settings-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ s.singularLabel }}</div>\n <div class=\"x-settings-editor-actions\">\n @if (draft['id']) {\n <button type=\"button\" class=\"x-settings-btn x-settings-danger\" (click)=\"remove()\">Delete</button>\n }\n <button type=\"button\" class=\"x-settings-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-settings-grid\">\n @for (f of s.fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward clicks to the first checkbox -->\n <div class=\"x-settings-f x-settings-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-settings-f\" [class.x-settings-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-settings-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of f.options; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-settings-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n }\n }\n}\n\n<div class=\"x-settings-more\">\n <p>\n <strong>Users & roles</strong> \u2014\n <a routerLink=\"/admin/users\">manage accounts</a>.\n </p>\n <p>\n <strong>Notifications</strong> \u2014 transactional and marketing templates\n are seeded per environment (NotificationTemplates); per-customer\n preferences are on the customer record.\n </p>\n <p class=\"x-settings-audit\">\n <strong>Audit log</strong> \u2014 every privileged action is recorded\n (ntx-apps-audit); <a routerLink=\"/admin/audit\">open the viewer</a>.\n </p>\n</div>\n", styles: [".x-page-head{margin-bottom:16px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-settings-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px;border-bottom:1px solid var(--color-border)}.x-settings-tab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;padding:8px 12px;font-size:13.5px;font-weight:600;color:var(--color-text-muted);cursor:pointer}.x-settings-tab.is-active{color:var(--color-text);border-bottom-color:var(--color-brand)}.x-settings-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-settings-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-settings-btn:disabled{opacity:.5;cursor:default}.x-settings-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-settings-danger{color:var(--color-danger, #c0362c)}.x-settings-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-settings-editor-head{display:flex;align-items:center;justify-content:space-between}.x-settings-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-settings-editor-actions{display:flex;gap:8px}.x-settings-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-settings-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-settings-f-wide{grid-column:1/-1}.x-settings-f input,.x-settings-f select,.x-settings-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-settings-f input[type=checkbox]{width:18px;height:18px}.x-settings-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-settings-required{color:var(--color-danger, #c0362c)}.x-settings-more{margin-top:28px;padding-top:18px;border-top:1px solid var(--color-border);font-size:13px;line-height:1.6;color:var(--color-text-muted)}.x-settings-more a{color:var(--color-brand)}.x-settings-audit{margin-bottom:0}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: JsonBuilderComponent, selector: "x-json-builder", inputs: ["kind", "value"], outputs: ["valueChange"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
332
359
|
}
|
|
333
360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: SettingsComponent, decorators: [{
|
|
334
361
|
type: Component,
|
|
335
|
-
args: [{ standalone: false, selector: 'x-settings', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Settings</div>\n <div class=\"x-page-subtitle\">\n Channels, shipping and returns configuration.\n </div>\n</div>\n\n<nav class=\"x-settings-tabs\">\n @for (s of sections; track s.key) {\n <button\n type=\"button\"\n class=\"x-settings-tab\"\n [class.is-active]=\"active === s.key\"\n (click)=\"selectTab(s.key)\"\n >\n {{ s.title }}\n </button>\n }\n</nav>\n\n@for (s of sections; track s.key) {\n @if (active === s.key) {\n @if (!editing) {\n <div class=\"x-settings-toolbar\">\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" (click)=\"startCreate()\">\n + New {{ s.singularLabel }}\n </button>\n </div>\n @if (s.data$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n } @else if (draft) {\n <div class=\"x-settings-editor\">\n <div class=\"x-settings-editor-head\">\n <div class=\"x-settings-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ s.singularLabel }}</div>\n <div class=\"x-settings-editor-actions\">\n @if (draft['id']) {\n <button type=\"button\" class=\"x-settings-btn x-settings-danger\" (click)=\"remove()\">Delete</button>\n }\n <button type=\"button\" class=\"x-settings-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-settings-grid\">\n @for (f of s.fields; track f.key) {\n <label class=\"x-settings-f\" [class.x-settings-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-settings-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of f.options; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-settings-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n </div>\n </div>\n }\n }\n}\n\n<div class=\"x-settings-more\">\n <p>\n <strong>Users & roles</strong> \u2014\n <a routerLink=\"/admin/users\">manage accounts</a>.\n </p>\n <p>\n <strong>Notifications</strong> \u2014 transactional and marketing templates\n are seeded per environment (NotificationTemplates); per-customer\n preferences are on the customer record.\n </p>\n <p class=\"x-settings-audit\">\n <strong>Audit log</strong> \u2014 every privileged action is recorded\n (ntx-apps-audit); <a routerLink=\"/admin/audit\">open the viewer</a>.\n </p>\n</div>\n", styles: [".x-page-head{margin-bottom:16px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-settings-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px;border-bottom:1px solid var(--color-border)}.x-settings-tab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;padding:8px 12px;font-size:13.5px;font-weight:600;color:var(--color-text-muted);cursor:pointer}.x-settings-tab.is-active{color:var(--color-text);border-bottom-color:var(--color-brand)}.x-settings-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-settings-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-settings-btn:disabled{opacity:.5;cursor:default}.x-settings-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-settings-danger{color:var(--color-danger, #c0362c)}.x-settings-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-settings-editor-head{display:flex;align-items:center;justify-content:space-between}.x-settings-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-settings-editor-actions{display:flex;gap:8px}.x-settings-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-settings-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-settings-f-wide{grid-column:1/-1}.x-settings-f input,.x-settings-f select,.x-settings-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-settings-f input[type=checkbox]{width:18px;height:18px}.x-settings-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-settings-required{color:var(--color-danger, #c0362c)}.x-settings-more{margin-top:28px;padding-top:18px;border-top:1px solid var(--color-border);font-size:13px;line-height:1.6;color:var(--color-text-muted)}.x-settings-more a{color:var(--color-brand)}.x-settings-audit{margin-bottom:0}\n"] }]
|
|
362
|
+
args: [{ standalone: false, selector: 'x-settings', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Settings</div>\n <div class=\"x-page-subtitle\">\n Channels, shipping and returns configuration.\n </div>\n</div>\n\n<nav class=\"x-settings-tabs\">\n @for (s of sections; track s.key) {\n <button\n type=\"button\"\n class=\"x-settings-tab\"\n [class.is-active]=\"active === s.key\"\n (click)=\"selectTab(s.key)\"\n >\n {{ s.title }}\n </button>\n }\n</nav>\n\n@for (s of sections; track s.key) {\n @if (active === s.key) {\n @if (!editing) {\n <div class=\"x-settings-toolbar\">\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" (click)=\"startCreate()\">\n + New {{ s.singularLabel }}\n </button>\n </div>\n @if (s.data$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n } @else if (draft) {\n <div class=\"x-settings-editor\">\n <div class=\"x-settings-editor-head\">\n <div class=\"x-settings-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ s.singularLabel }}</div>\n <div class=\"x-settings-editor-actions\">\n @if (draft['id']) {\n <button type=\"button\" class=\"x-settings-btn x-settings-danger\" (click)=\"remove()\">Delete</button>\n }\n <button type=\"button\" class=\"x-settings-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-settings-grid\">\n @for (f of s.fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward clicks to the first checkbox -->\n <div class=\"x-settings-f x-settings-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-settings-f\" [class.x-settings-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-settings-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of f.options; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-settings-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n }\n }\n}\n\n<div class=\"x-settings-more\">\n <p>\n <strong>Users & roles</strong> \u2014\n <a routerLink=\"/admin/users\">manage accounts</a>.\n </p>\n <p>\n <strong>Notifications</strong> \u2014 transactional and marketing templates\n are seeded per environment (NotificationTemplates); per-customer\n preferences are on the customer record.\n </p>\n <p class=\"x-settings-audit\">\n <strong>Audit log</strong> \u2014 every privileged action is recorded\n (ntx-apps-audit); <a routerLink=\"/admin/audit\">open the viewer</a>.\n </p>\n</div>\n", styles: [".x-page-head{margin-bottom:16px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-settings-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px;border-bottom:1px solid var(--color-border)}.x-settings-tab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;padding:8px 12px;font-size:13.5px;font-weight:600;color:var(--color-text-muted);cursor:pointer}.x-settings-tab.is-active{color:var(--color-text);border-bottom-color:var(--color-brand)}.x-settings-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-settings-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-settings-btn:disabled{opacity:.5;cursor:default}.x-settings-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-settings-danger{color:var(--color-danger, #c0362c)}.x-settings-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-settings-editor-head{display:flex;align-items:center;justify-content:space-between}.x-settings-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-settings-editor-actions{display:flex;gap:8px}.x-settings-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-settings-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-settings-f-wide{grid-column:1/-1}.x-settings-f input,.x-settings-f select,.x-settings-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-settings-f input[type=checkbox]{width:18px;height:18px}.x-settings-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-settings-required{color:var(--color-danger, #c0362c)}.x-settings-more{margin-top:28px;padding-top:18px;border-top:1px solid var(--color-border);font-size:13px;line-height:1.6;color:var(--color-text-muted)}.x-settings-more a{color:var(--color-brand)}.x-settings-audit{margin-bottom:0}\n"] }]
|
|
336
363
|
}] });
|
|
337
364
|
|
|
338
365
|
class SettingsModule {
|
|
339
366
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: SettingsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
340
367
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: SettingsModule, declarations: [SettingsComponent], imports: [SharedModule,
|
|
368
|
+
JsonBuilderComponent,
|
|
341
369
|
ElementsModule,
|
|
342
370
|
WebgetsModule, i1$1.RouterModule] }); }
|
|
343
371
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: SettingsModule, imports: [SharedModule,
|
|
372
|
+
JsonBuilderComponent,
|
|
344
373
|
ElementsModule,
|
|
345
374
|
WebgetsModule,
|
|
346
375
|
RouterModule.forChild([{ path: '', component: SettingsComponent }])] }); }
|
|
@@ -351,6 +380,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
351
380
|
declarations: [SettingsComponent],
|
|
352
381
|
imports: [
|
|
353
382
|
SharedModule,
|
|
383
|
+
JsonBuilderComponent,
|
|
354
384
|
ElementsModule,
|
|
355
385
|
WebgetsModule,
|
|
356
386
|
RouterModule.forChild([{ path: '', component: SettingsComponent }]),
|
|
@@ -359,4 +389,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
359
389
|
}] });
|
|
360
390
|
|
|
361
391
|
export { SettingsModule };
|
|
362
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-settings.module-
|
|
392
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs","sources":["../../../projects/admin/src/lib/pages/settings/settings.component.ts","../../../projects/admin/src/lib/pages/settings/settings.component.html","../../../projects/admin/src/lib/pages/settings/settings.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, notify, titleCase, using } from '@thescaffold/ngx-core';\nimport { BehaviorSubject, firstValueFrom, map, takeUntil } from 'rxjs';\nimport { CrudFieldSpec, emptyValueFor } from '../_shared/simple-crud.base';\n\ninterface Section {\n key: string;\n title: string;\n singularLabel: string;\n mount: string;\n columns: { key: string; value: string; type?: string; class?: string }[];\n fields: CrudFieldSpec[];\n data$: BehaviorSubject<any>;\n page: number;\n query?: string;\n}\n\n// R1 production-readiness pass — ADM-12 / ORD-05. P7.1's original\n// version stacked these four config resources as read-only lists; ops\n// had no way to add a channel, shipping zone, shipping method or return\n// policy \"without a deploy\" (ADM-12's own words). Same field-by-field\n// form idea as `SimpleCrudDirective`, adapted for four resources sharing\n// one tabbed page rather than one resource per route.\n@Component({\n standalone: false,\n selector: 'x-settings',\n templateUrl: './settings.component.html',\n styleUrl: './settings.component.scss',\n})\nexport class SettingsComponent extends BaseDirective {\n readonly sections: Section[] = [\n {\n key: 'channels',\n title: 'Channels',\n singularLabel: 'channel',\n mount: 'apps/commerce/channel',\n columns: [\n { key: 'name', value: 'Name' },\n { key: 'code', value: 'Code' },\n { key: 'currency', value: 'Currency' },\n ],\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true },\n { key: 'code', label: 'Code', type: 'text', required: true, placeholder: 'e.g. web-ng' },\n { key: 'currency', label: 'Currency', type: 'text', placeholder: 'NGN' },\n {\n key: 'taxMode',\n label: 'Tax mode',\n type: 'select',\n options: [\n { value: 'inclusive', label: 'Inclusive' },\n { value: 'exclusive', label: 'Exclusive' },\n ],\n },\n ],\n data$: new BehaviorSubject<any>(null),\n page: 1,\n },\n {\n key: 'zones',\n title: 'Shipping zones',\n singularLabel: 'shipping zone',\n mount: 'apps/commerce/delivery-zone',\n columns: [\n { key: 'name', value: 'Name' },\n { key: 'state', value: 'State' },\n { key: 'lga', value: 'LGA' },\n ],\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true },\n // Populated from `apps/commerce/static-list-item` in `init()` below\n // (StaticLists) — this form has no per-field dependent-options\n // support, so LGA lists every LGA rather than just the picked\n // state's (leave blank on the zone itself for a whole-state zone).\n { key: 'state', label: 'State', type: 'select', required: true, options: [] },\n { key: 'lga', label: 'LGA (blank = whole state)', type: 'select', options: [] },\n ],\n data$: new BehaviorSubject<any>(null),\n page: 1,\n },\n {\n key: 'methods',\n title: 'Shipping methods',\n singularLabel: 'shipping method',\n mount: 'apps/commerce/delivery-method',\n columns: [\n { key: 'name', value: 'Name' },\n { key: 'flatFee', value: 'Flat fee' },\n { key: 'perKg', value: 'Per kg' },\n {\n key: 'enabled',\n value: 'Enabled',\n type: 'class',\n class: 'badge text-bg-light border',\n },\n ],\n fields: [\n { key: 'name', label: 'Name', type: 'text', required: true },\n {\n key: 'type',\n label: 'Type',\n type: 'select',\n options: [\n { value: 'door', label: 'Door delivery' },\n { value: 'express', label: 'Express' },\n { value: 'pickup', label: 'Pickup' },\n { value: 'scheduled', label: 'Scheduled' },\n { value: 'freight', label: 'Freight' },\n ],\n },\n { key: 'estimateDaysMin', label: 'Estimate — min days', type: 'number' },\n { key: 'estimateDaysMax', label: 'Estimate — max days', type: 'number' },\n { key: 'enabled', label: 'Enabled', type: 'boolean' },\n // index/DELIVERY.md §4.2 — a carrier-backed method is priced live by the carrier.\n // Leave \"Carrier\" on Manual for a rate-card method (never a fallback for a failed carrier call).\n {\n key: 'provider',\n label: 'Carrier',\n type: 'select',\n options: [\n { value: '', label: 'Manual (rate rules below)' },\n { value: 'auto', label: 'Default carrier (GIG)' },\n { value: 'gig', label: 'GIG Logistics' },\n ],\n },\n {\n key: 'fulfilment',\n label: 'Customer choice',\n type: 'select',\n options: [\n { value: 'home', label: 'Home delivery' },\n { value: 'pickup', label: 'Pickup (collect from a GIG location)' },\n ],\n },\n { key: 'markupPercent', label: 'Markup on the carrier price (%)', type: 'number' },\n { key: 'freeOverSubtotal', label: 'Free delivery over order value (₦)', type: 'number' },\n {\n key: 'rateRules',\n label: 'Rate rules — manual methods only',\n type: 'builder',\n builder: 'rateRules',\n },\n ],\n data$: new BehaviorSubject<any>(null),\n page: 1,\n },\n {\n key: 'returns',\n title: 'Return policies',\n singularLabel: 'return policy',\n mount: 'apps/commerce/return-policy',\n columns: [\n { key: 'windowDays', value: 'Window (days)' },\n { key: 'restockingFeePct', value: 'Restock fee %' },\n { key: 'whoPaysReturn', value: 'Who pays' },\n {\n key: 'enabled',\n value: 'Enabled',\n type: 'class',\n class: 'badge text-bg-light border',\n },\n ],\n fields: [\n { key: 'windowDays', label: 'Return window (days)', type: 'number', required: true },\n {\n key: 'reasonCode',\n label: 'Reason code (blank = default policy)',\n type: 'select',\n options: [\n { value: 'damaged_in_transit', label: 'Damaged in transit' },\n { value: 'wrong_item', label: 'Wrong item' },\n { value: 'not_as_described', label: 'Not as described' },\n { value: 'faulty_on_arrival', label: 'Faulty on arrival' },\n { value: 'changed_mind', label: 'Changed mind' },\n { value: 'missing_parts', label: 'Missing parts' },\n ],\n },\n { key: 'restockingFeePct', label: 'Restocking fee %', type: 'number' },\n {\n key: 'whoPaysReturn',\n label: 'Who pays for return shipping',\n type: 'select',\n options: [\n { value: 'customer', label: 'Customer' },\n { value: 'tilmart', label: 'Tilmart' },\n { value: 'seller', label: 'Seller' },\n ],\n },\n { key: 'allowChangeOfMind', label: 'Allow change-of-mind returns', type: 'boolean' },\n { key: 'enabled', label: 'Enabled', type: 'boolean' },\n ],\n data$: new BehaviorSubject<any>(null),\n page: 1,\n },\n ];\n\n active = this.sections[0].key;\n editing = false;\n saving = false;\n draft: Record<string, any> | null = null;\n\n get activeSection(): Section {\n return this.sections.find((s) => s.key === this.active)!;\n }\n\n override init = () => {\n for (const section of this.sections) this.load(section);\n void this.loadZoneOptions();\n };\n\n private async loadZoneOptions(): Promise<void> {\n const zones = this.sections.find((s) => s.key === 'zones')!;\n const stateField = zones.fields.find((f) => f.key === 'state')!;\n const lgaField = zones.fields.find((f) => f.key === 'lga')!;\n const [statesRes, lgaRows]: any[] = await Promise.all([\n firstValueFrom(\n this.apiService.on('apps/commerce/static-list-item').getMany({\n listKey: 'ng-state',\n perPage: 200,\n } as any),\n ),\n this.fetchAllPages({ listKey: 'ng-lga' }),\n ]);\n stateField.options = (statesRes?.data ?? []).map((r: any) => ({\n value: r.code,\n label: r.label,\n }));\n lgaField.options = lgaRows.map((r: any) => ({\n value: r.code,\n label: `${r.label} (${r.parentCode})`,\n }));\n }\n\n // The CRUD list endpoint caps `perPage` at 200 server-side regardless of\n // what's asked for — 774 LGAs need 4 pages.\n private async fetchAllPages(filter: Record<string, unknown>): Promise<any[]> {\n const rows: any[] = [];\n let page = 1;\n for (;;) {\n const res: any = await firstValueFrom(\n this.apiService.on('apps/commerce/static-list-item').getMany({\n ...filter,\n page,\n perPage: 200,\n } as any),\n );\n const batch = res?.data ?? [];\n rows.push(...batch);\n if (batch.length < 200) break;\n page++;\n }\n return rows;\n }\n\n private load(section: Section, page = section.page, query = section.query): void {\n section.page = page;\n section.query = query;\n const params: any = { page, perPage: 100 };\n if (query) params.query = query;\n this.apiService\n .on(section.mount)\n .getMany(params)\n .pipe(\n takeUntil(this.$),\n map((response: any) => ({\n title: titleCase(section.title),\n columns: section.columns,\n rows: response?.data,\n hasHeaders: true,\n hasTextFilter: true,\n page: response?.meta?.current_page,\n perPage: response?.meta?.per_page,\n total: response?.meta?.total,\n onPage: (p: number) => this.load(section, p, query),\n onSearch: (q: string) => this.load(section, 1, q),\n onRefresh: () => this.load(section, page, query),\n links: {\n secondary: [{ title: 'Edit', fn: (_l: any, item: any) => this.edit(item) }],\n },\n })),\n )\n .subscribe(using((data) => section.data$.next(data)));\n }\n\n selectTab(key: string): void {\n this.active = key;\n this.editing = false;\n this.draft = null;\n }\n\n startCreate(): void {\n this.editing = true;\n const draft: Record<string, any> = {};\n for (const field of this.activeSection.fields) {\n draft[field.key] = emptyValueFor(field);\n }\n this.draft = draft;\n }\n\n edit(item: any): void {\n this.editing = true;\n const draft = { ...item };\n for (const field of this.activeSection.fields) {\n if (field.type === 'json' && draft[field.key] != null && typeof draft[field.key] !== 'string') {\n draft[field.key] = JSON.stringify(draft[field.key], null, 2);\n }\n }\n this.draft = draft;\n }\n\n cancelEdit(): void {\n this.editing = false;\n this.draft = null;\n }\n\n async save(): Promise<void> {\n if (!this.draft) return;\n const section = this.activeSection;\n this.saving = true;\n try {\n const payload: Record<string, any> = {};\n for (const field of section.fields) {\n const raw = this.draft[field.key];\n if (field.type === 'number') {\n payload[field.key] = raw !== null && raw !== undefined && `${raw}` !== '' ? Number(raw) : undefined;\n } else if (field.type === 'boolean') {\n payload[field.key] = !!raw;\n } else if (field.type === 'builder') {\n payload[field.key] = raw ?? emptyValueFor(field);\n } else if (field.type === 'json') {\n try {\n payload[field.key] = raw && `${raw}`.trim() ? JSON.parse(raw) : undefined;\n } catch {\n payload[field.key] = undefined;\n }\n } else {\n payload[field.key] = raw || undefined;\n }\n }\n\n const source = this.apiService.on(section.mount);\n if (this.draft['id']) {\n await firstValueFrom(source.update(this.draft['id'], payload));\n } else {\n await firstValueFrom(source.create(payload));\n }\n notify(`${titleCase(section.singularLabel)} saved.`, undefined, 'success');\n this.editing = false;\n this.draft = null;\n this.load(section, section.page, section.query);\n } catch {\n notify('Could not save (check required fields).', undefined, 'error');\n } finally {\n this.saving = false;\n }\n }\n\n async remove(): Promise<void> {\n if (!this.draft?.['id']) return;\n const section = this.activeSection;\n try {\n await firstValueFrom(this.apiService.on(section.mount).remove(this.draft['id']));\n notify(`${titleCase(section.singularLabel)} deleted.`, undefined, 'success');\n this.editing = false;\n this.draft = null;\n this.load(section, section.page, section.query);\n } catch {\n notify('Could not delete — it may still be referenced elsewhere.', undefined, 'error');\n }\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Settings</div>\n <div class=\"x-page-subtitle\">\n Channels, shipping and returns configuration.\n </div>\n</div>\n\n<nav class=\"x-settings-tabs\">\n @for (s of sections; track s.key) {\n <button\n type=\"button\"\n class=\"x-settings-tab\"\n [class.is-active]=\"active === s.key\"\n (click)=\"selectTab(s.key)\"\n >\n {{ s.title }}\n </button>\n }\n</nav>\n\n@for (s of sections; track s.key) {\n @if (active === s.key) {\n @if (!editing) {\n <div class=\"x-settings-toolbar\">\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" (click)=\"startCreate()\">\n + New {{ s.singularLabel }}\n </button>\n </div>\n @if (s.data$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n } @else if (draft) {\n <div class=\"x-settings-editor\">\n <div class=\"x-settings-editor-head\">\n <div class=\"x-settings-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ s.singularLabel }}</div>\n <div class=\"x-settings-editor-actions\">\n @if (draft['id']) {\n <button type=\"button\" class=\"x-settings-btn x-settings-danger\" (click)=\"remove()\">Delete</button>\n }\n <button type=\"button\" class=\"x-settings-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-settings-btn x-settings-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-settings-grid\">\n @for (f of s.fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward clicks to the first checkbox -->\n <div class=\"x-settings-f x-settings-f-wide\" [attr.data-testid]=\"'field-' + f.key\">\n <span>{{ f.label }}</span>\n <x-json-builder [kind]=\"f.builder!\" [(value)]=\"draft[f.key]\"></x-json-builder>\n </div>\n } @else {\n <label class=\"x-settings-f\" [class.x-settings-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-settings-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">— choose —</option>\n @for (opt of f.options; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-settings-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n }\n </div>\n </div>\n }\n }\n}\n\n<div class=\"x-settings-more\">\n <p>\n <strong>Users & roles</strong> —\n <a routerLink=\"/admin/users\">manage accounts</a>.\n </p>\n <p>\n <strong>Notifications</strong> — transactional and marketing templates\n are seeded per environment (NotificationTemplates); per-customer\n preferences are on the customer record.\n </p>\n <p class=\"x-settings-audit\">\n <strong>Audit log</strong> — every privileged action is recorded\n (ntx-apps-audit); <a routerLink=\"/admin/audit\">open the viewer</a>.\n </p>\n</div>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { JsonBuilderComponent } from '../_shared/rule-builders/json-builder.component';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { SettingsComponent } from './settings.component';\n\n@NgModule({\n declarations: [SettingsComponent],\n imports: [\n SharedModule,\n JsonBuilderComponent,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: SettingsComponent }]),\n ],\n})\nexport class SettingsModule {}\n"],"names":["i2","i3.JsonBuilderComponent","i4","i5","i1"],"mappings":";;;;;;;;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;AAOM,MAAO,iBAAkB,SAAQ,aAAa,CAAA;AANpD,IAAA,WAAA,GAAA;;AAOW,QAAA,IAAA,CAAA,QAAQ,GAAc;AAC7B,YAAA;AACE,gBAAA,GAAG,EAAE,UAAU;AACf,gBAAA,KAAK,EAAE,UAAU;AACjB,gBAAA,aAAa,EAAE,SAAS;AACxB,gBAAA,KAAK,EAAE,uBAAuB;AAC9B,gBAAA,OAAO,EAAE;AACP,oBAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC9B,oBAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC9B,oBAAA,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACvC,iBAAA;AACD,gBAAA,MAAM,EAAE;AACN,oBAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;AAC5D,oBAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE;AACxF,oBAAA,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,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IAAA,EAAA,MAAA,EAAA,CAAA,g0EAAA,CAAA,EAAA;;;MERX,cAAc,CAAA;+GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAd,cAAc,EAAA,YAAA,EAAA,CATV,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAE9B,YAAY;YACZ,oBAAoB;YACpB,cAAc;YACd,aAAa,EAAAC,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIJ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAPvB,YAAY;YACZ,oBAAoB;YACpB,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG1D,cAAc,EAAA,UAAA,EAAA,CAAA;kBAV1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,oBAAoB;wBACpB,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpE,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, ViewChild, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/router';
|
|
4
|
+
import { RouterModule } from '@angular/router';
|
|
5
|
+
import { using, notify, SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
+
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
|
+
import { FlyoutService, ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
|
+
import { takeUntil, firstValueFrom } from 'rxjs';
|
|
9
|
+
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs';
|
|
10
|
+
import * as i1 from '@angular/forms';
|
|
11
|
+
import * as i3 from '@angular/common';
|
|
12
|
+
|
|
13
|
+
const EXCEPTION_REASONS = [
|
|
14
|
+
'recipient_unavailable',
|
|
15
|
+
'address_not_found',
|
|
16
|
+
'recipient_refused',
|
|
17
|
+
'damaged_in_transit',
|
|
18
|
+
'access_blocked',
|
|
19
|
+
'weather',
|
|
20
|
+
'vehicle_issue',
|
|
21
|
+
'security',
|
|
22
|
+
'other',
|
|
23
|
+
];
|
|
24
|
+
// ORD-08 / ORD-12 — the fulfilment queue. List every shipment; drill in
|
|
25
|
+
// to dispatch, mark delivered, or record a delivery exception (each
|
|
26
|
+
// calls `FulfilmentWorkflow` via the shipment controller).
|
|
27
|
+
class ShipmentsComponent extends ListPageDirective {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.flyoutService = inject(FlyoutService);
|
|
31
|
+
this.pluralName = 'shipments';
|
|
32
|
+
this.dataSource = this.apiService.on('apps/commerce/shipment');
|
|
33
|
+
this.lineSource = this.apiService.on('apps/commerce/shipment-line');
|
|
34
|
+
this.exceptionSource = this.apiService.on('apps/commerce/delivery-exception');
|
|
35
|
+
this.reasons = EXCEPTION_REASONS;
|
|
36
|
+
this.columns = [
|
|
37
|
+
{ key: 'statusHtml', value: 'Status' },
|
|
38
|
+
{ key: 'orderId', value: 'Order' },
|
|
39
|
+
{ key: 'bookingStatus', value: 'Booking' },
|
|
40
|
+
{ key: 'carrier', value: 'Carrier' },
|
|
41
|
+
{ key: 'trackingRef', value: 'Tracking' },
|
|
42
|
+
{ key: 'createdAt', value: 'Created', type: 'date' },
|
|
43
|
+
];
|
|
44
|
+
this.detail = null;
|
|
45
|
+
// index/DELIVERY.md §9/§10 — the carrier booking panel
|
|
46
|
+
this.events = [];
|
|
47
|
+
this.sites = [];
|
|
48
|
+
this.waybillInput = '';
|
|
49
|
+
this.changeTo = '';
|
|
50
|
+
this.busy = false;
|
|
51
|
+
this.exceptionReason = 'recipient_unavailable';
|
|
52
|
+
this.exceptionNote = '';
|
|
53
|
+
}
|
|
54
|
+
view(item) {
|
|
55
|
+
this.detail = null;
|
|
56
|
+
this.events = [];
|
|
57
|
+
this.waybillInput = '';
|
|
58
|
+
this.changeTo = '';
|
|
59
|
+
this.exceptionReason = 'recipient_unavailable';
|
|
60
|
+
this.exceptionNote = '';
|
|
61
|
+
this.flyoutService.open(this.detailFlyout);
|
|
62
|
+
if (item.provider)
|
|
63
|
+
void this.loadDelivery(item);
|
|
64
|
+
this.lineSource
|
|
65
|
+
.getMany({ shipmentId: item.id, page: 1, perPage: 100 })
|
|
66
|
+
.pipe(takeUntil(this.$))
|
|
67
|
+
.subscribe(using(({ data: lines }) => {
|
|
68
|
+
this.detail = { ...item, lines: lines ?? [], exceptions: [] };
|
|
69
|
+
this.exceptionSource
|
|
70
|
+
.getMany({ shipmentId: item.id, page: 1, perPage: 50 })
|
|
71
|
+
.pipe(takeUntil(this.$))
|
|
72
|
+
.subscribe(using(({ data }) => {
|
|
73
|
+
if (this.detail)
|
|
74
|
+
this.detail.exceptions = data ?? [];
|
|
75
|
+
}));
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
async loadDelivery(item) {
|
|
79
|
+
const [ev, cov] = await Promise.all([
|
|
80
|
+
firstValueFrom(this.apiService.get(`apps/commerce/logistics/shipment/${item.id}/events`)).catch(() => undefined),
|
|
81
|
+
firstValueFrom(this.apiService.get('apps/commerce/stock-location/coverage/overview')).catch(() => undefined),
|
|
82
|
+
]);
|
|
83
|
+
this.events = ev?.data ?? [];
|
|
84
|
+
this.sites = (cov?.data?.sites ?? []).filter((s) => s.ready && s.id !== item.stockLocationId);
|
|
85
|
+
}
|
|
86
|
+
get siteName() {
|
|
87
|
+
return this.detail?.originSnapshot?.name ?? '—';
|
|
88
|
+
}
|
|
89
|
+
get bookingMessage() {
|
|
90
|
+
const e = this.detail?.bookingError;
|
|
91
|
+
if (!e)
|
|
92
|
+
return '';
|
|
93
|
+
if (e.reason === 'wallet-insufficient')
|
|
94
|
+
return 'Waiting for the GIG wallet to be topped up — this booking resumes automatically.';
|
|
95
|
+
if (e.errorKey === 'credentials-rejected')
|
|
96
|
+
return 'GIG rejected our login — waiting for the credentials to be fixed.';
|
|
97
|
+
if (this.detail.bookingStatus === 'needs_review') {
|
|
98
|
+
return 'The booking request may have reached GIG but we got no answer. Search the GIG dashboard for this order number before retrying, to avoid booking it twice.';
|
|
99
|
+
}
|
|
100
|
+
return e.message || e.errorKey || 'The booking failed.';
|
|
101
|
+
}
|
|
102
|
+
get cost() {
|
|
103
|
+
return {
|
|
104
|
+
charged: this.detail?.providerCost != null ? Number(this.detail.providerCost) : undefined,
|
|
105
|
+
quoted: this.detail?.quotedAmount != null ? Number(this.detail.quotedAmount) : undefined,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** Booking actions (retry / cancel / enter waybill / change origin). */
|
|
109
|
+
async logistics(action) {
|
|
110
|
+
if (!this.detail)
|
|
111
|
+
return;
|
|
112
|
+
const body = action === 'enter-waybill' ? { waybill: this.waybillInput }
|
|
113
|
+
: action === 'change-origin' ? { stockLocationId: this.changeTo }
|
|
114
|
+
: action === 'cancel-booking' ? { reason: 'Cancelled by staff' }
|
|
115
|
+
: {};
|
|
116
|
+
if (action === 'cancel-booking' && !confirm('Cancel this booking with the carrier?'))
|
|
117
|
+
return;
|
|
118
|
+
this.busy = true;
|
|
119
|
+
try {
|
|
120
|
+
const res = await firstValueFrom(this.apiService.post(`apps/commerce/logistics/shipment/${this.detail.id}/${action}`, body));
|
|
121
|
+
if (res?.status === 'error')
|
|
122
|
+
throw new Error(res.message);
|
|
123
|
+
notify('Done.', undefined, 'success');
|
|
124
|
+
this.flyoutService.dismiss();
|
|
125
|
+
this.list();
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
const m = e?.error?.message ?? e?.message ?? 'That action failed.';
|
|
129
|
+
notify(String(m), undefined, 'error');
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
this.busy = false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
act(path, body, okMsg) {
|
|
136
|
+
this.apiService
|
|
137
|
+
.post(`apps/commerce/shipment/${this.detail.id}/${path}`, body)
|
|
138
|
+
.pipe(takeUntil(this.$))
|
|
139
|
+
.subscribe(using((res) => {
|
|
140
|
+
if (res?.status === 'error') {
|
|
141
|
+
notify(res.message || 'That action failed.', undefined, 'error');
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
notify(okMsg, undefined, 'success');
|
|
145
|
+
this.flyoutService.dismiss();
|
|
146
|
+
this.list();
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
dispatch() {
|
|
150
|
+
this.act('dispatch', {}, 'Shipment dispatched.');
|
|
151
|
+
}
|
|
152
|
+
deliver() {
|
|
153
|
+
this.act('deliver', {}, 'Shipment marked delivered.');
|
|
154
|
+
}
|
|
155
|
+
recordException() {
|
|
156
|
+
this.act('exception', { reasonCode: this.exceptionReason, notes: this.exceptionNote || undefined }, 'Delivery exception recorded.');
|
|
157
|
+
}
|
|
158
|
+
extraCollectionFields() {
|
|
159
|
+
return {
|
|
160
|
+
links: {
|
|
161
|
+
secondary: [{ title: 'View', fn: (_link, item) => this.view(item) }],
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
166
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ShipmentsComponent, isStandalone: false, selector: "x-shipments", viewQueries: [{ propertyName: "detailFlyout", first: true, predicate: ["detailFlyout"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Shipments</div>\n <div class=\"x-page-subtitle\">Dispatch, deliver, and record delivery exceptions (ORD-08).</div>\n</div>\n\n@if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n} @else {\n <x-element-loader></x-element-loader>\n}\n\n<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Shipment' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n @if (detail.trackingRef) {\n <div class=\"small text-secondary mt-1\">{{ detail.carrier }} \u00B7 {{ detail.trackingRef }}</div>\n }\n @if (detail.dispatchedAt) {\n <div class=\"small text-secondary\">Dispatched {{ detail.dispatchedAt | date: 'MMM d, h:mm a' }}</div>\n }\n @if (detail.deliveredAt) {\n <div class=\"small text-secondary\">Delivered {{ detail.deliveredAt | date: 'MMM d, h:mm a' }}</div>\n }\n </div>\n\n @if (detail.provider) {\n <div class=\"border rounded p-3 d-flex flex-column gap-2\" data-testid=\"delivery-panel\">\n <div class=\"d-flex align-items-center gap-2\">\n <span class=\"fw-bold small\">Carrier booking</span>\n <span class=\"badge text-bg-light border\" data-testid=\"booking-status\">{{ detail.bookingStatus }}</span>\n <span class=\"small text-secondary\">{{ detail.provider | uppercase }}</span>\n </div>\n <div class=\"small\">Collected from: <strong data-testid=\"pickup-site\">{{ siteName }}</strong></div>\n @if (detail.trackingRef) {\n <div class=\"small\">Waybill: <span class=\"font-monospace\" data-testid=\"waybill\">{{ detail.trackingRef }}</span>\n @if (detail.labelUrl) { \u00B7 <a [href]=\"detail.labelUrl\" target=\"_blank\" rel=\"noopener\">label</a> }\n </div>\n }\n @if (cost.charged != null || cost.quoted != null) {\n <div class=\"small text-secondary\">\n @if (cost.quoted != null) { Quoted \u20A6{{ cost.quoted | number: '1.0-2' }} }\n @if (cost.charged != null) { \u00B7 Charged \u20A6{{ cost.charged | number: '1.0-2' }} }\n </div>\n }\n @if (bookingMessage) { <div class=\"alert alert-warning py-2 small mb-0\" data-testid=\"booking-message\">{{ bookingMessage }}</div> }\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.bookingStatus === 'pending' || detail.bookingStatus === 'failed' || detail.bookingStatus === 'needs_review') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy\" (click)=\"logistics('retry-booking')\" data-testid=\"retry-booking\">Retry booking</button>\n }\n @if (detail.bookingStatus === 'booked' && detail.status !== 'delivered') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger\" [disabled]=\"busy\" (click)=\"logistics('cancel-booking')\" data-testid=\"cancel-booking\">Cancel booking</button>\n }\n </div>\n @if (!detail.trackingRef) {\n <div class=\"d-flex gap-2\">\n <input class=\"form-control form-control-sm\" placeholder=\"Waybill booked on the carrier's own dashboard\" [(ngModel)]=\"waybillInput\" data-testid=\"waybill-input\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy || !waybillInput.trim()\" (click)=\"logistics('enter-waybill')\" data-testid=\"enter-waybill\">Enter waybill</button>\n </div>\n }\n @if ((detail.status === 'preparing' || detail.status === 'ready_for_dispatch') && sites.length) {\n <div class=\"d-flex gap-2\">\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"changeTo\" data-testid=\"change-origin-select\">\n <option value=\"\">Collect from a different site\u2026</option>\n @for (s of sites; track s.id) { <option [value]=\"s.id\">{{ s.name }}</option> }\n </select>\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy || !changeTo\" (click)=\"logistics('change-origin')\" data-testid=\"change-origin\">Change</button>\n </div>\n }\n @if (events.length) {\n <div class=\"small\" data-testid=\"timeline\">\n <div class=\"fw-bold mb-1\">Timeline</div>\n @for (e of events; track e.id) {\n <div class=\"text-secondary\">{{ e.occurredAt | date: 'MMM d, h:mm a' }} \u00B7 {{ e.description || e.status }}</div>\n }\n </div>\n }\n </div>\n }\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.status === 'preparing' || detail.status === 'ready_for_dispatch') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"dispatch()\">Dispatch</button>\n }\n @if (detail.status === 'dispatched' || detail.status === 'out_for_delivery' || detail.status === 'failed_delivery') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-success\" (click)=\"deliver()\">Mark delivered</button>\n }\n </div>\n\n <table class=\"table table-sm\">\n <thead><tr><th>Order line</th><th>Qty</th><th>Serials</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td class=\"font-monospace small\">{{ line.orderLineId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"small\">{{ line.serialNumbers?.join(', ') || '\u2014' }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div>\n <div class=\"fw-bold small mb-1\">Delivery exceptions</div>\n @for (ex of detail.exceptions; track ex.id) {\n <div class=\"small text-secondary\">\n Attempt {{ ex.attemptNumber }} \u00B7 {{ ex.reasonCode }}\n @if (ex.notes) { \u2014 {{ ex.notes }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div class=\"d-flex flex-column gap-2\">\n <div class=\"fw-bold small\">Record an exception</div>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"exceptionReason\">\n @for (reason of reasons; track reason) {\n <option [value]=\"reason\">{{ reason }}</option>\n }\n </select>\n <input class=\"form-control form-control-sm\" placeholder=\"Note (optional)\" [(ngModel)]=\"exceptionNote\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-warning align-self-start\" (click)=\"recordException()\">\n Record exception\n </button>\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "component", type: i2.FlyoutComponent, selector: "x-webget-flyout", inputs: ["data"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i3.DecimalPipe, name: "number" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
|
|
167
|
+
}
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsComponent, decorators: [{
|
|
169
|
+
type: Component,
|
|
170
|
+
args: [{ standalone: false, selector: 'x-shipments', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Shipments</div>\n <div class=\"x-page-subtitle\">Dispatch, deliver, and record delivery exceptions (ORD-08).</div>\n</div>\n\n@if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n} @else {\n <x-element-loader></x-element-loader>\n}\n\n<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Shipment' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n @if (detail.trackingRef) {\n <div class=\"small text-secondary mt-1\">{{ detail.carrier }} \u00B7 {{ detail.trackingRef }}</div>\n }\n @if (detail.dispatchedAt) {\n <div class=\"small text-secondary\">Dispatched {{ detail.dispatchedAt | date: 'MMM d, h:mm a' }}</div>\n }\n @if (detail.deliveredAt) {\n <div class=\"small text-secondary\">Delivered {{ detail.deliveredAt | date: 'MMM d, h:mm a' }}</div>\n }\n </div>\n\n @if (detail.provider) {\n <div class=\"border rounded p-3 d-flex flex-column gap-2\" data-testid=\"delivery-panel\">\n <div class=\"d-flex align-items-center gap-2\">\n <span class=\"fw-bold small\">Carrier booking</span>\n <span class=\"badge text-bg-light border\" data-testid=\"booking-status\">{{ detail.bookingStatus }}</span>\n <span class=\"small text-secondary\">{{ detail.provider | uppercase }}</span>\n </div>\n <div class=\"small\">Collected from: <strong data-testid=\"pickup-site\">{{ siteName }}</strong></div>\n @if (detail.trackingRef) {\n <div class=\"small\">Waybill: <span class=\"font-monospace\" data-testid=\"waybill\">{{ detail.trackingRef }}</span>\n @if (detail.labelUrl) { \u00B7 <a [href]=\"detail.labelUrl\" target=\"_blank\" rel=\"noopener\">label</a> }\n </div>\n }\n @if (cost.charged != null || cost.quoted != null) {\n <div class=\"small text-secondary\">\n @if (cost.quoted != null) { Quoted \u20A6{{ cost.quoted | number: '1.0-2' }} }\n @if (cost.charged != null) { \u00B7 Charged \u20A6{{ cost.charged | number: '1.0-2' }} }\n </div>\n }\n @if (bookingMessage) { <div class=\"alert alert-warning py-2 small mb-0\" data-testid=\"booking-message\">{{ bookingMessage }}</div> }\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.bookingStatus === 'pending' || detail.bookingStatus === 'failed' || detail.bookingStatus === 'needs_review') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy\" (click)=\"logistics('retry-booking')\" data-testid=\"retry-booking\">Retry booking</button>\n }\n @if (detail.bookingStatus === 'booked' && detail.status !== 'delivered') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger\" [disabled]=\"busy\" (click)=\"logistics('cancel-booking')\" data-testid=\"cancel-booking\">Cancel booking</button>\n }\n </div>\n @if (!detail.trackingRef) {\n <div class=\"d-flex gap-2\">\n <input class=\"form-control form-control-sm\" placeholder=\"Waybill booked on the carrier's own dashboard\" [(ngModel)]=\"waybillInput\" data-testid=\"waybill-input\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy || !waybillInput.trim()\" (click)=\"logistics('enter-waybill')\" data-testid=\"enter-waybill\">Enter waybill</button>\n </div>\n }\n @if ((detail.status === 'preparing' || detail.status === 'ready_for_dispatch') && sites.length) {\n <div class=\"d-flex gap-2\">\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"changeTo\" data-testid=\"change-origin-select\">\n <option value=\"\">Collect from a different site\u2026</option>\n @for (s of sites; track s.id) { <option [value]=\"s.id\">{{ s.name }}</option> }\n </select>\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy || !changeTo\" (click)=\"logistics('change-origin')\" data-testid=\"change-origin\">Change</button>\n </div>\n }\n @if (events.length) {\n <div class=\"small\" data-testid=\"timeline\">\n <div class=\"fw-bold mb-1\">Timeline</div>\n @for (e of events; track e.id) {\n <div class=\"text-secondary\">{{ e.occurredAt | date: 'MMM d, h:mm a' }} \u00B7 {{ e.description || e.status }}</div>\n }\n </div>\n }\n </div>\n }\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.status === 'preparing' || detail.status === 'ready_for_dispatch') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"dispatch()\">Dispatch</button>\n }\n @if (detail.status === 'dispatched' || detail.status === 'out_for_delivery' || detail.status === 'failed_delivery') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-success\" (click)=\"deliver()\">Mark delivered</button>\n }\n </div>\n\n <table class=\"table table-sm\">\n <thead><tr><th>Order line</th><th>Qty</th><th>Serials</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td class=\"font-monospace small\">{{ line.orderLineId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"small\">{{ line.serialNumbers?.join(', ') || '\u2014' }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div>\n <div class=\"fw-bold small mb-1\">Delivery exceptions</div>\n @for (ex of detail.exceptions; track ex.id) {\n <div class=\"small text-secondary\">\n Attempt {{ ex.attemptNumber }} \u00B7 {{ ex.reasonCode }}\n @if (ex.notes) { \u2014 {{ ex.notes }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div class=\"d-flex flex-column gap-2\">\n <div class=\"fw-bold small\">Record an exception</div>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"exceptionReason\">\n @for (reason of reasons; track reason) {\n <option [value]=\"reason\">{{ reason }}</option>\n }\n </select>\n <input class=\"form-control form-control-sm\" placeholder=\"Note (optional)\" [(ngModel)]=\"exceptionNote\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-warning align-self-start\" (click)=\"recordException()\">\n Record exception\n </button>\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}\n"] }]
|
|
171
|
+
}], propDecorators: { detailFlyout: [{
|
|
172
|
+
type: ViewChild,
|
|
173
|
+
args: ['detailFlyout', { read: TemplateRef, static: true }]
|
|
174
|
+
}] } });
|
|
175
|
+
|
|
176
|
+
class ShipmentsModule {
|
|
177
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
178
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, declarations: [ShipmentsComponent], imports: [SharedModule,
|
|
179
|
+
ElementsModule,
|
|
180
|
+
WebgetsModule, i1$1.RouterModule] }); }
|
|
181
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, imports: [SharedModule,
|
|
182
|
+
ElementsModule,
|
|
183
|
+
WebgetsModule,
|
|
184
|
+
RouterModule.forChild([{ path: '', component: ShipmentsComponent }])] }); }
|
|
185
|
+
}
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, decorators: [{
|
|
187
|
+
type: NgModule,
|
|
188
|
+
args: [{
|
|
189
|
+
declarations: [ShipmentsComponent],
|
|
190
|
+
imports: [
|
|
191
|
+
SharedModule,
|
|
192
|
+
ElementsModule,
|
|
193
|
+
WebgetsModule,
|
|
194
|
+
RouterModule.forChild([{ path: '', component: ShipmentsComponent }]),
|
|
195
|
+
],
|
|
196
|
+
}]
|
|
197
|
+
}] });
|
|
198
|
+
|
|
199
|
+
export { ShipmentsModule };
|
|
200
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs","sources":["../../../projects/admin/src/lib/pages/shipments/shipments.component.ts","../../../projects/admin/src/lib/pages/shipments/shipments.component.html","../../../projects/admin/src/lib/pages/shipments/shipments.module.ts"],"sourcesContent":["import { Component, TemplateRef, ViewChild, inject } from '@angular/core';\nimport { notify, using } from '@thescaffold/ngx-core';\nimport { FlyoutService } from '@thescaffold/ngx-ui';\nimport { firstValueFrom, takeUntil } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\nconst EXCEPTION_REASONS = [\n 'recipient_unavailable',\n 'address_not_found',\n 'recipient_refused',\n 'damaged_in_transit',\n 'access_blocked',\n 'weather',\n 'vehicle_issue',\n 'security',\n 'other',\n];\n\n// ORD-08 / ORD-12 — the fulfilment queue. List every shipment; drill in\n// to dispatch, mark delivered, or record a delivery exception (each\n// calls `FulfilmentWorkflow` via the shipment controller).\n@Component({\n standalone: false,\n selector: 'x-shipments',\n templateUrl: './shipments.component.html',\n styleUrl: './shipments.component.scss',\n})\nexport class ShipmentsComponent extends ListPageDirective {\n private readonly flyoutService = inject(FlyoutService);\n\n protected pluralName = 'shipments';\n protected dataSource = this.apiService.on('apps/commerce/shipment');\n private readonly lineSource = this.apiService.on('apps/commerce/shipment-line');\n private readonly exceptionSource = this.apiService.on('apps/commerce/delivery-exception');\n\n readonly reasons = EXCEPTION_REASONS;\n\n protected columns = [\n { key: 'statusHtml', value: 'Status' },\n { key: 'orderId', value: 'Order' },\n { key: 'bookingStatus', value: 'Booking' },\n { key: 'carrier', value: 'Carrier' },\n { key: 'trackingRef', value: 'Tracking' },\n { key: 'createdAt', value: 'Created', type: 'date' },\n ];\n\n detail: any = null;\n // index/DELIVERY.md §9/§10 — the carrier booking panel\n events: any[] = [];\n sites: any[] = [];\n waybillInput = '';\n changeTo = '';\n busy = false;\n exceptionReason = 'recipient_unavailable';\n exceptionNote = '';\n\n @ViewChild('detailFlyout', { read: TemplateRef, static: true })\n detailFlyout!: TemplateRef<any>;\n\n view(item: any) {\n this.detail = null;\n this.events = [];\n this.waybillInput = '';\n this.changeTo = '';\n this.exceptionReason = 'recipient_unavailable';\n this.exceptionNote = '';\n this.flyoutService.open(this.detailFlyout);\n if (item.provider) void this.loadDelivery(item);\n\n this.lineSource\n .getMany({ shipmentId: item.id, page: 1, perPage: 100 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ data: lines }: { data: any[] }) => {\n this.detail = { ...item, lines: lines ?? [], exceptions: [] };\n this.exceptionSource\n .getMany({ shipmentId: item.id, page: 1, perPage: 50 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using(({ data }: { data: any[] }) => {\n if (this.detail) this.detail.exceptions = data ?? [];\n }));\n }),\n );\n }\n\n private async loadDelivery(item: any): Promise<void> {\n const [ev, cov]: any[] = await Promise.all([\n firstValueFrom(this.apiService.get(`apps/commerce/logistics/shipment/${item.id}/events`)).catch(() => undefined),\n firstValueFrom(this.apiService.get('apps/commerce/stock-location/coverage/overview')).catch(() => undefined),\n ]);\n this.events = ev?.data ?? [];\n this.sites = (cov?.data?.sites ?? []).filter((s: any) => s.ready && s.id !== item.stockLocationId);\n }\n\n get siteName(): string {\n return this.detail?.originSnapshot?.name ?? '—';\n }\n\n get bookingMessage(): string {\n const e = this.detail?.bookingError;\n if (!e) return '';\n if (e.reason === 'wallet-insufficient') return 'Waiting for the GIG wallet to be topped up — this booking resumes automatically.';\n if (e.errorKey === 'credentials-rejected') return 'GIG rejected our login — waiting for the credentials to be fixed.';\n if (this.detail.bookingStatus === 'needs_review') {\n return 'The booking request may have reached GIG but we got no answer. Search the GIG dashboard for this order number before retrying, to avoid booking it twice.';\n }\n return e.message || e.errorKey || 'The booking failed.';\n }\n\n get cost(): { charged?: number; quoted?: number } {\n return {\n charged: this.detail?.providerCost != null ? Number(this.detail.providerCost) : undefined,\n quoted: this.detail?.quotedAmount != null ? Number(this.detail.quotedAmount) : undefined,\n };\n }\n\n /** Booking actions (retry / cancel / enter waybill / change origin). */\n async logistics(action: 'retry-booking' | 'cancel-booking' | 'enter-waybill' | 'change-origin'): Promise<void> {\n if (!this.detail) return;\n const body: Record<string, unknown> =\n action === 'enter-waybill' ? { waybill: this.waybillInput }\n : action === 'change-origin' ? { stockLocationId: this.changeTo }\n : action === 'cancel-booking' ? { reason: 'Cancelled by staff' }\n : {};\n if (action === 'cancel-booking' && !confirm('Cancel this booking with the carrier?')) return;\n this.busy = true;\n try {\n const res: any = await firstValueFrom(this.apiService.post(`apps/commerce/logistics/shipment/${this.detail.id}/${action}`, body));\n if (res?.status === 'error') throw new Error(res.message);\n notify('Done.', undefined, 'success');\n this.flyoutService.dismiss();\n this.list();\n } catch (e: any) {\n const m = e?.error?.message ?? e?.message ?? 'That action failed.';\n notify(String(m), undefined, 'error');\n } finally {\n this.busy = false;\n }\n }\n\n private act(path: string, body: Record<string, unknown>, okMsg: string) {\n this.apiService\n .post(`apps/commerce/shipment/${this.detail.id}/${path}`, body)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n if (res?.status === 'error') {\n notify(res.message || 'That action failed.', undefined, 'error');\n return;\n }\n notify(okMsg, undefined, 'success');\n this.flyoutService.dismiss();\n this.list();\n }),\n );\n }\n\n dispatch() {\n this.act('dispatch', {}, 'Shipment dispatched.');\n }\n\n deliver() {\n this.act('deliver', {}, 'Shipment marked delivered.');\n }\n\n recordException() {\n this.act(\n 'exception',\n { reasonCode: this.exceptionReason, notes: this.exceptionNote || undefined },\n 'Delivery exception recorded.',\n );\n }\n\n protected override extraCollectionFields() {\n return {\n links: {\n secondary: [{ title: 'View', fn: (_link: any, item: any) => this.view(item) }],\n },\n };\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Shipments</div>\n <div class=\"x-page-subtitle\">Dispatch, deliver, and record delivery exceptions (ORD-08).</div>\n</div>\n\n@if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n} @else {\n <x-element-loader></x-element-loader>\n}\n\n<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Shipment' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n @if (detail.trackingRef) {\n <div class=\"small text-secondary mt-1\">{{ detail.carrier }} · {{ detail.trackingRef }}</div>\n }\n @if (detail.dispatchedAt) {\n <div class=\"small text-secondary\">Dispatched {{ detail.dispatchedAt | date: 'MMM d, h:mm a' }}</div>\n }\n @if (detail.deliveredAt) {\n <div class=\"small text-secondary\">Delivered {{ detail.deliveredAt | date: 'MMM d, h:mm a' }}</div>\n }\n </div>\n\n @if (detail.provider) {\n <div class=\"border rounded p-3 d-flex flex-column gap-2\" data-testid=\"delivery-panel\">\n <div class=\"d-flex align-items-center gap-2\">\n <span class=\"fw-bold small\">Carrier booking</span>\n <span class=\"badge text-bg-light border\" data-testid=\"booking-status\">{{ detail.bookingStatus }}</span>\n <span class=\"small text-secondary\">{{ detail.provider | uppercase }}</span>\n </div>\n <div class=\"small\">Collected from: <strong data-testid=\"pickup-site\">{{ siteName }}</strong></div>\n @if (detail.trackingRef) {\n <div class=\"small\">Waybill: <span class=\"font-monospace\" data-testid=\"waybill\">{{ detail.trackingRef }}</span>\n @if (detail.labelUrl) { · <a [href]=\"detail.labelUrl\" target=\"_blank\" rel=\"noopener\">label</a> }\n </div>\n }\n @if (cost.charged != null || cost.quoted != null) {\n <div class=\"small text-secondary\">\n @if (cost.quoted != null) { Quoted ₦{{ cost.quoted | number: '1.0-2' }} }\n @if (cost.charged != null) { · Charged ₦{{ cost.charged | number: '1.0-2' }} }\n </div>\n }\n @if (bookingMessage) { <div class=\"alert alert-warning py-2 small mb-0\" data-testid=\"booking-message\">{{ bookingMessage }}</div> }\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.bookingStatus === 'pending' || detail.bookingStatus === 'failed' || detail.bookingStatus === 'needs_review') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy\" (click)=\"logistics('retry-booking')\" data-testid=\"retry-booking\">Retry booking</button>\n }\n @if (detail.bookingStatus === 'booked' && detail.status !== 'delivered') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger\" [disabled]=\"busy\" (click)=\"logistics('cancel-booking')\" data-testid=\"cancel-booking\">Cancel booking</button>\n }\n </div>\n @if (!detail.trackingRef) {\n <div class=\"d-flex gap-2\">\n <input class=\"form-control form-control-sm\" placeholder=\"Waybill booked on the carrier's own dashboard\" [(ngModel)]=\"waybillInput\" data-testid=\"waybill-input\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy || !waybillInput.trim()\" (click)=\"logistics('enter-waybill')\" data-testid=\"enter-waybill\">Enter waybill</button>\n </div>\n }\n @if ((detail.status === 'preparing' || detail.status === 'ready_for_dispatch') && sites.length) {\n <div class=\"d-flex gap-2\">\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"changeTo\" data-testid=\"change-origin-select\">\n <option value=\"\">Collect from a different site…</option>\n @for (s of sites; track s.id) { <option [value]=\"s.id\">{{ s.name }}</option> }\n </select>\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"busy || !changeTo\" (click)=\"logistics('change-origin')\" data-testid=\"change-origin\">Change</button>\n </div>\n }\n @if (events.length) {\n <div class=\"small\" data-testid=\"timeline\">\n <div class=\"fw-bold mb-1\">Timeline</div>\n @for (e of events; track e.id) {\n <div class=\"text-secondary\">{{ e.occurredAt | date: 'MMM d, h:mm a' }} · {{ e.description || e.status }}</div>\n }\n </div>\n }\n </div>\n }\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.status === 'preparing' || detail.status === 'ready_for_dispatch') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"dispatch()\">Dispatch</button>\n }\n @if (detail.status === 'dispatched' || detail.status === 'out_for_delivery' || detail.status === 'failed_delivery') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-success\" (click)=\"deliver()\">Mark delivered</button>\n }\n </div>\n\n <table class=\"table table-sm\">\n <thead><tr><th>Order line</th><th>Qty</th><th>Serials</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td class=\"font-monospace small\">{{ line.orderLineId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"small\">{{ line.serialNumbers?.join(', ') || '—' }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div>\n <div class=\"fw-bold small mb-1\">Delivery exceptions</div>\n @for (ex of detail.exceptions; track ex.id) {\n <div class=\"small text-secondary\">\n Attempt {{ ex.attemptNumber }} · {{ ex.reasonCode }}\n @if (ex.notes) { — {{ ex.notes }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div class=\"d-flex flex-column gap-2\">\n <div class=\"fw-bold small\">Record an exception</div>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"exceptionReason\">\n @for (reason of reasons; track reason) {\n <option [value]=\"reason\">{{ reason }}</option>\n }\n </select>\n <input class=\"form-control form-control-sm\" placeholder=\"Note (optional)\" [(ngModel)]=\"exceptionNote\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-warning align-self-start\" (click)=\"recordException()\">\n Record exception\n </button>\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { ShipmentsComponent } from './shipments.component';\n\n@NgModule({\n declarations: [ShipmentsComponent],\n imports: [\n SharedModule,\n ElementsModule,\n Webgets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AC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;AAClC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;AACrE,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -6,7 +6,7 @@ import { using, notify, SharedModule } from '@thescaffold/ngx-core';
|
|
|
6
6
|
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
7
|
import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
8
|
import { takeUntil } from 'rxjs';
|
|
9
|
-
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-
|
|
9
|
+
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs';
|
|
10
10
|
import * as i1 from '@angular/forms';
|
|
11
11
|
import * as i3 from '@angular/common';
|
|
12
12
|
|
|
@@ -182,4 +182,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
182
182
|
}] });
|
|
183
183
|
|
|
184
184
|
export { StaffModule };
|
|
185
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-staff.module-
|
|
185
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs.map
|