Skip to content

Set up new page for case contacts table#6467

Merged
compwron merged 33 commits into
rubyforgood:mainfrom
MikeRose151:mikerose151/6462-new-case-contact-table-page
Sep 26, 2025
Merged

Set up new page for case contacts table#6467
compwron merged 33 commits into
rubyforgood:mainfrom
MikeRose151:mikerose151/6462-new-case-contact-table-page

Conversation

@MikeRose151
Copy link
Copy Markdown
Contributor

@MikeRose151 MikeRose151 commented Aug 8, 2025

What github issue is this PR for, if any?

Resolves #6462

What changed, and why?

The following design has been proposed as a replacement for the existing Case Contact Cards. This PR provides the foundations for the new design by doing the following:

  • Create view and controller / set up routing
  • Implement a basic (unpolished) version of the table, populated with the case contacts data

I will create new issues/tickets for the next steps as listed below below (and new PRs will be made for each issue). This will enable others to support with this new page.

  • Create feature flag (with flipper)
  • Implement expansion functionality so that user can click on the down arrow next to the bell icon (or maybe anywhere on the card) to expand the row in order to see more details
  • Implement functionality to the right-hand side menu for each row - menu options are to “Edit”, “Delete”, “Set Reminder” (the logic for these buttons should already exist as the current design has these features)
  • Implement “add new case” button (the logic should already exist as the current design has this feature)
  • Implement “filter” functionality (again, the logic should already exist as the current design has this feature)
  • Implement “columns” functionality, to enable the user to hide/show columns
  • Implement “search” functionality
  • Add mobile responsiveness
  • Any accessibility considerations?

How is this tested? (please write rspec and jest tests!) 💖💪

Added basic testing in spec/requests/case_contacts_new_design_spec.rb to verify that all case contacts are listed, draft status badges display, and contacts are ordered by date as default.

Screenshots please :)

image

@github-actions github-actions Bot added javascript Touches JavaScript code ruby Touches Ruby code erb Touches ERB templates labels Aug 8, 2025
Comment thread app/javascript/src/dashboard.js Outdated
Comment on lines +11 to +14
order: [[2, 'desc']],
columnDefs: [
{ orderable: false, targets: [0, 1, -1] } // disable sort on bell, chevron, vertical elipses menu
]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I used this existing function to remove the sortable function for a few columns in the table. As far as I can tell, this function was leftover from an old feature (seems to be a similar-looking table to the one this PR is implementing). Is it safe to assume that editing this function is not gonna break anything elsewhere in the app?

For more context, this PR from a while back is where the function got added. It seems case contacts used to be in a table once upon a time?

@MikeRose151
Copy link
Copy Markdown
Contributor Author

I plan to add basic tests for verifying that the routing works and the template renders correctly. Currently seeing a lot of failing tests when I run bin/rails spec locally, so I'll try to figure out what's happening there and then write the tests before getting this reviewed

@compwron
Copy link
Copy Markdown
Collaborator

this is looking proming!

@MikeRose151 MikeRose151 marked this pull request as ready for review August 22, 2025 15:29
@compwron compwron requested a review from Copilot September 6, 2025 05:51
@MikeRose151
Copy link
Copy Markdown
Contributor Author

@compwron this PR is ready for review :) what's the review process e.g. should I tag people here or post in slack or just leave it like this and someone will get round to it when they have a moment?

@compwron compwron requested a review from Copilot September 26, 2025 20:17
bundle exec rake db:schema:load
bundle exec rails assets:precompile

- name: Run rspec and upload code coverage
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no more code coverage? I mean it does speed it up, but was this intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah I thought what I've done here is removing what we're doing with code climate, as per this slack thread: https://rubyforgood.slack.com/archives/CVB0QJGVD/p1757473365867509?thread_ts=1757356417.512309&cid=CVB0QJGVD

have I removed more than I was supposed to? 🫣

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

</td>
<td>
<% if case_contact.contact_made %>
<i class="lni lni-checkmark-circle" style="color: green;"></i>
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

Inline styles should be avoided in favor of CSS classes. Consider defining a CSS class for the green checkmark styling.

Copilot uses AI. Check for mistakes.
<% if case_contact.contact_made %>
<i class="lni lni-checkmark-circle" style="color: green;"></i>
<% else %>
<i class="lni lni-cross-circle" style="color: orange;"></i>
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

Inline styles should be avoided in favor of CSS classes. Consider defining a CSS class for the orange cross styling.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

looks safe in prod, let's try it :)

@compwron compwron merged commit 701a228 into rubyforgood:main Sep 26, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

erb Touches ERB templates javascript Touches JavaScript code ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Case Contact Table

3 participants