From 7bbf441b8d9345f07cad30d8373c9690ac1b3053 Mon Sep 17 00:00:00 2001 From: Siddharth Yadav Date: Mon, 3 Oct 2022 10:12:55 +0530 Subject: [PATCH] Revert "Rename notification property values" --- src/cljs/athens/views/notifications/core.cljs | 6 ++-- .../athens/views/notifications/popover.cljs | 36 +++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/cljs/athens/views/notifications/core.cljs b/src/cljs/athens/views/notifications/core.cljs index 6d1d6f19e0..abd26d28b1 100644 --- a/src/cljs/athens/views/notifications/core.cljs +++ b/src/cljs/athens/views/notifications/core.cljs @@ -43,10 +43,10 @@ #:block{:string "[[athens/notification]]" :uid (common.utils/gen-block-uid)} "athens/notification/type" - #:block{:string notification-type + #:block{:string (str "[[" notification-type "]]") :uid (common.utils/gen-block-uid)} "athens/notification/trigger" - #:block{:string notification-trigger-uid + #:block{:string (str "((" notification-trigger-uid "))") :uid (common.utils/gen-block-uid)} "athens/notification/for-user" #:block{:string notification-for-user @@ -61,7 +61,7 @@ #:block{:string "false" :uid (common.utils/gen-block-uid)} "athens/notification/trigger/parent" - #:block{:string notification-trigger-parent + #:block{:string (str "((" notification-trigger-parent "))") :uid (common.utils/gen-block-uid)}}}] {:block/uid inbox-block-uid :relation notification-position}) diff --git a/src/cljs/athens/views/notifications/popover.cljs b/src/cljs/athens/views/notifications/popover.cljs index cade6babfc..81a513169b 100644 --- a/src/cljs/athens/views/notifications/popover.cljs +++ b/src/cljs/athens/views/notifications/popover.cljs @@ -34,14 +34,10 @@ [prop] (let [type (:block/string (get prop "athens/notification/type"))] (cond - (or (= type "[[athens/notification/type/comment]]") - (= type "athens/notification/type/comment")) "Comments" - (or (= type "[[athens/notification/type/mention]]") - (= type "athens/notification/type/mention")) "Mentions" - (or (= type "[[athens/notification/type/task/assigned/to]]") - (= type "athens/notification/type/task/assigned/to")) "Assignments" - (or (= type "[[athens/notification/type/task/assigned/by]]") - (= type "athens/notification/type/task/assigned/by")) "Created"))) + (= type "[[athens/notification/type/comment]]") "Comments" + (= type "[[athens/notification/type/mention]]") "Mentions" + (= type "[[athens/notification/type/task/assigned/to]]") "Assignments" + (= type "[[athens/notification/type/task/assigned/by]]") "Created"))) (defn get-archive-state @@ -70,23 +66,17 @@ timeAgo) archive-state (get-archive-state properties) read-state (get-read-state properties) - trigger-parent-uid (or (-> (get properties "athens/notification/trigger/parent") - :block/string - (common-db/strip-markup "((" "))")) - (-> (get properties "athens/notification/trigger/parent") - :block/string)) + trigger-parent-uid (-> (get properties "athens/notification/trigger/parent") + :block/string + (common-db/strip-markup "((" "))")) trigger-parent-string (-> (common-db/get-block db [:block/uid trigger-parent-uid]) :block/string) - username (or (-> (get properties "athens/notification/trigger/author") - :block/string - (common-db/strip-markup "[[" "]]")) - (-> (get properties "athens/notification/trigger/author") - :block/string)) - trigger-uid (or (-> (get properties "athens/notification/trigger") - :block/string - (common-db/strip-markup "((" "))")) - (-> (get properties "athens/notification/trigger") - :block/string)) + username (-> (get properties "athens/notification/trigger/author") + :block/string + (common-db/strip-markup "[[" "]]")) + trigger-uid (-> (get properties "athens/notification/trigger") + :block/string + (common-db/strip-markup "((" "))")) body (-> (common-db/get-block db [:block/uid trigger-uid]) :block/string)] {"id" uid