Skip to content

Commit 1318c6c

Browse files
committed
Add some more features: locale changer
Add some more entities
1 parent f82cd3a commit 1318c6c

File tree

112 files changed

+5855
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+5855
-700
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"axios-extensions": "^3.1.3",
2222
"core-js": "^3.6.5",
2323
"jwt-decode": "^3.1.2",
24-
"localforage": "^1.10.0",
2524
"lodash": "^4.17.21",
2625
"moment": "^2.29.1",
2726
"regenerator-runtime": "^0.13.9",
@@ -96,5 +95,5 @@
9695
"> 1%",
9796
"last 2 versions",
9897
"not dead"
99-
],
98+
]
10099
}

public/img/flags/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Project flags
2+
3+
Flags are PNG images downloaded from an icon pack: https://icon-icons.com/fr/pack/Flags/2087
4+
5+
Download the PNG 64 file to add a new flag

public/img/flags/be.png

1004 Bytes
Loading

public/img/flags/de.png

986 Bytes
Loading

public/img/flags/es.png

1.75 KB
Loading

public/img/flags/fr.png

995 Bytes
Loading

public/img/flags/ma.png

1.6 KB
Loading

public/img/flags/uk.png

4.58 KB
Loading

src/App.vue

+91-36
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
22
<v-app id="my-front">
3+
<snackbar></snackbar>
4+
35
<v-system-bar app>
46
<v-spacer></v-spacer>
57

@@ -29,6 +31,35 @@
2931

3032
<v-divider />
3133

34+
<v-list dense>
35+
<v-list-item>
36+
<v-list-item-action>
37+
<v-icon>mdi-home</v-icon>
38+
</v-list-item-action>
39+
<v-list-item-content>
40+
<v-list-item-title>Home</v-list-item-title>
41+
</v-list-item-content>
42+
</v-list-item>
43+
<v-list-item :to="{ name: 'AddressList' }">
44+
<v-list-item-action>
45+
<v-icon>mdi-book</v-icon>
46+
</v-list-item-action>
47+
<v-list-item-content>
48+
<v-list-item-title> Books </v-list-item-title>
49+
</v-list-item-content>
50+
</v-list-item>
51+
<v-list-item :to="{ name: 'ContactList' }">
52+
<v-list-item-action>
53+
<v-icon>mdi-comment-quote</v-icon>
54+
</v-list-item-action>
55+
<v-list-item-content>
56+
<v-list-item-title> Reviews </v-list-item-title>
57+
</v-list-item-content>
58+
</v-list-item>
59+
</v-list>
60+
61+
<v-divider />
62+
3263
<v-list dense nav>
3364
<v-list-item-group v-model="selectedItem" color="primary">
3465
<v-list-item
@@ -73,7 +104,16 @@
73104
</v-app-bar>
74105

75106
<v-main>
107+
<Breadcrumb layout-class="pl-3 py-3" />
108+
76109
<v-container fluid>
110+
<LocaleChanger
111+
flag
112+
label
113+
current-language="fr-FR"
114+
:flag-height="12"
115+
></LocaleChanger>
116+
77117
<router-view />
78118
</v-container>
79119
</v-main>
@@ -128,12 +168,22 @@
128168
</template>
129169

130170
<script>
131-
import jwt_decode from "jwt-decode";
132-
import { mapActions, mapGetters, mapMutations, mapState } from "vuex";
133-
import { readFromStorage, removeFromStorage } from "@/_helpers";
171+
import { mapActions, mapGetters, mapState } from "vuex";
172+
import { readFromStorage } from "@/utils/local-storage";
134173
import router from "@/router";
135174
175+
import Breadcrumb from "@/components/base/Breadcrumb";
176+
import Snackbar from "@/components/base/Snackbar";
177+
178+
import LocaleChanger from "@/components/base/LocaleChanger";
179+
136180
export default {
181+
components: {
182+
Breadcrumb,
183+
Snackbar,
184+
LocaleChanger,
185+
},
186+
137187
data: () => ({
138188
drawer: null,
139189
fixed: false,
@@ -146,27 +196,52 @@ export default {
146196
},
147197
{
148198
icon: "mdi-home-city-outline",
149-
title: "Sites",
150-
to: "/sites",
199+
title: "Addresses",
200+
to: "/addresses",
151201
},
152202
{
153-
icon: "mdi-library-shelves",
154-
title: "Libraries",
155-
to: "/libraries",
203+
icon: "mdi-account-group",
204+
title: "Contacts",
205+
to: "/contacts",
156206
},
157207
{
158-
icon: "mdi-account-group",
159-
title: "Communities",
160-
to: "/communities",
208+
icon: "mdi-book",
209+
title: "Documents",
210+
to: "/documents",
211+
},
212+
{
213+
icon: "mdi-book-alphabet",
214+
title: "Documents versions",
215+
to: "/documentversions",
161216
},
217+
{
218+
icon: "mdi-signature-freehand",
219+
title: "Relations",
220+
to: "/relations",
221+
},
222+
{
223+
icon: "mdi-factory",
224+
title: "Sites",
225+
to: "/sites",
226+
},
227+
// {
228+
// icon: "mdi-library-shelves",
229+
// title: "Libraries",
230+
// to: "/libraries",
231+
// },
232+
// {
233+
// icon: "mdi-account-group",
234+
// title: "Communities",
235+
// to: "/communities",
236+
// },
162237
],
163238
miniVariant: true,
164239
rightDrawer: false,
165240
title: "This is the application title",
166241
}),
167242
computed: {
168243
...mapState({
169-
currentUser: (state) => state.User,
244+
currentUser: (state) => state.Authentication,
170245
currentLanguage: (state) => state.currentLanguage,
171246
}),
172247
userLoggedIn() {
@@ -180,11 +255,8 @@ export default {
180255
},
181256
},
182257
created() {
183-
// const defaultLanguage = navigator.language.split("-")[0];
184-
// console.log(`Default navigator language: ${defaultLanguage}`, this.currentLanguage);
185-
186258
const userToken = readFromStorage("token") || "";
187-
this.$store.commit("User/SET_TOKEN", userToken);
259+
this.$store.commit("Authentication/SET_TOKEN", userToken);
188260
if (userToken) {
189261
console.log("A user is still signed-in!", this.currentUser);
190262
}
@@ -201,23 +273,6 @@ export default {
201273
this.getOidcConfiguration();
202274
}
203275
204-
// Event handler for the locale changed with the locale changer component
205-
this.$root.$on("language-changed", (code) => {
206-
// if (code === "default") {
207-
// code = defaultLanguage;
208-
// }
209-
// const localeCode = code;
210-
// // i18n library locale update
211-
// this.$i18n.locale = localeCode;
212-
// const localeName = this.$i18n.t("name");
213-
//
214-
// // Set the current user locale
215-
// this.setLocale({ code: localeCode, name: localeName });
216-
//
217-
// // Force the view update - not necessary, uncomment to reactivate
218-
// // this.$forceUpdate();
219-
});
220-
221276
// Only if a user signed in
222277
this.$root.$on("user-signed-in", () => {
223278
console.log("A user just signed-in!", this.currentUser);
@@ -232,15 +287,15 @@ export default {
232287
});
233288
},
234289
mounted() {
235-
console.log("Logged-in", this.userLoggedIn, this.isLoggedIn());
290+
console.log("mounted - Logged-in", this.userLoggedIn, this.isLoggedIn());
236291
237292
this.userLoggedIn && this.$root.$emit("user-signed-in");
238293
},
239294
methods: {
240295
...mapGetters("Alert", ["lastLoginMessage"]),
241-
...mapGetters("User", ["isLoggedIn", "friendlyName", "initials"]),
296+
...mapGetters("Authentication", ["isLoggedIn", "friendlyName", "initials"]),
242297
...mapActions({ getApiVersion: "Api/getVersion" }),
243-
...mapActions({ logout: "User/logout" }),
298+
...mapActions({ logout: "Authentication/logout" }),
244299
...mapActions({
245300
getOidcConfiguration: "OidcConfiguration/getOidcConfiguration",
246301
}),

src/_helpers/backend-config.js

-14
This file was deleted.

0 commit comments

Comments
 (0)