Commit Graph

131 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan 14a7649840 Fix plugin's compatibility with older discourse versions.
Follow-up to d469260bf9
2021-06-17 09:13:22 +08:00
Alan Guo Xiang Tan 10456a93a2
FIX: Holidays gem not required in Sidekiq. 2021-06-09 10:49:09 +08:00
Alan Guo Xiang Tan d469260bf9 PERF: N+1 queries while loading `Post#event` in a topic. 2021-06-07 15:20:08 +08:00
Alan Guo Xiang Tan 0e3431f111 Hard fork holidays/holidays gem into plugin.
The original gem does not seem to be maintained anymore so we're pulling
this into the plugin so that we can update the definitions easily.
2021-06-07 10:54:52 +08:00
Sam aa7086b14c
DEV: update holiday definitions (#130) 2021-05-05 12:17:00 +10:00
Vinoth Kannan 3b1f1ea5ed
FIX: retrieve custom fields from preloaded data to stop N+1 issue. (#128)
All the preloaded custom fields are stored in `TopicView`'s post_custom_fields property. To prevent N+1 we should use that instead of `post.custom_fields` method.
2021-05-03 09:06:25 +02:00
Dan Ungureanu 776e3d1b9d
FIX: Show holiday name only once (#120) 2021-04-23 19:16:29 +03:00
Dan Ungureanu 4d9d30fe18
FIX: Handle multiple holidays in the same day (#118)
If a user had two holidays in the same day, the calendar would show
only of them, but the username would be shown twice. This ensures the
calendar shows both holidays and the username only once.
2021-04-14 11:42:21 +03:00
Gerhard Schlager 11397e2910
DEV: Fix flaky spec (#103) 2021-02-09 18:24:26 +01:00
Krzysztof Kotlarek 21d536de5d
FIX: randomly failing export CSV spec (#81)
The test is failing because of an incorrect order. I added an order by `created_by`.

Also, I needed to split create_invitess because it is using the same date for `created_at`

```ruby
def create_invitees(attrs)
  timestamp = Time.now
  attrs.map! do |attr|
    {
      post_id: self.id, created_at: timestamp, updated_at: timestamp
    }.merge(attr)
  end

  self.invitees.insert_all!(attrs)
end
```
2020-12-14 10:52:03 +11:00
Régis Hanol 94600a8508 FIX: properly handle holidays in the same week
UX: sort usernames in grouped holidays
2020-11-27 18:06:40 +01:00
Krzysztof Kotlarek 9f69f273ad
FIX: move post events into separate tables (#70)
* FIX: correctly destroys standalone calendar events (#66)

Standalone events are mostly created for holidays where we create a calendar event not associated to any post of of the topic, before this change, the loop was exited before collecting the ID of the calendar event to be destroyed.
2020-11-25 09:32:51 +11:00
Daniel Waterworth 77744d4c65
FIX: find_each does not respect ordering clauses (#74)
`find_each` gets the rows in batches, ordered by the primary key, so
ordering clauses are ignored. I assume this is fine, because If it is
not OK to fetch them all from postgres, then it is also not OK to send
them all to the client at once.
2020-11-24 12:13:10 -06:00
Régis Hanol 44521c65c3
FIX: sort calendar_details for better holidays support (#71) 2020-11-19 17:30:15 +01:00
Joffrey JAFFEUX 9560350108
FEATURE: more dynamic event dates in topic titles (#61)
- always auto updated
- correctly computed, based on past/current/future event
- displays a green indicator when an event is on going
2020-09-27 14:25:27 +02:00
jjaffeux b7b6213983 FIX: non staff users part of allowed groups can only edit own event 2020-09-24 15:25:02 +02:00
jjaffeux 0854550fe4 UX: improved dates styles in topics and dates are now relative 2020-09-19 12:52:43 +02:00
jjaffeux b41c49c34e FIX: makes every_month use the same weekday 2020-09-12 23:09:43 +02:00
jjaffeux a64735750f FIX: keys returns an array not a string
Followup to 88e26b26
2020-09-04 17:29:49 +02:00
jjaffeux 88e26b26b6 UX: do not notify ongoing invitees when only editing tags 2020-09-04 16:02:40 +02:00
jjaffeux ae6f7c9d25 FIX: custom fields are now part of markdown 2020-08-25 13:22:09 +02:00
jjaffeux d1bf3bafeb DEV: simpler post eval 2020-08-20 15:21:26 +02:00
jjaffeux 2399624f51 FIX: sends event creation's notification to all potential invitees
When in private event, we don't create invitees, although we know the list of people who can join, send an invite to this list.

Also fixes the total count of users on private events.
2020-08-13 16:20:49 +02:00
jjaffeux 60f9d6cf4f FIX: ensures invitees are notified again when recurrence is used 2020-08-13 10:46:27 +02:00
jjaffeux 019847948c FEATURE: intoduces recurrence support
For now: every_week/every_day/every_month/every_weekday (monday to friday)
2020-08-13 10:19:13 +02:00
jjaffeux b5e388a74c FEATURE: allows to extend the edit notifications period 2020-08-11 14:04:00 +02:00
jjaffeux 49e4cca2c2 REFACTOR: removes dead code 2020-08-11 08:18:12 +02:00
jjaffeux 1e62bfa8c8 REFACTOR: removes dead code 2020-08-11 08:02:41 +02:00
jjaffeux ad57efb6fe REFACTOR: makes reminders to be in raw 2020-08-10 23:38:04 +02:00
jjaffeux 227327b395 Merge branch 'master' of github.com:discourse/discourse-calendar 2020-08-10 16:02:25 +02:00
jjaffeux da91f7417d FEATURE: allows to set reminder
Note that reminders; as custom fields, are only editable on created event and not when creating it.
2020-08-10 16:02:12 +02:00
David Taylor 6f06bc8ba3
DEV: Use plugin API to amend Post class (#57)
This ensures that the patch is reloaded automatically during development, and should stop the random `NoMethodError (undefined method `group_timezones' for #<Post>` errors in development
2020-08-10 13:10:41 +01:00
jjaffeux 5c5ffdaaab FEATURE: allows to remove invitees from the modal listing them 2020-08-09 13:41:10 +02:00
jjaffeux 4e5fad6b4f FEATURE: inline bulk invite 2020-08-09 10:01:21 +02:00
jjaffeux 6754bdfc8b FEATURE: adds support for custom fields on event
Custom fields are create in the site settings of the event plugin. Once at least one custom field is created, a new form will appear in each event UI. These custom fields are passed when DIscourseEvent triggers of the plugin are called, allowing you to pass custom data of the even to other plugins.
2020-08-07 17:50:15 +02:00
Penar Musaraj bf31bb359c
DEV: Use CSS custom properties for complex color variations 2020-08-06 10:27:25 -04:00
jjaffeux ed37c5bcc7 FIX: directly check on post if we have an event
This is cleaner and also avoids a 404 when no event is found
2020-08-04 21:06:02 +02:00
jjaffeux 214899ea9a FEATURE: notify going invitees of edits on OP during event 2020-08-04 16:11:58 +02:00
jjaffeux bdf4942ee1 DEV: triggers DiscourseEvents when an event starts/ends 2020-08-04 14:25:00 +02:00
Joffrey JAFFEUX 1451a65f54
FEATURE: allows to bulk invite into events (#54) 2020-08-03 15:47:01 +02:00
Krzysztof Kotlarek 88842e12df FIX: check if allow_staff_user_custom_field exisits 2020-07-27 12:00:51 +10:00
Krzysztof Kotlarek 8ffd5e0b79 FIX: compatibility after allowlist rewording in Discourse 2020-07-15 09:28:44 +10:00
Dan Ungureanu b832232268
FEATURE: Add user preferences field to select region (#44) 2020-06-18 11:29:08 +03:00
jjaffeux 8485eebf69 DEV: bumps holidays gem to 8.2.0 2020-06-09 09:56:05 +02:00
jjaffeux 2340a79062 DEV: bumps holidays gem to 8.1.0 2020-06-09 09:54:54 +02:00
jjaffeux f5ffee3e6a FIX: better identifier and uses real dates for grouping 2020-06-01 20:02:08 +02:00
jjaffeux 13f14c3a2d FIX: prevents breaking of other reports export 2020-05-31 07:36:27 +02:00
jjaffeux 4469ebda3b FIX: allows non admin events creators to export csv 2020-05-24 16:59:09 +02:00
jjaffeux cced2c8c02 FIX: prevents error if the associated post has been destroyed 2020-05-10 17:42:14 +02:00
jjaffeux b95380a1e8 FIX: ensures a destroyed user is correctly removed from invitees 2020-05-04 09:46:38 +02:00