mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
59ed833abc
5 changed files with 38 additions and 17 deletions
|
@ -9,6 +9,12 @@ penpot - error report {{id}}
|
|||
<div>[<a href="/dbg/error">⮜</a>]</div>
|
||||
<div>[<a href="#context">context</a>]</div>
|
||||
<div>[<a href="#params">request params</a>]</div>
|
||||
{% if data %}
|
||||
<div>[<a href="#edata">error data</a>]</div>
|
||||
{% endif %}
|
||||
{% if spec-explain %}
|
||||
<div>[<a href="#spec-explain">spec explain</a>]</div>
|
||||
{% endif %}
|
||||
{% if spec-problems %}
|
||||
<div>[<a href="#spec-problems">spec problems</a>]</div>
|
||||
{% endif %}
|
||||
|
@ -16,9 +22,6 @@ penpot - error report {{id}}
|
|||
<div>[<a href="#spec-value">spec value</a>]</div>
|
||||
{% endif %}
|
||||
|
||||
{% if data %}
|
||||
<div>[<a href="#edata">error data</a>]</div>
|
||||
{% endif %}
|
||||
{% if trace %}
|
||||
<div>[<a href="#trace">error trace</a>]</div>
|
||||
{% endif %}
|
||||
|
@ -55,6 +58,15 @@ penpot - error report {{id}}
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if spec-explain %}
|
||||
<div class="table-row multiline">
|
||||
<div id="spec-explain" class="table-key">SPEC EXPLAIN: </div>
|
||||
<div class="table-val">
|
||||
<pre>{{spec-explain}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if spec-problems %}
|
||||
<div class="table-row multiline">
|
||||
<div id="spec-problems" class="table-key">SPEC PROBLEMS: </div>
|
||||
|
|
|
@ -150,14 +150,14 @@
|
|||
(binding [ppr/*print-right-margin* 300]
|
||||
(let [context (dissoc report
|
||||
:trace :cause :params :data :spec-problems
|
||||
:spec-value :error :explain :hint)
|
||||
:spec-explain :spec-value :error :explain :hint)
|
||||
params {:context (with-out-str (ppr/pprint context))
|
||||
:hint (:hint report)
|
||||
:spec-explain (:spec-explain report)
|
||||
:spec-problems (:spec-problems report)
|
||||
:spec-value (:spec-value report)
|
||||
:data (:data report)
|
||||
:trace (or (:cause report)
|
||||
(:trace report)
|
||||
:trace (or (:trace report)
|
||||
(some-> report :error :trace))
|
||||
:params (:params report)}]
|
||||
(-> (io/resource "templates/error-report.tmpl")
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
[app.common.uuid :as uuid]
|
||||
[clojure.pprint]
|
||||
[clojure.spec.alpha :as s]
|
||||
[expound.alpha :as expound]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
(defn- parse-client-ip
|
||||
|
@ -31,6 +32,8 @@
|
|||
:params (:params request)
|
||||
:spec-problems (some-> data ::s/problems)
|
||||
:spec-value (some-> data ::s/value)
|
||||
:spec-explain (with-out-str
|
||||
(expound/printer data))
|
||||
:data (some-> data (dissoc ::s/problems ::s/value :hint))
|
||||
:ip-addr (parse-client-ip request)
|
||||
:profile-id (:profile-id request)}
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
`(->> (ThreadContext/getImmutableContext)
|
||||
(send-off logging-agent
|
||||
(fn [_# cdata#]
|
||||
(with-context (into {:cause ~cause} cdata#)
|
||||
(with-context (into {} cdata#)
|
||||
(->> (or ~raw (build-map-message ~props))
|
||||
(write-log! ~logger-sym ~level-sym ~cause))))))
|
||||
|
||||
|
|
|
@ -276,8 +276,9 @@
|
|||
:luminosity})
|
||||
|
||||
(s/def ::shape-attrs
|
||||
(s/keys :req-un [::type ::name]
|
||||
:opt-un [::id
|
||||
(s/keys :opt-un [::id
|
||||
::type
|
||||
::name
|
||||
::component-id
|
||||
::component-file
|
||||
::component-root?
|
||||
|
@ -345,15 +346,16 @@
|
|||
(s/def :internal.shape.text/key string?)
|
||||
|
||||
(s/def :internal.shape.text/content
|
||||
(s/or :container
|
||||
(s/keys :req-un [:internal.shape.text/type
|
||||
:internal.shape.text/children]
|
||||
:opt-un [:internal.shape.text/key])
|
||||
:content
|
||||
(s/keys :req-un [:internal.shape.text/text])))
|
||||
(s/nilable
|
||||
(s/or :text-container
|
||||
(s/keys :req-un [:internal.shape.text/type
|
||||
:internal.shape.text/children]
|
||||
:opt-un [:internal.shape.text/key])
|
||||
:text-content
|
||||
(s/keys :req-un [:internal.shape.text/text]))))
|
||||
|
||||
(s/def :internal.shape.path/command keyword?)
|
||||
(s/def :internal.shape.path/params (s/map-of keyword? any?))
|
||||
(s/def :internal.shape.path/params (s/nilable (s/map-of keyword? any?)))
|
||||
(s/def :internal.shape.path/command-item
|
||||
(s/keys :req-un [:internal.shape.path/command
|
||||
:internal.shape.path/params]))
|
||||
|
@ -378,7 +380,11 @@
|
|||
(s/and ::shape-attrs
|
||||
(s/keys :opt-un [:internal.shape/hide-fill-on-export])))
|
||||
|
||||
(s/def ::shape (s/multi-spec shape-spec :type))
|
||||
(s/def ::shape
|
||||
(s/and (s/multi-spec shape-spec :type)
|
||||
#(contains? % :name)
|
||||
#(contains? % :type)))
|
||||
|
||||
(s/def :internal.page/objects (s/map-of uuid? ::shape))
|
||||
|
||||
(s/def ::page
|
||||
|
|
Loading…
Reference in a new issue