-
Notifications
You must be signed in to change notification settings - Fork 32
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
1135 calendar updates button #1246
Conversation
…endars synchronization
…troller and service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @entantoencuanto, it works great. I have added a couple of small issues in the code review, but I'd like you to add also an integration test. Ping me if you need help mocking the calendar synchronization.
current_site.activities.where(action: 'admin_gobierto_calendars.calendars_synchronized', subject: collection_container) | ||
.order(created_at: :asc) | ||
.last.try(:created_at) | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else
is not necessary, isn't it?
calendar_integration.sync_person_events(@calendar_configuration_form.collection_container) | ||
publish_calendar_sync_activity(@calendar_configuration_form) | ||
end | ||
redirect_to edit_admin_calendars_configuration_path(@collection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a flash message after the sync? Right now it works but there's no clear feedback for the user that it worked
<%= t('.last_sync') %>: <%= time_ago_in_words @last_sync %> - | ||
<% end %> | ||
|
||
<%= link_to sync_calendars_admin_calendars_configuration_path(@calendar_configuration_form.collection_id), method: :put, data: { confirm: "Are you sure?" } do %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing translation
Codecov Report
@@ Coverage Diff @@
## master #1246 +/- ##
==========================================
+ Coverage 75.79% 75.88% +0.09%
==========================================
Files 455 457 +2
Lines 12205 12231 +26
==========================================
+ Hits 9251 9282 +31
+ Misses 2954 2949 -5
Continue to review full report at Codecov.
|
Hey @entantoencuanto can this be accepted again? |
Yes, I think so |
Related with #1135
What does this PR do?
Adds a link on admin edition view of calendar configurations to sync the calendar if some integration is defined. Also a new activity is created when a calendar is synchronized. If there are previous calendar update activities the date of last sync is shown next to the link.
How should this be manually tested?
Visit http:https://madrid.gobify.net/admin/gobierto_calendars/configurations/29/edit
Does this PR changes any configuration file?
config/initializers/subscribers.rb
to include activities related with calendars