From 461c5017d54a14b5a6073ef5bdcac01f9a68e9e6 Mon Sep 17 00:00:00 2001 From: tiittapauppi Date: Sat, 15 Jun 2024 22:36:18 +0300 Subject: [PATCH] Improve infoboard entry management (#22) Improves the infoboard management view. --------- Co-authored-by: Nico Hagelberg --- src/components/Infoboard.vue | 32 ++++++++++-- src/components/Social.vue | 96 +++++++++++++++++------------------- src/store.ts | 9 +--- src/types.ts | 1 - 4 files changed, 74 insertions(+), 64 deletions(-) diff --git a/src/components/Infoboard.vue b/src/components/Infoboard.vue index 6940a39..42b345d 100644 --- a/src/components/Infoboard.vue +++ b/src/components/Infoboard.vue @@ -60,17 +60,24 @@ :key="i" :class="'card'" :title="infoboard.title" - :sub-title="infoboard.created_at" + :sub-title="'Created on ' + formatDate(infoboard.created_at)" > -

- {{ infoboard.body }} -

-

Set: {{ infoboard.priority }} Enabled: {{ infoboard.enabled }}

+
+ Enabled + Disabled + Set {{ infoboard.priority }} + Active until {{ formatDate(infoboard.active_until) }} ({{ formatDuration(infoboard.active_until) }}) +
+
+
{{ infoboard.body }}
+
Edit infoboard entry @@ -137,6 +144,7 @@ @@ -729,12 +719,15 @@ export default { button { margin-right: 15px; } + .wrapper { padding: 15px; } + .card { margin: 15px; } + .selected-person { margin-top: 15px } @@ -744,6 +737,7 @@ h3 { .action-button { margin: 12px auto; } + .person-groups-checkboxes { margin-top: 15px; @@ -756,11 +750,11 @@ h3 { padding: 16px; } -li > * { +li>* { margin: auto 4px; } -li > strong { +li>strong { cursor: pointer; } diff --git a/src/store.ts b/src/store.ts index fa05705..69b0c5f 100644 --- a/src/store.ts +++ b/src/store.ts @@ -10,10 +10,7 @@ const vuexPersist = new VuexPersist({ storage: localStorage, }); -const uri = - window.location.hostname === "localhost" - ? "http://localhost:8888" - : window.location.origin; +const uri = window.location.hostname === "localhost" ? "http://localhost:8888" : window.location.origin; const store = new Vuex.Store({ state: { @@ -51,9 +48,7 @@ const store = new Vuex.Store({ } }, deleteDataBlob(state, data) { - state.dataBlobs = state.dataBlobs.filter( - (e) => e.type !== data.type || e.id !== data.id, - ); + state.dataBlobs = state.dataBlobs.filter((e) => e.type !== data.type || e.id !== data.id); }, setAllDataBlobs(state, datas) { state.dataBlobs = datas; diff --git a/src/types.ts b/src/types.ts index 0722bca..dda1913 100644 --- a/src/types.ts +++ b/src/types.ts @@ -6,7 +6,6 @@ interface DataBlob { version: number; [x: string]: any; } - export interface State { dataBlobs: DataBlob[]; info: {