Skip to content
Draft
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
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
# The branches below must be a subset of the branches above
branches:
- main
- rfg-event-2025
paths-ignore:
- 'doc/**'
- '**/*.md'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths-ignore:
- "doc/**"
- "**/*.md"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/erb_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths:
- '**/*.erb'
- '**/*.html'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/factory_bot_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths-ignore:
- 'doc/**'
- '**/*.md'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/npm_lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths:
- '**/*.js'
- '**/*.json'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rake-after_party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths-ignore:
- "doc/**"
- "**/*.md"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ruby_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths-ignore:
- 'doc/**'
- '**/*.md'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths-ignore:
- 'doc/**'
- '**/*.md'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/spec_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
branches:
- main
- rfg-event-2025
paths-ignore:
- 'doc/**'
- '**/*.md'
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require:
- standard
- rubocop-factory_bot

plugins:
Expand All @@ -7,4 +8,5 @@ plugins:
- rubocop-rspec_rails

inherit_gem:
standard: config/base.yml
pundit: config/rubocop-rspec.yml
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -525,18 +525,18 @@ GEM
rswag-ui (2.16.0)
actionpack (>= 5.2, < 8.1)
railties (>= 5.2, < 8.1)
rubocop (1.75.8)
rubocop (1.80.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.1)
rubocop-ast (1.46.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
Expand Down Expand Up @@ -612,10 +612,10 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
standard (1.50.0)
standard (1.51.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.75.5)
rubocop (~> 1.80.2)
standard-custom (~> 1.0.0)
standard-performance (~> 1.8)
standard-custom (1.0.2)
Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/pages/volunteers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ table#volunteers.dataTable.hover > tbody > tr.selected:hover > * {
border: 1px solid #757575;
}

table#volunteers.dataTable {
.emancipation-btn {
padding: 5px 10px;
font-size: 10px;
line-height: 16px;
vertical-align: middle;
}
}
8 changes: 8 additions & 0 deletions app/decorators/casa_case_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ def case_contacts_latest_before(date)
object.case_contacts.where("occurred_at < ?", date).max_by(&:occurred_at)
end

def case_contacts_made
object.case_contacts.where('occurred_at > ?', DateTime.now - 60.days).count
end

def last_attempted_contact_formatted(volunteer_id)
object.case_contacts.where(creator_id: volunteer_id).order(occurred_at: :desc).first&.occurred_at&.strftime("%B %d, %Y")
end

def case_contacts_filtered_by_active_assignment_ordered_by_occurred_at
object.case_contacts
.joins("INNER JOIN case_assignments on case_assignments.casa_case_id = case_contacts.casa_case_id and case_assignments.volunteer_id = case_contacts.creator_id")
Expand Down
30 changes: 27 additions & 3 deletions app/javascript/src/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,14 @@ $(() => { // JQuery's callback for the DOM loading
}
})
},
order: [[7, 'desc']],
order: [[8, 'desc']],
columns: [
{
className: 'dt-control',
orderable: false,
data: null,
defaultContent: ''
},
{
data: 'id',
targets: 0,
Expand Down Expand Up @@ -206,9 +212,14 @@ $(() => { // JQuery's callback for the DOM loading
`
})
const caseNumbers = `
<span class="mobile-label">Case Number(s)</span>
${links.join(', ')}
<span class="mobile-label">Case Total</span>
${links.length}
`

// const caseNumbers = `
// <span class="mobile-label">Case Number(s)</span>
// ${links.join(', ')}
// `
return caseNumbers
},
orderable: false
Expand Down Expand Up @@ -306,6 +317,19 @@ $(() => { // JQuery's callback for the DOM loading
}
})

volunteersTable.on('click', 'tbody td.dt-control', function (e) {
let tr = e.target.closest('tr');
let row = volunteersTable.row(tr);

if (row.child.isShown()) {
row.child.hide();
}
else {
const vdomId = `#volunteer-details-${row.data().id}`
row.child($(vdomId).html()).show();
}
});

// Because the table saves state, we have to check/uncheck modal inputs based on what
// columns are visible
volunteersTable.columns().every(function (index) {
Expand Down
26 changes: 26 additions & 0 deletions app/views/volunteers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<th>
<input id="checkbox-toggle-all" type="checkbox" class="form-check-input" data-select-all-target="checkboxAll" data-action="select-all#toggleAll">
</th>
<th></th>
<th>Name</th>
<th>Email</th>
<th>Supervisor</th>
Expand Down Expand Up @@ -247,3 +248,28 @@

</div>
</div>

<div style='display:none'>
<% current_organization.volunteers.each do |volunteer| %>
<div id="volunteer-details-<%= volunteer.id %>">
<% if volunteer.casa_cases.any? %>
<table>
<tr>
<th> Case Number </th>
<th> Transition Aged Youth </th>
<th> Last Attempted Contact </th>
<th> Contacts Made in Past 60 Days </th>
</tr>
<% volunteer.casa_cases.each do |casa_case| %>
<tr>
<td> <%= casa_case.case_number %> </td>
<td> <%= casa_case.decorate.transition_aged_youth %> </td>
<td> <%= casa_case.decorate.last_attempted_contact_formatted(volunteer.id) %></td>
<td> <%= casa_case.decorate.case_contacts_made %>
</tr>
<% end %>
</table>
<% end %>
</div>
<% end %>
</div>
18 changes: 9 additions & 9 deletions spec/system/supervisors/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@
no_active_contact_element = supervisor_stats.find("span.no-attempted-contact")

expect(active_contact_element).to have_text(active_contacts_expected)
expect(active_contact_element.has_css?("pr-#{active_contacts_expected * 15}"))
expect(active_contact_element).to match_css(".pr-#{active_contacts_expected * 15}")
expect(no_active_contact_element).to have_text(no_active_contacts_expected)
expect(no_active_contact_element.has_css?("pl-#{no_active_contacts_expected * 15}"))
expect(no_active_contact_element).to match_css(".pl-#{no_active_contacts_expected * 15}")
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
end

Expand All @@ -378,9 +378,9 @@
no_active_contact_element = supervisor_stats.find("span.no-attempted-contact")

expect(active_contact_element).to have_text(active_contacts_expected)
expect(active_contact_element.has_css?("pr-#{active_contacts_expected * 15}"))
expect(active_contact_element).to match_css(".pr-#{active_contacts_expected * 15}")
expect(no_active_contact_element).to have_text(no_active_contacts_expected)
expect(no_active_contact_element.has_css?("pl-#{no_active_contacts_expected * 15}"))
expect(no_active_contact_element).to match_css(".pl-#{no_active_contacts_expected * 15}")
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
end

Expand All @@ -393,10 +393,10 @@
transition_aged_youth_expected = 3
active_contact_element = supervisor_stats.find("span.attempted-contact")

expect { supervisor_stats.find("span.no-attempted-contact") }.to raise_error(Capybara::ElementNotFound)
expect(active_contact_element).to have_text(active_contacts_expected)
expect(active_contact_element.has_css?("pl-#{active_contacts_expected * 15}"))
expect(active_contact_element).to match_css(".pl-#{active_contacts_expected * 15}")
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
expect(supervisor_stats).not_to have_css("span.no-attempted-contact")
end

it "shows the correct element for a supervisor with only no contact volunteers", :js do
Expand All @@ -408,11 +408,11 @@
transition_aged_youth_expected = 2
no_contact_element = supervisor_stats.find("span.no-attempted-contact")

expect { supervisor_stats.find("span.attempted-contact") }.to raise_error(Capybara::ElementNotFound)
expect { supervisor_stats.find("span.attmepted-contact-end") }.to raise_error(Capybara::ElementNotFound)
expect(no_contact_element).to have_text(no_contacts_expected)
expect(no_contact_element.has_css?("pl-#{no_contacts_expected * 15}"))
expect(no_contact_element).to match_css(".pl-#{no_contacts_expected * 15}")
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
expect(supervisor_stats).not_to have_css("span.attempted-contact")
expect(supervisor_stats).not_to have_css("span.attempted-contact-end")
end

it "shows the correct text with a supervisor with no assigned volunteers", :js do
Expand Down
Loading