Skip to content

Commit cd39246

Browse files
authored
Merge pull request #6669 from Sergio-Mira/5377-remove-global-span-css
Remove global span tag CSS
2 parents cb62962 + 9e8d598 commit cd39246

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

app/javascript/src/dashboard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ $(() => { // JQuery's callback for the DOM loading
455455
const activeContactElement = activeContactVolunteers
456456
? (
457457
`
458-
<span class="attempted-contact status-btn success-bg text-white pl-${activeContactVolunteers * 15} pr-${activeContactVolunteers * 15}">
458+
<span class="attempted-contact supervisor-stat success-bg text-white pl-${activeContactVolunteers * 15} pr-${activeContactVolunteers * 15}" title="Number of Volunteers attempting contact (within 2 weeks)">
459459
${activeContactVolunteers}
460460
</span>
461461
`
@@ -465,7 +465,7 @@ $(() => { // JQuery's callback for the DOM loading
465465
const noContactElement = noContactVolunteers > 0
466466
? (
467467
`
468-
<span class="no-attempted-contact status-btn danger-bg text-white pl-${noContactVolunteers * 15} pr-${noContactVolunteers * 15}">
468+
<span class="no-attempted-contact supervisor-stat danger-bg text-white pl-${noContactVolunteers * 15} pr-${noContactVolunteers * 15}" title="Number of Volunteers not attempting contact (within 2 weeks)">
469469
${noContactVolunteers}
470470
</span>
471471
`
@@ -476,7 +476,7 @@ $(() => { // JQuery's callback for the DOM loading
476476
if (activeContactVolunteers <= 0 && noContactVolunteers <= 0) {
477477
volunteersCounterElement = '<span class="no-volunteers" style="flex-grow: 1">No assigned volunteers</span>'
478478
} else {
479-
volunteersCounterElement = `<span class="status-btn deactive-bg text-black pl-${transitionAgedCaseVolunteers * 15} pr-${transitionAgedCaseVolunteers * 15}">${transitionAgedCaseVolunteers}</span>`
479+
volunteersCounterElement = `<span class="supervisor-stat deactive-bg text-black pl-${transitionAgedCaseVolunteers * 15} pr-${transitionAgedCaseVolunteers * 15}" title="Count of Transition Aged Youth">${transitionAgedCaseVolunteers}</span>`
480480
}
481481

482482
return `

app/views/casa_admins/index.html.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@
5858
</div>
5959
</div>
6060
</div>
61-
</div>

app/views/supervisors/index.html.erb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
<div class="card-style mb-30">
4949
<h6 class="mb-10">Legend for Supervisor List</h6>
5050
<p class="text-sm mb-20">
51-
<span class="status-btn success-bg text-white mb-10">Number of Volunteers attempting contact (within 2 weeks)</span><br>
52-
<span class="status-btn danger-bg text-white mb-10">Number of Volunteers not attempting contact (within 2 weeks)</span><br>
53-
<span class="status-btn deactive-bg text-black">Count of Transition Aged Youth</span>
51+
<span class="supervisor-stat success-bg text-white mb-10">Number of Volunteers attempting contact (within 2 weeks)</span><br>
52+
<span class="supervisor-stat danger-bg text-white mb-10">Number of Volunteers not attempting contact (within 2 weeks)</span><br>
53+
<span class="supervisor-stat deactive-bg text-black">Count of Transition Aged Youth</span>
5454
</p>
5555
<div class="table-wrapper table-responsive">
5656
<table
@@ -78,20 +78,20 @@
7878

7979
<div class="d-flex flex-row w-100">
8080
<% if active_volunteers %>
81-
<div class="status-btn success-bg text-white flex-grow-1" style="max-width: <%= (active_volunteers * 15) %>%; text-align: center"><%= active_volunteers %></div>
81+
<div class="supervisor-stat success-bg text-white flex-grow-1" style="max-width: <%= (active_volunteers * 15) %>%; text-align: center"><%= active_volunteers %></div>
8282
<% end %>
8383
<% if no_attempt_volunteers.nonzero? %>
84-
<div class="status-btn danger-bg text-white flex-grow-1" style="max-width: <%= (no_attempt_volunteers * 15) %>%; text-align: center"><%= no_attempt_volunteers %></div>
84+
<div class="supervisor-stat danger-bg text-white flex-grow-1" style="max-width: <%= (no_attempt_volunteers * 15) %>%; text-align: center"><%= no_attempt_volunteers %></div>
8585
<% else %>
8686
<div class="flex-grow-1"></div>
8787
<% end %>
8888
</div>
8989

9090
<div class="d-flex flex-row py-2" style="max-width: 50%;">
9191
<% if !(active_volunteers || no_attempt_volunteers.nonzero?) %>
92-
<div class="status-btn bg-secondary text-white">No assigned volunteers</div>
92+
<div class="supervisor-stat bg-secondary text-white">No assigned volunteers</div>
9393
<% else %>
94-
<div class="status-btn deactive-bg text-black" style="width:<%= (transition_volunteers * 15) %>; % text-align: center">
94+
<div class="supervisor-stat deactive-bg text-black" style="width:<%= (transition_volunteers * 15) %>; % text-align: center">
9595
<%= transition_volunteers %>
9696
</div>
9797
<% end %>

public/assets/css/main.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ i,
5454
a {
5555
display: inline-block; }
5656

57-
span {
58-
display: block; }
59-
}
6057
audio,
6158
canvas,
6259
iframe,
@@ -3859,4 +3856,12 @@ h6,
38593856
font-weight: 800; }
38603857

38613858
.fw-900 {
3862-
font-weight: 900; }
3859+
font-weight: 900; }
3860+
3861+
/* ====== Supervisor Stats ====== */
3862+
.supervisor-stat {
3863+
display: block;
3864+
padding: 7px 15px;
3865+
border-radius: 30px;
3866+
font-size: 14px;
3867+
font-weight: 400; }

spec/system/supervisors/index_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
expect(active_contact_element).to match_css(".pr-#{active_contacts_expected * 15}")
364364
expect(no_active_contact_element).to have_text(no_active_contacts_expected)
365365
expect(no_active_contact_element).to match_css(".pl-#{no_active_contacts_expected * 15}")
366-
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
366+
expect(supervisor_stats.find(".supervisor-stat.deactive-bg")).to have_text(transition_aged_youth_expected)
367367
end
368368

369369
it "shows the correct volunteers for the second supervisor with both volunteer types", :js do
@@ -381,7 +381,7 @@
381381
expect(active_contact_element).to match_css(".pr-#{active_contacts_expected * 15}")
382382
expect(no_active_contact_element).to have_text(no_active_contacts_expected)
383383
expect(no_active_contact_element).to match_css(".pl-#{no_active_contacts_expected * 15}")
384-
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
384+
expect(supervisor_stats.find(".supervisor-stat.deactive-bg")).to have_text(transition_aged_youth_expected)
385385
end
386386

387387
it "shows the correct element for a supervisor with only contact volunteers", :js do
@@ -395,7 +395,7 @@
395395

396396
expect(active_contact_element).to have_text(active_contacts_expected)
397397
expect(active_contact_element).to match_css(".pl-#{active_contacts_expected * 15}")
398-
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
398+
expect(supervisor_stats.find(".supervisor-stat.deactive-bg")).to have_text(transition_aged_youth_expected)
399399
expect(supervisor_stats).not_to have_css("span.no-attempted-contact")
400400
end
401401

@@ -410,7 +410,7 @@
410410

411411
expect(no_contact_element).to have_text(no_contacts_expected)
412412
expect(no_contact_element).to match_css(".pl-#{no_contacts_expected * 15}")
413-
expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected)
413+
expect(supervisor_stats.find(".supervisor-stat.deactive-bg")).to have_text(transition_aged_youth_expected)
414414
expect(supervisor_stats).not_to have_css("span.attempted-contact")
415415
expect(supervisor_stats).not_to have_css("span.attempted-contact-end")
416416
end

0 commit comments

Comments
 (0)