Files
discourse/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder-text.gjs
Joffrey JAFFEUX 42801c950f UI: redesigned settings/members (#23804)
This PR is a first step towards private groups. It redesigns settings/members area of a channel and also drops the "about" page which is now mixed into settings.

This commit is also:
- introducing chat-form, a small DSL to create forms, ideally I would want something in core for this
- introducing a DToggleSwitch page object component to simplify testing toggles
- migrating various components to gjs
2023-10-09 14:11:16 +02:00

40 lines
1.1 KiB
JavaScript

import Component from "@glimmer/component";
import I18n from "I18n";
import { inject as service } from "@ember/service";
export default class ChatRetentionReminderText extends Component {
<template>
<span class="chat-retention-reminder-text">
{{this.text}}
</span>
</template>
@service siteSettings;
get text() {
if (this.args.channel.isDirectMessageChannel) {
if (this.#countForChannelType > 0) {
return I18n.t("chat.retention_reminders.dm", {
count: this.siteSettings.chat_dm_retention_days,
});
} else {
return I18n.t("chat.retention_reminders.dm_none");
}
} else {
if (this.#countForChannelType > 0) {
return I18n.t("chat.retention_reminders.public", {
count: this.siteSettings.chat_channel_retention_days,
});
} else {
return I18n.t("chat.retention_reminders.public_none");
}
}
}
get #countForChannelType() {
return this.args.channel.isDirectMessageChannel
? this.siteSettings.chat_dm_retention_days
: this.siteSettings.chat_channel_retention_days;
}
}