Skip to content

Conversation

@agustinbusso
Copy link
Contributor

@agustinbusso agustinbusso commented Jan 7, 2026

Description

Add a new section in admin > settings > logs for Agents logs

Related tickets and PRs

https://processmaker.atlassian.net/browse/FOUR-28659


Note

Adds a new Admin Logs section rendered via a Vue SPA and gated by permissions/package availability.

  • New LogsController@index, Blade view admin.logs.index, web routes under /admin/logs (wildcard) with optional email CSV export; sidebar menu entry added in GenerateMenus
  • Vue app (resources/js/admin/logs) with router-based views: Email (errors|matched|total) and Agents (design|execution), conditional routing based on installed packages
  • UI components: Sidebar, HeaderBar (category tabs + search), LogTable (column presets per category/type), BaseTable, and Pagination; data fetched from /api/1.1/email-start-event/logs/:type and /api/1.0/flow-genie/logs/(design|execution)
  • Search triggers refresh; Email views show "Export to CSV" linking to /admin/logs/export/csv?type=...&search=...
  • Date formatting utility using Luxon and user settings; i18n keys added; webpack entry added for build

Written by Cursor Bugbot for commit 5f65a78. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 21

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

},
beforeDestroy() {
// Clean up event listener
this.$root.$off('bv::collapse::state');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Event cleanup removes all listeners not just component's

Low Severity

The beforeDestroy hook calls this.$root.$off('bv::collapse::state') without passing the handler callback reference. In Vue, calling $off with only the event name removes ALL listeners for that event, not just the one this component registered. Other components in the codebase correctly pass the handler reference to $off (e.g., in ErrorHandlingMixin.vue). This could cause issues if the component is destroyed while other listeners depend on this event.

Fix in Cursor Fix in Web

},
getExportUrl() {
return `/admin/logs/export/csv?type=${this.logType}&search=${this.search}`;
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search parameter not URL-encoded in export URL

Medium Severity

The getExportUrl computed property directly interpolates this.search into the URL query string without using encodeURIComponent(). If a user's search term contains special characters like &, =, ?, or #, the URL will be malformed. For example, searching for test&foo=bar would produce a URL where foo is incorrectly parsed as a separate query parameter rather than part of the search value, causing the export to return wrong results.

Fix in Cursor Fix in Web

},
immediate: true,
},
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate API requests when changing log categories

Low Severity

Both the category and logType watchers call resetAndFetch() when their values change. When navigating between categories (e.g., from email to agents), both props change simultaneously, causing both watchers to fire and triggering two identical API requests. The watchers could be consolidated or use a debounce mechanism to avoid the duplicate network call.

Fix in Cursor Fix in Web

onHandleSearch() {
if (this.$refs.routerView) {
this.$refs.routerView.refresh({ search: this.search });
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search functionality broken due to incorrect RouterView ref

High Severity

The onHandleSearch method calls this.$refs.routerView.refresh(), but in Vue 2 the ref on <RouterView> points to the RouterView component wrapper, not the rendered child component (LogTable). Since RouterView doesn't have a refresh method, the search functionality will silently fail and users won't be able to filter log data. The refresh method exists on LogTable but is inaccessible through this ref pattern.

Fix in Cursor Fix in Web

next();
}
},
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing redirect route for /email causes blank page

Medium Severity

The routes configuration includes a redirect from /agents to /agents/design (lines 69-72), but there is no equivalent redirect for /email to /email/errors. The route /email/:logType requires the logType parameter, so navigating to /admin/logs/email without a log type results in no route match and a blank page. This creates inconsistent behavior where /agents works correctly but /email does not.

Fix in Cursor Fix in Web

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@agustinbusso agustinbusso merged commit 1f6187e into epic/FOUR-25679 Jan 7, 2026
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants