From 90b3dbe0bff833383a611a2b9f0e3ec526ca3201 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Tue, 16 Jun 2026 22:00:41 +0100 Subject: [PATCH] tests fixing ofr modules --- .../database/seeders/PlatformSeeder.php | 10 +- Modules/changelog.yaml | 192 ------------------ Modules/module.json | 26 --- 3 files changed, 7 insertions(+), 221 deletions(-) delete mode 100644 Modules/changelog.yaml delete mode 100644 Modules/module.json diff --git a/Modules/Platform/database/seeders/PlatformSeeder.php b/Modules/Platform/database/seeders/PlatformSeeder.php index 494b11f7..a1308da6 100644 --- a/Modules/Platform/database/seeders/PlatformSeeder.php +++ b/Modules/Platform/database/seeders/PlatformSeeder.php @@ -9,6 +9,7 @@ use Illuminate\Support\Str; use Modules\Platform\app\Models\Company; use Modules\Warehouse\app\Models\Warehouse; use Modules\Warehouse\app\Models\WarehouseValidationRule; +use Spatie\Permission\Models\Role; class PlatformSeeder extends Seeder { @@ -17,6 +18,8 @@ class PlatformSeeder extends Seeder */ public function run(): void { + $role = Role::findOrCreate('platform-admin', 'web'); + $company = Company::updateOrCreate( ['slug' => 'mpba-limited'], [ @@ -29,7 +32,7 @@ class PlatformSeeder extends Seeder ] ); - User::updateOrCreate( + $user = User::updateOrCreate( ['email' => 'mark.gregory@mpba.co.uk'], [ 'company_id' => $company->id, @@ -41,7 +44,8 @@ class PlatformSeeder extends Seeder 'email_verified_at' => now(), ], ); - User::updateOrCreate( + $user->assignRole($role); + $user = User::updateOrCreate( ['email' => 'david.price@mpba.co.uk'], [ 'company_id' => $company->id, @@ -53,7 +57,7 @@ class PlatformSeeder extends Seeder 'email_verified_at' => now(), ] ); - + $user->assignRole($role); $warehouse = Warehouse::firstOrNew([ 'company_id' => $company->id, 'code' => 'MPBA-MAIN', diff --git a/Modules/changelog.yaml b/Modules/changelog.yaml deleted file mode 100644 index 3cdfc162..00000000 --- a/Modules/changelog.yaml +++ /dev/null @@ -1,192 +0,0 @@ -- version: 1.3.6 - date: 2026-06-16 - changes: - - Backfilled status columns onto Kanban boards that have none so selected boards render usable workflow columns. - - Added runtime board-column repair to keep newly-created boards usable immediately. - - Tightened the Kanban board selector width and dark styling. - - -- version: 1.3.5 - date: 2026-06-16 - changes: - - Fixed Kanban board filtering so the selected board only shows tickets assigned to that single board. - - Added a backfill migration for existing tickets without a board assignment. - - Restyled the active board selector and per-ticket board selector with compact dark controls. - - -- version: 1.3.4 - date: 2026-06-16 - changes: - - Added single-board ticket assignment via helpdesk_tickets.board_id. - - Added Kanban board owner support. - - Added board-to-board ticket moves while enforcing one active board per ticket. - - Added status move alerts/toasts when tickets move between workflow statuses. - - Added create/edit ticket board selection and default-board assignment for new tickets. - -- version: 1.3.3 - date: '2026-06-16' - changes: - - Reworked Helpdesk action styling so header, support, settings, table, save, reset, edit and delete buttons use reliable coloured native styling. - - Replaced settings section card dynamic Tailwind colour classes with inline styles so card colours always render. - - Improved Kanban board dropdown styling. - - Hardened ticket create inputs and Select2 controls to prevent white flashes during save. - -url: https://wms.vm -versions: - "1.0.0": - changed: - - Initial Module Definition - "1.0.1": - changed: - - Added Vite Support and removed webpack - "1.0.2": - changed: - - Stabilised the Livewire rich text editor so ticket details no longer clear during typing or submit early. - - Added Helpdesk Kanban board for workflow status movement. - - Added Kanban PHPUnit and Dusk coverage. - - Added Kanban navigation links to the dashboard and ticket list. - - "1.0.3": - changed: - - Fixed Helpdesk dashboard rendering by removing dependency on missing x-app-layout/x-layouts.app components. - - Registered anonymous Helpdesk Blade components so x-helpdesk component views resolve correctly. - - Registered the Kanban Livewire component in the Helpdesk service provider. - - Rebuilt the ticket create page to use the correct subject/body Livewire properties. - - Stabilised the rich HTML editor so typing no longer clears the field or accidentally submits the ticket form. - - Added root layout support-menu integration instructions for enabled Helpdesk modules. - - "1.0.4": - changed: - - Fixed the Helpdesk page header so dark WMS pages do not render a blank white hero. - - Changed ticket create save to validate all fields and return to the tickets index after creation to avoid route-model redirect issues. - - Added a root layout replacement containing the Support sidebar menu and Livewire update endpoint configuration. - - Kept module.json version in sync with changelog.yaml. - - "1.0.5": - changed: - - Added the missing POST helpdesk.tickets.store route so native form submission to /helpdesk/tickets no longer returns 404. - - Added TicketStoreController as a safe non-JavaScript fallback while keeping the Livewire ticket create flow intact. - - Updated the ticket create form with method, action, CSRF, multipart support and named fields for fallback posting. - - Kept module.json version in sync with changelog.yaml. - - "1.0.6": - changed: - - Rebuilt the Helpdesk database seeder with the requested Categories, Team, Priority and Status lookup values. - - Added contrasting colour assignments for seeded lookup records. - - Corrected the seeder namespace to Modules\\Helpdesk\\Database\\Seeders for PSR-4 module autoloading. - - Kept module.json version in sync with changelog.yaml. - - "1.0.9": - changed: - - Added editable tickets with assignment, status, priority, category, team, project, due date and details updates. - - Changed the default ticket creation status to New. - - Added configurable Kanban boards with status-column assignment and a default Standard Support board. - - Rebuilt the Kanban board into a professional drag-and-drop board with SortableJS fallback loading. - - Added blue Back and green Edit actions on ticket view pages. - - Improved Helpdesk settings styling, blue edit actions, and a dedicated Kanban Boards CRUD section. - - Marked mandatory ticket fields and enhanced create/edit ticket forms with Select2-capable dropdowns. - - Kept module.json version in sync with changelog.yaml. - - "1.1.3": - changed: - - Fixed ticket update permissions so platform admins, helpdesk admins, assigned agents and ticket owners can edit tickets where appropriate. - - Added the missing ticket edit Blade view with assignment, status, priority, category, project, team, due date and details controls. - - Replaced the Kanban drag dependency path with native browser drag-and-drop to prevent blocked scripts from breaking ticket movement. - - Added Kanban Boards CRUD to Helpdesk settings with configurable status columns. - - Improved ticket create and edit form layout, mandatory markers, dark footer styling and searchable Select2-capable dropdown loading. - - Kept module.json version in sync with changelog.yaml. - - "1.2.0": - changed: - - Added RedmineUP-inspired canned responses with professional reply macro tokens for ticket, requester, agent, status, priority, category, project, team and URL values. - - Added SLA policies, first-response and resolution due dates, breach tracking, SLA event history and ticket/Kanban breach indicators. - - Added incoming email automation rule models and service support for matching sender, subject, mailbox and category to auto-set priority, category, team, project, assignee and status. - - Added database-driven autoresponder enhancements with optional read-receipt tracking tokens, workflow log open timestamps and open counts. - - Added customer/requester profile context on ticket detail pages with tags and richer support metadata. - - Added satisfaction rating data model for closed-ticket feedback reporting by agent, team and category. - - Added ticket tags, checklist templates, checklist items, checklist progress and agent checklist toggling. - - Added product/service/build linkage for tickets with support cost/time fields and product-aware administration. - - Extended Helpdesk settings with professional CRUD sections for canned responses, SLA policies, automation rules, checklist templates, tags and products/services. - - Extended ticket create/edit/show and Kanban screens to include product/service linkage, SLA status, tags and checklist progress without breaking the existing workflow. - - Added PHPUnit coverage for automation, SLA, canned response macro rendering, checklist toggling and product linkage, plus Dusk coverage for the new settings sections. - - Kept module.json version in sync with changelog.yaml. - - "1.2.1": - changed: - - Added signed Git webhook ingestion endpoint at POST /api/helpdesk/git/webhook/{repository} for registered repositories. - - Added GitHub X-Hub-Signature-256 HMAC validation, GitLab X-Gitlab-Token validation and a generic X-Helpdesk-Token fallback for internal providers. - - Added automatic commit persistence and Helpdesk ticket linking from HD-YYYY-00000 references in commit messages, branch names and commit URLs. - - Added helpdesk_git_webhook_logs for auditable accepted, ignored and rejected provider deliveries. - - Added Git webhook endpoint visibility and delivery counts to the Helpdesk Git repository settings table. - - Added provider setup documentation for GitHub, GitLab and generic signed Git payloads. - - Added PHPUnit coverage for accepted GitHub/GitLab push webhooks, invalid signature rejection and ignored non-push events. - - Kept module.json version in sync with changelog.yaml. - - "1.2.2": - changed: - - Fixed Helpdesk settings rendering during rolling upgrades by defaulting newly added RedmineUP/Git settings collections in the Blade view. - - Prevented undefined variable errors for canned responses, SLA policies, automation rules, checklist templates, tags and products when compiled views and Livewire component code are briefly out of sync. - - Kept module.json version in sync with changelog.yaml. - - "1.2.3": - changed: - - Fixed Helpdesk settings Livewire actions for the RedmineUP-inspired sections so SLA, canned responses, automation, products, tags and checklists can be saved from /helpdesk/settings. - - Added SettingsManager mount-time form normalisation to survive stale Livewire snapshots after module upgrades. - - Added a defensive workflow tracking-pixel URL fallback so ticket creation cannot fail when route caches are stale. - - Registered the workflow open pixel route in the web route file as a backup to the module provider route. - - Kept module.json version in sync with changelog.yaml. - - - "1.2.5": - changed: - - Fixed the Helpdesk settings default-company Livewire action by adding saveDefaultHelpdeskCompany to SettingsManager. - - Added default flags for Helpdesk statuses as well as priorities, categories, teams and projects. - - Updated ticket creation to use the configured default status and lookup defaults. - - Added selectable ticket tags to the create ticket workflow and synced tags onto new tickets. - - Kept the one-line ticket subject input and dark form repaint fixes. - - Kept module.json version in sync with changelog.yaml. - - - "1.2.6": - changed: - - Fixed the Helpdesk settings default-company Livewire method and made the default company property resilient to select empty-string values. - - Confirmed default statuses, priorities, categories, teams and projects are applied during ticket creation. - - Confirmed ticket tags can be assigned on create and edit and are synced to the ticket-tag pivot. - - Kept module.json version in sync with changelog.yaml. - - "1.2.8": - changed: - - Replaced white Flux action buttons on the Helpdesk dashboard, ticket list, Kanban board and settings header with explicit high-contrast coloured action buttons. - - Standardised + New Ticket actions as green buttons across Helpdesk entry points. - - Kept module.json version in sync with changelog.yaml. - - - "1.2.9": - changed: - - Applied explicit Helpdesk action colour conventions across dashboard, tickets, Kanban and settings pages. - - Coloured settings section navigation tiles by domain so Statuses, Priorities, Categories, Teams, Projects, Boards, Workflow, SLA, Tags, Products and Defaults are visually distinct. - - Coloured save, reset, edit, delete, settings, ticket, Kanban, reply and update action buttons consistently. - - Kept module.json version in sync with changelog.yaml. - - - "1.3.0": - changed: - - Fixed malformed Helpdesk settings action buttons that caused Blade parse errors. - - Applied explicit coloured action buttons across settings tables, settings forms and Kanban board configuration actions. - - Kept module.json version in sync with changelog.yaml. - - - "1.3.7": - changed: - - Fixed ticket create/edit clear actions by adding public Livewire clearForm methods to both components. - - Stabilised Select2 clearing by loading module assets on ticket forms, adding placeholder support, manually syncing Select2 changes back to Livewire and clearing browser widgets after Livewire reset events. - - Replaced native due date inputs on ticket create/edit with a reusable Helpdesk Flatpickr date-picker component. - - Added Flatpickr module dependency and dark Helpdesk calendar styling. - - Kept module.json version in sync with changelog.yaml. - - "1.3.9": - changed: - - Fixed TicketControlsController authorization by using Laravel Gate authorization instead of relying on a missing controller authorize helper. - - Kept normal CSRF-protected POST ticket controls for agent, status and priority persistence. - - Restricted posted agent assignments to tenant/company users or global users when the users.company_id column exists. - - Kept compact ticket control buttons and module.json version in sync with changelog.yaml. diff --git a/Modules/module.json b/Modules/module.json deleted file mode 100644 index 1e4d3519..00000000 --- a/Modules/module.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "Helpdesk", - "alias": "helpdesk", - "description": "Professional Livewire/Flux helpdesk module with ticketing, Kanban, SLA, canned responses, automation rules, checklists, ratings, read receipts, product/service linkage and signed Git webhook tracking.", - "keywords": [ - "helpdesk", - "tickets", - "livewire", - "flux", - "sla", - "automation", - "canned-responses", - "kanban", - "checklists", - "git-webhooks", - "github", - "gitlab", - "audit" - ], - "priority": 0, - "providers": [ - "Modules\\Helpdesk\\Providers\\HelpdeskServiceProvider" - ], - "files": [], - "version": "1.3.7" -}