Skip to content

Commit

Permalink
Improvements for calendar in version 0.28 (#12)
Browse files Browse the repository at this point in the history
* fix calendar content height

* set time format

* fix external_event_spec

* change external_events_spec

* update test.yml file

* remove actions/dowload-artifac from test.yml file

* remove strftime

* remove strftime from external_event_spec
q
  • Loading branch information
ElviaBth authored May 13, 2024
1 parent 259f3b6 commit f418f84
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ jobs:
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- name: List Chrome
run: apt list --installed | grep chrome

- name: Remove Chrome
run: sudo apt remove google-chrome-stable

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 119.0.6045.105

- uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -74,3 +84,9 @@ jobs:
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
1 change: 1 addition & 0 deletions app/packs/src/decidim/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const calendar = new Calendar(calendarEl, {
plugins: [interactionPlugin, dayGridPlugin, timeGridPlugin, listPlugin],
initialView: getInitialView(),
dayMaxEvents: 3,
contentHeight: "auto",
locale: currentLocale,
firstDay: calendarEl.dataset.hasOwnProperty("firstday") // eslint-disable-line no-prototype-builtins
? parseInt(calendarEl.dataset.firstday)
Expand Down
4 changes: 3 additions & 1 deletion app/presenters/decidim/calendar/event_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def all_day?
def hour
return nil if start.is_a?(Date) || all_day?

start.strftime("%H:%M")
format = Decidim::Calendar.calendar_options[:hour12] ? "%I:%M %p" : "%H:%M"

start.strftime(format)
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/system/admin/external_events_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
start_time = Time.current
end_time = 2.days.from_now

fill_in "external_event[start_at]", with: start_time.strftime("%Y-%m-%dT%H:%M")
fill_in "external_event[end_at]", with: end_time.strftime("%Y-%m-%dT%H:%M")
fill_in "external_event[start_at]", with: start_time
fill_in "external_event[end_at]", with: end_time

within ".new_event" do
fill_in_i18n(
Expand Down Expand Up @@ -76,8 +76,8 @@
start_time = Time.current
end_time = 2.days.from_now

fill_in "external_event[start_at]", with: start_time.strftime("%Y-%m-%dT%H:%M")
fill_in "external_event[end_at]", with: end_time.strftime("%Y-%m-%dT%H:%M")
fill_in "external_event[start_at]", with: start_time
fill_in "external_event[end_at]", with: end_time

within ".edit_event" do
fill_in_i18n(
Expand Down

0 comments on commit f418f84

Please sign in to comment.