From 31348bbc636f26baec73b5982af0b536fb830d36 Mon Sep 17 00:00:00 2001 From: Markus Thielen Date: Sat, 11 Mar 2023 12:15:55 +0100 Subject: [PATCH] todo item markup --- src/assets/img/trash-solid.png | Bin 0 -> 2624 bytes src/components/TodoRoot.vue | 73 ++++++++++++++++++++++++++++++--- src/router/index.js | 19 ++------- src/store.js | 15 ++++++- 4 files changed, 84 insertions(+), 23 deletions(-) create mode 100644 src/assets/img/trash-solid.png diff --git a/src/assets/img/trash-solid.png b/src/assets/img/trash-solid.png new file mode 100644 index 0000000000000000000000000000000000000000..167df76088c1cf2880c8eb8f5b15d244a1cb913d GIT binary patch literal 2624 zcmV-G3cvMPx;`bk7VRCr$PU0sYMRTVy`hsEdvEDxaaBA93tqY-u0fH5M-gZxDhj0Ox~gy=F| zr`p8D2eB6)L=(Ht?RGI@1Qin_D26{1e}Ii~iHeHRC`J>(7ZiAKh6jy|)5nz4z0=cE z)phT=_jXs!PQCO)pP%o1-#xdgtM9EssM(Pu$p--7orrij0Gu2N-g6>yHvs(981tP- zIaFb>(kr)+N-Mp=M0_Ip7y#U=52o_`I5U4)H_i06c@&rT^3dBhm=?y$M1qS--#1qd=-HbP3t)dFybGa;5m zTE@MGnZIsn8_mpHkPw_CN%90Dz9w3g7J)_NPsW(nT9`&PnJGxO+dXb|b@e^E zz`LTxw;wf!qv8PgMpYM<3exR%k6&3?`60w6D>4IK;q8TVN%L!FeoL7{sUSpjEdYGY zB~znpkCGjS^$jjcV}FR5zg@)FEI}UG`P~syjG4ppFf$ikQCbMHFwk>uxVhHpBS;8d zHjAChOc4Td+!%`%ByM%}kG`$@<|N2myIv=QKScis05B&(bR3Pmf)u(1L0zXu1UQ`O zPwHMQ?>ZMVpz4sT5#WxPcix+)R^8~laWHp5<~}SNHUerVNW=IGKE7%v$c+CGtcxFuI&X19Nsd)p5xLG7^HrDnodxN1I+qQH!|z%piQYy<38E*h_*u7k zv#Hf;y}#G%eb0)kk&&|?M3gTmd&nh85Zg%HN0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-|v54i@{3}BFbOpmA{Fn zp+}TC@Em4Vzg)~$5apwqLJ~19!EJ?DNCZ=(vGkElHlx-~kP`GnlrJUCmy{}wh?HzW zW0}X&>}cq6`_q|O{rD<7K}zT*qP+m{PlXyg#-%`)lbCr$TcDR9dD8l9OVCmf)=#?) zVT>Y#Ao*xeExiv*MJ=MO8s@z&XS1T;;1gHCE}=Hu(lq_6h`2Akcb&6q!S`$si1=id zWv}#s>fIss+Y)?WI`}S7XxnWFv#RkF1R+V<5#EFDAV4Hjjjkcy%WijbaYoTZls_o= z(n!2CE$ltad|5Tqd3n-0#J2QX8KF)SacR{9N5YZO_ zpyLCg7?%45Mpz80Xgy~BgvxW`(#pp_{~hva0JzyJh>LUFq3?pE$o3{?{;W?B?+!`R z^ac?by_3%eil^@!gsMt`h|5`)eaWX1wIE|~Ns?TNh+7}kRE1oLI8s<8n(c1dM>0)D zQVTK;k|fE6hEVU4w|c-5B!=yL0Gl27(DPI=MG`>Y5bEL9m0&9PFXej)GLf z9R1Ip3qv8hp@y*-0CF+Z|DPAtPT| literal 0 HcmV?d00001 diff --git a/src/components/TodoRoot.vue b/src/components/TodoRoot.vue index 97b907b..78959ef 100644 --- a/src/components/TodoRoot.vue +++ b/src/components/TodoRoot.vue @@ -6,6 +6,21 @@ --> - \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index b5c74ce..68b9954 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,7 @@ * https://basebox.tech */ -import { store } from "../store"; +import {showError, store} from "../store"; import { createRouter, createWebHistory } from 'vue-router' import HomeView from '../views/HomeView.vue' import OAUthError from "../components/FatalError.vue"; @@ -47,13 +47,8 @@ router.beforeEach(async (to, from) => { } catch (err) { const errorMsg = `Failed to get session info from basebox/finish OpenID Connect login: ${err}`; console.error(errorMsg); - /* show error component */ - return { - name: "oauth-error", - params: { - errorMsg - } - } + /* show error */ + showError(errorMsg); } /* We have to create the logged-in user explicitly; see comment for `createUser()` */ @@ -62,13 +57,7 @@ router.beforeEach(async (to, from) => { } catch (err) { const errorMsg = `Failed to create user: ${err}`; console.error(errorMsg); - /* show error component */ - return { - name: "oauth-error", - params: { - errorMsg - } - } + showError(errorMsg); } return {name: 'home'}; diff --git a/src/store.js b/src/store.js index 3813642..97d1199 100644 --- a/src/store.js +++ b/src/store.js @@ -17,7 +17,7 @@ export const store = reactive({ /** basebox session data */ session: {}, - /** Fatal errort message, if any */ + /** Fatal error message, if any */ fatalError: "", }); @@ -36,5 +36,16 @@ export function clearSession() { store.session = {}; } +/** + * Show an error. + */ +export function showError(message) { + store.fatalError = message; +} - +/** + * Clear error. + */ +export function clearError() { + store.fatalError = ""; +}