mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 07:29:08 -05:00
Show properly conflict errors on colors page.
This commit is contained in:
parent
5fade8bb93
commit
c8683ea0ba
3 changed files with 11 additions and 2 deletions
|
@ -70,8 +70,11 @@
|
||||||
"errors.form.max-len" "Should be less than %s"
|
"errors.form.max-len" "Should be less than %s"
|
||||||
"errors.form.color" "Should be a valid color string"
|
"errors.form.color" "Should be a valid color string"
|
||||||
"errors.form.password-not-match" "Password does not match"
|
"errors.form.password-not-match" "Password does not match"
|
||||||
"errors.generic" "Something work has happened."
|
|
||||||
"errors.auth.unauthorized" "Username or passwords seems to be wrong."
|
"errors.auth.unauthorized" "Username or passwords seems to be wrong."
|
||||||
"errors.auth.invalid-recovery-token" "The recovery token is invalid."
|
"errors.auth.invalid-recovery-token" "The recovery token is invalid."
|
||||||
"errors.profile.update-password" "Error updating password, probably your old password is wrong."
|
"errors.profile.update-password" "Error updating password, probably your old password is wrong."
|
||||||
|
|
||||||
|
"errors.generic" "Something work has happened."
|
||||||
|
"errors.conflict" "Conflict on saving data, please refresh and try again."
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
(defn- on-error
|
(defn- on-error
|
||||||
"A default error handler."
|
"A default error handler."
|
||||||
[error]
|
[{:keys [status] :as error}]
|
||||||
(cond
|
(cond
|
||||||
;; Unauthorized or Auth timeout
|
;; Unauthorized or Auth timeout
|
||||||
(and (:status error)
|
(and (:status error)
|
||||||
|
@ -59,6 +59,10 @@
|
||||||
(= (:status error) 419)))
|
(= (:status error) 419)))
|
||||||
(rs/emit! (dauth/logout))
|
(rs/emit! (dauth/logout))
|
||||||
|
|
||||||
|
;; Conflict
|
||||||
|
(= status 412)
|
||||||
|
(dmsg/error! (tr "errors.conflict"))
|
||||||
|
|
||||||
;; Network error
|
;; Network error
|
||||||
(= (:status error) 0)
|
(= (:status error) 0)
|
||||||
(do
|
(do
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
[uxbox.main.data.dashboard :as dd]
|
[uxbox.main.data.dashboard :as dd]
|
||||||
[uxbox.main.data.lightbox :as udl]
|
[uxbox.main.data.lightbox :as udl]
|
||||||
[uxbox.main.state :as st]
|
[uxbox.main.state :as st]
|
||||||
|
[uxbox.main.ui.messages :as uum]
|
||||||
[uxbox.main.ui.colorpicker :refer (colorpicker)]
|
[uxbox.main.ui.colorpicker :refer (colorpicker)]
|
||||||
[uxbox.main.ui.dashboard.header :refer (header)]
|
[uxbox.main.ui.dashboard.header :refer (header)]
|
||||||
[uxbox.main.ui.forms :as form]
|
[uxbox.main.ui.forms :as form]
|
||||||
|
@ -330,6 +331,7 @@
|
||||||
colls (mx/react collections-ref)
|
colls (mx/react collections-ref)
|
||||||
coll (get colls (:id state))]
|
coll (get colls (:id state))]
|
||||||
[:main.dashboard-main
|
[:main.dashboard-main
|
||||||
|
(uum/messages)
|
||||||
(header)
|
(header)
|
||||||
[:section.dashboard-content
|
[:section.dashboard-content
|
||||||
(nav state colls)
|
(nav state colls)
|
||||||
|
|
Loading…
Add table
Reference in a new issue