Skip to content

feat(integrations): add activity logs view#4671

Merged
chickenn00dle merged 13 commits into
trunkfrom
feat/integrations-logs-view
May 4, 2026
Merged

feat(integrations): add activity logs view#4671
chickenn00dle merged 13 commits into
trunkfrom
feat/integrations-logs-view

Conversation

@chickenn00dle
Copy link
Copy Markdown
Contributor

@chickenn00dle chickenn00dle commented Apr 16, 2026

All Submissions:

Changes proposed in this Pull Request:

Adds a per-integration activity logs view accessible via the kebab menu on each integration card, using the DataViews component with server-side pagination.

walkthrough.mp4

PHP:

  • New Integrations::count_scheduled_actions() method for pagination totals
  • New REST endpoint GET /settings/{integration_id}/logs with params for pagination, sorting, search, and status filtering
  • Hook names resolved to human-readable labels server-side

Frontend:

  • "Logs" menu item added to the integration card kebab dropdown
  • New LogsView component using DataViews with server-side pagination
  • Columns: Timestamp, Event, Status (with colored Badge)
  • Status filter via DataViews FiltersToggle
  • Lazy data fetching (only when logs view is navigated to)
  • Loading spinner and error notice states
  • Custom toolbar: search + filter toggle (no view config gear)

Closes DSGNEWS-155.

How to test the changes in this Pull Request:

  1. Enable integrations settings (define( 'NEWSPACK_INTEGRATIONS_SETTINGS_ENABLED', true ))
  2. Navigate to Audience → Integrations
  3. On an enabled integration card, click the kebab menu (⋮) → verify "Logs" appears above "Disable"
  4. Click "Logs" → verify the logs view loads with a spinner, then displays a DataViews table
  5. Verify columns: Timestamp (wide), Event, Status (colored badge)
  6. Test pagination via the footer controls
  7. Test search by typing in the search input
  8. Click the filter icon next to search → filter by status
  9. Verify "Back to Integrations" navigation works via the back arrow

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@chickenn00dle chickenn00dle changed the base branch from feat/integrations-configuration-view-redesign to feat/integrations-dashboard-redesign April 16, 2026 21:02
@chickenn00dle chickenn00dle marked this pull request as ready for review April 17, 2026 15:39
@chickenn00dle chickenn00dle requested a review from a team as a code owner April 17, 2026 15:39
Copilot AI review requested due to automatic review settings April 17, 2026 15:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an “Activity Logs” screen per integration in the Audience → Integrations wizard, backed by a new REST API endpoint that provides server-side pagination/filtering/search over Action Scheduler actions.

Changes:

  • Adds a “Logs” action to each enabled integration card and a hidden wizard route to a new logs view.
  • Introduces a LogsView DataViews table with server-driven pagination, sorting, search, and status filtering.
  • Adds a REST endpoint to fetch integration-specific scheduled-action logs plus a new Integrations::count_scheduled_actions() helper for totals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/wizards/audience/views/integrations/style.scss Adds styling for the logs DataViews toolbar and filter toggle.
src/wizards/audience/views/integrations/settings-section.js Adds “Logs” to the kebab menu for enabled integrations.
src/wizards/audience/views/integrations/logs-view.js New DataViews-based logs screen with server-side pagination/search/filtering.
src/wizards/audience/views/integrations/index.js Registers the hidden /settings/:integrationId/logs route in the wizard.
includes/wizards/audience/class-audience-integrations.php Adds GET .../settings/{integration_id}/logs REST endpoint returning paginated log items.
includes/reader-activation/class-integrations.php Adds count_scheduled_actions() to support pagination totals for logs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/wizards/audience/class-audience-integrations.php
Comment thread includes/reader-activation/class-integrations.php
Comment thread src/wizards/audience/views/integrations/logs-view.js Outdated
Comment thread includes/wizards/audience/class-audience-integrations.php
Comment thread includes/wizards/audience/class-audience-integrations.php
Comment thread includes/wizards/audience/class-audience-integrations.php
Comment thread includes/wizards/audience/class-audience-integrations.php
@chickenn00dle chickenn00dle force-pushed the feat/integrations-logs-view branch from ab532f1 to 5d759f9 Compare April 17, 2026 16:08
@chickenn00dle chickenn00dle added the [Status] Blocked The issue or pull request is blocked label Apr 17, 2026
@chickenn00dle
Copy link
Copy Markdown
Contributor Author

This one is ready for review, but depends on #4665. I'm gonna add the blocked label until that PR is approved and merged.

@chickenn00dle chickenn00dle force-pushed the feat/integrations-logs-view branch 2 times, most recently from 62da46e to 8595875 Compare April 17, 2026 17:10
Base automatically changed from feat/integrations-dashboard-redesign to trunk April 17, 2026 19:12
@chickenn00dle chickenn00dle added [Status] Needs Review The issue or pull request needs to be reviewed and removed [Status] Blocked The issue or pull request is blocked labels Apr 17, 2026
@chickenn00dle
Copy link
Copy Markdown
Contributor Author

@miguelpeixe adding you as a reviewer so you can decide whether to go with your PR or this one.

chickenn00dle and others added 12 commits April 29, 2026 09:10
…nd remove logs menu

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add min/max constraints on per_page and minimum on page REST args
- Defensively clamp $page/$per_page in the callback before offset calc
- Use @wordpress/date dateI18n for locale-aware, Safari-safe timestamps

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@chickenn00dle chickenn00dle force-pushed the feat/integrations-logs-view branch from 8595875 to 3b2e9d0 Compare April 29, 2026 14:25
Copy link
Copy Markdown
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Code looks good and tests well!

We've been rendering the DataViews component full-width, without any left/right margin. It's the case for Access Control Institutions, Story Budget, and the upcoming Newsletters redesign. I think this should follow the same standard.

I also have a few suggestions that are non-blocking, but I think we should tackle them in a follow-up PR to help with troubleshooting. In the exploration done in #4561, the dataviews component has a "View details" action, which renders the complete action payload, including integration-specific meta (like retry count, reason, user ID, and context), and its logs:

Image Image

We could also benefit from having a "Run" action for pending actions, which is also a feature in Woo's default AS page. Also non-blocking for this PR.

@github-actions github-actions Bot added the [Status] Needs Changes or Feedback The issue or pull request needs action from the original creator label May 4, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@chickenn00dle
Copy link
Copy Markdown
Contributor Author

chickenn00dle commented May 4, 2026

Addressed the full-width DataViews feedback in b4bb2f7. The Logs view section now uses fullWidth: true to match the Institutions / Story Budget / Newsletters pattern.

Tracking the non-blocking suggestions (View details modal with action payload + meta, and Run action for pending actions) in this follow-up Linear issue.

This should be ready for review again @miguelpeixe

@chickenn00dle chickenn00dle requested a review from miguelpeixe May 4, 2026 19:30
Copy link
Copy Markdown
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Thank you!

@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed [Status] Needs Changes or Feedback The issue or pull request needs action from the original creator labels May 4, 2026
@chickenn00dle chickenn00dle merged commit fb98062 into trunk May 4, 2026
9 checks passed
@chickenn00dle chickenn00dle deleted the feat/integrations-logs-view branch May 4, 2026 20:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Hey @chickenn00dle, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request May 7, 2026
# [6.40.0-alpha.1](v6.39.1...v6.40.0-alpha.1) (2026-05-07)

### Bug Fixes

* **access-control:** allow `0` member limit values to be shown ([#4670](#4670)) ([b7ea1e3](b7ea1e3))
* **access-control:** allow access rules with `supports_anonymous` to evaluate anonymous readers ([#4695](#4695)) ([3219d63](3219d63))
* **access-control:** bump content rule suggestion limit to 100 ([#4669](#4669)) ([64629eb](64629eb))
* **access-control:** ignore content rules with empty value ([#4675](#4675)) ([c01e97d](c01e97d))
* add `use` statements for clarity ([b0074c0](b0074c0))
* add 30s timeout to v2 invisible token acquisition to prevent hang ([8fd1a17](8fd1a17))
* add isolated flag to v2 invisible widget to prevent interference ([9cfcc30](9cfcc30))
* address potential race condition on multiple registrations with same email ([4fbb990](4fbb990))
* **advertising:** toggle spacing under category autocomplete ([1c65593](1c65593))
* **block-theme:** ensure Overlay Menu block panel opens in editor after template part switch ([#4642](#4642)) ([e45cfd0](e45cfd0))
* **campaigns:** remove wrapper div around add campaign modal input ([#4705](#4705)) ([e04d4af](e04d4af))
* centralize, normalize definition of `$referer` ([e38a94f](e38a94f))
* condition config output on RAS ([22c87af](22c87af))
* condition reCAPTCHA v3 actions on their `ready()` ([a70d5ff](a70d5ff))
* **content-gate:** pass redirectToLayout explicitly on Save ([#4702](#4702)) ([a95cd4d](a95cd4d))
* ensure idempotency by making sure callers get current reader data for logged-in readers ([be59918](be59918))
* gracefully reject calls if essential config is missing ([dd4c46b](dd4c46b))
* **indesign:** exclude rich media blocks from export output ([#4614](#4614)) ([6e45232](6e45232))
* make endpoint available only when RAS is enabled, per Copilot ([18de923](18de923))
* **memberships:** prevent duplicate teams on stripped-meta renewals ([#4661](#4661)) ([84f6c99](84f6c99))
* merge into existing `reader` now that we are out of POC ([3200cc0](3200cc0))
* move grecaptcha.execute inside try block to prevent Promise leak ([f224df8](f224df8))
* move reCAPTCHA behind rate limiting to protect metered service from floods ([0ec69a2](0ec69a2))
* **recaptcha:** skip script registration on TEC Community Events pages ([#4666](#4666)) ([d9a57c5](d9a57c5))
* reject Promise and provide helpful error if reCAPTCHA not happy ([099a109](099a109))
* send nonce, if available, with registration request ([ab57d81](ab57d81))
* textarea support ([8676e2d](8676e2d))
* use returned status rather than hardcoded value ([ea9af30](ea9af30))
* use server-side email, not submitted email, for logged-in users ([56e699f](56e699f))

### Features

* **access-control:** add Specific posts content rule ([#4674](#4674)) ([6735309](6735309))
* **access-control:** auto-signup on renewal only for already subscribed lists ([#4621](#4621)) ([23934c6](23934c6))
* **access-control:** human-readable group subscription names ([#4667](#4667)) ([a817304](a817304))
* **access-control:** tweaks to Access Control UI components ([#4659](#4659)) ([3c08943](3c08943))
* add block theme support to lite site ([#4628](#4628)) ([71632b9](71632b9))
* add overridable registration key methods to Integration base class ([2b4d04f](2b4d04f))
* add reCAPTCHA v2 invisible support to register() ([60b0e77](60b0e77))
* **block-theme:** add size options to the Overlay Menu ([#4652](#4652)) ([3b11b75](3b11b75))
* **block-theme:** move co-authors RSS feed code to the Newspack Plugin ([#4629](#4629)) ([50a160c](50a160c))
* **co-authors:** support CAP core entity store alongside legacy store ([#4673](#4673)) ([b80c49a](b80c49a))
* **components:** addToolbarBackButton util in newspack-components ([#4619](#4619)) ([ec36aa3](ec36aa3))
* **content-gate:** expose institutional IP allowlist endpoint ([#4685](#4685)) ([c6a054a](c6a054a))
* **data-events:** woo transactional events ([#4687](#4687)) ([544d718](544d718))
* delegate key generation and validation to Integration instances ([6aba746](6aba746))
* initial reader registration API rollup from working branch ([0250b2a](0250b2a))
* **integrations:** add activity logs view ([#4671](#4671)) ([fb98062](fb98062))
* **integrations:** add content gate metadata ([#4605](#4605)) ([dcd2a09](dcd2a09))
* **integrations:** contact cron for push and pull ([#4608](#4608)) ([29e6668](29e6668))
* **integrations:** redesign configure view ([#4668](#4668)) ([472dd06](472dd06))
* **integrations:** redesign dashboard with CardFeature grid ([#4665](#4665)) ([d20aae8](d20aae8))
* localize reCAPTCHA site key and version for both v2 and v3 ([56ba6ea](56ba6ea))
* more options for registration ([4c23648](4c23648))
* **newspack-ui:** refactor newsletter signup form with Newspack UI utilities ([#4491](#4491)) ([1859473](1859473))
* **reader-activation:** configure ESP incoming fields from schema ([#4676](#4676)) ([8bc84cc](8bc84cc))
* **reader-activation:** frontend registration API for integrations ([2d7a1bc](2d7a1bc))
* **settings:** Experimental Tools framework (NPPM-2692) ([#4591](#4591)) ([5a300eb](5a300eb))
* trigger a hook and invoke an integration callback when logged in user registers ([167383a](167383a))
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

🎉 This PR is included in version 6.40.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants