Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/agents/plan.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tools:
- search/searchResults
- search/usages
- vscode/vscodeAPI
- execute/runInTerminal
- read/terminalLastCommand
---

# Plan Mode - Strategic Planning & Architecture Assistant
Expand Down
11 changes: 10 additions & 1 deletion .github/agents/tdd-green.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
---
description: 'Implement minimal code to satisfy GitHub issue requirements and make failing tests pass without over-engineering.'
name: 'TDD Green Phase - Make Tests Pass Quickly'
tools: ['github', 'findTestFiles', 'edit/editFiles', 'runTests', 'runCommands', 'codebase', 'filesystem', 'search', 'problems', 'testFailure', 'terminalLastCommand']
tools: ["vscode/*", "findTestFiles", "edit/editFiles", "edit/createFile", "edit/createDirectory", "execute/runInTerminal", "search/codebase", "filesystem", "search", "read/problems", "execute/testFailure", "read/terminalLastCommand"]
handoffs:
- label: Return to TDD RED Phase
agent: tdd-red
prompt: Now create more test specs.
send: true
- label: Start Refactor
agent: tdd-refactor
prompt: Now refactor this work.
send: true
---
# TDD Green Phase - Make Tests Pass Quickly

Expand Down
7 changes: 6 additions & 1 deletion .github/agents/tdd-red.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
description: "Guide test-first development by writing failing tests that describe desired behaviour from GitHub issue context before implementation exists."
name: "TDD Red Phase - Write Failing Tests First"
tools: ["github", "findTestFiles", "edit/editFiles", "runTests", "runCommands", "codebase", "filesystem", "search", "problems", "testFailure", "terminalLastCommand"]
tools: ["vscode/*", "findTestFiles", "edit/editFiles", "edit/createFile", "edit/createDirectory", "execute/runInTerminal", "search/codebase", "filesystem", "search", "read/problems", "execute/testFailure", "read/terminalLastCommand"]
handoffs:
- label: Start Implementation
agent: tdd-green
prompt: Now implement the plan outlined above.
send: true
---

# TDD Red Phase - Write Failing Tests First
Expand Down
2 changes: 1 addition & 1 deletion .github/agents/tdd-refactor.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Improve code quality, apply security best practices, and enhance design whilst maintaining green tests and GitHub issue compliance."
name: "TDD Refactor Phase - Improve Quality & Security"
tools: ["github", "findTestFiles", "edit/editFiles", "runTests", "runCommands", "codebase", "filesystem", "search", "problems", "testFailure", "terminalLastCommand"]
tools: ["vscode/*", "findTestFiles", "edit/editFiles", "edit/createFile", "edit/createDirectory", "execute/runInTerminal", "search/codebase", "filesystem", "search", "read/problems", "execute/testFailure", "read/terminalLastCommand"]
---

# TDD Refactor Phase - Improve Quality & Security
Expand Down
7 changes: 7 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@

For all Ruby on Rails code you write, follow these conventions: [Ruby on Rails Coding Standards](instructions/ruby-on-rails.instructions.md)

### HTML and CSS Conventions

- Avoid adding HTML styles inline; use CSS classes instead.
- Use BEM (Block, Element, Modifier) naming conventions for CSS classes.
- If JavaScript is needed for UI behavior, preferably use appropriate postprocessors rather than inline scripts.
- If inline `<script>` or `<style>` tags are necessary, use Rails `javascript_tag` or `style_tag` helpers with a nonce for CSP compliance.

### Database Conventions
- Use migrations for all schema changes; avoid direct DB modifications for implementation.
- Name tables according to Rails conventions (plural snake_case) aligning with model names.
Expand Down
27 changes: 18 additions & 9 deletions .github/instructions/rspec-system-spec.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,29 @@ If an HTML snapshot is needed for debugging, use the helper method:
save_html_snapshot('/tmp/debug_page.html')
```

To capture console logs from the browser, store them to a global array variable during the test run
and retrieve them later for debugging:
To capture console logs and CSP violations from the browser, use the helper methods:

```ruby
# At the start of the test run
page.execute_script('window.browserLogs = []; console.log = function(msg) { window.browserLogs.push(msg); };')
```
# Set up capture AFTER initial page load, BEFORE navigating to page to debug
visit '/'
setup_browser_console_capture

```ruby
# At the end of the test run
logs = page.evaluate_script('window.browserLogs')
puts "Browser console logs:\n#{logs.join("\n")}"
# Navigate and perform actions you want to debug
visit '/page/to/debug'
finish_page_loading
click_button 'Submit'

# Print captured logs with context description
print_browser_console_logs('After clicking Submit')

# Or retrieve logs programmatically without printing
result = get_browser_console_logs
puts "CSP violations: #{result[:csp_violations].count}"
result[:logs].each { |log| puts log }
```

The capture methods intercept `console.log`, `console.error`, `console.warn`, and CSP violation events.

### Things to Remember
- Standard string / varchar fields downcase data on storage and titleize on display. Keep this in mind when writing system specs that interact with user data fields.
- Some fields rely heavily on Javascript for rendering and interaction (e.g., chosen.js dropdowns, big select dialogs, custom rich text editors). Always use the provided helper methods to interact with these fields.
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ yarn-debug.log*
/public/assets

# Test related NfsStore processing file
.__processing-index__
.__processing-index__

public/handlebars*
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,62 @@ Since [version 8.4.0](#840---2024-01-10) the convention is that releases made wi

## Unreleased

## [9.42.2] - 2026-01-23

### From FPHS - PR #870 - 2026-01-23

- [Changed] embedded_block in report to allow URLs with /edit - fixes #325
- [Fixed] embedded_block in report to allow activity log URLs

### From FPHS - PR #868 - 2026-01-22

- [Added] activity log access summaries in admin panel - resolves #867

### From FPHS - PR #865 - 2026-01-22

- [Added] `active_sublist_values` option to page layouts `view_options` - fixes #584
- [Added] `sort_sublists` option to set default sort order (`'asc'` or `'desc'`) to page layouts `view_options`

### From FPHS - PR #864 - 2026-01-22

- [Added] a scope to exclude a role name from a user access controls query (required coalesce to work)
- [Added] the ability to show extra calculated columns in admin index lists
- [Added] UAC summary to Dynamic Model and External Identifier admin panels - fixes #859

### From FPHS - PR #860 - 2026-01-21

- [Added] access control filtering for master tabs nav dropdown - fixed #673

- [Fixed] External IDs panel blank when switching participants, resolves original issue #653 incorrectly addresed by PR #855 - fixes #857

### From FPHS - PR #856 - 2026-01-21

- [Fixed] view_options.alt_width_classes not working for external ID or dynamic models displayed in master panels - fixes #389

### From FPHS - PR #855 - 2026-01-20

- [Fixed] external IDs panel not showing content when switching participants - fixed #653

### From FPHS - PR #854 - 2026-01-20

- [Fixed] error parsing JSON field when the content is an empty string - fixes #853

### From FPHS - PR #852 - 2026-01-20

- [Fixed] issue when users tried to reset their password with a previously used password, they saw confusing duplicate errors - fixes #340

### From FPHS - PR #851 - 2026-01-20

- [Fixed] switch_id_on_click for multiple external IDs - fixed #312

### From FPHS - PR #850 - 2026-01-20

- [Fixed] styling on admin log and long lines in YAML editors

### From FPHS - PR #849 - 2026-01-20

- [Fixed] spec test issues

## [9.42.1] - 2026-01-19

### From FPHS - PR #848 - 2026-01-19
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ GEM
ansi (1.5.0)
ast (2.4.3)
aws-eventstream (1.4.0)
aws-partitions (1.1206.0)
aws-partitions (1.1209.0)
aws-sdk-cloudwatchlogs (1.138.0)
aws-sdk-core (~> 3, >= 3.241.4)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -199,7 +199,7 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
devise-two-factor (6.3.0)
devise-two-factor (6.3.1)
activesupport (>= 7.0, < 8.2)
devise (>= 4.0, < 5.0)
railties (>= 7.0, < 8.2)
Expand Down Expand Up @@ -441,12 +441,12 @@ GEM
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-embedded (1.97.2)
sass-embedded (1.97.3)
google-protobuf (~> 4.31)
rake (>= 13)
sass-embedded (1.97.2-arm64-darwin)
sass-embedded (1.97.3-arm64-darwin)
google-protobuf (~> 4.31)
sass-embedded (1.97.2-x86_64-linux-gnu)
sass-embedded (1.97.3-x86_64-linux-gnu)
google-protobuf (~> 4.31)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand Down
2 changes: 1 addition & 1 deletion app-scripts/clean-test-assets-and-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

RAILS_ENV=test bundle exec rails assets:clobber
RAILS_ENV=test bundle exec rails assets:precompile
rm -rf tmp/cache
rm -rf tmp/cache public/handlebars-*/* tmp/handlebars-*/*
2 changes: 1 addition & 1 deletion app-scripts/parallel_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ done

echo "========================================================================" >> tmp/working_failing_specs.log
echo "All Done" >> tmp/working_failing_specs.log
echo "Runs with Failures: $(grep 'Failures: ' tmp/failing_specs.log | wc -l)" >> tmp/working_failing_specs.log
echo "Runs with failures: $(grep 'Failures: ' tmp/working_failing_specs.log | wc -l)" >> tmp/working_failing_specs.log
echo "==>>>> $(date)" >> tmp/working_failing_specs.log
echo "========================================================================" >> tmp/working_failing_specs.log
mv tmp/working_failing_specs.log tmp/failing_specs.log
Expand Down
3 changes: 2 additions & 1 deletion app-scripts/parallel_test_retest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo "Retesting failed specs"
old_ifs=$IFS
IFS=$'\n'
retest=''
for line in $(grep -P '\e\[[0-9]+mrspec ' tmp/failing_specs.log) ; do
for line in $(grep -P '(\e\[[0-9]+m)?rspec ' tmp/failing_specs.log) ; do
[[ $line =~ rspec\ ([a-zA-Z0-9_\./]+) ]]
retest="${retest}"$'\n'"$(echo ${BASH_REMATCH[1]})"
done
Expand All @@ -25,6 +25,7 @@ IFS=$old_ifs

if [ -z "${retest}" ]; then
echo "No failed specs found in tmp/failing_specs.log"
echo "No failed specs found in tmp/failing_specs.log" >> tmp/failing_specs.log
exit 0
fi

Expand Down
Loading