@mapomodule/uikit 1.0.0-alpha.12 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/components/Detail/Detail.vue +48 -9
- package/components/MediaManager/MediaManager.vue +7 -6
- package/components/fields/FksField.vue +25 -5
- package/components/fields/MediaField.vue +9 -0
- package/components/fields/wygEditor/defaults.js +3 -3
- package/components/layout/Sidebar/Sidebar.vue +13 -32
- package/components/layout/Sidebar/SidebarFooter.vue +1 -1
- package/components/layout/Sidebar/SidebarListItem.vue +19 -1
- package/components/layout/Sidebar/SidebarProfile.vue +42 -0
- package/components/layout/routebuilder.js +2 -2
- package/layouts/default.vue +19 -7
- package/layouts/empty.vue +10 -0
- package/package.json +3 -3
- package/layouts/error.vue +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.13](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2022-03-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* added missing error messages to media field ([1489001](https://github.com/lotrekagency/mapo/commit/148900133c1671acc5a47fe994b41db07013ab2a))
|
|
12
|
+
* clean default layout ([b32e5db](https://github.com/lotrekagency/mapo/commit/b32e5db6876420a3b53bb9da4cf13c7e53fb279f))
|
|
13
|
+
* fix back button in detail page when you came from login or when you have no window history ([7881004](https://github.com/lotrekagency/mapo/commit/78810046d91d02fcfa845bcc7fce95cb011a21ae))
|
|
14
|
+
* fix detail language load ([92a2718](https://github.com/lotrekagency/mapo/commit/92a271878b9f1f2585c3dcc18749adc7c7683ae1))
|
|
15
|
+
* fix error page style ([d8753a1](https://github.com/lotrekagency/mapo/commit/d8753a1ae0a2c857cd4a5417694c17bcf9a5bb9d))
|
|
16
|
+
* fix menu route building for nested folders ([1d15b17](https://github.com/lotrekagency/mapo/commit/1d15b17e3cbb75aa92e301429f667e119ecb9334))
|
|
17
|
+
* fix sidebar menu styling for nested long menus ([ba87f59](https://github.com/lotrekagency/mapo/commit/ba87f5912db02f86c857d237b5408094b63ed164))
|
|
18
|
+
* handle media manager requests errors. ([809704b](https://github.com/lotrekagency/mapo/commit/809704b7822b7991423e108bf1b8e398c19157e9))
|
|
19
|
+
* **detail:** set current lang at mount time ([46c98a7](https://github.com/lotrekagency/mapo/commit/46c98a76a2a787e752b7fea7e2442b719338aa6f))
|
|
20
|
+
* remove logout from sidebar if no user logged in ([e9d562b](https://github.com/lotrekagency/mapo/commit/e9d562b9f6f71a01f8235caa26c24a8f6d5c0f5d))
|
|
21
|
+
* remove remaining toc plugin configuration from tinymce ([9defb47](https://github.com/lotrekagency/mapo/commit/9defb47c5da6e8b7fa87ee39943f9a66d48ca538))
|
|
22
|
+
* remove toc and imagetools plugin from tinymce ([e1d12cf](https://github.com/lotrekagency/mapo/commit/e1d12cf72cf6aa488ed4135788fecd1ffa99da43))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* accept axios configuration in endpoint prop of FksField ([9dfca0b](https://github.com/lotrekagency/mapo/commit/9dfca0b5d2a488c0fdab5e8411454e7f0efe5904))
|
|
28
|
+
* added loading page before content retrieve in detail page ([4f26c03](https://github.com/lotrekagency/mapo/commit/4f26c037ab095f931a3ff430b07451de9bef504f))
|
|
29
|
+
* added login button to profile component if no user logged in ([354a25a](https://github.com/lotrekagency/mapo/commit/354a25a32164dc1d284cbe4542c65e04379b1c75))
|
|
30
|
+
* detached SidebarProfile from sidebar component ([92c2894](https://github.com/lotrekagency/mapo/commit/92c28941e6069bbc4e15775ea380c453c7267420))
|
|
31
|
+
* make all modals draggable 🛸 ([57da10d](https://github.com/lotrekagency/mapo/commit/57da10d17aa31d58e55fda5385d45d43beed8c4f))
|
|
32
|
+
* pass errors to slot bindings inDetail component ([9303b39](https://github.com/lotrekagency/mapo/commit/9303b39be40810e526ad5f89428812cd3e7b349d))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
# [1.0.0-alpha.12](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-02-16)
|
|
7
39
|
|
|
8
40
|
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<div v-show="loading">
|
|
4
|
+
<v-progress-linear
|
|
5
|
+
color="primary"
|
|
6
|
+
indeterminate
|
|
7
|
+
absolute
|
|
8
|
+
style="top: 0;"
|
|
9
|
+
></v-progress-linear>
|
|
10
|
+
<span class="detail-component-loading ">
|
|
11
|
+
<v-icon size="30">mdi-timer-sand</v-icon>
|
|
12
|
+
Fetching data..
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div v-show="!loading">
|
|
3
16
|
<!-- Use this to override the title of the detail component. -->
|
|
4
17
|
<slot name="title" v-bind="slotBindings">
|
|
5
18
|
<!-- `<h1> "Create | Edit" + modelName </h1>` -->
|
|
@@ -93,7 +106,7 @@
|
|
|
93
106
|
<!-- Use this to override the Save button. -->
|
|
94
107
|
<slot name="button.save" v-bind="slotBindings">
|
|
95
108
|
<!-- The Save button. -->
|
|
96
|
-
<v-btn :disabled="isReadonly" class="mb-2" tile block @click="saveItem(true)">{{
|
|
109
|
+
<v-btn v-show="canGoBack" :disabled="isReadonly" class="mb-2" tile block @click="saveItem(true)">{{
|
|
97
110
|
isNew ? "Create" : "Save"
|
|
98
111
|
}}</v-btn>
|
|
99
112
|
</slot>
|
|
@@ -107,7 +120,7 @@
|
|
|
107
120
|
<!-- Use this to override the Back button. -->
|
|
108
121
|
<slot name="button.back" v-bind="slotBindings">
|
|
109
122
|
<!-- The Back button. -->
|
|
110
|
-
<v-btn class="mb-2" tile block @click="
|
|
123
|
+
<v-btn v-show="canGoBack" class="mb-2" tile block @click="back"
|
|
111
124
|
>Back</v-btn
|
|
112
125
|
>
|
|
113
126
|
</slot>
|
|
@@ -186,8 +199,21 @@
|
|
|
186
199
|
</v-row>
|
|
187
200
|
</v-form>
|
|
188
201
|
</div>
|
|
202
|
+
</div>
|
|
189
203
|
</template>
|
|
190
204
|
|
|
205
|
+
<style lang="scss" scoped>
|
|
206
|
+
.detail-component-loading {
|
|
207
|
+
position: absolute;
|
|
208
|
+
top: 50%;
|
|
209
|
+
transform: translateY(-50%);
|
|
210
|
+
width: 100%;
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
justify-content: center;
|
|
214
|
+
align-items: center;
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
191
217
|
|
|
192
218
|
<script>
|
|
193
219
|
/**
|
|
@@ -199,7 +225,8 @@ export default {
|
|
|
199
225
|
data() {
|
|
200
226
|
return {
|
|
201
227
|
model: {},
|
|
202
|
-
|
|
228
|
+
modelLanguages: [],
|
|
229
|
+
currentLang: this.lang,
|
|
203
230
|
errors: null
|
|
204
231
|
};
|
|
205
232
|
},
|
|
@@ -254,12 +281,15 @@ export default {
|
|
|
254
281
|
},
|
|
255
282
|
},
|
|
256
283
|
methods: {
|
|
284
|
+
back() {
|
|
285
|
+
this.$nuxt.context?.from?.name == "login" ? this.$router.go(-3) : this.$router.back()
|
|
286
|
+
},
|
|
257
287
|
saveItem(back = false) {
|
|
258
288
|
this.errors = null;
|
|
259
289
|
this.$refs.form?.resetValidation();
|
|
260
290
|
this.crud
|
|
261
291
|
.updateOrCreate(this.model, {}, { multipart: this.multipart })
|
|
262
|
-
.then((resp) => { back ? this
|
|
292
|
+
.then((resp) => { back ? this.back() : this.model = resp })
|
|
263
293
|
.catch(error => {
|
|
264
294
|
this.errors =
|
|
265
295
|
(error.response.status == 400 && error.response.data) || null;
|
|
@@ -280,7 +310,7 @@ export default {
|
|
|
280
310
|
if (res) {
|
|
281
311
|
this.crud
|
|
282
312
|
.delete(this.identifier)
|
|
283
|
-
.then(() => this
|
|
313
|
+
.then(() => this.back())
|
|
284
314
|
.catch(error =>
|
|
285
315
|
this.$mapo.$snack.open({
|
|
286
316
|
message: error.response?.data?.detail || "Something whent bad, please try again later...",
|
|
@@ -349,7 +379,13 @@ export default {
|
|
|
349
379
|
}
|
|
350
380
|
}
|
|
351
381
|
},
|
|
352
|
-
|
|
382
|
+
computed: {
|
|
383
|
+
canGoBack() {
|
|
384
|
+
if (process.browser) {
|
|
385
|
+
return this.$nuxt.context?.from?.name !== "login" && window.history.length > 1 || window.history.length > 3
|
|
386
|
+
}
|
|
387
|
+
return true;
|
|
388
|
+
},
|
|
353
389
|
crud() {
|
|
354
390
|
return this.$mapo.$api.crud(this.endpoint);
|
|
355
391
|
},
|
|
@@ -385,13 +421,12 @@ export default {
|
|
|
385
421
|
return !Object.keys(this.model).length;
|
|
386
422
|
},
|
|
387
423
|
langs() {
|
|
388
|
-
return
|
|
389
|
-
this.model?.lang_info?.site_languages.map(l => l.id) || this.languages
|
|
390
|
-
);
|
|
424
|
+
return this.modelLanguages || this.languages;
|
|
391
425
|
},
|
|
392
426
|
slotBindings() {
|
|
393
427
|
return {
|
|
394
428
|
model: this.model,
|
|
429
|
+
errors: this.errors,
|
|
395
430
|
currentLang: this.currentLang,
|
|
396
431
|
crud: this.crud,
|
|
397
432
|
isNew: this.isNew,
|
|
@@ -415,10 +450,14 @@ export default {
|
|
|
415
450
|
if (this.identifier && this.identifier !== "new") {
|
|
416
451
|
this.crud.detail(this.identifier).then(res => {
|
|
417
452
|
this.model = res;
|
|
453
|
+
this.modelLanguages = this.model?.lang_info?.site_languages.map(l => l.id)
|
|
418
454
|
this.initLang();
|
|
455
|
+
}).catch(error => {
|
|
456
|
+
this.$nuxt.error({ statusCode: error.response.status, message: error.response.data?.detail || "Ops some error occurred.." })
|
|
419
457
|
});
|
|
420
458
|
} else if (this.value) {
|
|
421
459
|
this.model = this.value;
|
|
460
|
+
this.modelLanguages = this.model?.lang_info?.site_languages.map(l => l.id)
|
|
422
461
|
this.initLang();
|
|
423
462
|
}
|
|
424
463
|
}
|
|
@@ -160,13 +160,14 @@ export default {
|
|
|
160
160
|
search: this.searchValue || undefined,
|
|
161
161
|
fltr: this.mime ? `mime_type=${this.mime}` : undefined,
|
|
162
162
|
};
|
|
163
|
-
|
|
164
|
-
response =
|
|
165
|
-
params
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
163
|
+
try {
|
|
164
|
+
response = id
|
|
165
|
+
? await this.mediaFolderCrud.detail(id, { params })
|
|
166
|
+
: await this.mediaFolderCrud.list({ params });
|
|
167
|
+
} catch (error) {
|
|
168
|
+
console.error({ code: error.response.status, response: error.response.data})
|
|
169
169
|
}
|
|
170
|
+
|
|
170
171
|
this.processResponse(response);
|
|
171
172
|
this.loading = false;
|
|
172
173
|
this.editMedia = null;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-autocomplete
|
|
2
|
+
<v-autocomplete
|
|
3
|
+
v-bind="fieldAttrs"
|
|
4
|
+
v-model="model"
|
|
5
|
+
:items="options"
|
|
6
|
+
></v-autocomplete>
|
|
3
7
|
</template>
|
|
4
8
|
|
|
5
9
|
<script>
|
|
@@ -26,7 +30,7 @@ export default {
|
|
|
26
30
|
type: Array,
|
|
27
31
|
default: () => [],
|
|
28
32
|
},
|
|
29
|
-
endpoint: String,
|
|
33
|
+
endpoint: String | Object,
|
|
30
34
|
},
|
|
31
35
|
computed: {
|
|
32
36
|
fieldAttrs() {
|
|
@@ -36,6 +40,22 @@ export default {
|
|
|
36
40
|
...this.$attrs,
|
|
37
41
|
};
|
|
38
42
|
},
|
|
43
|
+
crudConfig() {
|
|
44
|
+
switch (typeof this.endpoint) {
|
|
45
|
+
case "string":
|
|
46
|
+
return {
|
|
47
|
+
url: this.endpoint,
|
|
48
|
+
conf: null,
|
|
49
|
+
};
|
|
50
|
+
case "object":
|
|
51
|
+
return {
|
|
52
|
+
url: this.endpoint.url,
|
|
53
|
+
conf: this.endpoint.conf,
|
|
54
|
+
};
|
|
55
|
+
default:
|
|
56
|
+
return { url: "", conf: null };
|
|
57
|
+
}
|
|
58
|
+
},
|
|
39
59
|
},
|
|
40
60
|
watch: {
|
|
41
61
|
items(val) {
|
|
@@ -49,10 +69,10 @@ export default {
|
|
|
49
69
|
},
|
|
50
70
|
},
|
|
51
71
|
mounted() {
|
|
52
|
-
if (this.
|
|
72
|
+
if (this.crudConfig.url) {
|
|
53
73
|
this.$mapo.$api
|
|
54
|
-
.crud(this.
|
|
55
|
-
.list()
|
|
74
|
+
.crud(this.crudConfig.url)
|
|
75
|
+
.list(this.crudConfig.conf)
|
|
56
76
|
.then((res) => (this.options = res));
|
|
57
77
|
}
|
|
58
78
|
},
|
|
@@ -104,6 +104,11 @@
|
|
|
104
104
|
|
|
105
105
|
</div>
|
|
106
106
|
</v-hover>
|
|
107
|
+
<v-messages
|
|
108
|
+
v-model="errorMessages"
|
|
109
|
+
color="error"
|
|
110
|
+
class="mt-2"
|
|
111
|
+
/>
|
|
107
112
|
</div>
|
|
108
113
|
</template>
|
|
109
114
|
|
|
@@ -128,6 +133,10 @@ export default {
|
|
|
128
133
|
type: String,
|
|
129
134
|
default: () => "",
|
|
130
135
|
},
|
|
136
|
+
errorMessages: {
|
|
137
|
+
type: String | Array,
|
|
138
|
+
default: () => []
|
|
139
|
+
},
|
|
131
140
|
rmAddBtn: {
|
|
132
141
|
type: Boolean,
|
|
133
142
|
default: false,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var useDarkMode = false;
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
plugins: 'mapomedia preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor
|
|
4
|
+
plugins: 'mapomedia preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars emoticons',
|
|
5
5
|
// imagetools_cors_hosts: ['picsum.photos'],
|
|
6
6
|
menubar: 'file edit view insert format tools table help',
|
|
7
|
-
menu: { insert: { title: 'Insert', items: 'link mapomedia media template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor
|
|
7
|
+
menu: { insert: { title: 'Insert', items: 'link mapomedia media template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor | insertdatetime' } },
|
|
8
8
|
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview | mapomedia media template link anchor codesample | ltr rtl',
|
|
9
9
|
toolbar_sticky: true,
|
|
10
10
|
image_advtab: true,
|
|
@@ -50,7 +50,7 @@ export default {
|
|
|
50
50
|
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote mapomedia quicktable',
|
|
51
51
|
noneditable_noneditable_class: 'mceNonEditable',
|
|
52
52
|
toolbar_mode: 'sliding',
|
|
53
|
-
contextmenu: 'link mapomedia
|
|
53
|
+
contextmenu: 'link mapomedia table',
|
|
54
54
|
skin: useDarkMode ? 'oxide-dark' : 'oxide',
|
|
55
55
|
content_css: useDarkMode ? 'dark' : 'default',
|
|
56
56
|
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-navigation-drawer
|
|
3
|
-
v-model="
|
|
3
|
+
v-model="drawer"
|
|
4
4
|
:mini-variant.sync="miniVariant"
|
|
5
5
|
width="300"
|
|
6
6
|
:clipped="this.$store.getters['mapo/app/clipped']"
|
|
@@ -9,20 +9,7 @@
|
|
|
9
9
|
>
|
|
10
10
|
<div class="menu_container">
|
|
11
11
|
<div>
|
|
12
|
-
<
|
|
13
|
-
<v-list-item-avatar v-if="avatar">
|
|
14
|
-
<v-img :src="avatar"></v-img>
|
|
15
|
-
</v-list-item-avatar>
|
|
16
|
-
<v-list-item-icon v-else>
|
|
17
|
-
<v-icon>mdi-account</v-icon>
|
|
18
|
-
</v-list-item-icon>
|
|
19
|
-
<v-list-item-title>{{
|
|
20
|
-
this.$mapo.$auth.user.username
|
|
21
|
-
}}</v-list-item-title>
|
|
22
|
-
<v-btn icon @click.stop="miniVariant = !miniVariant">
|
|
23
|
-
<v-icon>mdi-chevron-left</v-icon>
|
|
24
|
-
</v-btn>
|
|
25
|
-
</v-list-item>
|
|
12
|
+
<SidebarProfile />
|
|
26
13
|
<v-divider></v-divider>
|
|
27
14
|
</div>
|
|
28
15
|
<div class="menu_container">
|
|
@@ -48,13 +35,8 @@
|
|
|
48
35
|
// @vuese
|
|
49
36
|
export default {
|
|
50
37
|
name: "Sidebar",
|
|
51
|
-
data() {
|
|
52
|
-
return {
|
|
53
|
-
miniVariant: false
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
38
|
computed: {
|
|
57
|
-
|
|
39
|
+
drawer: {
|
|
58
40
|
get() {
|
|
59
41
|
return this.$store.getters["mapo/app/drawer"];
|
|
60
42
|
},
|
|
@@ -62,19 +44,18 @@ export default {
|
|
|
62
44
|
if (this.$store.getters["mapo/app/drawer"] !== value)
|
|
63
45
|
this.$store.dispatch("mapo/app/toggleSidebarDrawer");
|
|
64
46
|
return value;
|
|
65
|
-
}
|
|
47
|
+
},
|
|
66
48
|
},
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
miniVariant: {
|
|
50
|
+
get() {
|
|
51
|
+
return this.$store.getters["mapo/app/minivariant"];
|
|
52
|
+
},
|
|
53
|
+
set(value) {
|
|
54
|
+
if (this.$store.getters["mapo/app/minivariant"] !== value)
|
|
55
|
+
this.$store.dispatch("mapo/app/toggleSidebarMinivariant");
|
|
56
|
+
return value;
|
|
57
|
+
},
|
|
69
58
|
},
|
|
70
|
-
avatar() {
|
|
71
|
-
return this.$mapo.$auth.user.avatar;
|
|
72
|
-
}
|
|
73
59
|
},
|
|
74
|
-
methods: {
|
|
75
|
-
drawerReverse() {
|
|
76
|
-
return (this.drawer = !this.drawer);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
60
|
};
|
|
80
61
|
</script>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/>
|
|
15
15
|
</v-list>
|
|
16
16
|
<v-divider></v-divider>
|
|
17
|
-
<v-list-item dense class="logout__button" link @click.native="logout">
|
|
17
|
+
<v-list-item v-if="$mapo.$auth.user.isLoggedIn" dense class="logout__button" link @click.native="logout">
|
|
18
18
|
<v-list-item-icon>
|
|
19
19
|
<v-icon>mdi-logout</v-icon>
|
|
20
20
|
</v-list-item-icon>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
>
|
|
24
24
|
</v-list-item>
|
|
25
25
|
|
|
26
|
-
<div :style="indent" v-if="childrens.length && expanded && !forceCollapse">
|
|
26
|
+
<div class="child-menu" :style="indent" v-if="childrens.length && expanded && !forceCollapse">
|
|
27
27
|
<SidebarListItem
|
|
28
28
|
v-for="(item, i) in childrens"
|
|
29
29
|
:key="i"
|
|
@@ -76,6 +76,19 @@
|
|
|
76
76
|
z-index: -1;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
.child-menu {
|
|
80
|
+
position: relative;
|
|
81
|
+
&::after {
|
|
82
|
+
content: "";
|
|
83
|
+
position: absolute;
|
|
84
|
+
width: 0px;
|
|
85
|
+
height: 100%;
|
|
86
|
+
top: -9px;
|
|
87
|
+
margin-left: -4px;
|
|
88
|
+
border-left: solid 3px #acacac;
|
|
89
|
+
z-index: -1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
79
92
|
}
|
|
80
93
|
.spider-menu.child:last-child {
|
|
81
94
|
.v-list-item__icon {
|
|
@@ -86,6 +99,11 @@
|
|
|
86
99
|
border-bottom-left-radius: 3px;
|
|
87
100
|
}
|
|
88
101
|
}
|
|
102
|
+
.child-menu{
|
|
103
|
+
&::after {
|
|
104
|
+
height: 0px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
89
107
|
}
|
|
90
108
|
</style>
|
|
91
109
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-list-item>
|
|
3
|
+
<v-list-item-avatar v-if="avatar">
|
|
4
|
+
<v-img :src="avatar"></v-img>
|
|
5
|
+
</v-list-item-avatar>
|
|
6
|
+
<v-list-item-icon v-else>
|
|
7
|
+
<v-icon>mdi-account</v-icon>
|
|
8
|
+
</v-list-item-icon>
|
|
9
|
+
<v-list-item-title>
|
|
10
|
+
<span v-if="isLoggedIn">
|
|
11
|
+
{{ username }}
|
|
12
|
+
</span>
|
|
13
|
+
<NuxtLink v-else to="/login"> Login </NuxtLink>
|
|
14
|
+
</v-list-item-title>
|
|
15
|
+
<v-btn icon @click.stop="toggleMiniVariant">
|
|
16
|
+
<v-icon>mdi-chevron-left</v-icon>
|
|
17
|
+
</v-btn>
|
|
18
|
+
</v-list-item>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
// @vuese
|
|
24
|
+
export default {
|
|
25
|
+
computed: {
|
|
26
|
+
username() {
|
|
27
|
+
return this.isLoggedIn ? this.$mapo.$auth.user.username : "";
|
|
28
|
+
},
|
|
29
|
+
avatar() {
|
|
30
|
+
return this.$mapo.$auth.user.avatar;
|
|
31
|
+
},
|
|
32
|
+
isLoggedIn() {
|
|
33
|
+
return this.$mapo.$auth.user.isLoggedIn;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
toggleMiniVariant() {
|
|
38
|
+
this.$store.dispatch("mapo/app/toggleSidebarMinivariant");
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
@@ -22,7 +22,7 @@ function buildRoutes(routes, defaultIcon) {
|
|
|
22
22
|
|
|
23
23
|
function nestReduce(array, defaultIcon) {
|
|
24
24
|
return array.reduce((stack, route) => {
|
|
25
|
-
const names = route.relPath.split("/");
|
|
25
|
+
const names = (route.relPath || "").split("/");
|
|
26
26
|
if (names.length === 1) {
|
|
27
27
|
stack.push(route);
|
|
28
28
|
} else {
|
|
@@ -31,7 +31,7 @@ function nestReduce(array, defaultIcon) {
|
|
|
31
31
|
if (pIndex === -1) {
|
|
32
32
|
const label = (route.meta && route.meta.parentLabel) || name
|
|
33
33
|
const icon = (route.meta && route.meta.parentIcon) || getDefaultIcon({ route, label }, defaultIcon)
|
|
34
|
-
stack.push({ name, label, icon, childrens: [] });
|
|
34
|
+
stack.push({ name, label, icon, relPath: name, childrens: [] });
|
|
35
35
|
pIndex = stack.length - 1;
|
|
36
36
|
}
|
|
37
37
|
stack[pIndex].childrens.push(
|
package/layouts/default.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-app>
|
|
3
3
|
<Sidebar />
|
|
4
|
-
<Topbar
|
|
4
|
+
<Topbar />
|
|
5
5
|
<v-main>
|
|
6
6
|
<nuxt />
|
|
7
7
|
<root-components />
|
|
@@ -9,13 +9,25 @@
|
|
|
9
9
|
</v-app>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
|
+
<style lang="scss">
|
|
13
|
+
.v-main__wrap {
|
|
14
|
+
.__nuxt-error-page {
|
|
15
|
+
background: transparent;
|
|
16
|
+
.error {
|
|
17
|
+
background: transparent !important;
|
|
18
|
+
svg {
|
|
19
|
+
// fill: #ff5252 !important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
12
25
|
|
|
13
26
|
<script>
|
|
27
|
+
import initDraggable from "@mapomodule/utils/plugins/v-draggable-modals";
|
|
14
28
|
export default {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
}
|
|
29
|
+
mounted() {
|
|
30
|
+
initDraggable();
|
|
31
|
+
},
|
|
20
32
|
};
|
|
21
|
-
</script>
|
|
33
|
+
</script>
|
package/layouts/empty.vue
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "This is part of Mapo nuxt module. Injects Mapo ui components in the nuxt component discovery system.",
|
|
6
6
|
"author": "bnznamco <gabriele.baldi.01@gmail.com>",
|
|
7
7
|
"repository": "https://github.com/lotrekagency/mapo",
|
|
8
8
|
"main": "./module.js",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@mapomodule/utils": "^1.0.0-alpha.
|
|
10
|
+
"@mapomodule/utils": "^1.0.0-alpha.13",
|
|
11
11
|
"@nuxtjs/vuetify": "^1.12.1"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "b0fac0f5ebde4c65cc5347dbb841392dc04ef5e8"
|
|
17
17
|
}
|
package/layouts/error.vue
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-app>
|
|
3
|
-
<h1 v-if="error.statusCode === 404">
|
|
4
|
-
{{ pageNotFound }}
|
|
5
|
-
</h1>
|
|
6
|
-
<h1 v-else>
|
|
7
|
-
{{ otherError }}
|
|
8
|
-
</h1>
|
|
9
|
-
<NuxtLink to="/">
|
|
10
|
-
Home page
|
|
11
|
-
</NuxtLink>
|
|
12
|
-
<root-components />
|
|
13
|
-
</v-app>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
export default {
|
|
18
|
-
layout: 'empty',
|
|
19
|
-
props: {
|
|
20
|
-
error: {
|
|
21
|
-
type: Object,
|
|
22
|
-
default: null
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
data () {
|
|
26
|
-
return {
|
|
27
|
-
pageNotFound: '404 Not Found',
|
|
28
|
-
otherError: 'An error occurred'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
head () {
|
|
32
|
-
const title =
|
|
33
|
-
this.error.statusCode === 404 ? this.pageNotFound : this.otherError
|
|
34
|
-
return {
|
|
35
|
-
title
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<style scoped>
|
|
42
|
-
h1 {
|
|
43
|
-
font-size: 20px;
|
|
44
|
-
}
|
|
45
|
-
</style>
|