1
1
<template >
2
2
<v-app id =" my-front" >
3
+ <snackbar ></snackbar >
4
+
3
5
<v-system-bar app >
4
6
<v-spacer ></v-spacer >
5
7
29
31
30
32
<v-divider />
31
33
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
+
32
63
<v-list dense nav >
33
64
<v-list-item-group v-model =" selectedItem" color =" primary" >
34
65
<v-list-item
73
104
</v-app-bar >
74
105
75
106
<v-main >
107
+ <Breadcrumb layout-class =" pl-3 py-3" />
108
+
76
109
<v-container fluid >
110
+ <LocaleChanger
111
+ flag
112
+ label
113
+ current-language =" fr-FR"
114
+ :flag-height =" 12"
115
+ ></LocaleChanger >
116
+
77
117
<router-view />
78
118
</v-container >
79
119
</v-main >
128
168
</template >
129
169
130
170
<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" ;
134
173
import router from " @/router" ;
135
174
175
+ import Breadcrumb from " @/components/base/Breadcrumb" ;
176
+ import Snackbar from " @/components/base/Snackbar" ;
177
+
178
+ import LocaleChanger from " @/components/base/LocaleChanger" ;
179
+
136
180
export default {
181
+ components: {
182
+ Breadcrumb,
183
+ Snackbar,
184
+ LocaleChanger,
185
+ },
186
+
137
187
data : () => ({
138
188
drawer: null ,
139
189
fixed: false ,
@@ -146,27 +196,52 @@ export default {
146
196
},
147
197
{
148
198
icon: " mdi-home-city-outline" ,
149
- title: " Sites " ,
150
- to: " /sites " ,
199
+ title: " Addresses " ,
200
+ to: " /addresses " ,
151
201
},
152
202
{
153
- icon: " mdi-library-shelves " ,
154
- title: " Libraries " ,
155
- to: " /libraries " ,
203
+ icon: " mdi-account-group " ,
204
+ title: " Contacts " ,
205
+ to: " /contacts " ,
156
206
},
157
207
{
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" ,
161
216
},
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
+ // },
162
237
],
163
238
miniVariant: true ,
164
239
rightDrawer: false ,
165
240
title: " This is the application title" ,
166
241
}),
167
242
computed: {
168
243
... mapState ({
169
- currentUser : (state ) => state .User ,
244
+ currentUser : (state ) => state .Authentication ,
170
245
currentLanguage : (state ) => state .currentLanguage ,
171
246
}),
172
247
userLoggedIn () {
@@ -180,11 +255,8 @@ export default {
180
255
},
181
256
},
182
257
created () {
183
- // const defaultLanguage = navigator.language.split("-")[0];
184
- // console.log(`Default navigator language: ${defaultLanguage}`, this.currentLanguage);
185
-
186
258
const userToken = readFromStorage (" token" ) || " " ;
187
- this .$store .commit (" User /SET_TOKEN" , userToken);
259
+ this .$store .commit (" Authentication /SET_TOKEN" , userToken);
188
260
if (userToken) {
189
261
console .log (" A user is still signed-in!" , this .currentUser );
190
262
}
@@ -201,23 +273,6 @@ export default {
201
273
this .getOidcConfiguration ();
202
274
}
203
275
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
-
221
276
// Only if a user signed in
222
277
this .$root .$on (" user-signed-in" , () => {
223
278
console .log (" A user just signed-in!" , this .currentUser );
@@ -232,15 +287,15 @@ export default {
232
287
});
233
288
},
234
289
mounted () {
235
- console .log (" Logged-in" , this .userLoggedIn , this .isLoggedIn ());
290
+ console .log (" mounted - Logged-in" , this .userLoggedIn , this .isLoggedIn ());
236
291
237
292
this .userLoggedIn && this .$root .$emit (" user-signed-in" );
238
293
},
239
294
methods: {
240
295
... mapGetters (" Alert" , [" lastLoginMessage" ]),
241
- ... mapGetters (" User " , [" isLoggedIn" , " friendlyName" , " initials" ]),
296
+ ... mapGetters (" Authentication " , [" isLoggedIn" , " friendlyName" , " initials" ]),
242
297
... mapActions ({ getApiVersion: " Api/getVersion" }),
243
- ... mapActions ({ logout: " User /logout" }),
298
+ ... mapActions ({ logout: " Authentication /logout" }),
244
299
... mapActions ({
245
300
getOidcConfiguration: " OidcConfiguration/getOidcConfiguration" ,
246
301
}),
0 commit comments