mirror of
https://github.com/penpot/penpot.git
synced 2025-03-15 17:21:17 -05:00
Merge pull request #5504 from penpot/palba-add-feature-flags-to-events
✨ Add feature flags info to posthog events
This commit is contained in:
commit
d62eb3d3f4
2 changed files with 13 additions and 0 deletions
|
@ -143,6 +143,11 @@
|
||||||
(let [f (obj/get global "externalSessionId")]
|
(let [f (obj/get global "externalSessionId")]
|
||||||
(when (fn? f) (f))))
|
(when (fn? f) (f))))
|
||||||
|
|
||||||
|
(defn external-context-info
|
||||||
|
[]
|
||||||
|
(let [f (obj/get global "externalContextInfo")]
|
||||||
|
(when (fn? f) (f))))
|
||||||
|
|
||||||
;; --- Helper Functions
|
;; --- Helper Functions
|
||||||
|
|
||||||
(defn ^boolean check-browser? [candidate]
|
(defn ^boolean check-browser? [candidate]
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
["ua-parser-js" :as ua]
|
["ua-parser-js" :as ua]
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
|
[app.common.json :as json]
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
|
@ -93,6 +94,11 @@
|
||||||
data
|
data
|
||||||
data))
|
data))
|
||||||
|
|
||||||
|
(defn add-external-context-info
|
||||||
|
[context]
|
||||||
|
(let [external-context-info (json/->clj (cf/external-context-info))]
|
||||||
|
(merge context external-context-info)))
|
||||||
|
|
||||||
(defn- process-event-by-proto
|
(defn- process-event-by-proto
|
||||||
[event]
|
[event]
|
||||||
(let [data (d/deep-merge (-data event) (meta event))
|
(let [data (d/deep-merge (-data event) (meta event))
|
||||||
|
@ -102,6 +108,7 @@
|
||||||
(assoc :event-origin (::origin data))
|
(assoc :event-origin (::origin data))
|
||||||
(assoc :event-namespace (namespace type))
|
(assoc :event-namespace (namespace type))
|
||||||
(assoc :event-symbol ev-name)
|
(assoc :event-symbol ev-name)
|
||||||
|
(add-external-context-info)
|
||||||
(d/without-nils))
|
(d/without-nils))
|
||||||
props (-> data d/without-qualified simplify-props)]
|
props (-> data d/without-qualified simplify-props)]
|
||||||
|
|
||||||
|
@ -119,6 +126,7 @@
|
||||||
(let [type (::type data "action")
|
(let [type (::type data "action")
|
||||||
context (-> (::context data)
|
context (-> (::context data)
|
||||||
(assoc :event-origin (::origin data))
|
(assoc :event-origin (::origin data))
|
||||||
|
(add-external-context-info)
|
||||||
(d/without-nils))
|
(d/without-nils))
|
||||||
props (-> data d/without-qualified simplify-props)]
|
props (-> data d/without-qualified simplify-props)]
|
||||||
{:type type
|
{:type type
|
||||||
|
|
Loading…
Add table
Reference in a new issue