Events Plugin šŸ“†

I upgraded to the latest version today. It works now. Thanks

2 Likes

Thats good to know. You were most certainly facing this issue.

2 Likes

Hi everyone,

Iā€™ve been experiencing for approximately one month a bug that I canā€™t replicate but that I donā€™t know how to solve either.
On one of the instance Iā€™m managing, the Agenda page is sorted by activity date rather than the event date.
I am using these other plugins (but I donā€™t think they are involved in any way since I use the same ones for other instances):

Plugins

discourse-checklist 0.4.1 O
discourse-custom-wizard 0.1 O
discourse-data-explorer 0.2 O
discourse-events 0.1 O
discourse-footnote 0.1 O
discourse-locations 0.1 O
discourse-math 0.9 N
discourse-quick-messages 0.1 N
discourse-sidebar-categories 0.1 O
discourse-solved 0.1 O
discourse-whos-online 1.0 O
docker_manager 0.1 O

Does any one of you have a hint of a config problem, or something I might have done that would have broken it, or some place I should ckeck to diagnose the problem ?

More details or access to the instance via MP.

Thanks in advance

2 Likes

Thanks for the report.
Please click on report a bug link on the first post of this topic and fill the form with relevant details. That way itā€™ll become easy for us to schedule an appropriate time to look into the issue.

3 Likes

Hi everyone,

Next to the topic name, there are a calendar icon and the date of the event displayed on /latest, /top, /unread or /agenda pages. They are not displayed on the <Category + Latest> page, nor on mobile.

Is there a setting to add them there ? (I could not find it)
If not, can anyone see a dirty hack I could use to make it happen, for example by copy-pasting something on the plugin code for /latest enable it on /categories ? (even if that would become cluttered, Iā€™ll find a way with CSS to make it not that horrible)

Thanks in advance

2 Likes

Yes. This is reported on our instance. Weā€™ll schedule a fix shortly.

3 Likes

https://github.com/paviliondev/discourse-events/blob/3135b10525b528648c5ac26ee51aee5cbff6ec31/assets/javascripts/discourse/connectors/edit-topic/topic-controls-event.js.es6#L16

      if (this._state === 'destroying') return;

can you tell me what the purpose of this line of code in the ember observer is? Does it relate to the Lifecycle of ember components: https://guides.emberjs.com/release/components/the-component-lifecycle/ ?

2 Likes

Yes. You can actually print it in the console and see its value during different lifecycle events.

1 Like

Ok so whats the purpose of just returning, when the state is ā€˜destroyingā€™ ? what would happen if we omit this line?

1 Like

To prevent the next two statements from getting executed because those would become unnecessary :slight_smile:

1 Like

so its for performance?

2 Likes

It would be worth doing even if there was no performance gain. Why would you want to run a bunch of statements which have no use in a particular case?

Now that I thought about it and did some research, thereā€™s a proper word fall it called return early pattern for functions.

1 Like


I did some more digging. I set a breakpoint on the line and then executed the statements. Its not just unnecessary to execute them, it actually leads to an error.

2 Likes

I said unnecessary but yeah, it would also throw an error. If youā€™re interested, you can have a look at ember-concurrency which gives out of the box solution to tackle these kind of situations. It isnā€™t included in discourse core yet though.

So if it was used, this case would be taken care of, by the library itself.

1 Like

I just watched this talk while learning about observers vs computed properties:


Can you explain why an observer was used in this case, instead of a computed property?
I am trying to understand the trade offs and different use cases.
1 Like

Can this be made to work on tags/tag pages?

1 Like

What is the functionality you are wanting on tags/tag pages? Events plugin mostly affects topics, but categories also can get a calendar and agenda view of event topics within the category. Are you suggesting providing an agenda view of tagged event topics? That might be interesting to look at, e.g. to display all events tagged by a country. That would be pretty cool! But it is not on the roadmap as of now as far as I know. You could request the feature at https://thepavilion.io/.

3 Likes

thanks for your reply @tobiaseigen. weā€™re heavily promoting tags for user navigation as they are so wonderfully flexible. The main issue is that most plugins and theme components wonā€™t work with them. So yes, its extra flexibility we want to create. Anything users tag posts as would have an attached calendar they can use if they visit the tag page.

You can see that with the Kanban plugin that one of our volunteer Public Happiness Movement devs succeeded in adapting it for tag pages: https://github.com/artysidorenko/discourse-kanban-theme

Iā€™m a pretty basic dev myself, but i wonder if the code @artysidorenko used can be modified to work on this plugin too. Honestly there are so many plugins and theme components that would benefit from also working with tag-pages, i wonder if the core team might want to package a stock solutionā€¦

3 Likes

you can enable the plugin not only per category but also system wide. Maybe thats good enough for your usecase.

1 Like

thanks for your reply. when using a tags for navigation users wouldnā€™t be in a category to be able to see a calendar or link, and a sitewide all encompassing calendar isnā€™t sufficient for multiple teams

1 Like