This commit is contained in:
2020-06-05 14:09:37 +00:00
parent 3dd037d38a
commit 4c3a2f8988
4 changed files with 17 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ todo: dark mode would be nice just for me and my eyes
Add locale key Add locale key
Add persistence, local setting only Add persistence, local setting only
Play around confirm colors are ok Play around confirm colors are ok
- file list in attachment is incorrect - file list in attachment is incorrect colors in dark
todo: Are UTC filters really working properly? todo: Are UTC filters really working properly?
Check that a datafilter with dates incoming datetime ranges are either interpreted as UTC on route (from post formdata maybe, already know query params are NOT) Check that a datafilter with dates incoming datetime ranges are either interpreted as UTC on route (from post formdata maybe, already know query params are NOT)

View File

@@ -276,14 +276,15 @@ export default {
window.$gz.eventBus.$off(); window.$gz.eventBus.$off();
}, },
mounted() { mounted() {
// this.$vuetify.theme.dark = true; let vm = this;
this.$root.$gzconfirm = this.$refs.gzconfirm.open; vm.$vuetify.theme.dark = vm.$store.state.darkMode;
this.$root.$gznotify = this.$refs.gznotify.addNotification; vm.$root.$gzconfirm = vm.$refs.gzconfirm.open;
vm.$root.$gznotify = vm.$refs.gznotify.addNotification;
//weird bastardization thing //weird bastardization thing
//basically I want to access $gz in vue components where I can't access Window //basically I want to access $gz in vue components where I can't access Window
//this smells bad but it works //this smells bad but it works
this.$root.$gz = window.$gz; vm.$root.$gz = window.$gz;
//Capture open object type and id if present //Capture open object type and id if present
//localhost:8080/login?type=2&id=22 //localhost:8080/login?type=2&id=22
@@ -304,8 +305,8 @@ export default {
} }
//redirect to login if not authenticated //redirect to login if not authenticated
if (!this.$store.state.authenticated) { if (!vm.$store.state.authenticated) {
this.$router.push("login"); vm.$router.push("login");
} else { } else {
//this can be safely called any time, it checks if there is an open object in store and //this can be safely called any time, it checks if there is an open object in store and
//opens it or if not just returns //opens it or if not just returns

View File

@@ -43,7 +43,8 @@ export default new Vuex.Store({
navItems: [], navItems: [],
logArray: [], logArray: [],
formSettings: {}, //this is the settings on forms that survive a refresh like grid number of items to show etc formSettings: {}, //this is the settings on forms that survive a refresh like grid number of items to show etc
formCustomTemplate: {} //this is the custom fields settings for forms formCustomTemplate: {}, //this is the custom fields settings for forms,
darkMode: false
}, },
mutations: { mutations: {
setLastClientVersion(state, data) { setLastClientVersion(state, data) {
@@ -140,6 +141,9 @@ export default new Vuex.Store({
}, },
clearOpenObject(state) { clearOpenObject(state) {
state.openObject = null; state.openObject = null;
},
setDarkMode(state, data) {
state.darkMode = data;
} }
}, },
actions: {} actions: {}

View File

@@ -165,7 +165,7 @@ export default {
selectLists: { selectLists: {
translations: [] translations: []
}, },
darkMode: false, darkMode: this.$store.state.darkMode,
obj: { obj: {
/*concurrency": 7490431, /*concurrency": 7490431,
"translationId": 1, "translationId": 1,
@@ -235,6 +235,7 @@ export default {
return window.$gz.form; return window.$gz.form;
}, },
darkModeChanged() { darkModeChanged() {
this.$store.commit("setDarkMode", this.darkMode);
this.$vuetify.theme.dark = this.darkMode; this.$vuetify.theme.dark = this.darkMode;
}, },
fieldValueChanged(ref) { fieldValueChanged(ref) {
@@ -438,7 +439,8 @@ function fetchTranslatedText(vm) {
"UserEmailAddress", "UserEmailAddress",
"Hour12", "Hour12",
"UserColor", "UserColor",
"Translation" "Translation",
"DarkMode"
]); ]);
} }