Skip to content

Commit

Permalink
Building properly the notification level string (mattermost#4143)
Browse files Browse the repository at this point in the history
* Building properly the notification level string

* Updating snapshot
  • Loading branch information
jespino authored and mgdelacroix committed Nov 19, 2019
1 parent 18afb38 commit 02a8c58
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,17 @@ exports[`components/channel_notifications_modal/NotificationSection should match
`;

exports[`components/channel_notifications_modal/NotificationSection should match snapshot, on global DEFAULT 1`] = `
<Fragment>
<FormattedMessage
defaultMessage="Global default"
id="channel_notifications.globalDefault"
values={Object {}}
/>
<span>
(
</span>
<FormattedMessage
defaultMessage="default"
id="channel_notifications.levels.default"
values={Object {}}
/>
<span>
)
</span>
</Fragment>
<FormattedMessage
defaultMessage="Global default ({notifyLevel})"
id="channel_notifications.globalDefault"
values={
Object {
"notifyLevel": <FormattedMessage
defaultMessage="default"
id="channel_notifications.levels.default"
values={Object {}}
/>,
}
}
/>
`;
23 changes: 11 additions & 12 deletions components/channel_notifications_modal/components/describe.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ export default function Describe({section, isCollapsed, memberNotifyLevel, globa
t('channel_notifications.levels.mention');
t('channel_notifications.levels.none');
const levelsFormattedMessageId = 'channel_notifications.levels.' + globalNotifyLevel;
const notifyLevel = (
<FormattedMessage
id={levelsFormattedMessageId}
defaultMessage={globalNotifyLevel}
/>
);
return (
<React.Fragment>
<FormattedMessage
id='channel_notifications.globalDefault'
defaultMessage='Global default'
/>
<span>{' ('}</span>
<FormattedMessage
id={levelsFormattedMessageId}
defaultMessage={globalNotifyLevel}
/>
<span>{')'}</span>
</React.Fragment>
<FormattedMessage
id='channel_notifications.globalDefault'
defaultMessage='Global default ({notifyLevel})'
values={{notifyLevel}}
/>
);
} else if (memberNotifyLevel === NotificationLevels.MENTION && section === NotificationSections.MARK_UNREAD) {
if (isCollapsed) {
Expand Down
2 changes: 1 addition & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,7 @@
"channel_modal.purposeEx": "E.g.: \"A channel to file bugs and improvements\"",
"channel_modal.type": "Type",
"channel_notifications.allActivity": "For all activity",
"channel_notifications.globalDefault": "Global default",
"channel_notifications.globalDefault": "Global default ({notifyLevel})",
"channel_notifications.ignoreChannelMentions": "Ignore mentions for @channel, @here and @all",
"channel_notifications.ignoreChannelMentions.help": "When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel.",
"channel_notifications.ignoreChannelMentions.off.title": "Off",
Expand Down

0 comments on commit 02a8c58

Please sign in to comment.