Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: agent agenda off days contrast #4924

Merged
merged 4 commits into from
Dec 26, 2024
Merged
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: 1 addition & 1 deletion app/helpers/absences_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module AbsencesHelper
CALENDAR_BACKGROUND_COLOR = "rgba(127, 140, 141, 0.7)".freeze
CALENDAR_BACKGROUND_COLOR = "rgba(52, 57, 58, 0.7)".freeze

def absence_tag(absence)
if absence.expired?
Expand Down
1 change: 1 addition & 0 deletions app/services/off_days.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def self.to_full_calendar_array
start: jour_ferie.beginning_of_day.as_json,
end: jour_ferie.end_of_day.as_json,
backgroundColor: AbsencesHelper::CALENDAR_BACKGROUND_COLOR,
textColor: "white",
}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"title" => absence.title,
"start" => absence.starts_at.as_json,
"end" => absence.ends_at.as_json,
"backgroundColor" => "rgba(127, 140, 141, 0.7)",
"backgroundColor" => "rgba(52, 57, 58, 0.7)",
"url" => "/admin/organisations/#{organisation.id}/absences/#{absence.id}/edit",
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
stub_netsize_ok
travel_to(now)
login_as(agent, scope: :agent)
# Depuis que les jours fériés sont affichés sur la journée complète dans le calendrier,
# cela peut nous empêcher de cliquer sur une plage horaire et générer une flaky.
# On les retire pour ce test
allow(OffDays).to receive(:to_full_calendar_array).and_return([])
visit admin_organisation_agent_agenda_path(organisation, agent)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/services/off_days_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
describe ".to_full_calendar_array" do
it "returns the proper format for full calendar" do
array = described_class.to_full_calendar_array
expect(array[0].keys).to match_array(%i[title start end backgroundColor])
expect(array[0][:backgroundColor]).to eq "rgba(127, 140, 141, 0.7)"
expect(array[0].keys).to match_array(%i[title start end backgroundColor textColor])
expect(array[0][:backgroundColor]).to eq "rgba(52, 57, 58, 0.7)"
end
end
end
Loading