@mapomodule/uikit 1.0.0-alpha.40 → 1.0.0-alpha.41
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
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.41](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.40...v1.0.0-alpha.41) (2022-12-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* hide language select if empty ([c2b6d9e](https://github.com/lotrekagency/mapo/commit/c2b6d9e9d3f96959f64f9322e3deb68eb9f8b006))
|
|
12
|
+
* **media-editor:** clone media object from store ([5f0d39a](https://github.com/lotrekagency/mapo/commit/5f0d39a033cf70d0860ae201978f65c5da0ee321))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* handle all_permissions prop in user ([14d4252](https://github.com/lotrekagency/mapo/commit/14d425215434e29f82093fc96e53b172bf247b8f))
|
|
18
|
+
* hide parent sidebar item when there aren't any accessible items ([2358b1d](https://github.com/lotrekagency/mapo/commit/2358b1d3b56813ed7a7a39541951b2e4ff66a223))
|
|
19
|
+
* **media editor:** disable save and delete button on medias without permissions ([e15bc71](https://github.com/lotrekagency/mapo/commit/e15bc718d50c9b8ef5d1bd215e3149609866dc3c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.0.0-alpha.40](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.39...v1.0.0-alpha.40) (2022-12-20)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -1,176 +1,201 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="media" class="media-editor--wrapper">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
<
|
|
3
|
+
<div class="img_overlay">
|
|
4
|
+
<v-btn
|
|
5
|
+
class="img_overlay__button img_overlay__button--back"
|
|
6
|
+
small
|
|
7
|
+
icon
|
|
8
|
+
@click="closeEditor"
|
|
9
|
+
>
|
|
10
|
+
<v-icon>mdi-arrow-left</v-icon>
|
|
11
|
+
</v-btn>
|
|
12
|
+
<v-btn
|
|
13
|
+
class="img_overlay__button img_overlay__button--href"
|
|
14
|
+
small
|
|
15
|
+
icon
|
|
16
|
+
:href="media.file"
|
|
17
|
+
target="_blank"
|
|
18
|
+
>
|
|
19
|
+
<v-icon>mdi-open-in-new</v-icon>
|
|
20
|
+
</v-btn>
|
|
21
|
+
</div>
|
|
22
|
+
<MediaPreview
|
|
23
|
+
:media="media"
|
|
24
|
+
contain
|
|
25
|
+
filename
|
|
26
|
+
media-controls
|
|
27
|
+
class="media-editor--preview elevation-2"
|
|
28
|
+
/>
|
|
29
|
+
<v-overlay absolute v-model="editing" @click="editing = false"></v-overlay>
|
|
30
|
+
<div class="dialog">
|
|
31
|
+
<div class="dialog__container">
|
|
32
|
+
<v-card
|
|
33
|
+
flat
|
|
34
|
+
tile
|
|
35
|
+
class="dialog__content overflow-y-auto"
|
|
36
|
+
:class="{ 'py-0': !editing }"
|
|
37
|
+
:max-height="editing ? height : '0px'"
|
|
38
|
+
>
|
|
39
|
+
<v-card-text class="flex-grow-0">
|
|
40
|
+
<v-row class="flex-md-row-reverse">
|
|
41
|
+
<v-col md="6" cols="12" class="info-media">
|
|
42
|
+
<table class="text-caption fill-height pb-md-10">
|
|
43
|
+
<tr>
|
|
44
|
+
<td class="pr-3">
|
|
45
|
+
<b>{{ $t("mapo.fileName") }}:</b>
|
|
46
|
+
</td>
|
|
47
|
+
<td>{{ fileName }}</td>
|
|
48
|
+
</tr>
|
|
49
|
+
<tr>
|
|
50
|
+
<td class="pr-3">
|
|
51
|
+
<b>{{ $t("mapo.mime") }}:</b>
|
|
52
|
+
</td>
|
|
53
|
+
<td>{{ media.mime_type }}</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td class="pr-3">
|
|
57
|
+
<b>{{ $t("mapo.created") }}:</b>
|
|
58
|
+
</td>
|
|
59
|
+
<td>{{ dateCreated }}</td>
|
|
60
|
+
</tr>
|
|
61
|
+
<tr>
|
|
62
|
+
<td class="pr-3">
|
|
63
|
+
<b>{{ $t("mapo.size") }}:</b>
|
|
64
|
+
</td>
|
|
65
|
+
<td>{{ fileSize }}</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td class="pr-3"><b>URL:</b></td>
|
|
69
|
+
<td>
|
|
70
|
+
<a :href="media.file" target="_blank">{{ media.file }}</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td class="pr-3">
|
|
75
|
+
<b>{{ $t("mapo.linkedModels") }}:</b>
|
|
76
|
+
</td>
|
|
77
|
+
<td>
|
|
78
|
+
<ul>
|
|
79
|
+
<li v-for="link in media.links" :key="link.id">
|
|
80
|
+
<b>{{ link.model }} (id:{{ link.id }})</b> - {{ link.name }}
|
|
81
|
+
</li>
|
|
82
|
+
</ul>
|
|
83
|
+
</td>
|
|
84
|
+
</tr>
|
|
85
|
+
</table>
|
|
86
|
+
</v-col>
|
|
87
|
+
<v-col md="6" cols="12">
|
|
88
|
+
<v-row>
|
|
89
|
+
<v-col sm="6" md="12" cols="12">
|
|
90
|
+
<v-text-field
|
|
91
|
+
dense
|
|
92
|
+
v-model="media.name"
|
|
93
|
+
:label="$t('mapo.name')"
|
|
94
|
+
:readonly="!canEdit"
|
|
95
|
+
></v-text-field>
|
|
96
|
+
</v-col>
|
|
97
|
+
<v-col sm="6" md="12" cols="12">
|
|
98
|
+
<v-text-field
|
|
99
|
+
dense
|
|
100
|
+
v-model="media.title"
|
|
101
|
+
:label="$t('mapo.titleTag')"
|
|
102
|
+
:readonly="!canEdit"
|
|
103
|
+
></v-text-field>
|
|
104
|
+
</v-col>
|
|
105
|
+
<v-col sm="6" md="12" cols="12">
|
|
106
|
+
<v-text-field
|
|
107
|
+
dense
|
|
108
|
+
v-model="media.description"
|
|
109
|
+
:label="$t('mapo.description')"
|
|
110
|
+
:readonly="!canEdit"
|
|
111
|
+
></v-text-field>
|
|
112
|
+
</v-col>
|
|
113
|
+
<v-col sm="6" md="12" cols="12">
|
|
114
|
+
<v-text-field
|
|
115
|
+
dense
|
|
116
|
+
v-model="media.alt_text"
|
|
117
|
+
:label="$t('mapo.altTag')"
|
|
118
|
+
:readonly="!canEdit"
|
|
119
|
+
></v-text-field>
|
|
120
|
+
</v-col>
|
|
121
|
+
<v-col
|
|
122
|
+
sm="6"
|
|
123
|
+
md="12"
|
|
124
|
+
cols="12"
|
|
125
|
+
class="d-flex align-center"
|
|
126
|
+
v-if="canEdit"
|
|
127
|
+
>
|
|
128
|
+
<div class="d-flex flex-column flex-grow-1">
|
|
129
|
+
<v-file-input
|
|
130
|
+
v-model="newFile"
|
|
131
|
+
:accept="accept"
|
|
132
|
+
:label="$t('mapo.mediaEditor.changeFile')"
|
|
133
|
+
show-size
|
|
71
134
|
dense
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
135
|
+
prepend-icon
|
|
136
|
+
></v-file-input>
|
|
137
|
+
<v-checkbox
|
|
138
|
+
v-if="newFile"
|
|
139
|
+
v-model="sameUrl"
|
|
140
|
+
:label="$t('mapo.mediaEditor.maintainOldUrl')"
|
|
141
|
+
class="ma-0"
|
|
142
|
+
hide-details
|
|
78
143
|
dense
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
v-if="newFile && newFilePreview"
|
|
118
|
-
:src="newFilePreview"
|
|
119
|
-
aspect-ratio="1"
|
|
120
|
-
min-width="70px"
|
|
121
|
-
max-width="110px"
|
|
122
|
-
class="grey lighten-2 ml-3"
|
|
123
|
-
>
|
|
124
|
-
<template v-slot:placeholder>
|
|
125
|
-
<v-row
|
|
126
|
-
class="fill-height ma-0"
|
|
127
|
-
align="center"
|
|
128
|
-
justify="center"
|
|
129
|
-
>
|
|
130
|
-
<v-progress-circular
|
|
131
|
-
indeterminate
|
|
132
|
-
color="grey lighten-5"
|
|
133
|
-
></v-progress-circular>
|
|
134
|
-
</v-row>
|
|
135
|
-
</template>
|
|
136
|
-
</v-img>
|
|
137
|
-
</v-col>
|
|
138
|
-
</v-row>
|
|
139
|
-
</v-col>
|
|
140
|
-
</v-row>
|
|
141
|
-
</v-card-text>
|
|
142
|
-
</v-card>
|
|
144
|
+
></v-checkbox>
|
|
145
|
+
</div>
|
|
146
|
+
<v-img
|
|
147
|
+
v-if="newFile && newFilePreview"
|
|
148
|
+
:src="newFilePreview"
|
|
149
|
+
aspect-ratio="1"
|
|
150
|
+
min-width="70px"
|
|
151
|
+
max-width="110px"
|
|
152
|
+
class="grey lighten-2 ml-3"
|
|
153
|
+
>
|
|
154
|
+
<template v-slot:placeholder>
|
|
155
|
+
<v-row class="fill-height ma-0" align="center" justify="center">
|
|
156
|
+
<v-progress-circular
|
|
157
|
+
indeterminate
|
|
158
|
+
color="grey lighten-5"
|
|
159
|
+
></v-progress-circular>
|
|
160
|
+
</v-row>
|
|
161
|
+
</template>
|
|
162
|
+
</v-img>
|
|
163
|
+
</v-col>
|
|
164
|
+
</v-row>
|
|
165
|
+
</v-col>
|
|
166
|
+
</v-row>
|
|
167
|
+
</v-card-text>
|
|
168
|
+
</v-card>
|
|
169
|
+
<v-btn
|
|
170
|
+
tile
|
|
171
|
+
depressed
|
|
172
|
+
width="100%"
|
|
173
|
+
:class="{ 'pr-0': editing }"
|
|
174
|
+
@click="editing = !editing"
|
|
175
|
+
>
|
|
176
|
+
<span>{{ canEdit ? $t("mapo.edit") : $t("mapo.mediaEditor.details") }}</span>
|
|
177
|
+
<v-icon :style="rotate">mdi-chevron-up</v-icon>
|
|
178
|
+
<div class="edit_spacer" :class="{ 'flex-grow-1': editing }"></div>
|
|
179
|
+
<v-btn v-if="editing && canEdit" text tile color="primary" @click="saveMedia">
|
|
180
|
+
{{ $t("mapo.save") }}
|
|
181
|
+
</v-btn>
|
|
143
182
|
<v-btn
|
|
183
|
+
v-if="editing && canDelete"
|
|
184
|
+
text
|
|
144
185
|
tile
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
:class="{ 'pr-0': editing }"
|
|
148
|
-
@click="editing = !editing"
|
|
186
|
+
color="error"
|
|
187
|
+
@click.stop="confirmDelete"
|
|
149
188
|
>
|
|
150
|
-
|
|
151
|
-
<v-icon :style="rotate">mdi-chevron-up</v-icon>
|
|
152
|
-
<div class="edit_spacer" :class="{ 'flex-grow-1': editing }"></div>
|
|
153
|
-
<v-btn v-if="editing" text tile color="primary" @click="saveMedia">
|
|
154
|
-
{{ $t("mapo.save") }}
|
|
155
|
-
</v-btn>
|
|
156
|
-
<v-btn
|
|
157
|
-
v-if="editing"
|
|
158
|
-
text
|
|
159
|
-
tile
|
|
160
|
-
color="error"
|
|
161
|
-
@click.stop="confirmDelete"
|
|
162
|
-
>
|
|
163
|
-
{{ $t("mapo.delete") }}
|
|
164
|
-
</v-btn>
|
|
189
|
+
{{ $t("mapo.delete") }}
|
|
165
190
|
</v-btn>
|
|
166
|
-
</
|
|
191
|
+
</v-btn>
|
|
167
192
|
</div>
|
|
193
|
+
</div>
|
|
168
194
|
</div>
|
|
169
195
|
</template>
|
|
170
196
|
|
|
171
197
|
<style lang="scss" scoped>
|
|
172
|
-
|
|
173
|
-
.media-editor--wrapper{
|
|
198
|
+
.media-editor--wrapper {
|
|
174
199
|
height: 100%;
|
|
175
200
|
display: flex;
|
|
176
201
|
flex-direction: column;
|
|
@@ -195,16 +220,17 @@ table tr td:nth-child(2) {
|
|
|
195
220
|
transition-timing-function: ease-out;
|
|
196
221
|
}
|
|
197
222
|
}
|
|
198
|
-
.media-editor--preview{
|
|
223
|
+
.media-editor--preview {
|
|
199
224
|
max-height: calc(100vh - 180px);
|
|
200
225
|
flex-grow: 1;
|
|
201
|
-
@media (max-width: 600px){
|
|
226
|
+
@media (max-width: 600px) {
|
|
202
227
|
max-height: calc(100vh - 260px);
|
|
203
|
-
min-height: calc(100vh - 260px);
|
|
228
|
+
min-height: calc(100vh - 260px);
|
|
229
|
+
}
|
|
204
230
|
}
|
|
205
|
-
.v-dialog .media-editor--preview{
|
|
231
|
+
.v-dialog .media-editor--preview {
|
|
206
232
|
max-height: calc(100vh - 510px);
|
|
207
|
-
@media (max-width: 600px){
|
|
233
|
+
@media (max-width: 600px) {
|
|
208
234
|
max-height: calc(100vh - 375px);
|
|
209
235
|
min-height: unset;
|
|
210
236
|
}
|
|
@@ -231,8 +257,9 @@ table tr td:nth-child(2) {
|
|
|
231
257
|
}
|
|
232
258
|
</style>
|
|
233
259
|
<script>
|
|
260
|
+
import { deepClone } from "@mapomodule/utils/helpers/objHelpers";
|
|
234
261
|
import { humanFileSize } from "@mapomodule/utils/helpers/formatters";
|
|
235
|
-
import { mapGetters, mapActions } from "vuex"
|
|
262
|
+
import { mapGetters, mapActions } from "vuex";
|
|
236
263
|
|
|
237
264
|
export default {
|
|
238
265
|
name: "MediaEditor",
|
|
@@ -269,25 +296,42 @@ export default {
|
|
|
269
296
|
return 425;
|
|
270
297
|
}
|
|
271
298
|
},
|
|
272
|
-
accept(){
|
|
299
|
+
accept() {
|
|
273
300
|
switch (this.media.mime_type && this.media.mime_type.split("/")[0]) {
|
|
274
301
|
case "image":
|
|
275
|
-
return "image/*"
|
|
302
|
+
return "image/*";
|
|
276
303
|
case "video":
|
|
277
|
-
return "video/*"
|
|
304
|
+
return "video/*";
|
|
278
305
|
case "audio":
|
|
279
|
-
return "audio/*"
|
|
306
|
+
return "audio/*";
|
|
280
307
|
default:
|
|
281
|
-
return "*"
|
|
308
|
+
return "*";
|
|
282
309
|
}
|
|
283
310
|
},
|
|
284
311
|
newFilePreview() {
|
|
285
|
-
return this.newFile.type.startsWith("image/")
|
|
312
|
+
return this.newFile.type.startsWith("image/")
|
|
313
|
+
? URL.createObjectURL(this.newFile)
|
|
314
|
+
: null;
|
|
315
|
+
},
|
|
316
|
+
permissionsModel() {
|
|
317
|
+
return this.$mapo.$options?.medias?.permissionsModel || "media";
|
|
318
|
+
},
|
|
319
|
+
canEdit() {
|
|
320
|
+
return this.$store.getters["mapo/user/hasModelPermission"](
|
|
321
|
+
this.permissionsModel,
|
|
322
|
+
"change"
|
|
323
|
+
);
|
|
324
|
+
},
|
|
325
|
+
canDelete() {
|
|
326
|
+
return this.$store.getters["mapo/user/hasModelPermission"](
|
|
327
|
+
this.permissionsModel,
|
|
328
|
+
"delete"
|
|
329
|
+
);
|
|
286
330
|
},
|
|
287
331
|
},
|
|
288
332
|
watch: {
|
|
289
333
|
editMedia(val) {
|
|
290
|
-
this.media = val;
|
|
334
|
+
this.media = deepClone(val);
|
|
291
335
|
this.editing = false;
|
|
292
336
|
this.newFile = null;
|
|
293
337
|
this.sameUrl = false;
|
|
@@ -304,7 +348,7 @@ export default {
|
|
|
304
348
|
alt_text: this.media.alt_text,
|
|
305
349
|
file: this.newFile || undefined,
|
|
306
350
|
same_url: (this.newFile && this.sameUrl) || undefined,
|
|
307
|
-
language_code: this.$i18n.locale
|
|
351
|
+
language_code: this.$i18n.locale,
|
|
308
352
|
}).then(() => {
|
|
309
353
|
this.newFile = null;
|
|
310
354
|
this.sameUrl = false;
|
|
@@ -315,10 +359,13 @@ export default {
|
|
|
315
359
|
.open({
|
|
316
360
|
title: this.$t("mapo.delete"),
|
|
317
361
|
question: this.$t("mapo.mediaEditor.confirmDelete"),
|
|
318
|
-
approveButton: {
|
|
362
|
+
approveButton: {
|
|
363
|
+
text: this.$t("mapo.delete"),
|
|
364
|
+
attrs: { color: "red", text: true },
|
|
365
|
+
},
|
|
319
366
|
})
|
|
320
367
|
.then((res) => res && this.deleteMedia(this.media));
|
|
321
|
-
}
|
|
368
|
+
},
|
|
322
369
|
},
|
|
323
370
|
};
|
|
324
371
|
</script>
|
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
>
|
|
24
24
|
</v-list-item>
|
|
25
25
|
|
|
26
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
class="child-menu"
|
|
28
|
+
:style="indent"
|
|
29
|
+
v-if="childrens.length && expanded && !forceCollapse"
|
|
30
|
+
>
|
|
27
31
|
<SidebarListItem
|
|
28
32
|
v-for="(item, i) in childrens"
|
|
29
33
|
:key="i"
|
|
@@ -44,15 +48,15 @@
|
|
|
44
48
|
<style lang="scss" scoped>
|
|
45
49
|
@import "@mapomodule/uikit/assets/variables.scss";
|
|
46
50
|
|
|
47
|
-
.v-list-item::after{
|
|
48
|
-
content:
|
|
51
|
+
.v-list-item::after {
|
|
52
|
+
content: "";
|
|
49
53
|
position: absolute;
|
|
50
54
|
background: rgba(0, 0, 0, 0.2);
|
|
51
55
|
height: 100%;
|
|
52
56
|
width: 4px;
|
|
53
57
|
left: 0;
|
|
54
58
|
}
|
|
55
|
-
.v-list-item.v-list-item--active::after{
|
|
59
|
+
.v-list-item.v-list-item--active::after {
|
|
56
60
|
background: var(--v-primary-base);
|
|
57
61
|
}
|
|
58
62
|
.expand-icon {
|
|
@@ -110,7 +114,7 @@
|
|
|
110
114
|
border-bottom-left-radius: 3px;
|
|
111
115
|
}
|
|
112
116
|
}
|
|
113
|
-
.child-menu{
|
|
117
|
+
.child-menu {
|
|
114
118
|
&::after {
|
|
115
119
|
height: 0px;
|
|
116
120
|
}
|
|
@@ -131,7 +135,8 @@ export default {
|
|
|
131
135
|
indent() {
|
|
132
136
|
return {
|
|
133
137
|
paddingLeft: `calc(1rem + ${+this.depth * this.nestDepth}px)`,
|
|
134
|
-
marginLeft:
|
|
138
|
+
marginLeft:
|
|
139
|
+
this.depth > 1 && `calc(-1rem - ${(this.depth - 1) * this.nestDepth}px)`,
|
|
135
140
|
};
|
|
136
141
|
},
|
|
137
142
|
rotate() {
|
|
@@ -141,21 +146,28 @@ export default {
|
|
|
141
146
|
};
|
|
142
147
|
},
|
|
143
148
|
activeChild() {
|
|
144
|
-
return (this.childrens || []).some((child) =>
|
|
149
|
+
return (this.childrens || []).some((child) =>
|
|
150
|
+
this.$nuxt.$route.path.startsWith(child.link)
|
|
151
|
+
);
|
|
145
152
|
},
|
|
146
153
|
userCanSee() {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
return this.checkPermissions();
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
methods: {
|
|
158
|
+
checkPermissions(child = undefined) {
|
|
159
|
+
const item = child || this;
|
|
160
|
+
const middleware = this.$mapo.$auth.getRouteMiddlewares({ meta: item.meta });
|
|
161
|
+
if (middleware.includes("permissions")) {
|
|
162
|
+
const { model } = item.meta?.permissions || {};
|
|
163
|
+
return this.$store.getters["mapo/user/hasModelPermission"](model, "view");
|
|
154
164
|
}
|
|
155
|
-
if (middleware.includes("auth")){
|
|
156
|
-
return this.$mapo.$auth.user.isLoggedIn
|
|
165
|
+
if (middleware.includes("auth")) {
|
|
166
|
+
return this.$mapo.$auth.user.isLoggedIn;
|
|
157
167
|
}
|
|
158
|
-
return
|
|
168
|
+
return (
|
|
169
|
+
item.childrens.length == 0 || item.childrens.some((c) => this.checkPermissions(c))
|
|
170
|
+
);
|
|
159
171
|
},
|
|
160
172
|
},
|
|
161
173
|
props: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.41",
|
|
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>",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "9f6bc45ab0ae3b56ed6fa98597c80808efced174"
|
|
19
19
|
}
|
package/translations/en-US.js
CHANGED
|
@@ -109,10 +109,11 @@ export default {
|
|
|
109
109
|
changeFile: "Change File",
|
|
110
110
|
maintainOldUrl: "Maintain old URL",
|
|
111
111
|
confirmDelete: "Are you sure you want to delete this media?",
|
|
112
|
+
details: "Details",
|
|
112
113
|
},
|
|
113
114
|
// MediaManager/MediaFolders.vue
|
|
114
115
|
mediaFolders: {
|
|
115
|
-
goBack: "Go back",
|
|
116
|
+
goBack: "Go back",
|
|
116
117
|
noFolders: "No folders here... Create a new one!",
|
|
117
118
|
newFolder: "Add new folder",
|
|
118
119
|
editFolder: "Edit folder",
|
package/translations/it-IT.js
CHANGED
|
@@ -111,10 +111,11 @@ export default {
|
|
|
111
111
|
changeFile: "Cambia File",
|
|
112
112
|
maintainOldUrl: "Mantieni URL precedente",
|
|
113
113
|
confirmDelete: "Vuoi veramente eliminare questo media?",
|
|
114
|
+
details: "Dettagli",
|
|
114
115
|
},
|
|
115
116
|
// MediaManager/MediaFolders.vue
|
|
116
117
|
mediaFolders: {
|
|
117
|
-
goBack: "Torna indietro",
|
|
118
|
+
goBack: "Torna indietro",
|
|
118
119
|
noFolders: "Non sono presenti cartelle... Creane una!",
|
|
119
120
|
newFolder: "Crea nuova cartella",
|
|
120
121
|
editFolder: "Modifica cartella",
|