A platform for community discussion. Free, open, simple.
FIX: Restore chat link on post event widget (#39287)
Max Mulatza27b53cad67b
diff --git a/plugins/discourse-calendar/assets/javascripts/discourse/components/discourse-post-event/chat-channel.gjs b/plugins/discourse-calendar/assets/javascripts/discourse/components/discourse-post-event/chat-channel.gjsindex f673ee8a9ff..a988b341e62 100644--- a/plugins/discourse-calendar/assets/javascripts/discourse/components/discourse-post-event/chat-channel.gjs+++ b/plugins/discourse-calendar/assets/javascripts/discourse/components/discourse-post-event/chat-channel.gjs@@ -1,24 +1,27 @@+import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import { optionalRequire } from "discourse/lib/utilities";import { and } from "discourse/truth-helpers";-const ChannelTitle = optionalRequire(- "discourse/plugins/chat/discourse/components/channel-title"-);+export default class DiscoursePostEventChatChannel extends Component {+ get channelTitle() {+ return optionalRequire(+ "discourse/plugins/chat/discourse/components/channel-title"+ );+ }-const DiscoursePostEventChatChannel = <template>- {{#if (and @event.channel ChannelTitle)}}- <section class="event__section event-chat-channel">- <span></span>- <LinkTo- @route="chat.channel"- @models={{@event.channel.routeModels}}- class="chat-channel-link"- >- <ChannelTitle @channel={{@event.channel}} />- </LinkTo>- </section>- {{/if}}-</template>;--export default DiscoursePostEventChatChannel;+ <template>+ {{#if (and @event.channel this.channelTitle)}}+ <section class="event__section event-chat-channel">+ <span></span>+ <LinkTo+ @route="chat.channel"+ @models={{@event.channel.routeModels}}+ class="chat-channel-link"+ >+ <this.channelTitle @channel={{@event.channel}} />+ </LinkTo>+ </section>+ {{/if}}+ </template>+}diff --git a/plugins/discourse-calendar/assets/javascripts/discourse/models/discourse-post-event-event.js b/plugins/discourse-calendar/assets/javascripts/discourse/models/discourse-post-event-event.jsindex 742cc35a84a..a269379fd22 100644--- a/plugins/discourse-calendar/assets/javascripts/discourse/models/discourse-post-event-event.js+++ b/plugins/discourse-calendar/assets/javascripts/discourse/models/discourse-post-event-event.js@@ -7,10 +7,6 @@ import User from "discourse/models/user";import DiscoursePostEventEventStats from "./discourse-post-event-event-stats";import DiscoursePostEventInvitee from "./discourse-post-event-invitee";-const ChatChannel = optionalRequire(- "discourse/plugins/chat/discourse/models/chat-channel"-);-const DEFAULT_REMINDER = {type: "notification",value: 15,@@ -62,6 +58,10 @@ export default class DiscoursePostEventEvent {@tracked _reminders;constructor(args = {}) {+ const ChatChannel = optionalRequire(+ "discourse/plugins/chat/discourse/models/chat-channel"+ );+this.id = args.id;this.rrule = args.rrule;this.name = args.name;