0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 21:09:00 -05:00

Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2022-01-26 14:24:34 +01:00
commit 59ed833abc
5 changed files with 38 additions and 17 deletions

View file

@ -9,6 +9,12 @@ penpot - error report {{id}}
<div>[<a href="/dbg/error">⮜</a>]</div> <div>[<a href="/dbg/error">⮜</a>]</div>
<div>[<a href="#context">context</a>]</div> <div>[<a href="#context">context</a>]</div>
<div>[<a href="#params">request params</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 %} {% if spec-problems %}
<div>[<a href="#spec-problems">spec problems</a>]</div> <div>[<a href="#spec-problems">spec problems</a>]</div>
{% endif %} {% endif %}
@ -16,9 +22,6 @@ penpot - error report {{id}}
<div>[<a href="#spec-value">spec value</a>]</div> <div>[<a href="#spec-value">spec value</a>]</div>
{% endif %} {% endif %}
{% if data %}
<div>[<a href="#edata">error data</a>]</div>
{% endif %}
{% if trace %} {% if trace %}
<div>[<a href="#trace">error trace</a>]</div> <div>[<a href="#trace">error trace</a>]</div>
{% endif %} {% endif %}
@ -55,6 +58,15 @@ penpot - error report {{id}}
</div> </div>
{% endif %} {% 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 %} {% if spec-problems %}
<div class="table-row multiline"> <div class="table-row multiline">
<div id="spec-problems" class="table-key">SPEC PROBLEMS: </div> <div id="spec-problems" class="table-key">SPEC PROBLEMS: </div>

View file

@ -150,14 +150,14 @@
(binding [ppr/*print-right-margin* 300] (binding [ppr/*print-right-margin* 300]
(let [context (dissoc report (let [context (dissoc report
:trace :cause :params :data :spec-problems :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)) params {:context (with-out-str (ppr/pprint context))
:hint (:hint report) :hint (:hint report)
:spec-explain (:spec-explain report)
:spec-problems (:spec-problems report) :spec-problems (:spec-problems report)
:spec-value (:spec-value report) :spec-value (:spec-value report)
:data (:data report) :data (:data report)
:trace (or (:cause report) :trace (or (:trace report)
(:trace report)
(some-> report :error :trace)) (some-> report :error :trace))
:params (:params report)}] :params (:params report)}]
(-> (io/resource "templates/error-report.tmpl") (-> (io/resource "templates/error-report.tmpl")

View file

@ -12,6 +12,7 @@
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[clojure.pprint] [clojure.pprint]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[expound.alpha :as expound]
[cuerdas.core :as str])) [cuerdas.core :as str]))
(defn- parse-client-ip (defn- parse-client-ip
@ -31,6 +32,8 @@
:params (:params request) :params (:params request)
:spec-problems (some-> data ::s/problems) :spec-problems (some-> data ::s/problems)
:spec-value (some-> data ::s/value) :spec-value (some-> data ::s/value)
:spec-explain (with-out-str
(expound/printer data))
:data (some-> data (dissoc ::s/problems ::s/value :hint)) :data (some-> data (dissoc ::s/problems ::s/value :hint))
:ip-addr (parse-client-ip request) :ip-addr (parse-client-ip request)
:profile-id (:profile-id request)} :profile-id (:profile-id request)}

View file

@ -180,7 +180,7 @@
`(->> (ThreadContext/getImmutableContext) `(->> (ThreadContext/getImmutableContext)
(send-off logging-agent (send-off logging-agent
(fn [_# cdata#] (fn [_# cdata#]
(with-context (into {:cause ~cause} cdata#) (with-context (into {} cdata#)
(->> (or ~raw (build-map-message ~props)) (->> (or ~raw (build-map-message ~props))
(write-log! ~logger-sym ~level-sym ~cause)))))) (write-log! ~logger-sym ~level-sym ~cause))))))

View file

@ -276,8 +276,9 @@
:luminosity}) :luminosity})
(s/def ::shape-attrs (s/def ::shape-attrs
(s/keys :req-un [::type ::name] (s/keys :opt-un [::id
:opt-un [::id ::type
::name
::component-id ::component-id
::component-file ::component-file
::component-root? ::component-root?
@ -345,15 +346,16 @@
(s/def :internal.shape.text/key string?) (s/def :internal.shape.text/key string?)
(s/def :internal.shape.text/content (s/def :internal.shape.text/content
(s/or :container (s/nilable
(s/or :text-container
(s/keys :req-un [:internal.shape.text/type (s/keys :req-un [:internal.shape.text/type
:internal.shape.text/children] :internal.shape.text/children]
:opt-un [:internal.shape.text/key]) :opt-un [:internal.shape.text/key])
:content :text-content
(s/keys :req-un [:internal.shape.text/text]))) (s/keys :req-un [:internal.shape.text/text]))))
(s/def :internal.shape.path/command keyword?) (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/def :internal.shape.path/command-item
(s/keys :req-un [:internal.shape.path/command (s/keys :req-un [:internal.shape.path/command
:internal.shape.path/params])) :internal.shape.path/params]))
@ -378,7 +380,11 @@
(s/and ::shape-attrs (s/and ::shape-attrs
(s/keys :opt-un [:internal.shape/hide-fill-on-export]))) (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 :internal.page/objects (s/map-of uuid? ::shape))
(s/def ::page (s/def ::page