Skip to content

fix: update audit log back link text and fix date filter row layout - #670

Merged
junaidiqbalmoj merged 17 commits into
masterfrom
feature/467-audit-log-view-updates
Jul 3, 2026
Merged

fix: update audit log back link text and fix date filter row layout#670
junaidiqbalmoj merged 17 commits into
masterfrom
feature/467-audit-log-view-updates

Conversation

@alexbottenberg

@alexbottenberg alexbottenberg commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Back link on audit log detail page changed from "Back to audit log list" to "Back" (English) / "Yn ôl" (Welsh)
  • Removed CSS rule .app-date-filter-narrow .govuk-date-input__item:last-child { padding-top: 10px; } that was forcing the Year date input onto a second row
  • Removed app-date-filter-narrow class from the date input formGroup in audit-log-list template

Test plan

  • Run yarn test — all 637 tests pass
  • Navigate to /audit-log-detail?id=<id> and confirm back link reads "Back"
  • Navigate with ?lng=cy and confirm back link reads "Yn ôl"
  • Navigate to /audit-log-list, open filter panel, confirm Day/Month/Year date inputs appear on one row

Closes #467

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed audit log list date filter to display on a single row
    • Improved audit log page layout for better content visibility
    • Updated audit log detail back link text to "Back" (English) and "Yn ôl" (Welsh) for conciseness
  • Chores

    • Updated package export configuration
    • Updated SonarQube analysis exclusion patterns

Fixes two formatting inconsistencies in the Audit Log Viewer:
- Back link on audit-log-detail changed from "Back to audit log list" to "Back" (en/cy)
- Removed CSS rule forcing Year date input onto a new row in the filter panel

Closes #467

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Two audit-log UI fixes are applied: the detail page back link text is shortened to "Back"/"Yn ôl" via localisation strings, and the list page date-filter layout is corrected by removing a SCSS padding rule and reorganising the template under a new audit-log-layout flex structure. Separately, a wildcard JS package export is replaced with explicit entries, and a Sonar exclusion is added.

Changes

Audit Log Formatting Fixes

Layer / File(s) Summary
Ticket specification and documentation
docs/tickets/467/ticket.md, docs/tickets/467/plan.md, docs/tickets/467/tasks.md, docs/tickets/467/review.md
Full ticket spec, implementation plan, task checklist, and review record for the two formatting fixes.
Back link localisation strings
libs/system-admin-pages/src/pages/audit-log-detail/en.ts, libs/system-admin-pages/src/pages/audit-log-detail/cy.ts
backToList shortened to "Back" (English) and "Yn ôl" (Welsh).
Audit-log-list template and markup
libs/system-admin-pages/src/pages/audit-log-list/index.njk
Block renamed to page_content, layout restructured under audit-log-layout, formGroup override removed from govukDateInput, year input narrowed to govuk-input--width-2, userEmail wrapped in audit-log-layout__word-break span, and view header updated with visually-hidden span.
Date filter and audit-log layout CSS
libs/system-admin-pages/src/assets/css/dashboard.scss
Narrow date-input padding rule removed; .audit-log-layout flex container, fixed-width filter panel, flexible content column, word-break, and view-header rules added.

Package Exports and Sonar Config

Layer / File(s) Summary
Explicit package exports and Sonar exclusion
libs/list-types/common/package.json, sonar-project.properties
Wildcard JS export replaced with explicit sjp-filter-search.js and table-search.js entries; **/*.build.ts added to sonar.exclusions.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope changes: removal of wildcard export in package.json and addition of unrelated audit-log-layout CSS system not covered in issue #467 acceptance criteria. Remove the package.json exports modification and the audit-log-layout CSS classes; keep only the date filter narrow class removal and back link text updates as specified in issue #467.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the two main fixes: updating audit log back link text and fixing date filter row layout.
Linked Issues check ✅ Passed The PR fully addresses both acceptance criteria from issue #467: back link text updated to 'Back'/'Yn ôl' in respective languages, and date filter inputs now render on a single row.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/467-audit-log-view-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 420f90bb-e94b-487c-ab8c-bc892f110a13

📥 Commits

Reviewing files that changed from the base of the PR and between bdf9951 and b30ace2.

📒 Files selected for processing (8)
  • docs/tickets/467/plan.md
  • docs/tickets/467/review.md
  • docs/tickets/467/tasks.md
  • docs/tickets/467/ticket.md
  • libs/system-admin-pages/src/assets/css/dashboard.scss
  • libs/system-admin-pages/src/pages/audit-log-detail/cy.ts
  • libs/system-admin-pages/src/pages/audit-log-detail/en.ts
  • libs/system-admin-pages/src/pages/audit-log-list/index.njk
💤 Files with no reviewable changes (2)
  • libs/system-admin-pages/src/pages/audit-log-list/index.njk
  • libs/system-admin-pages/src/assets/css/dashboard.scss

Comment thread docs/tickets/467/plan.md
Comment on lines +63 to +68
The test at lines 69–105 ("should render audit log detail when found") asserts:
```typescript
backToListText: expect.any(String),
```
This assertion continues to pass after the change because the value is still a string. No test update is required unless the team wants to assert the exact string value. The existing assertion is sufficient for the scope of this ticket.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align test guidance with the ticket acceptance checks.

Line 67 says no test update is required, but the ticket/PR test plan expects validating exact back link text in English and Welsh. Please make the plan explicit and consistent to avoid conflicting implementation guidance.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright E2E Test Results

84 tests   52 ✅  5m 59s ⏱️
33 suites  32 💤
 1 files     0 ❌

Results for commit 120ca39.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

The govuk-date-input flex container wraps by default, causing the Year
input to drop onto a second row in the one-quarter filter panel. Using
flex-wrap: nowrap keeps all three inputs on a single row.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 86d910bc-a658-473d-85cd-218e321f2095

📥 Commits

Reviewing files that changed from the base of the PR and between b30ace2 and ca8c0d8.

📒 Files selected for processing (1)
  • libs/system-admin-pages/src/assets/css/dashboard.scss

Comment thread libs/system-admin-pages/src/assets/css/dashboard.scss Outdated
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

…erflow

Overriding block content directly causes govuk-grid-row negative margins
to bleed outside govuk-main-wrapper. Using page_content places content
inside the already-padded width container, matching all other pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

govuk-grid-row uses negative margins (-15px each side) which bleed
outside govuk-main-wrapper. Replaced with a flexbox layout that has
no negative margins and stays within the width container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

alexbottenberg and others added 2 commits June 4, 2026 10:42
The .js extension caused Vite to fail resolving the file since it only
exists as .ts in the source tree.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The wildcard export pattern does not map .js paths to .ts source files.
Add explicit named exports matching the pattern used by other packages
so Vite resolves the imports correctly in dev mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

- Add VITE_DEV_BUILD flag to suppress content hashes from dev asset filenames, preventing stale references after rebuilds
- Reintroduce govuk-grid-row on the audit-log layout wrapper so GOV.UK grid columns work correctly alongside the flexbox container
- Remove gap between filter and content panels; strip right padding from the three-quarters column to avoid overflow
- Make the 'view' column header visually hidden so its narrow width doesn't push other columns; use word-break on email cells to prevent overflow
- Enable overflow-x: auto on the content area as a safety net for narrow viewports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0aba461a-4f05-4ab4-b8b7-8486ab7a0527

📥 Commits

Reviewing files that changed from the base of the PR and between d9f7205 and 547a962.

📒 Files selected for processing (5)
  • apps/web/package.json
  • apps/web/vite.build.ts
  • libs/list-types/common/package.json
  • libs/system-admin-pages/src/assets/css/dashboard.scss
  • libs/system-admin-pages/src/pages/audit-log-list/index.njk
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/system-admin-pages/src/pages/audit-log-list/index.njk

Comment on lines +62 to +64
.audit-log-layout__word-break {
word-break: break-word;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Is word-break: break-worddeprecated in current CSS specs, and isoverflow-wrap: anywhere the recommended replacement?

💡 Result:

Yes, the word-break: break-word value is deprecated in current CSS specifications [1][2]. It was historically used as a legacy alias to prevent text from overflowing its container, but it is no longer considered appropriate for new development [3][4]. The recommended replacement is overflow-wrap: anywhere [2][4]. While both word-break: break-word and overflow-wrap: anywhere are designed to prevent long, unbreakable strings (like long words or URLs) from overflowing their containers, overflow-wrap: anywhere is the modern, standards-compliant way to achieve this behavior [4]. Using overflow-wrap: anywhere is preferred because it correctly accounts for soft wrap opportunities when calculating min-content intrinsic sizes, which helps ensure elements like inline-blocks or flex items behave predictably [4][5]. In contrast, the deprecated word-break: break-word acts as an alias for word-break: normal combined with overflow-wrap: anywhere, but it lacks the consistent, standardized behavior defined by modern CSS Text specifications [1][6][4].

Citations:


Replace word-break: break-word with overflow-wrap.

word-break: break-word is a legacy/deprecated value; use overflow-wrap instead for consistent cross-engine wrapping.

Suggested patch
  .audit-log-layout__word-break {
-    word-break: break-word;
+    overflow-wrap: anywhere;
+    word-break: normal;
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.audit-log-layout__word-break {
word-break: break-word;
}
.audit-log-layout__word-break {
overflow-wrap: anywhere;
word-break: normal;
}
🧰 Tools
🪛 Stylelint (17.12.0)

[error] 63-63: Deprecated keyword "break-word" for property "word-break" (declaration-property-value-keyword-no-deprecated)

(declaration-property-value-keyword-no-deprecated)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

Comment thread apps/web/package.json Outdated
Comment thread apps/web/vite.build.ts
alexbottenberg and others added 3 commits June 15, 2026 09:42
The Vite manifest already handles hashed filename resolution at runtime,
making the dev-build flag and custom output naming redundant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Newer vitest hangs on dynamic imports of non-existent workspace packages
rather than throwing. Mock the missing @hmcts/civil-daily-cause-list as an
empty module so the test resolves synchronously via the "no validate function"
path. Unify both no-schema error messages to "No JSON schema available" for
consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

Resolve conflict in list-type-validator.test.ts - use master's cleaner
comment wording for the civil-daily-cause-list mock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

parseInt("27er", 10) silently returns 27, so inputs like "27er", "3er",
and "2007er" passed validation and produced a valid date with no error.

Replace parseInt with a /^\d+$/ guard and Number() — any non-digit
character in any field now returns null immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@junaidiqbalmoj
junaidiqbalmoj merged commit 9cecc43 into master Jul 3, 2026
26 checks passed
hmctsclaudecode Bot pushed a commit that referenced this pull request Jul 9, 2026
10 STATUS + IMPL changes (closed issue + merged closing PR → verified):
  REQ-0078 (#301): implemented → verified (PR #458)
  REQ-0105 (#428): in_progress  → verified (PR #749)
  REQ-0106 (#429): approved     → verified (PR #761)
  REQ-0107 (#431): implemented → verified (PR #701)
  REQ-0108 (#434): approved     → verified (PR #772)
  REQ-0109 (#436): implemented → verified (PR #727)
  REQ-0112 (#467): implemented → verified (PR #670)
  REQ-0124 (#563): approved     → verified (PR #782)
  REQ-0135 (#569): in_progress  → verified (PR #748)
  REQ-0137 (#729): approved     → verified (PR #766)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update: Audit log view

3 participants