@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs","sources":["../../../projects/admin/src/lib/pages/staff/staff.component.ts","../../../projects/admin/src/lib/pages/staff/staff.component.html","../../../projects/admin/src/lib/pages/staff/staff.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { notify, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\ninterface StaffRole {\n id: string;\n name: string;\n title: string;\n permissions: string[];\n superAdmin: boolean;\n}\n\n// Staff (admin dashboard accounts) — super admin only. Backed by\n// `apps/admin/staff` (libs/admin), which enforces the super-admin check\n// server-side; the nav entry and route are only a courtesy. Roles offered\n// here are the existing platform RoleTypes (support agent, catalogue\n// manager, order manager, finance manager, super administrator) — the\n// permission strings shown under each are the ones that role already\n// carries, not something this page defines.\n@Component({\n standalone: false,\n selector: 'x-staff',\n templateUrl: './staff.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class StaffComponent extends ListPageDirective {\n protected pluralName = 'staff';\n protected dataSource = this.apiService.on('apps/admin/staff');\n\n protected columns = [\n { key: 'name', value: 'Name' },\n { key: 'ref', value: 'Email' },\n { key: 'roleLabel', value: 'Roles' },\n { key: 'statusLabel', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'createdAt', value: 'Added', type: 'date' },\n ];\n\n roles: StaffRole[] = [];\n mode: 'create' | 'roles' | null = null;\n saving = false;\n draft: { id?: string; ref?: string; email: string; firstName: string; lastName: string; password: string; roleTypeIds: string[] } | null = null;\n // Shown once after a create that generated the password server-side.\n created: { ref: string; password: string } | null = null;\n\n override init = () => {\n this.apiService\n .get('apps/admin/staff/roles')\n .pipe(takeUntil(this.$))\n .subscribe(using((res: any) => (this.roles = res?.data ?? [])));\n this.list();\n };\n\n protected override mapRow(row: any) {\n return {\n ...row,\n name: [row.firstName, row.lastName].filter(Boolean).join(' ') || '—',\n roleLabel: (row.roles ?? []).map((r: any) => this.roleTitle(r)).join(', '),\n statusLabel: row.suspended ? 'Suspended' : 'Active',\n };\n }\n\n protected override extraCollectionFields() {\n return {\n links: {\n secondary: [\n { title: 'Edit roles', fn: (_link: any, item: any) => this.editRoles(item) },\n {\n title: 'Suspend / reactivate',\n fn: (_link: any, item: any) => this.toggleSuspended(item),\n },\n ],\n },\n };\n }\n\n roleTitle(role: { name: string; title?: string }): string {\n if (role.name === 'global_admin') return 'Super administrator';\n if (role.title) return role.title;\n const words = role.name.replace(/_/g, ' ');\n return words.charAt(0).toUpperCase() + words.slice(1);\n }\n\n startCreate(): void {\n this.created = null;\n this.mode = 'create';\n this.draft = { email: '', firstName: '', lastName: '', password: '', roleTypeIds: [] };\n }\n\n editRoles(item: any): void {\n this.created = null;\n this.mode = 'roles';\n this.draft = {\n id: item.id,\n ref: item.ref,\n email: item.ref,\n firstName: item.firstName ?? '',\n lastName: item.lastName ?? '',\n password: '',\n roleTypeIds: (item.roles ?? []).map((r: any) => r.id),\n };\n }\n\n cancel(): void {\n this.mode = null;\n this.draft = null;\n }\n\n hasRole(id: string): boolean {\n return !!this.draft?.roleTypeIds.includes(id);\n }\n\n toggleRole(id: string): void {\n if (!this.draft) return;\n const ids = this.draft.roleTypeIds;\n this.draft.roleTypeIds = ids.includes(id) ? ids.filter((r) => r !== id) : [...ids, id];\n }\n\n save(): void {\n if (!this.draft || this.saving) return;\n const d = this.draft;\n if (!d.roleTypeIds.length) {\n notify('Assign at least one role.', undefined, 'error');\n return;\n }\n const request$ =\n this.mode === 'create'\n ? this.apiService.post('apps/admin/staff', {\n email: d.email,\n firstName: d.firstName,\n lastName: d.lastName,\n ...(d.password ? { password: d.password } : {}),\n roleTypeIds: d.roleTypeIds,\n })\n : this.apiService.patch(`apps/admin/staff/${d.id}/roles`, { roleTypeIds: d.roleTypeIds });\n\n this.saving = true;\n request$.pipe(takeUntil(this.$)).subscribe({\n next: (res: any) => {\n this.saving = false;\n if (this.mode === 'create' && res?.data?.temporaryPassword) {\n this.created = { ref: res.data.ref, password: res.data.temporaryPassword };\n }\n notify(this.mode === 'create' ? 'Staff account created.' : 'Roles updated.', undefined, 'success');\n this.cancel();\n this.list(this.page, this.perPage, this.query);\n },\n error: (err: any) => {\n this.saving = false;\n notify(err?.error?.message || 'Could not save.', undefined, 'error');\n },\n });\n }\n\n toggleSuspended(item: any): void {\n const action = item.suspended ? 'unsuspend' : 'suspend';\n this.apiService\n .patch(`apps/admin/staff/${item.id}/${action}`, {})\n .pipe(takeUntil(this.$))\n .subscribe({\n next: () => {\n notify(item.suspended ? 'Account reactivated.' : 'Account suspended.', undefined, 'success');\n this.list(this.page, this.perPage, this.query);\n },\n error: (err: any) => notify(err?.error?.message || 'Could not update the account.', undefined, 'error'),\n });\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Staff</div>\n <div class=\"x-page-subtitle\">\n Back-office accounts and the roles that decide what each can do in the admin console. Super administrators only.\n </div>\n</div>\n\n@if (created) {\n <div class=\"x-scrud-editor\" style=\"margin-bottom: 14px\">\n <div class=\"x-scrud-editor-title\">Account created for {{ created.ref }}</div>\n <div class=\"x-page-subtitle\">\n Temporary password (shown once — copy it now and share it securely):\n <code>{{ created.password }}</code>\n </div>\n <div class=\"x-scrud-editor-actions\">\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"created = null\">Dismiss</button>\n </div>\n </div>\n}\n\n@if (!mode) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New staff member</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">\n {{ mode === 'create' ? 'New staff member' : 'Roles for ' + draft.ref }}\n </div>\n <div class=\"x-scrud-editor-actions\">\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancel()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n @if (mode === 'create') {\n <div class=\"x-scrud-grid\">\n <label class=\"x-scrud-f\">\n First name <span class=\"x-scrud-required\">*</span>\n <input type=\"text\" [(ngModel)]=\"draft.firstName\" />\n </label>\n <label class=\"x-scrud-f\">\n Last name <span class=\"x-scrud-required\">*</span>\n <input type=\"text\" [(ngModel)]=\"draft.lastName\" />\n </label>\n <label class=\"x-scrud-f\">\n Email <span class=\"x-scrud-required\">*</span>\n <input type=\"email\" [(ngModel)]=\"draft.email\" autocomplete=\"off\" />\n </label>\n <label class=\"x-scrud-f\">\n Initial password\n <input type=\"text\" [(ngModel)]=\"draft.password\" placeholder=\"Leave blank to generate one\" autocomplete=\"off\" />\n </label>\n </div>\n }\n\n <div class=\"x-scrud-f\">\n Roles <span class=\"x-scrud-required\">*</span>\n @for (role of roles; track role.id) {\n <label style=\"display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-top: 6px\">\n <input type=\"checkbox\" [checked]=\"hasRole(role.id)\" (change)=\"toggleRole(role.id)\" style=\"margin-top: 3px\" />\n <span>\n <strong>{{ roleTitle(role) }}</strong>\n @if (role.superAdmin) {\n <span class=\"badge text-bg-light border\" style=\"margin-left: 6px\">can manage staff</span>\n }\n <span style=\"display: block; font-size: 11.5px; color: var(--color-text-muted)\">\n {{ role.permissions.length }} permission{{ role.permissions.length === 1 ? '' : 's' }}\n </span>\n </span>\n </label>\n }\n </div>\n </div>\n}\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 { StaffComponent } from './staff.component';\n\n@NgModule({\n declarations: [StaffComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: StaffComponent }]),\n ],\n})\nexport class StaffModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAaA;AAC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file":"isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs","sources":["../../../projects/admin/src/lib/pages/staff/staff.component.ts","../../../projects/admin/src/lib/pages/staff/staff.component.html","../../../projects/admin/src/lib/pages/staff/staff.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { notify, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\ninterface StaffRole {\n id: string;\n name: string;\n title: string;\n permissions: string[];\n superAdmin: boolean;\n}\n\n// Staff (admin dashboard accounts) — super admin only. Backed by\n// `apps/admin/staff` (libs/admin), which enforces the super-admin check\n// server-side; the nav entry and route are only a courtesy. Roles offered\n// here are the existing platform RoleTypes (support agent, catalogue\n// manager, order manager, finance manager, super administrator) — the\n// permission strings shown under each are the ones that role already\n// carries, not something this page defines.\n@Component({\n standalone: false,\n selector: 'x-staff',\n templateUrl: './staff.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class StaffComponent extends ListPageDirective {\n protected pluralName = 'staff';\n protected dataSource = this.apiService.on('apps/admin/staff');\n\n protected columns = [\n { key: 'name', value: 'Name' },\n { key: 'ref', value: 'Email' },\n { key: 'roleLabel', value: 'Roles' },\n { key: 'statusLabel', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'createdAt', value: 'Added', type: 'date' },\n ];\n\n roles: StaffRole[] = [];\n mode: 'create' | 'roles' | null = null;\n saving = false;\n draft: { id?: string; ref?: string; email: string; firstName: string; lastName: string; password: string; roleTypeIds: string[] } | null = null;\n // Shown once after a create that generated the password server-side.\n created: { ref: string; password: string } | null = null;\n\n override init = () => {\n this.apiService\n .get('apps/admin/staff/roles')\n .pipe(takeUntil(this.$))\n .subscribe(using((res: any) => (this.roles = res?.data ?? [])));\n this.list();\n };\n\n protected override mapRow(row: any) {\n return {\n ...row,\n name: [row.firstName, row.lastName].filter(Boolean).join(' ') || '—',\n roleLabel: (row.roles ?? []).map((r: any) => this.roleTitle(r)).join(', '),\n statusLabel: row.suspended ? 'Suspended' : 'Active',\n };\n }\n\n protected override extraCollectionFields() {\n return {\n links: {\n secondary: [\n { title: 'Edit roles', fn: (_link: any, item: any) => this.editRoles(item) },\n {\n title: 'Suspend / reactivate',\n fn: (_link: any, item: any) => this.toggleSuspended(item),\n },\n ],\n },\n };\n }\n\n roleTitle(role: { name: string; title?: string }): string {\n if (role.name === 'global_admin') return 'Super administrator';\n if (role.title) return role.title;\n const words = role.name.replace(/_/g, ' ');\n return words.charAt(0).toUpperCase() + words.slice(1);\n }\n\n startCreate(): void {\n this.created = null;\n this.mode = 'create';\n this.draft = { email: '', firstName: '', lastName: '', password: '', roleTypeIds: [] };\n }\n\n editRoles(item: any): void {\n this.created = null;\n this.mode = 'roles';\n this.draft = {\n id: item.id,\n ref: item.ref,\n email: item.ref,\n firstName: item.firstName ?? '',\n lastName: item.lastName ?? '',\n password: '',\n roleTypeIds: (item.roles ?? []).map((r: any) => r.id),\n };\n }\n\n cancel(): void {\n this.mode = null;\n this.draft = null;\n }\n\n hasRole(id: string): boolean {\n return !!this.draft?.roleTypeIds.includes(id);\n }\n\n toggleRole(id: string): void {\n if (!this.draft) return;\n const ids = this.draft.roleTypeIds;\n this.draft.roleTypeIds = ids.includes(id) ? ids.filter((r) => r !== id) : [...ids, id];\n }\n\n save(): void {\n if (!this.draft || this.saving) return;\n const d = this.draft;\n if (!d.roleTypeIds.length) {\n notify('Assign at least one role.', undefined, 'error');\n return;\n }\n const request$ =\n this.mode === 'create'\n ? this.apiService.post('apps/admin/staff', {\n email: d.email,\n firstName: d.firstName,\n lastName: d.lastName,\n ...(d.password ? { password: d.password } : {}),\n roleTypeIds: d.roleTypeIds,\n })\n : this.apiService.patch(`apps/admin/staff/${d.id}/roles`, { roleTypeIds: d.roleTypeIds });\n\n this.saving = true;\n request$.pipe(takeUntil(this.$)).subscribe({\n next: (res: any) => {\n this.saving = false;\n if (this.mode === 'create' && res?.data?.temporaryPassword) {\n this.created = { ref: res.data.ref, password: res.data.temporaryPassword };\n }\n notify(this.mode === 'create' ? 'Staff account created.' : 'Roles updated.', undefined, 'success');\n this.cancel();\n this.list(this.page, this.perPage, this.query);\n },\n error: (err: any) => {\n this.saving = false;\n notify(err?.error?.message || 'Could not save.', undefined, 'error');\n },\n });\n }\n\n toggleSuspended(item: any): void {\n const action = item.suspended ? 'unsuspend' : 'suspend';\n this.apiService\n .patch(`apps/admin/staff/${item.id}/${action}`, {})\n .pipe(takeUntil(this.$))\n .subscribe({\n next: () => {\n notify(item.suspended ? 'Account reactivated.' : 'Account suspended.', undefined, 'success');\n this.list(this.page, this.perPage, this.query);\n },\n error: (err: any) => notify(err?.error?.message || 'Could not update the account.', undefined, 'error'),\n });\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Staff</div>\n <div class=\"x-page-subtitle\">\n Back-office accounts and the roles that decide what each can do in the admin console. Super administrators only.\n </div>\n</div>\n\n@if (created) {\n <div class=\"x-scrud-editor\" style=\"margin-bottom: 14px\">\n <div class=\"x-scrud-editor-title\">Account created for {{ created.ref }}</div>\n <div class=\"x-page-subtitle\">\n Temporary password (shown once — copy it now and share it securely):\n <code>{{ created.password }}</code>\n </div>\n <div class=\"x-scrud-editor-actions\">\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"created = null\">Dismiss</button>\n </div>\n </div>\n}\n\n@if (!mode) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New staff member</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">\n {{ mode === 'create' ? 'New staff member' : 'Roles for ' + draft.ref }}\n </div>\n <div class=\"x-scrud-editor-actions\">\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancel()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n @if (mode === 'create') {\n <div class=\"x-scrud-grid\">\n <label class=\"x-scrud-f\">\n First name <span class=\"x-scrud-required\">*</span>\n <input type=\"text\" [(ngModel)]=\"draft.firstName\" />\n </label>\n <label class=\"x-scrud-f\">\n Last name <span class=\"x-scrud-required\">*</span>\n <input type=\"text\" [(ngModel)]=\"draft.lastName\" />\n </label>\n <label class=\"x-scrud-f\">\n Email <span class=\"x-scrud-required\">*</span>\n <input type=\"email\" [(ngModel)]=\"draft.email\" autocomplete=\"off\" />\n </label>\n <label class=\"x-scrud-f\">\n Initial password\n <input type=\"text\" [(ngModel)]=\"draft.password\" placeholder=\"Leave blank to generate one\" autocomplete=\"off\" />\n </label>\n </div>\n }\n\n <div class=\"x-scrud-f\">\n Roles <span class=\"x-scrud-required\">*</span>\n @for (role of roles; track role.id) {\n <label style=\"display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-top: 6px\">\n <input type=\"checkbox\" [checked]=\"hasRole(role.id)\" (change)=\"toggleRole(role.id)\" style=\"margin-top: 3px\" />\n <span>\n <strong>{{ roleTitle(role) }}</strong>\n @if (role.superAdmin) {\n <span class=\"badge text-bg-light border\" style=\"margin-left: 6px\">can manage staff</span>\n }\n <span style=\"display: block; font-size: 11.5px; color: var(--color-text-muted)\">\n {{ role.permissions.length }} permission{{ role.permissions.length === 1 ? '' : 's' }}\n </span>\n </span>\n </label>\n }\n </div>\n </div>\n}\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 { StaffComponent } from './staff.component';\n\n@NgModule({\n declarations: [StaffComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\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AE,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;AACjE,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Plain-language, colour-toned status chips for admin tables. The
|
|
2
|
+
// collection widget renders plain cells as HTML, so a row mapper can drop
|
|
3
|
+
// `statusBadge(row.status)` straight into a column.
|
|
4
|
+
const TONES = {
|
|
5
|
+
// orders
|
|
6
|
+
pending_payment: 'warn',
|
|
7
|
+
payment_received: 'info',
|
|
8
|
+
on_hold: 'warn',
|
|
9
|
+
confirmed: 'info',
|
|
10
|
+
processing: 'info',
|
|
11
|
+
ready_to_ship: 'info',
|
|
12
|
+
ready_for_pickup: 'info',
|
|
13
|
+
partially_fulfilled: 'warn',
|
|
14
|
+
dispatched: 'info',
|
|
15
|
+
delivered: 'success',
|
|
16
|
+
completed: 'success',
|
|
17
|
+
cancelled: 'neutral',
|
|
18
|
+
refunded: 'neutral',
|
|
19
|
+
failed: 'danger',
|
|
20
|
+
// catalogue
|
|
21
|
+
draft: 'neutral',
|
|
22
|
+
active: 'success',
|
|
23
|
+
archived: 'neutral',
|
|
24
|
+
// payments / requests / claims
|
|
25
|
+
success: 'success',
|
|
26
|
+
pending: 'warn',
|
|
27
|
+
requested: 'warn',
|
|
28
|
+
submitted: 'warn',
|
|
29
|
+
new: 'warn',
|
|
30
|
+
approved: 'success',
|
|
31
|
+
rejected: 'danger',
|
|
32
|
+
escalated: 'danger',
|
|
33
|
+
closed: 'neutral',
|
|
34
|
+
won: 'success',
|
|
35
|
+
lost: 'neutral',
|
|
36
|
+
};
|
|
37
|
+
const LABELS = {
|
|
38
|
+
pending_payment: 'Awaiting payment',
|
|
39
|
+
payment_received: 'Paid',
|
|
40
|
+
ready_to_ship: 'Ready to ship',
|
|
41
|
+
ready_for_pickup: 'Ready for pickup',
|
|
42
|
+
partially_fulfilled: 'Partly shipped',
|
|
43
|
+
on_hold: 'On hold',
|
|
44
|
+
};
|
|
45
|
+
function statusLabel(status) {
|
|
46
|
+
if (!status)
|
|
47
|
+
return '—';
|
|
48
|
+
if (LABELS[status])
|
|
49
|
+
return LABELS[status];
|
|
50
|
+
const words = status.replace(/[_-]+/g, ' ').trim();
|
|
51
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
52
|
+
}
|
|
53
|
+
function statusBadge(status) {
|
|
54
|
+
if (!status)
|
|
55
|
+
return '—';
|
|
56
|
+
const tone = TONES[status] ?? 'neutral';
|
|
57
|
+
return `<span class="x-status x-status-${tone}" title="${status}">${statusLabel(status)}</span>`;
|
|
58
|
+
}
|
|
59
|
+
// Filter chips for `x-webget-collection` (`data.filters`): "All" plus one
|
|
60
|
+
// per status; each chip's `query` is merged into the list request.
|
|
61
|
+
function statusFilters(statuses) {
|
|
62
|
+
return [{ title: 'All', query: {} }, ...statuses.map((s) => ({ title: statusLabel(s), query: { status: s } }))];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { statusBadge as a, statusFilters as s };
|
|
66
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs","sources":["../../../projects/admin/src/lib/pages/_shared/status-badge.ts"],"sourcesContent":["// Plain-language, colour-toned status chips for admin tables. The\n// collection widget renders plain cells as HTML, so a row mapper can drop\n// `statusBadge(row.status)` straight into a column.\n\ntype Tone = 'neutral' | 'info' | 'warn' | 'success' | 'danger';\n\nconst TONES: Record<string, Tone> = {\n // orders\n pending_payment: 'warn',\n payment_received: 'info',\n on_hold: 'warn',\n confirmed: 'info',\n processing: 'info',\n ready_to_ship: 'info',\n ready_for_pickup: 'info',\n partially_fulfilled: 'warn',\n dispatched: 'info',\n delivered: 'success',\n completed: 'success',\n cancelled: 'neutral',\n refunded: 'neutral',\n failed: 'danger',\n // catalogue\n draft: 'neutral',\n active: 'success',\n archived: 'neutral',\n // payments / requests / claims\n success: 'success',\n pending: 'warn',\n requested: 'warn',\n submitted: 'warn',\n new: 'warn',\n approved: 'success',\n rejected: 'danger',\n escalated: 'danger',\n closed: 'neutral',\n won: 'success',\n lost: 'neutral',\n};\n\nconst LABELS: Record<string, string> = {\n pending_payment: 'Awaiting payment',\n payment_received: 'Paid',\n ready_to_ship: 'Ready to ship',\n ready_for_pickup: 'Ready for pickup',\n partially_fulfilled: 'Partly shipped',\n on_hold: 'On hold',\n};\n\nexport function statusLabel(status?: string | null): string {\n if (!status) return '—';\n if (LABELS[status]) return LABELS[status];\n const words = status.replace(/[_-]+/g, ' ').trim();\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\nexport function statusBadge(status?: string | null): string {\n if (!status) return '—';\n const tone = TONES[status] ?? 'neutral';\n return `<span class=\"x-status x-status-${tone}\" title=\"${status}\">${statusLabel(status)}</span>`;\n}\n\n// Filter chips for `x-webget-collection` (`data.filters`): \"All\" plus one\n// per status; each chip's `query` is merged into the list request.\nexport function statusFilters(statuses: string[]): { title: string; query: Record<string, string> }[] {\n return [{ title: 'All', query: {} }, ...statuses.map((s) => ({ title: statusLabel(s), query: { status: s } }))];\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AAIA,MAAM,KAAK,GAAyB;;AAElC,IAAA,eAAe,EAAE,MAAM;AACvB,IAAA,gBAAgB,EAAE,MAAM;AACxB,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,aAAa,EAAE,MAAM;AACrB,IAAA,gBAAgB,EAAE,MAAM;AACxB,IAAA,mBAAmB,EAAE,MAAM;AAC3B,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,MAAM,EAAE,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EAAkC,IAAI,CAAA,SAAA,EAAY,MAAM,CAAA,EAAA,EAAK,WAAW,CAAC,MAAM,CAAC,CAAA,OAAA,CAAS;AAClG;AAEA;AACA;AACM,SAAU,aAAa,CAAC,QAAkB,EAAA;AAC9C,IAAA,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACjH;;;;"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { 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 { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
|
+
import { takeUntil, firstValueFrom, catchError, of } from 'rxjs';
|
|
9
|
+
import { S as SimpleCrudDirective, J as JsonBuilderComponent } from './isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs';
|
|
10
|
+
import * as i1 from '@angular/forms';
|
|
11
|
+
import * as i3 from '@angular/common';
|
|
12
|
+
|
|
13
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
14
|
+
// R1 production-readiness pass — CAT-08 (partial). Was a flat read-only
|
|
15
|
+
// table; this makes available/reserved/incoming/threshold/policy
|
|
16
|
+
// editable directly. Reason-coded adjustment history, transfers between
|
|
17
|
+
// locations and serial-number registers are real, separate scope (no
|
|
18
|
+
// `StockAdjustment`-style entity exists yet — that's a new audit-trail
|
|
19
|
+
// feature, not a form to add) — most new variant/location stock rows
|
|
20
|
+
// still get created from the Catalogue product editor, which has proper
|
|
21
|
+
// variant/location pickers; this page is for adjusting an existing row.
|
|
22
|
+
class StockComponent extends SimpleCrudDirective {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.locationSource = this.apiService.on('apps/commerce/stock-location');
|
|
26
|
+
this.variantSource = this.apiService.on('apps/commerce/product-variant');
|
|
27
|
+
this.productSource = this.apiService.on('apps/commerce/product');
|
|
28
|
+
// Rows reference a variant and a location by id; these caches turn them
|
|
29
|
+
// into "Product · SKU" and the location's name.
|
|
30
|
+
this.variants = new Map();
|
|
31
|
+
this.products = new Map();
|
|
32
|
+
this.locations = new Map();
|
|
33
|
+
this.pageTitle = 'Stock';
|
|
34
|
+
this.pageSubtitle = 'Per-variant, per-location levels — available, reserved and incoming.';
|
|
35
|
+
this.singularLabel = 'stock level';
|
|
36
|
+
this.pluralName = 'stock';
|
|
37
|
+
this.dataSource = this.apiService.on('apps/commerce/stock-level');
|
|
38
|
+
this.columns = [
|
|
39
|
+
{ key: 'productLabel', value: 'Product' },
|
|
40
|
+
{ key: 'skuLabel', value: 'SKU' },
|
|
41
|
+
{ key: 'locationLabel', value: 'Location' },
|
|
42
|
+
{ key: 'available', value: 'Available' },
|
|
43
|
+
{ key: 'reserved', value: 'Reserved' },
|
|
44
|
+
{ key: 'incoming', value: 'Incoming' },
|
|
45
|
+
{ key: 'levelHtml', value: 'Level' },
|
|
46
|
+
];
|
|
47
|
+
this.fields = [
|
|
48
|
+
{ key: 'variantId', label: 'Variant SKU (or id)', type: 'text', required: true, placeholder: 'e.g. MUST-PV18-5548' },
|
|
49
|
+
{ key: 'locationId', label: 'Location', type: 'select', optionsKey: 'locations', required: true },
|
|
50
|
+
{ key: 'available', label: 'Available', type: 'number' },
|
|
51
|
+
{ key: 'reserved', label: 'Reserved', type: 'number' },
|
|
52
|
+
{ key: 'incoming', label: 'Incoming', type: 'number' },
|
|
53
|
+
{ key: 'lowStockThreshold', label: 'Low-stock threshold', type: 'number' },
|
|
54
|
+
{ key: 'leadTimeDays', label: 'Lead time (days)', type: 'number' },
|
|
55
|
+
{
|
|
56
|
+
key: 'outOfStockPolicy',
|
|
57
|
+
label: 'Out-of-stock policy',
|
|
58
|
+
type: 'select',
|
|
59
|
+
options: [
|
|
60
|
+
{ value: 'hide', label: 'Hide' },
|
|
61
|
+
{ value: 'show', label: 'Show (sold out)' },
|
|
62
|
+
{ value: 'backorder', label: 'Backorder' },
|
|
63
|
+
{ value: 'preorder', label: 'Preorder' },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
this.init = () => {
|
|
68
|
+
this.list();
|
|
69
|
+
this.locationSource
|
|
70
|
+
.getMany({ page: 1, perPage: 100 })
|
|
71
|
+
.pipe(takeUntil(this.$))
|
|
72
|
+
.subscribe(using((response) => {
|
|
73
|
+
const rows = response?.data ?? [];
|
|
74
|
+
rows.forEach((l) => this.locations.set(l.id, l.name));
|
|
75
|
+
this.dynamicOptions['locations'] = rows.map((l) => ({
|
|
76
|
+
value: l.id,
|
|
77
|
+
label: l.name,
|
|
78
|
+
}));
|
|
79
|
+
// Location names may arrive after the first page rendered.
|
|
80
|
+
if (this.list$.value)
|
|
81
|
+
this.list(this.page, this.perPage, this.query);
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async enrichRows(rows) {
|
|
86
|
+
const variantIds = [...new Set(rows.map((r) => r.variantId).filter((id) => id && !this.variants.has(id)))];
|
|
87
|
+
await Promise.all(variantIds.map(async (id) => {
|
|
88
|
+
const v = await this.byId(this.variantSource, id);
|
|
89
|
+
this.variants.set(id, { sku: v?.sku, productId: v?.productId });
|
|
90
|
+
}));
|
|
91
|
+
const productIds = [
|
|
92
|
+
...new Set(rows
|
|
93
|
+
.map((r) => this.variants.get(r.variantId)?.productId)
|
|
94
|
+
.filter((id) => !!id && !this.products.has(id))),
|
|
95
|
+
];
|
|
96
|
+
await Promise.all(productIds.map(async (id) => {
|
|
97
|
+
this.products.set(id, (await this.byId(this.productSource, id))?.name ?? '');
|
|
98
|
+
}));
|
|
99
|
+
// The picker list holds the first 100 sites; look up any others.
|
|
100
|
+
const locationIds = [...new Set(rows.map((r) => r.locationId).filter((id) => id && !this.locations.has(id)))];
|
|
101
|
+
await Promise.all(locationIds.map(async (id) => {
|
|
102
|
+
this.locations.set(id, (await this.byId(this.locationSource, id))?.name ?? '');
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
// A list call filtered by id answers 200 with no rows for a deleted
|
|
106
|
+
// record, where `getOne` would 404 (and log a console error) for each.
|
|
107
|
+
async byId(source, id) {
|
|
108
|
+
const res = await firstValueFrom(source.getMany({ id, page: 1, perPage: 1 }).pipe(catchError(() => of(null))));
|
|
109
|
+
return (res?.data ?? []).find((r) => r.id === id) ?? null;
|
|
110
|
+
}
|
|
111
|
+
mapRow(row) {
|
|
112
|
+
const variant = this.variants.get(row.variantId);
|
|
113
|
+
const free = Number(row.available ?? 0) - Number(row.reserved ?? 0);
|
|
114
|
+
const threshold = row.lowStockThreshold != null ? Number(row.lowStockThreshold) : 5;
|
|
115
|
+
const level = free <= 0
|
|
116
|
+
? '<span class="x-status x-status-danger">Out</span>'
|
|
117
|
+
: free <= threshold
|
|
118
|
+
? '<span class="x-status x-status-warn">Low</span>'
|
|
119
|
+
: '<span class="x-status x-status-success">OK</span>';
|
|
120
|
+
return {
|
|
121
|
+
...row,
|
|
122
|
+
// Empty name = the record was deleted (stock rows outlive their product / site).
|
|
123
|
+
productLabel: (variant?.productId && this.products.get(variant.productId)) || 'Removed product',
|
|
124
|
+
skuLabel: variant?.sku || '—',
|
|
125
|
+
locationLabel: this.locations.get(row.locationId) || 'Removed location',
|
|
126
|
+
levelHtml: level,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
// New rows can name the variant by SKU; it's swapped for the id here.
|
|
130
|
+
async save() {
|
|
131
|
+
const ref = `${this.draft?.['variantId'] ?? ''}`.trim();
|
|
132
|
+
if (this.draft && ref && !UUID.test(ref)) {
|
|
133
|
+
const res = await firstValueFrom(this.variantSource.getMany({ sku: ref, page: 1, perPage: 1 }).pipe(catchError(() => of(null))));
|
|
134
|
+
const match = (res?.data ?? []).find((v) => v.sku === ref);
|
|
135
|
+
if (!match) {
|
|
136
|
+
notify(`No variant has the SKU "${ref}".`, undefined, 'error');
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this.draft['variantId'] = match.id;
|
|
140
|
+
}
|
|
141
|
+
return super.save();
|
|
142
|
+
}
|
|
143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StockComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
144
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: StockComponent, isStandalone: false, selector: "x-stock", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-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-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other\u2026</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-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 @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\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", 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}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-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-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-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-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-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-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"], dependencies: [{ kind: "component", type: JsonBuilderComponent, selector: "x-json-builder", inputs: ["kind", "value"], outputs: ["valueChange"] }, { 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: "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" }] }); }
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StockComponent, decorators: [{
|
|
147
|
+
type: Component,
|
|
148
|
+
args: [{ standalone: false, selector: 'x-stock', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-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-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other\u2026</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-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 @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\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", 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}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-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-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-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-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-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-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"] }]
|
|
149
|
+
}] });
|
|
150
|
+
|
|
151
|
+
class StockModule {
|
|
152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
153
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: StockModule, declarations: [StockComponent], imports: [JsonBuilderComponent,
|
|
154
|
+
SharedModule,
|
|
155
|
+
ElementsModule,
|
|
156
|
+
WebgetsModule, i1$1.RouterModule] }); }
|
|
157
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StockModule, imports: [JsonBuilderComponent,
|
|
158
|
+
SharedModule,
|
|
159
|
+
ElementsModule,
|
|
160
|
+
WebgetsModule,
|
|
161
|
+
RouterModule.forChild([{ path: '', component: StockComponent }])] }); }
|
|
162
|
+
}
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StockModule, decorators: [{
|
|
164
|
+
type: NgModule,
|
|
165
|
+
args: [{
|
|
166
|
+
declarations: [StockComponent],
|
|
167
|
+
imports: [
|
|
168
|
+
JsonBuilderComponent,
|
|
169
|
+
SharedModule,
|
|
170
|
+
ElementsModule,
|
|
171
|
+
WebgetsModule,
|
|
172
|
+
RouterModule.forChild([{ path: '', component: StockComponent }]),
|
|
173
|
+
],
|
|
174
|
+
}]
|
|
175
|
+
}] });
|
|
176
|
+
|
|
177
|
+
export { StockModule };
|
|
178
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs","sources":["../../../projects/admin/src/lib/pages/stock/stock.component.ts","../../../projects/admin/src/lib/pages/_shared/simple-crud.component.html","../../../projects/admin/src/lib/pages/stock/stock.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, of, takeUntil } from 'rxjs';\nimport { CrudFieldSpec, SimpleCrudDirective } from '../_shared/simple-crud.base';\n\nconst UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n// R1 production-readiness pass — CAT-08 (partial). Was a flat read-only\n// table; this makes available/reserved/incoming/threshold/policy\n// editable directly. Reason-coded adjustment history, transfers between\n// locations and serial-number registers are real, separate scope (no\n// `StockAdjustment`-style entity exists yet — that's a new audit-trail\n// feature, not a form to add) — most new variant/location stock rows\n// still get created from the Catalogue product editor, which has proper\n// variant/location pickers; this page is for adjusting an existing row.\n@Component({\n standalone: false,\n selector: 'x-stock',\n templateUrl: '../_shared/simple-crud.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class StockComponent extends SimpleCrudDirective {\n private readonly locationSource = this.apiService.on('apps/commerce/stock-location');\n private readonly variantSource = this.apiService.on('apps/commerce/product-variant');\n private readonly productSource = this.apiService.on('apps/commerce/product');\n\n // Rows reference a variant and a location by id; these caches turn them\n // into \"Product · SKU\" and the location's name.\n private readonly variants = new Map<string, { sku?: string; productId?: string }>();\n private readonly products = new Map<string, string>();\n private readonly locations = new Map<string, string>();\n\n protected pageTitle = 'Stock';\n protected pageSubtitle = 'Per-variant, per-location levels — available, reserved and incoming.';\n protected singularLabel = 'stock level';\n protected pluralName = 'stock';\n protected dataSource = this.apiService.on('apps/commerce/stock-level');\n\n protected columns = [\n { key: 'productLabel', value: 'Product' },\n { key: 'skuLabel', value: 'SKU' },\n { key: 'locationLabel', value: 'Location' },\n { key: 'available', value: 'Available' },\n { key: 'reserved', value: 'Reserved' },\n { key: 'incoming', value: 'Incoming' },\n { key: 'levelHtml', value: 'Level' },\n ];\n\n protected fields: CrudFieldSpec[] = [\n { key: 'variantId', label: 'Variant SKU (or id)', type: 'text', required: true, placeholder: 'e.g. MUST-PV18-5548' },\n { key: 'locationId', label: 'Location', type: 'select', optionsKey: 'locations', required: true },\n { key: 'available', label: 'Available', type: 'number' },\n { key: 'reserved', label: 'Reserved', type: 'number' },\n { key: 'incoming', label: 'Incoming', type: 'number' },\n { key: 'lowStockThreshold', label: 'Low-stock threshold', type: 'number' },\n { key: 'leadTimeDays', label: 'Lead time (days)', type: 'number' },\n {\n key: 'outOfStockPolicy',\n label: 'Out-of-stock policy',\n type: 'select',\n options: [\n { value: 'hide', label: 'Hide' },\n { value: 'show', label: 'Show (sold out)' },\n { value: 'backorder', label: 'Backorder' },\n { value: 'preorder', label: 'Preorder' },\n ],\n },\n ];\n\n override init = () => {\n this.list();\n this.locationSource\n .getMany({ page: 1, perPage: 100 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n const rows: any[] = response?.data ?? [];\n rows.forEach((l) => this.locations.set(l.id, l.name));\n this.dynamicOptions['locations'] = rows.map((l: any) => ({\n value: l.id,\n label: l.name,\n }));\n // Location names may arrive after the first page rendered.\n if (this.list$.value) this.list(this.page, this.perPage, this.query);\n }),\n );\n };\n\n protected override async enrichRows(rows: any[]): Promise<void> {\n const variantIds = [...new Set(rows.map((r) => r.variantId).filter((id) => id && !this.variants.has(id)))];\n await Promise.all(\n variantIds.map(async (id: string) => {\n const v = await this.byId(this.variantSource, id);\n this.variants.set(id, { sku: v?.sku, productId: v?.productId });\n }),\n );\n const productIds = [\n ...new Set(\n rows\n .map((r) => this.variants.get(r.variantId)?.productId)\n .filter((id): id is string => !!id && !this.products.has(id)),\n ),\n ];\n await Promise.all(\n productIds.map(async (id) => {\n this.products.set(id, (await this.byId(this.productSource, id))?.name ?? '');\n }),\n );\n // The picker list holds the first 100 sites; look up any others.\n const locationIds = [...new Set(rows.map((r) => r.locationId).filter((id) => id && !this.locations.has(id)))];\n await Promise.all(\n locationIds.map(async (id: string) => {\n this.locations.set(id, (await this.byId(this.locationSource, id))?.name ?? '');\n }),\n );\n }\n\n // A list call filtered by id answers 200 with no rows for a deleted\n // record, where `getOne` would 404 (and log a console error) for each.\n private async byId(source: any, id: string): Promise<any | null> {\n const res: any = await firstValueFrom(\n source.getMany({ id, page: 1, perPage: 1 } as any).pipe(catchError(() => of(null))),\n );\n return (res?.data ?? []).find((r: any) => r.id === id) ?? null;\n }\n\n protected override mapRow(row: any): any {\n const variant = this.variants.get(row.variantId);\n const free = Number(row.available ?? 0) - Number(row.reserved ?? 0);\n const threshold = row.lowStockThreshold != null ? Number(row.lowStockThreshold) : 5;\n const level =\n free <= 0\n ? '<span class=\"x-status x-status-danger\">Out</span>'\n : free <= threshold\n ? '<span class=\"x-status x-status-warn\">Low</span>'\n : '<span class=\"x-status x-status-success\">OK</span>';\n return {\n ...row,\n // Empty name = the record was deleted (stock rows outlive their product / site).\n productLabel: (variant?.productId && this.products.get(variant.productId)) || 'Removed product',\n skuLabel: variant?.sku || '—',\n locationLabel: this.locations.get(row.locationId) || 'Removed location',\n levelHtml: level,\n };\n }\n\n // New rows can name the variant by SKU; it's swapped for the id here.\n override async save(): Promise<void> {\n const ref = `${this.draft?.['variantId'] ?? ''}`.trim();\n if (this.draft && ref && !UUID.test(ref)) {\n const res: any = await firstValueFrom(\n this.variantSource.getMany({ sku: ref, page: 1, perPage: 1 } as any).pipe(catchError(() => of(null))),\n );\n const match = (res?.data ?? []).find((v: any) => v.sku === ref);\n if (!match) {\n notify(`No variant has the SKU \"${ref}\".`, undefined, 'error');\n return;\n }\n this.draft['variantId'] = match.id;\n }\n return super.save();\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n @if (f.type === 'builder') {\n <!-- a div, not a label: a label would forward every click inside the\n builder to its first checkbox -->\n <div class=\"x-scrud-f x-scrud-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-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n @if (f.allowCustom) {\n <select [ngModel]=\"selectValue(f)\" (ngModelChange)=\"onSelect(f, $event)\" [attr.data-testid]=\"'select-' + f.key\">\n <option value=\"\">— choose —</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n <option [value]=\"customOption\">Other…</option>\n </select>\n @if (selectValue(f) === customOption) {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || 'Type a name'\" [attr.data-testid]=\"'custom-' + f.key\" />\n }\n } @else {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">— choose —</option>\n @for (opt of optionsFor(f); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-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 @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\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","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { StockComponent } from './stock.component';\nimport { JsonBuilderComponent } from '../_shared/rule-builders/json-builder.component';\n\n@NgModule({\n declarations: [StockComponent],\n imports: [\n JsonBuilderComponent,\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: StockComponent }]),\n ],\n})\nexport class StockModule {}\n"],"names":["i1.JsonBuilderComponent","i2","i3","i4","i1"],"mappings":";;;;;;;;;;;;AAKA,MAAM,IAAI,GAAG,iEAAiE;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOM,MAAO,cAAe,SAAQ,mBAAmB,CAAA;AANvD,IAAA,WAAA,GAAA;;QAOmB,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,8BAA8B,CAAC;QACnE,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,+BAA+B,CAAC;QACnE,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,uBAAuB,CAAC;;;AAI3D,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,GAAG,EAAgD;AAClE,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,GAAG,EAAkB;AACpC,QAAA,IAAA,CAAA,S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AAE,cAAc,EAAE,CAAC,CAAC;AACjE,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -5,7 +5,7 @@ import { RouterModule } from '@angular/router';
|
|
|
5
5
|
import { SharedModule } from '@thescaffold/ngx-core';
|
|
6
6
|
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
7
|
import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
|
-
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-
|
|
8
|
+
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs';
|
|
9
9
|
import * as i3 from '@angular/common';
|
|
10
10
|
|
|
11
11
|
// Read-only, searchable User browser (docs/PLAN_2.md Phase 10 req #25) - no
|
|
@@ -83,4 +83,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
83
83
|
}] });
|
|
84
84
|
|
|
85
85
|
export { UsersModule };
|
|
86
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-users.module-
|
|
86
|
+
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-users.module-
|
|
1
|
+
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs","sources":["../../../projects/admin/src/lib/pages/users/users.component.ts","../../../projects/admin/src/lib/pages/users/users.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\n// Read-only, searchable User browser (docs/PLAN_2.md Phase 10 req #25) - no\n// list/detail existed anywhere in Tilmart's admin before this. Deliberately\n// thin: identity's own vendor \"people\" Angular pages (ngx-apps/projects/\n// identity/src/lib/pages/people/) are workspace-team-membership management\n// (\"invite a teammate to my workspace\", backed by apps/identity/role-type),\n// the wrong shape entirely for \"browse every registered buyer platform-\n// wide\" - so this is a fresh page against apps/identity/user directly,\n// matching this app's established x-webget-collection pattern (routes,\n// inbox, payments) rather than pulling in that vendor module.\n@Component({\n standalone: false,\n selector: 'x-users',\n template: `\n <div class=\"x-page-head\">\n <div class=\"x-page-title\">Users</div>\n <div class=\"x-page-subtitle\">Every registered account, across all workspaces.</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 styles: [\n `\n .x-page-head {\n margin-bottom: 20px;\n }\n .x-page-title {\n font-size: 24px;\n font-weight: 800;\n color: var(--color-text);\n }\n .x-page-subtitle {\n font-size: 13.5px;\n color: var(--color-text-muted);\n margin-top: 2px;\n }\n `,\n ],\n})\nexport class UsersComponent extends ListPageDirective {\n name = 'user';\n protected pluralName = 'users';\n protected dataSource = this.apiService.on('apps/identity/user');\n\n protected columns = [\n { key: 'ref', value: 'Email / phone' },\n { key: 'type', value: 'Type', type: 'class', class: 'badge text-bg-light border' },\n { key: 'createdAt', value: 'Joined', type: 'date' },\n ];\n\n}\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 { UsersComponent } from './users.component';\n\n@NgModule({\n declarations: [UsersComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: UsersComponent }]),\n ],\n})\nexport class UsersModule {}\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkCM,MAAO,cAAe,SAAQ,iBAAiB,CAAA;AAjCrD,IAAA,WAAA,GAAA;;QAkCE,IAAA,CAAA,IAAI,GAAG,MAAM;QACH,IAAA,CAAA,UAAU,GAAG,OAAO;QACpB,IAAA,CAAA,UAAU,GAAG,IA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