This commit is contained in:
21
app/ayanova/package-lock.json
generated
21
app/ayanova/package-lock.json
generated
@@ -13512,6 +13512,11 @@
|
|||||||
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
|
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"shvl": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/shvl/-/shvl-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-+rRPP46hloYUAEImJcqprUgXu+05Ikqr4h4V+w5i2zJy37nAqtkQKufs3+3S2fDq6JNRrHMIQhB/Vaex+jgAAw=="
|
||||||
|
},
|
||||||
"sigmund": {
|
"sigmund": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
|
||||||
@@ -15334,6 +15339,22 @@
|
|||||||
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz",
|
||||||
"integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w=="
|
"integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w=="
|
||||||
},
|
},
|
||||||
|
"vuex-persistedstate": {
|
||||||
|
"version": "2.5.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-2.5.4.tgz",
|
||||||
|
"integrity": "sha512-XYJhKIwO+ZVlTaXyxKxnplrJ88Fnvk5aDw753bxzRw5/yMKLQ6lq9CDCBex2fwZaQcLibhtgJOxGCHjy9GLSlQ==",
|
||||||
|
"requires": {
|
||||||
|
"deepmerge": "^2.1.0",
|
||||||
|
"shvl": "^1.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"deepmerge": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"w3c-hr-time": {
|
"w3c-hr-time": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz",
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
"vue": "^2.5.17",
|
"vue": "^2.5.17",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vuetify": "^1.3.0",
|
"vuetify": "^1.3.0",
|
||||||
"vuex": "^3.0.1"
|
"vuex": "^3.0.1",
|
||||||
|
"vuex-persistedstate": "^2.5.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cypress/webpack-preprocessor": "^3.0.0",
|
"@cypress/webpack-preprocessor": "^3.0.0",
|
||||||
|
|||||||
@@ -3,24 +3,8 @@ import config from "../utils/config";
|
|||||||
import api from "./apiutil";
|
import api from "./apiutil";
|
||||||
import _ from "../utils/libs/core.min.js";
|
import _ from "../utils/libs/core.min.js";
|
||||||
|
|
||||||
/*
|
//Keep the localized text keys here temporarily
|
||||||
Locale:
|
//TODO: rehydrate on page refresh / put in sessionstorage
|
||||||
Methods
|
|
||||||
- This module is responsible for handling all localized text operations
|
|
||||||
- It stores a local in memory cache of the keys and returns them from cache whenever possible
|
|
||||||
- Method: Get keys one at a time or in an array
|
|
||||||
- a method that accepts lt keys and returns their text
|
|
||||||
- If a key is not in the cache here then it returns an obvious error string
|
|
||||||
- Method: pre-fetch / Cache keys
|
|
||||||
- Used to pre-fetch a bunch of keys at once if necessary
|
|
||||||
- A caller will call this with the list of keys it will need in advance, the ones that are not present in the cache will be fetched from the server and the cache populated
|
|
||||||
- No text is actually returned at this point, it's just a pre-setup kind of thing to ensure better perf later
|
|
||||||
- Method: Clear cache
|
|
||||||
- Clear the local cache entirely
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var lt = {};
|
var lt = {};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import Vuex from "vuex";
|
import Vuex from "vuex";
|
||||||
|
import createPersistedState from "vuex-persistedstate";
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
|
plugins: [createPersistedState()],
|
||||||
state: {
|
state: {
|
||||||
authenticated: false,
|
authenticated: false,
|
||||||
apiUrl: "http://localhost:7575/api/v8.0/",
|
apiUrl: "http://localhost:7575/api/v8.0/",
|
||||||
|
|||||||
@@ -39,10 +39,5 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return role === (store.state.roles & role);
|
return role === (store.state.roles & role);
|
||||||
//https://stackoverflow.com/questions/39359740/what-are-enum-flags-in-typescript
|
|
||||||
//https://stackoverflow.com/questions/15551652/javascript-enum-flag-check
|
|
||||||
// if ((role & flags.ERROR) == flags.ERROR) {
|
|
||||||
// alert("ERROR IS SET");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ NEXT UP / CURRENTLY WORKING ON:
|
|||||||
|
|
||||||
- lookup naming guidelines for javascript functions (capitalized?) and fixup the code and stick to it.
|
- lookup naming guidelines for javascript functions (capitalized?) and fixup the code and stick to it.
|
||||||
- Look over the (now two) api calls and look for optimization and code shrinkage / de-duplication
|
- Look over the (now two) api calls and look for optimization and code shrinkage / de-duplication
|
||||||
|
- Handle refresh with session storage and how to rehydrate stuff
|
||||||
- Move on to the next thing (build and post?)
|
- Move on to the next thing (build and post?)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,21 +79,7 @@ https://vuex.vuejs.org/guide/structure.html
|
|||||||
VUEX STATE PERSISTENCE = VUEX-PERSISTEDSTATE
|
VUEX STATE PERSISTENCE = VUEX-PERSISTEDSTATE
|
||||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||||
- https://github.com/robinvdvleuten/vuex-persistedstate
|
- https://github.com/robinvdvleuten/vuex-persistedstate
|
||||||
- Some stuff should probably be persisted like auth, maybe other stuff?
|
- Many things need to be persisted and survive a refresh so this is how it will be done
|
||||||
- Is this app an online only app?
|
|
||||||
- Store enough stuff to keep working locally?
|
|
||||||
- Fill out a workorder offline?
|
|
||||||
- Create a new one offline?
|
|
||||||
- enter labour only, no parts or other lengthy lookup stuff??
|
|
||||||
- If recreating AyaNova 7 essentially, then that app is always online as well so maybe don't even consider offline work?
|
|
||||||
|
|
||||||
|
|
||||||
LOCALSTORAGE = Built in
|
|
||||||
=-=-=-=-=-=-=-=-=-=-=-=
|
|
||||||
- All modern browsers should support it and less libs the better
|
|
||||||
- Fallback if find it doesn't work:
|
|
||||||
- = STORE.JS Very widely used and I don't necessarily need a VUE specific one, this is the one used for pecklist and rockfish
|
|
||||||
- https://github.com/marcuswestin/store.js/
|
|
||||||
|
|
||||||
|
|
||||||
SERVICEWORKER = WORKBOX
|
SERVICEWORKER = WORKBOX
|
||||||
|
|||||||
Reference in New Issue
Block a user