Skip to content

Commit

Permalink
Merge pull request #432 from Wikia/cake-6121
Browse files Browse the repository at this point in the history
cake-6121 | Add talk page notification
  • Loading branch information
Chris Schuhmacher authored Nov 13, 2020
2 parents f1a61b0 + 9d647fc commit f58b497
Show file tree
Hide file tree
Showing 23 changed files with 64 additions and 44 deletions.
19 changes: 16 additions & 3 deletions app/components/on-site-notifications/notification-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default Component.extend(
case notificationTypes.articleCommentAtMention:
case notificationTypes.articleCommentReplyAtMention:
return 'wds-icons-mention-small';
case notificationTypes.talkPageMessage:
return 'wds-icons-bubble-small';
default:
return 'wds-icons-heart-small';
}
Expand Down Expand Up @@ -94,6 +96,8 @@ export default Component.extend(
return this.getMessageWallReplyBody(this.model);
case notificationTypes.messageWallPostRemoved:
return this.getMessageWallPostRemovedBody(this.model);
case notificationTypes.talkPageMessage:
return this.getTalkPageMessageBody(this.model);
default:
return null;
}
Expand Down Expand Up @@ -354,7 +358,7 @@ export default Component.extend(
return this.getTranslatedMessage('notifications-wall-reply-multiple-users-own-message', args);
}

args.secondUser = model.get('contentCreatorName') || this.getTranslatedMessage('username-anonymous');
args.secondUser = model.get('contentCreatorName') || this.getTranslatedMessage('notifications-anon-user');
return this.getTranslatedMessage('notifications-wall-reply-multiple-users', args);
}

Expand All @@ -369,7 +373,7 @@ export default Component.extend(
}

args.firstUser = this.getPossiblyAnonActorName(model);
args.secondUser = model.get('contentCreatorName') || this.getTranslatedMessage('username-anonymous');
args.secondUser = model.get('contentCreatorName') || this.getTranslatedMessage('notifications-anon-user');

return this.getTranslatedMessage('notifications-wall-reply', args);
},
Expand All @@ -380,6 +384,15 @@ export default Component.extend(
});
},

getTalkPageMessageBody(model) {
const userName = this.getPossiblyAnonActorName(model);
const args = {
user: userName,
};

return this.getTranslatedMessage('notifications-talk-page-message', args);
},

getMessageWallOwner(url) {
const regex = /\/Message_Wall:(.+?)([?#/].*)?$/i;
const result = regex.exec(url);
Expand All @@ -392,7 +405,7 @@ export default Component.extend(
},

getPossiblyAnonActorName(model) {
return model.get('latestActors.0.name') ? model.get('latestActors.0.name') : this.getTranslatedMessage('username-anonymous');
return model.get('latestActors.0.name') ? model.get('latestActors.0.name') : this.getTranslatedMessage('notifications-anon-user');
},

getTranslatedMessage(key, context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export default EmberObject.extend({
return notificationTypes.messageWallReply;
case 'wall-post-removed-notification':
return notificationTypes.messageWallPostRemoved;
case 'talk-page-notification':
return notificationTypes.talkPageMessage;
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default EmberObject.extend({
'article-comment-reply-at-mention',
'message-wall-post',
'message-wall-thread',
'talk-page-message',
];

return `contentType=${supportedContentTypes.join('&contentType=')}`;
Expand Down
1 change: 1 addition & 0 deletions app/utils/notification-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export default {
messageWallPost: 'message-wall-post',
messageWallReply: 'message-wall-reply',
messageWallPostRemoved: 'message-wall-post-removed',
talkPageMessage: 'talk-page-message',
};
24 changes: 15 additions & 9 deletions docs/assets/dummy.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/i18n/de/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours} Std.",
"license-description": "Nutzung von Community-Inhalten gemäß {license}, sofern nicht anders angegeben.",
"minutes-ago": "{minutes} Min.",
"notifications-anon-user": "Ein Fandom-Benutzer",
"notifications-article-comment-comment-mention": "{user} hat dich in einem Kommentar zu Artikel {articleTitle} <b>erwähnt</b>",
"notifications-article-comment-followed-article-comment": "{user} hat zu Artikel {articleTitle} <b>einen Kommentar hinterlassen</b>",
"notifications-article-comment-reply-followed-comment": "{user} hat auf einen Kommentar, den du verfolgst, zum Artikel {articleTitle} <b>geantwortet</b>",
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/i18n/en/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
"global-navigation-fandom-overview-link-vertical-movies": "Movies",
"global-navigation-fandom-overview-link-vertical-tv": "TV",
"global-navigation-fandom-overview-link-video": "Video",
"global-navigation-gamepedia-overview-link-wikis": "Wikis",
"global-navigation-gamepedia-overview-link-support": "Support",
"global-navigation-gamepedia-overview-link-pro": "Pro",
"global-navigation-notifications-title": "Notifications",
"global-navigation-messages-title": "Messages",
"global-navigation-search-cancel": "Cancel",
Expand Down Expand Up @@ -164,6 +167,5 @@
"license-description": "Community content is available under {license} unless otherwise noted.",
"wds-wikiaorg-homepage-aria-label": "Wikia.org homepage",
"wds-fandom-homepage-aria-label": "Fandom homepage",
"wds-gamepedia-homepage-aria-label": "Gamepedia homepage",
"username-anonymous": "A Fandom User"
"wds-gamepedia-homepage-aria-label": "Gamepedia homepage"
}
3 changes: 2 additions & 1 deletion docs/assets/i18n/es/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "El contenido de la comunidad está disponible bajo {license} a menos que se indique lo contrario.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Un usuario de Fandom",
"notifications-article-comment-comment-mention": "{user} <b>te mencionó</b> en un comentario en el artículo: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>comentó</b> en el artículo: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>respondió</b> a un comentario que estás siguiendo en este artículo: {articleTitle}",
Expand Down Expand Up @@ -162,6 +163,6 @@
"wds-avatar-badges-staff-tooltip": "Staff",
"wds-avatar-badges-vstf-tooltip": "VSTF",
"wds-fandom-homepage-aria-label": "Página de inicio de Fandom",
"wds-gamepedia-homepage-aria-label": "Página de inicio de Gamepedia",
"wds-gamepedia-homepage-aria-label": "Página de inicio de Gamepedia",
"wds-wikiaorg-homepage-aria-label": "Página de inicio de Wikia.org"
}
3 changes: 2 additions & 1 deletion docs/assets/i18n/fi/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}t",
"license-description": "Community content is available under {license} unless otherwise noted.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Fandom-avustaja",
"notifications-article-comment-comment-mention": "{user} <b>mentioned</b> you in a comment on the article: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>commented</b> on the article: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>replied</b> to a comment you are following on the article: {articleTitle}",
Expand Down Expand Up @@ -164,4 +165,4 @@
"wds-fandom-homepage-aria-label": "Fandom homepage",
"wds-gamepedia-homepage-aria-label": "Gamepedia homepage",
"wds-wikiaorg-homepage-aria-label": "Wikia.org homepage"
}
}
3 changes: 2 additions & 1 deletion docs/assets/i18n/fr/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "Sauf mention contraire, le contenu de la communauté est disponible sous licence {license} .",
"minutes-ago": "{minutes}min",
"notifications-anon-user": "Un utilisateur de Fandom",
"notifications-article-comment-comment-mention": "{user} vous <b>a mentionné</b> dans un commentaire sur l'article : {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>a ajouté un commentaire</b> sur l'article : {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>a répondu</b> à un commentaire que vous suivez sur l'article : {articleTitle}",
Expand Down Expand Up @@ -162,6 +163,6 @@
"wds-avatar-badges-staff-tooltip": "Staff de FANDOM",
"wds-avatar-badges-vstf-tooltip": "VSTF",
"wds-fandom-homepage-aria-label": "Page d'accueil Fandom",
"wds-gamepedia-homepage-aria-label": "Page d'accueil Gamepedia",
"wds-gamepedia-homepage-aria-label": "Page d'accueil Gamepedia",
"wds-wikiaorg-homepage-aria-label": "Page d'accueil Wikia.org"
}
1 change: 1 addition & 0 deletions docs/assets/i18n/id/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "Community content is available under {license} unless otherwise noted.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Pengguna Fandom",
"notifications-article-comment-comment-mention": "{user} <b>mentioned</b> you in a comment on the article: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>commented</b> on the article: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>replied</b> to a comment you are following on the article: {articleTitle}",
Expand Down
1 change: 1 addition & 0 deletions docs/assets/i18n/it/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "I contenuti della comunità sono disponibili sotto la licenza {license} a meno che non sia diversamente specificato.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Un utente di Fandom",
"notifications-article-comment-comment-mention": "{user} ti ha <b>menzionato</b> in un commento sull'articolo: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} ha <b>commentato</b> l'articolo: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} ha <b>risposto</b> ad un commento che stai seguendo sull'articolo: {articleTitle}",
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/i18n/ja/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}時間前",
"license-description": "特に記載のない限り、コミュニティのコンテンツは{license} ライセンスの下で利用可能です。",
"minutes-ago": "{minutes}分前",
"notifications-anon-user": "Fandomユーザー",
"notifications-article-comment-comment-mention": "{user}さんが記事「{articleTitle}」のコメントにあなたの<b>名前を書き込み</b>ました",
"notifications-article-comment-followed-article-comment": "{user}さんが記事「{articleTitle}」に<b>コメントを投稿</b>しました",
"notifications-article-comment-reply-followed-comment": "{user}さんが記事「{articleTitle}」であなたがフォローしているコメントに<b>返信</b>しました",
Expand Down Expand Up @@ -162,6 +163,6 @@
"wds-avatar-badges-staff-tooltip": "Fandomスタッフ",
"wds-avatar-badges-vstf-tooltip": "VSTF",
"wds-fandom-homepage-aria-label": "Fandomホームページ",
"wds-gamepedia-homepage-aria-label": "Gamepediaホームページ",
"wds-gamepedia-homepage-aria-label": "Gamepediaホームページ",
"wds-wikiaorg-homepage-aria-label": "Wikia.orgホームページ"
}
1 change: 1 addition & 0 deletions docs/assets/i18n/ko/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "Community content is available under {license} unless otherwise noted.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "A Fandom user",
"notifications-article-comment-comment-mention": "{user} <b>mentioned</b> you in a comment on the article: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>commented</b> on the article: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>replied</b> to a comment you are following on the article: {articleTitle}",
Expand Down
1 change: 1 addition & 0 deletions docs/assets/i18n/nl/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}u",
"license-description": "Community content is available under {license} unless otherwise noted.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Een Fandom-gebruiker",
"notifications-article-comment-comment-mention": "{user} <b>mentioned</b> you in a comment on the article: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>commented</b> on the article: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>replied</b> to a comment you are following on the article: {articleTitle}",
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/i18n/pl/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours} godz.",
"license-description": "Treści społeczności są dostępne na podstawie licencji {license}, o ile nie zaznaczono inaczej.",
"minutes-ago": "{minutes} min.",
"notifications-anon-user": "Użytkownik Fandomu",
"notifications-article-comment-comment-mention": "{user} <b>wspomniał(a)</b> Ciebie w komentarzu, w artykule: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>skomentował(a)</b> artykuł: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>odpowiedział(a)</b> na obserwowany komentarz w artykule: {articleTitle}",
Expand Down Expand Up @@ -162,6 +163,6 @@
"wds-avatar-badges-staff-tooltip": "FANDOM Staff",
"wds-avatar-badges-vstf-tooltip": "VSTF",
"wds-fandom-homepage-aria-label": "Strona główna Fandomu",
"wds-gamepedia-homepage-aria-label": "Strona główna Gamepedii",
"wds-gamepedia-homepage-aria-label": "Strona główna Gamepedii",
"wds-wikiaorg-homepage-aria-label": "Strona główna Wikia.org"
}
1 change: 1 addition & 0 deletions docs/assets/i18n/pt/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "O conteúdo da comunidade está disponível sob {license} salvo indicação em contrário.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Um usuário do Fandom",
"notifications-article-comment-comment-mention": "{user} <b>mencionou você </b>em um comentário no artigo: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>comentou</b> no artigo: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>respondeu</b>a um comentário que você está seguindo no artigo: {articleTitle}",
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/i18n/ru/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours} ч.",
"license-description": "Материалы сообщества доступны в соответствии с условиями лицензии {license}, если не указано иное.",
"minutes-ago": "{minutes} мин.",
"notifications-anon-user": "Участник ФЭНДОМА",
"notifications-article-comment-comment-mention": "{user} <b>упомянул(а)</b> вас в комментарии к статье: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user }<b>оставил(а) комментарий</b> к статье: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>ответил(а)</b> на комментарий, который вы отслеживаете, к статье: {articleTitle}",
Expand Down Expand Up @@ -162,6 +163,6 @@
"wds-avatar-badges-staff-tooltip": "Сотрудник ФЭНДОМА",
"wds-avatar-badges-vstf-tooltip": "VSTF",
"wds-fandom-homepage-aria-label": "Домашняя страница Фэндома",
"wds-gamepedia-homepage-aria-label": "Домашняя страница Gamepedia",
"wds-gamepedia-homepage-aria-label": "Домашняя страница Gamepedia",
"wds-wikiaorg-homepage-aria-label": "Домашняя страница Wikia.org"
}
1 change: 1 addition & 0 deletions docs/assets/i18n/vi/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}h",
"license-description": "Community content is available under {license} unless otherwise noted.",
"minutes-ago": "{minutes}m",
"notifications-anon-user": "Một người dùng Fandom",
"notifications-article-comment-comment-mention": "{user} <b>mentioned</b> you in a comment on the article: {articleTitle}",
"notifications-article-comment-followed-article-comment": "{user} <b>commented</b> on the article: {articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user} <b>replied</b> to a comment you are following on the article: {articleTitle}",
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/i18n/zh-hant/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"hours-ago": "{hours}小時前",
"license-description": "除非另有註明,否則社區內容均使用{license}授權條款。",
"minutes-ago": "{minutes}分鐘前",
"notifications-anon-user": "Fandom使用者",
"notifications-article-comment-comment-mention": "{user}在這個頁面的評論中<b>提到了</b>您:{articleTitle}",
"notifications-article-comment-followed-article-comment": "{user}在這個頁面留下了一則<b>評論</b>:{articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user}在這個頁面中<b>回覆了</b>您關注的評論:{articleTitle}",
Expand Down Expand Up @@ -162,6 +163,6 @@
"wds-avatar-badges-staff-tooltip": "Fandom職員",
"wds-avatar-badges-vstf-tooltip": "反破壞小組",
"wds-fandom-homepage-aria-label": "Fandom首頁",
"wds-gamepedia-homepage-aria-label": "Gamepedia首頁",
"wds-gamepedia-homepage-aria-label": "Gamepedia首頁",
"wds-wikiaorg-homepage-aria-label": "Wikia.org首頁"
}
5 changes: 3 additions & 2 deletions docs/assets/i18n/zh/design-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"hours-ago": "{hours}小时",
"license-description": "社区内容除另有注明外,均在{license}许可协议下提供。",
"minutes-ago": "{minutes}分钟",
"notifications-anon-user": "Fandom用户",
"notifications-article-comment-comment-mention": "{user}在这个页面的评论中<b>提到了</b>您:{articleTitle}",
"notifications-article-comment-followed-article-comment": "{user}在这个页面留下了一则<b>评论</b>:{articleTitle}",
"notifications-article-comment-reply-followed-comment": "{user}在这个页面中<b>回复了</b>您关注的评论:{articleTitle}",
Expand Down Expand Up @@ -158,6 +159,6 @@
"wds-avatar-badges-staff-tooltip": "FANDOM职员",
"wds-avatar-badges-vstf-tooltip": "反破坏小组",
"wds-fandom-homepage-aria-label": "Fandom首页",
"wds-gamepedia-homepage-aria-label": "Gamepedia首页",
"wds-gamepedia-homepage-aria-label": "Gamepedia首页",
"wds-wikiaorg-homepage-aria-label": "Wikia.org首页"
}
}
Loading

0 comments on commit f58b497

Please sign in to comment.