Pass data to text method to prevent duplication

Pass data to text method to prevent duplication

diff --git a/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6
index 5d27b59..75bac91 100644
--- a/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/custom-notification-item.js.es6
@@ -8,10 +8,7 @@ createWidgetFrom(DefaultNotificationItem, "custom-notification-item", {
     return data.title ? I18n.t(data.title) : "";
   },
 
-  text(notificationName) {
-    const { attrs } = this;
-    const data = attrs.data;
-
+  text(notificationName, data) {
     const username = formatUsername(data.display_username);
     const description = this.description();
 
diff --git a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
index 84a60b2..aa179be 100644
--- a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
@@ -79,10 +79,7 @@ export const DefaultNotificationItem =
       return Ember.isEmpty(description) ? "" : escapeExpression(description);
     },
 
-    text(notificationName) {
-      const { attrs } = this;
-      const data = attrs.data;
-
+    text(notificationName, data) {
       const username = formatUsername(data.display_username);
       const description = this.description();
 
@@ -107,7 +104,7 @@ export const DefaultNotificationItem =
       const notificationName = lookup[notificationType];
 
       let { data } = attrs;
-      let text = emojiUnescape(this.text(notificationName));
+      let text = emojiUnescape(this.text(notificationName, data));
       let icon = this.icon(notificationName, data);
 
       const title = this.title(notificationName, data);
diff --git a/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6
index 05037d8..7e18b54 100644
--- a/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6
@@ -2,9 +2,7 @@ import { createWidgetFrom } from "discourse/widgets/widget";
 import { DefaultNotificationItem } from "discourse/widgets/default-notification-item";
 
 createWidgetFrom(DefaultNotificationItem, "group-message-summary-notification-item", {
-  text(notificationName) {
-    const { attrs } = this;
-    const data = attrs.data;
+  text(notificationName, data) {
     const count = data.inbox_count;
     const group_name = data.group_name;
 
diff --git a/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6
index 3bde615..aba3e0f 100644
--- a/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/liked-notification-item.js.es6
@@ -3,10 +3,7 @@ import { DefaultNotificationItem } from "discourse/widgets/default-notification-
 import { formatUsername } from "discourse/lib/utilities";
 
 createWidgetFrom(DefaultNotificationItem, "liked-notification-item", {
-  text(notificationName) {
-    const { attrs } = this;
-    const data = attrs.data;
-
+  text(notificationName, data) {
     const username = formatUsername(data.display_username);
     const description = this.description();

GitHub sha: 8c349101