Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Missing option to disable/enable System Messages #10704

Merged
merged 3 commits into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
show 'enable/disable' system messages on edit room
  • Loading branch information
ggazzo committed May 8, 2018
commit bf71985e9260dfe7bb01bcbf6abf0c0b39a03e76
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,25 @@
</div>
{{/if}}
{{/with}}

{{#with settings.sysMes}}
{{#if canView}}
<div class="rc-user-info__row">
<div class="rc-switch rc-switch--blue">
<label class="rc-switch__label">
<span class="rc-switch__text">
{{_ label}}{{equal default value '*'}}
</span>
<input type="checkbox" class="rc-switch__input js-input-check" name="archived" checked="{{checked}}" disabled="{{./disabled}}">
<span class="rc-switch__button">
<span class="rc-switch__button-inside"></span>
</span>
</label>
</div>
</div>
{{/if}}
{{/with}}

{{#with settings.broadcast}}
{{#if canView}}
<div class="rc-user-info__row">
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-lib/lib/RoomTypeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export const RoomSettingsEnum = {
REACT_WHEN_READ_ONLY: 'reactWhenReadOnly',
ARCHIVE_OR_UNARCHIVE: 'archiveOrUnarchive',
JOIN_CODE: 'joinCode',
BROADCAST: 'broadcast'
BROADCAST: 'broadcast',
SYSTEM_MESSAGES: 'systemMessages'
};

export const UiTextContext = {
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-lib/lib/roomTypes/direct.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class DirectMessageRoomType extends RoomTypeConfig {
allowRoomSettingChange(room, setting) {
switch (setting) {
case RoomSettingsEnum.NAME:
case RoomSettingsEnum.SYSTEM_MESSAGES:
case RoomSettingsEnum.DESCRIPTION:
case RoomSettingsEnum.READ_ONLY:
case RoomSettingsEnum.REACT_WHEN_READ_ONLY:
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-lib/lib/roomTypes/private.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class PrivateRoomType extends RoomTypeConfig {
return !room.broadcast;
case RoomSettingsEnum.REACT_WHEN_READ_ONLY:
return !room.broadcast && room.ro;
case RoomSettingsEnum.SYSTEM_MESSAGES:
default:
return true;
}
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-lib/lib/roomTypes/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class PublicRoomType extends RoomTypeConfig {
return !room.broadcast;
case RoomSettingsEnum.REACT_WHEN_READ_ONLY:
return !room.broadcast && room.ro;
case RoomSettingsEnum.SYSTEM_MESSAGES:
default:
return true;
}
Expand Down
1 change: 1 addition & 0 deletions server/publications/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const fields = {
label: 1,
ro: 1,
reactWhenReadOnly: 1,
sysMes: 1,
sentiment: 1,
tokenpass: 1,
streamingOptions: 1,
Expand Down