Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
DEV-8308 Remove 'Announcements' functionality (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey-Volkov authored Aug 20, 2020
1 parent ff5611d commit 4c7618c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
38 changes: 21 additions & 17 deletions app/channel-settings/client/views/channelSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@
</div>
{{/with}}

{{#with settings.announcement}}
<div class="rc-user-info__row">
<div class="rc-input">
<label class="rc-input__label">
<div class="rc-input__title">{{_ label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="text" name="announcement" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
</div>
</label>
{{#if announcementEnabled}}
{{#with settings.announcement}}
<div class="rc-user-info__row">
<div class="rc-input">
<label class="rc-input__label">
<div class="rc-input__title">{{_ label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="text" name="announcement" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
</div>
</label>
</div>
</div>
</div>
{{/with}}
{{/with}}
{{/if}}
{{#unless isDirectMessage}}
{{#with settings.description}}
<div class="rc-user-info__row">
Expand Down Expand Up @@ -368,12 +370,14 @@ <h3 title="{{name}}" class="rc-user-info__name">{{> icon block="rc-header__icon"
</div>
</label>
{{/unless}}
<label class="rc-user-info__label">
{{_ "Announcement"}}
<div class="rc-user-info__description">
{{{RocketChatMarkdown announcement}}}
</div>
</label>
{{#if announcementEnabled}}
<label class="rc-user-info__label">
{{_ "Announcement"}}
<div class="rc-user-info__description">
{{{RocketChatMarkdown announcement}}}
</div>
</label>
{{/if}}
<label class="rc-user-info__label">
{{_ "Topic"}}
<div class="rc-user-info__description">
Expand Down
3 changes: 3 additions & 0 deletions app/channel-settings/client/views/channelSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,9 @@ Template.channelSettingsEditing.helpers({
const { room } = Template.instance();
return TAPi18n.__(label, { max: roomMaxAgeDefault(room.t) });
},
announcementEnabled() {
return settings.get('Allow_Announcements');
},
});

Template.channelSettings.helpers({
Expand Down
4 changes: 4 additions & 0 deletions app/lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ settings.addGroup('General', function() {
type: 'boolean',
public: true,
});
this.add('Allow_Announcements', true, {
type: 'boolean',
public: false,
});
this.add('First_Channel_After_Login', '', {
type: 'string',
public: true,
Expand Down
2 changes: 1 addition & 1 deletion app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ Template.room.helpers({
},

announcement() {
return Template.instance().state.get('announcement');
return settings.get('Allow_Announcements') && Template.instance().state.get('announcement');
},

messageboxData() {
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
"All_messages": "All messages",
"All_users": "All users",
"All_users_in_the_channel_can_write_new_messages": "All users in the channel can write new messages",
"Allow_Announcements": "Allow Announcements",
"Allow_collect_and_store_HTTP_header_informations": "Allow to collect and store HTTP header informations",
"Allow_collect_and_store_HTTP_header_informations_description": "This setting determines whether Livechat is allowed to store information collected from HTTP header data, such as IP address, User-Agent, and so on.",
"Allow_Invalid_SelfSigned_Certs": "Allow Invalid Self-Signed Certs",
Expand Down

0 comments on commit 4c7618c

Please sign in to comment.