From e11d2033d2a65a9ab89313ba689858e23801b183 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 16 Apr 2020 10:19:36 +0200 Subject: [PATCH] :tada: Add integrated 403 page. --- frontend/src/uxbox/main/ui.cljs | 8 ++++++-- .../uxbox/main/ui/{not_found.cljs => static.cljs} | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) rename frontend/src/uxbox/main/ui/{not_found.cljs => static.cljs} (66%) diff --git a/frontend/src/uxbox/main/ui.cljs b/frontend/src/uxbox/main/ui.cljs index fc0790045..76aac1b0c 100644 --- a/frontend/src/uxbox/main/ui.cljs +++ b/frontend/src/uxbox/main/ui.cljs @@ -22,7 +22,7 @@ [uxbox.main.store :as st] [uxbox.main.ui.dashboard :refer [dashboard]] [uxbox.main.ui.login :refer [login-page]] - [uxbox.main.ui.not-found :refer [not-found-page]] + [uxbox.main.ui.static :refer [not-found-page not-authorized-page]] [uxbox.main.ui.profile.recovery :refer [profile-recovery-page]] [uxbox.main.ui.profile.recovery-request :refer [profile-recovery-request-page]] [uxbox.main.ui.profile.register :refer [profile-register-page]] @@ -47,6 +47,7 @@ ["/view/:page-id" :viewer] ["/not-found" :not-found] + ["/not-authorized" :not-authorized] (when *assert* ["/debug/icons-preview" :debug-icons-preview]) @@ -132,8 +133,11 @@ :page-id page-id :key file-id}]) + :not-authorized + [:& not-authorized-page] + :not-found - [:& not-found-page {}])) + [:& not-found-page])) (mf/defc app [] diff --git a/frontend/src/uxbox/main/ui/not_found.cljs b/frontend/src/uxbox/main/ui/static.cljs similarity index 66% rename from frontend/src/uxbox/main/ui/not_found.cljs rename to frontend/src/uxbox/main/ui/static.cljs index ccd18fedd..93d1089b2 100644 --- a/frontend/src/uxbox/main/ui/not_found.cljs +++ b/frontend/src/uxbox/main/ui/static.cljs @@ -7,7 +7,7 @@ ;; ;; Copyright (c) 2020 UXBOX Labs SL -(ns uxbox.main.ui.not-found +(ns uxbox.main.ui.static (:require [cljs.spec.alpha :as s] [rumext.alpha :as mf] @@ -15,7 +15,6 @@ (mf/defc not-found-page [{:keys [error] :as props}] - (js/console.log "not-found" error) [:section.not-found-layout [:div.not-found-header i/logo] [:div.not-found-content @@ -25,3 +24,14 @@ [:div.desc-message "Oops! Page not found"] [:a.btn-primary.btn-small "Go back"]]]]) +(mf/defc not-authorized-page + [{:keys [error] :as props}] + [:section.not-found-layout + [:div.not-found-header i/logo] + [:div.not-found-content + [:div.message-container + [:div.error-img i/icon-lock] + [:div.main-message "403"] + [:div.desc-message "Sorry, you are not authorized to access this page."] + #_[:a.btn-primary.btn-small "Go back"]]]]) +