This commit is contained in:
2019-05-27 23:57:45 +00:00
parent a61f4a4979
commit 1f7cd6b692
3 changed files with 26 additions and 4 deletions

View File

@@ -27,6 +27,12 @@ NEXT TODOS:
- Right now you need to click twice on save - Right now you need to click twice on save
- On object not found when deleting an item and trying to reload the edit page, shoudl redirect to home or back instead or just not there - On object not found when deleting an item and trying to reload the edit page, shoudl redirect to home or back instead or just not there
- Locale settings move to store
- Right now if you reload a page the locale settings reset back to default as they are not backed by the store
- However localized text keys do not because they *are* backed by the store
- Put locale settings in store or invalidate and refresh them on reload
- Need to be mindful of page reloads everywhere as any uncached data is lost
DONE: 404 DONE: 404
- Can enter a route of /bad and it will just show an empty form like it thinks it's valid or something - Can enter a route of /bad and it will just show an empty form like it thinks it's valid or something
DONE: UNDER CONSTRUCTION DONE: UNDER CONSTRUCTION

View File

@@ -1,4 +1,4 @@
/* xeslint-disable */ /* eslint-disable */
import store from "../store"; import store from "../store";
import roles from "./authorizationroles"; import roles from "./authorizationroles";
import locale from "./locale"; import locale from "./locale";
@@ -17,8 +17,14 @@ function addNavItem(title, icon, route) {
// Initialize the app // Initialize the app
// on change of authentication status // on change of authentication status
export default function initialize() { export default function initialize() {
console.log("TOP:");
console.log(locale);
var promise = new Promise(function(resolve) { var promise = new Promise(function(resolve) {
console.log("2:");
console.log(locale);
if (store.state.authenticated) { if (store.state.authenticated) {
//Fetch the core localized text keys that will always be required by user //Fetch the core localized text keys that will always be required by user
locale locale
.fetch(locale.coreKeys) .fetch(locale.coreKeys)
@@ -78,6 +84,8 @@ export default function initialize() {
// addNavItem(locale.get("Logout"), "sign-out-alt", "/login"); // addNavItem(locale.get("Logout"), "sign-out-alt", "/login");
}) })
.then(() => { .then(() => {
console.log("3:");
console.log(locale);
//CACHE LOCALE SETTINGS //CACHE LOCALE SETTINGS
api api
.get("UserOptions/" + store.state.userId) .get("UserOptions/" + store.state.userId)
@@ -94,6 +102,9 @@ export default function initialize() {
} else { } else {
//TODO: also need the other locale settings such as number and date formats etc //TODO: also need the other locale settings such as number and date formats etc
console.log("4:");
console.log(locale);
var localOffset = new Date().getTimezoneOffset(); var localOffset = new Date().getTimezoneOffset();
if (localOffset != 0) { if (localOffset != 0) {
localOffset = (localOffset / 60) * -1; //time is in minutes and reversed from what we want or expect localOffset = (localOffset / 60) * -1; //time is in minutes and reversed from what we want or expect
@@ -114,9 +125,12 @@ export default function initialize() {
); );
} }
console.log("5:");
console.log(locale);
//Store offset in locale data //Store offset in locale data
locale.timeZoneOffset = res.data.timeZoneOffset; locale.timeZoneOffset = res.data.timeZoneOffset;
console.log("6 (after change):");
console.log(locale);
resolve(); resolve();
} }
}) })

View File

@@ -140,7 +140,9 @@
<v-layout align-left justify-center row wrap mt-5> <v-layout align-left justify-center row wrap mt-5>
<v-flex xs6 sm4> <v-flex xs6 sm4>
READY: {{ formState.ready }} endate: {{ obj.endDate }}
<br />
<!-- READY: {{ formState.ready }}
<br /> <br />
LOADING: {{ formState.loading }} LOADING: {{ formState.loading }}
<br /> <br />
@@ -149,7 +151,7 @@
VALID: {{ formState.valid }} VALID: {{ formState.valid }}
<br /> <br />
READONLY: {{ formState.readOnly }} READONLY: {{ formState.readOnly }}
<br /> <br /> -->
</v-flex> </v-flex>
</v-layout> </v-layout>
</v-form> </v-form>