0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 15:09:10 -05:00

Merge pull request #4501 from penpot/superalex-add-exception-audit-log-event

 Add exception page audit log event
This commit is contained in:
Aitor Moreno 2024-04-24 14:07:53 +02:00 committed by GitHub
commit 857429290d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 10 deletions

View file

@ -170,7 +170,7 @@
[:& (mf/provider ctx/current-route) {:value route} [:& (mf/provider ctx/current-route) {:value route}
[:& (mf/provider ctx/current-profile) {:value profile} [:& (mf/provider ctx/current-profile) {:value profile}
(if edata (if edata
[:& static/exception-page {:data edata}] [:& static/exception-page {:data edata :route route}]
[:* [:*
[:& msgs/notifications-hub] [:& msgs/notifications-hub]
(when route (when route

View file

@ -9,6 +9,8 @@
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.pprint :as pp] [app.common.pprint :as pp]
[app.common.uri :as u]
[app.main.data.events :as ev]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.util.dom :as dom] [app.util.dom :as dom]
@ -16,6 +18,7 @@
[app.util.i18n :refer [tr]] [app.util.i18n :refer [tr]]
[app.util.router :as rt] [app.util.router :as rt]
[app.util.webapi :as wapi] [app.util.webapi :as wapi]
[potok.v2.core :as ptk]
[rumext.v2 :as mf])) [rumext.v2 :as mf]))
(mf/defc error-container (mf/defc error-container
@ -146,15 +149,19 @@
(mf/defc exception-page (mf/defc exception-page
{::mf/props :obj} {::mf/props :obj}
[{:keys [data] :as props}] [{:keys [data route] :as props}]
(case (:type data) (let [type (:type data)
:not-found path (:path route)
[:& not-found] query-params (u/map->query-string (:query-params route))]
(st/emit! (ptk/event ::ev/event {::ev/name "exception-page" :type type :path path :query-params query-params}))
(case (:type data)
:not-found
[:& not-found]
:bad-gateway :bad-gateway
[:& bad-gateway] [:& bad-gateway]
:service-unavailable :service-unavailable
[:& service-unavailable] [:& service-unavailable]
[:> internal-error props])) [:> internal-error props])))