@tager/admin-blog 1.0.3 → 1.0.4
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/dist/dev/App.vue.d.ts +4 -3
- package/dist/hooks/useFetchCategories.d.ts +2 -2
- package/dist/hooks/useFetchCategory.d.ts +3 -3
- package/dist/hooks/useFetchModuleConfig.d.ts +2 -2
- package/dist/hooks/useFetchPosts.d.ts +2 -2
- package/dist/index.mjs +1402 -1637
- package/dist/services/requests.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/typings/common.d.ts +1 -1
- package/dist/typings/model.d.ts +3 -3
- package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +4 -4
- package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +5 -4
- package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +4 -4
- package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +5 -4
- package/dist/views/Categories/CategoryList/hooks/useAdvancedSearch.d.ts +5 -5
- package/dist/views/Posts/PostForm/PostForm.helpers.d.ts +6 -6
- package/dist/views/Posts/PostForm/PostForm.vue.d.ts +1853 -372
- package/dist/views/Posts/PostList/PostList.helpers.d.ts +4 -4
- package/dist/views/Posts/PostList/PostList.vue.d.ts +6 -5
- package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +5 -5
- package/package.json +20 -24
- package/src/dev/App.vue +1 -1
- package/src/dev/env.ts +11 -11
- package/src/hooks/useFetchCategories.ts +2 -2
- package/src/hooks/useFetchCategory.ts +3 -3
- package/src/hooks/useFetchModuleConfig.ts +2 -2
- package/src/hooks/useFetchPosts.ts +2 -2
- package/src/services/requests.ts +7 -7
- package/src/typings/model.ts +7 -7
- package/src/views/Categories/CategoryForm/CategoryForm.helpers.ts +6 -6
- package/src/views/Categories/CategoryForm/CategoryForm.vue +7 -7
- package/src/views/Categories/CategoryList/CategoryList.helpers.ts +4 -4
- package/src/views/Categories/CategoryList/CategoryList.vue +1 -1
- package/src/views/Categories/CategoryList/hooks/useAdvancedSearch.ts +6 -6
- package/src/views/Posts/PostForm/PostForm.helpers.ts +8 -8
- package/src/views/Posts/PostForm/PostForm.vue +12 -12
- package/src/views/Posts/PostList/PostList.helpers.ts +7 -7
- package/src/views/Posts/PostList/PostList.vue +7 -7
- package/src/views/Posts/PostList/hooks/useAdvancedSearch.ts +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { i18n, request, useResource, createId, notEmpty, isNotNullish, useI18n, useResourceDelete, useResourceClone, useToast, navigateBack, convertRequestErrorToMap
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getFilterParamAsStringArray, getFilterParamAsString, getFilterParams
|
|
7
|
-
import { Page } from "@tager/admin-layout";
|
|
8
|
-
import { universalFieldUtils, DynamicField } from "@tager/admin-dynamic-field";
|
|
9
|
-
import { compile } from "path-to-regexp";
|
|
1
|
+
import { i18n as Ue, request as R, useResource as te, createId as ee, notEmpty as ke, isNotNullish as Fe, useI18n as ue, useResourceDelete as Re, useResourceClone as sa, useToast as we, urlTranslit as Me, navigateBack as Ge, convertRequestErrorToMap as Ne, getWebsiteOrigin as qe } from "@tager/admin-services";
|
|
2
|
+
import { useRoute as ge, useRouter as de } from "vue-router";
|
|
3
|
+
import { onMounted as oe, watch as G, computed as r, ref as E, defineComponent as pe, resolveComponent as y, openBlock as T, createBlock as M, withCtx as A, createVNode as p, createElementVNode as Y, toDisplayString as x, createElementBlock as Q, createTextVNode as Se, createCommentVNode as B, withModifiers as Ve, Fragment as J, renderList as ra, createSlots as ia } from "vue";
|
|
4
|
+
import We from "lodash.isequal";
|
|
5
|
+
import ua from "lodash.pick";
|
|
6
|
+
import { getFilterParamAsStringArray as ie, getFilterParamAsString as Be, getFilterParams as He, DataTable as ze, AdvancedSearch as Ye, FormFieldMultiSelect as Le, FormField as Te, BaseButton as Qe, EditIcon as Ke, ContentCopyIcon as ga, DeleteIcon as je, useDataTable as Ze, formatDateTime as da, FormFooter as Je, ShortCodeConstructor as pa, FormFieldSelect as Xe, FormFieldUrlAliasInput as _e, FormFieldCheckbox as xe, FormFieldRichTextInput as ma, FormFieldFileInput as ca, SeoFieldGroup as ea, formatDate as ba, createTabErrorFinder as va, CountButton as fa, NorthIcon as ya, SouthIcon as ha, TabList as Ca } from "@tager/admin-ui";
|
|
7
|
+
import { Page as me } from "@tager/admin-layout";
|
|
8
|
+
import { universalFieldUtils as De, DynamicField as Fa } from "@tager/admin-dynamic-field";
|
|
9
|
+
import { compile as aa } from "path-to-regexp";
|
|
10
10
|
import "i18next";
|
|
11
|
-
const
|
|
11
|
+
const Sa = {
|
|
12
12
|
yes: "Yes",
|
|
13
13
|
no: "no",
|
|
14
14
|
blog: "Blog",
|
|
@@ -99,244 +99,230 @@ const EN = {
|
|
|
99
99
|
sortTitleAsc: "Title - A-Z",
|
|
100
100
|
sortTitleDesc: "Title - Z-A",
|
|
101
101
|
sortStatus: "Status"
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
cloneFailure: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",
|
|
102
|
+
}, Da = {
|
|
103
|
+
yes: "Да",
|
|
104
|
+
no: "Нет",
|
|
105
|
+
blog: "Блог",
|
|
106
|
+
posts: "Посты",
|
|
107
|
+
categories: "Категории",
|
|
108
|
+
createPost: "Создать пост",
|
|
109
|
+
createCategory: "Создать категорию",
|
|
110
|
+
home: "Главная",
|
|
111
|
+
allPosts: "Все посты",
|
|
112
|
+
postForm: "Форма поста",
|
|
113
|
+
allCategories: "Все категории",
|
|
114
|
+
categoryForm: "Форма категории",
|
|
115
|
+
success: "Успех",
|
|
116
|
+
error: "Ошибка",
|
|
117
|
+
newPost: "Новый пост",
|
|
118
|
+
edit: "Редактировать",
|
|
119
|
+
remove: "Удалить",
|
|
120
|
+
postsByCategory: "Посты по категориям",
|
|
121
|
+
name: "Заголовок",
|
|
122
|
+
image: "Изображение",
|
|
123
|
+
language: "Язык",
|
|
124
|
+
languages: "Языки",
|
|
125
|
+
date: "Дата",
|
|
126
|
+
dateOfPublication: "Дата публикации",
|
|
127
|
+
dateOfPublicationFrom: "Дата публикации - От",
|
|
128
|
+
dateOfPublicationTo: "Дата публикации - До",
|
|
129
|
+
from: "от",
|
|
130
|
+
to: "до",
|
|
131
|
+
From: "От",
|
|
132
|
+
To: "До",
|
|
133
|
+
category: "Категория",
|
|
134
|
+
actions: "Действия",
|
|
135
|
+
updatePost: "Обновить пост",
|
|
136
|
+
title: "Заголовок",
|
|
137
|
+
link: "Ссылка",
|
|
138
|
+
excerpt: "Краткое описание",
|
|
139
|
+
defaultCategory: "Категория по-умолчанию",
|
|
140
|
+
body: "Содержание",
|
|
141
|
+
coverImage: "Обложка",
|
|
142
|
+
innerImage: "Картинка поста",
|
|
143
|
+
innerImageMobile: "Картинка поста (Mobile)",
|
|
144
|
+
tags: "Теги",
|
|
145
|
+
relatedPosts: "Похожие посты",
|
|
146
|
+
blogPostWasSuccessfullyCreated: "Запись в блоге успешно создана",
|
|
147
|
+
blogPostWasSuccessfullyUpdated: "Запись в блоге успешно обновлено",
|
|
148
|
+
blogPostCreationWasFailed: "Не удалось создать запись в блоге",
|
|
149
|
+
blogPostUpdateWasFailed: "Не удалось обновить запись в блоге",
|
|
150
|
+
common: "Общие",
|
|
151
|
+
images: "Картинки",
|
|
152
|
+
relations: "Связи",
|
|
153
|
+
additionalFields: "Дополнительные поля",
|
|
154
|
+
viewPost: "Посмотреть пост",
|
|
155
|
+
blogCategories: "Категории",
|
|
156
|
+
newCategory: "Новая категория",
|
|
157
|
+
moveUp: "Двигаться вверх",
|
|
158
|
+
moveDown: "Двигаться вниз",
|
|
159
|
+
createBlogCategory: "Создать категорию блога",
|
|
160
|
+
updateBlogCategory: "Обновить категорию блога",
|
|
161
|
+
pageTitle: "Заголовок страницы",
|
|
162
|
+
pageDescription: "Описание страницы",
|
|
163
|
+
openGraphImage: "Картинка страницы",
|
|
164
|
+
blogCategoryWasSuccessfullyCreated: "Категория блога была успешно создана",
|
|
165
|
+
blogCategoryWasSuccessfullyUpdated: "Категория блога успешно обновлена",
|
|
166
|
+
blogCategoryCreationWasFailed: "Не удалось создать категорию блога",
|
|
167
|
+
blogCategoryUpdateWasFailed: "Не удалось обновить категорию блога",
|
|
168
|
+
clone: "Клонировать",
|
|
169
|
+
cloneConfirm: "Вы уверены, что хотите создать копию страницы?",
|
|
170
|
+
cloneSuccess: "Копия страницы успешно создана",
|
|
171
|
+
cloneFailure: "Ошибка копирования страницы",
|
|
173
172
|
tabs: {
|
|
174
|
-
common: "
|
|
173
|
+
common: "Общие",
|
|
175
174
|
seo: "SEO"
|
|
176
175
|
},
|
|
177
|
-
parentCategory: "
|
|
178
|
-
noParent: "
|
|
179
|
-
status: "
|
|
180
|
-
statusPublished: "
|
|
181
|
-
statusDraft: "
|
|
182
|
-
statusArchived: "
|
|
183
|
-
scheduleArchive: "
|
|
184
|
-
schedulePublish: "
|
|
185
|
-
archiveAt: "
|
|
186
|
-
publishAt: "
|
|
187
|
-
archiveAtLabel: "
|
|
188
|
-
publishAtLabel: "
|
|
189
|
-
sortDateTimeAsc: "
|
|
190
|
-
sortDateTimeDesc: "
|
|
191
|
-
sortTitleAsc: "
|
|
192
|
-
sortTitleDesc: "
|
|
193
|
-
sortStatus: "
|
|
176
|
+
parentCategory: "Родительская категория",
|
|
177
|
+
noParent: "Нет родительской",
|
|
178
|
+
status: "Статус",
|
|
179
|
+
statusPublished: "Опубликован",
|
|
180
|
+
statusDraft: "Черновик",
|
|
181
|
+
statusArchived: "В архиве",
|
|
182
|
+
scheduleArchive: "Запланировать перенос в архив",
|
|
183
|
+
schedulePublish: "Запланировать публикацию",
|
|
184
|
+
archiveAt: "Перенести в архив в",
|
|
185
|
+
publishAt: "Опубликовать в",
|
|
186
|
+
archiveAtLabel: "Перенос в архив",
|
|
187
|
+
publishAtLabel: "Публикация",
|
|
188
|
+
sortDateTimeAsc: "Дате - По возрастанию",
|
|
189
|
+
sortDateTimeDesc: "Дате - По убыванию",
|
|
190
|
+
sortTitleAsc: "Заголовку - А-Я",
|
|
191
|
+
sortTitleDesc: "Заголовку - Я-А",
|
|
192
|
+
sortStatus: "Статусу"
|
|
194
193
|
};
|
|
195
|
-
function
|
|
196
|
-
|
|
197
|
-
i18n.addTranslations("ru", "blog", RU);
|
|
194
|
+
function Pa() {
|
|
195
|
+
Ue.addTranslations("en", "blog", Sa), Ue.addTranslations("ru", "blog", Da);
|
|
198
196
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
197
|
+
function ta(e) {
|
|
198
|
+
return R.get({ path: "/admin/blog/posts", params: e });
|
|
201
199
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
200
|
+
function Ot() {
|
|
201
|
+
return R.get({ path: "/admin/blog/posts/count" });
|
|
204
202
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
203
|
+
function La(e) {
|
|
204
|
+
return R.get({ path: `/admin/blog/posts/${e}` });
|
|
207
205
|
}
|
|
208
|
-
function
|
|
209
|
-
return
|
|
206
|
+
function Ta(e) {
|
|
207
|
+
return R.post({ path: `/admin/blog/posts/${e}/clone` });
|
|
210
208
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
209
|
+
function Ia(e) {
|
|
210
|
+
return R.post({ path: "/admin/blog/posts", body: e });
|
|
213
211
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
212
|
+
function Aa(e, a) {
|
|
213
|
+
return R.put({ path: `/admin/blog/posts/${e}`, body: a });
|
|
216
214
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
215
|
+
function $a(e) {
|
|
216
|
+
return R.delete({ path: `/admin/blog/posts/${e}` });
|
|
219
217
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
218
|
+
function oa(e) {
|
|
219
|
+
return R.get({ path: "/admin/blog/categories", params: e });
|
|
222
220
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
221
|
+
function Oa(e) {
|
|
222
|
+
return R.get({ path: `/admin/blog/categories/${e}` });
|
|
225
223
|
}
|
|
226
|
-
function
|
|
227
|
-
return
|
|
224
|
+
function Ua(e) {
|
|
225
|
+
return R.post({ path: "/admin/blog/categories", body: e });
|
|
228
226
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
231
|
-
path: `/admin/blog/categories/${
|
|
232
|
-
body:
|
|
227
|
+
function Ba(e, a) {
|
|
228
|
+
return R.put({
|
|
229
|
+
path: `/admin/blog/categories/${e}`,
|
|
230
|
+
body: a
|
|
233
231
|
});
|
|
234
232
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
237
|
-
path: `/admin/blog/categories/${
|
|
233
|
+
function Ea(e) {
|
|
234
|
+
return R.delete({
|
|
235
|
+
path: `/admin/blog/categories/${e}`
|
|
238
236
|
});
|
|
239
237
|
}
|
|
240
|
-
function
|
|
241
|
-
return
|
|
242
|
-
path: `/admin/blog/categories/move/${
|
|
238
|
+
function ka(e, a) {
|
|
239
|
+
return R.post({
|
|
240
|
+
path: `/admin/blog/categories/move/${e}/${a}`
|
|
243
241
|
});
|
|
244
242
|
}
|
|
245
|
-
function
|
|
246
|
-
return
|
|
247
|
-
path:
|
|
243
|
+
function Ra() {
|
|
244
|
+
return R.get({
|
|
245
|
+
path: "/admin/blog/module-info"
|
|
248
246
|
});
|
|
249
247
|
}
|
|
250
|
-
function
|
|
251
|
-
const [
|
|
252
|
-
fetchResource: () =>
|
|
248
|
+
function wa() {
|
|
249
|
+
const [e, a] = te({
|
|
250
|
+
fetchResource: () => ta({ pageNumber: 1, pageSize: 99999, sort: "status" }),
|
|
253
251
|
initialValue: [],
|
|
254
252
|
resourceName: "Blog posts"
|
|
255
253
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
});
|
|
259
|
-
return resource;
|
|
254
|
+
return oe(() => {
|
|
255
|
+
e();
|
|
256
|
+
}), a;
|
|
260
257
|
}
|
|
261
|
-
function
|
|
262
|
-
categoryId,
|
|
263
|
-
isCreation
|
|
258
|
+
function Ma({
|
|
259
|
+
categoryId: e,
|
|
260
|
+
isCreation: a
|
|
264
261
|
}) {
|
|
265
|
-
const [
|
|
266
|
-
fetchResource: () =>
|
|
262
|
+
const [n, o] = te({
|
|
263
|
+
fetchResource: () => Oa(e.value),
|
|
267
264
|
initialValue: null,
|
|
268
265
|
resourceName: "Blog category"
|
|
269
266
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
});
|
|
276
|
-
watch(categoryId, () => {
|
|
277
|
-
if (isCreation.value || !categoryId.value) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
fetchCategory();
|
|
281
|
-
});
|
|
282
|
-
return resource;
|
|
267
|
+
return oe(() => {
|
|
268
|
+
a.value || !e.value || n();
|
|
269
|
+
}), G(e, () => {
|
|
270
|
+
a.value || !e.value || n();
|
|
271
|
+
}), o;
|
|
283
272
|
}
|
|
284
|
-
function
|
|
285
|
-
const [
|
|
286
|
-
fetchResource:
|
|
273
|
+
function Ie() {
|
|
274
|
+
const [e, a] = te({
|
|
275
|
+
fetchResource: oa,
|
|
287
276
|
initialValue: [],
|
|
288
277
|
resourceName: "Blog categories"
|
|
289
278
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
});
|
|
293
|
-
return resource;
|
|
279
|
+
return oe(() => {
|
|
280
|
+
e();
|
|
281
|
+
}), a;
|
|
294
282
|
}
|
|
295
|
-
function
|
|
296
|
-
const [
|
|
297
|
-
fetchResource:
|
|
283
|
+
function ce() {
|
|
284
|
+
const [e, a] = te({
|
|
285
|
+
fetchResource: Ra,
|
|
298
286
|
initialValue: null,
|
|
299
287
|
resourceName: "Module configuration"
|
|
300
288
|
});
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
});
|
|
304
|
-
return resource;
|
|
289
|
+
return oe(() => {
|
|
290
|
+
e();
|
|
291
|
+
}), a;
|
|
305
292
|
}
|
|
306
|
-
const
|
|
293
|
+
const N = {
|
|
307
294
|
POST_LIST: "/blog/posts",
|
|
308
295
|
POST_FORM: "/blog/posts/:postId",
|
|
309
296
|
CATEGORY_LIST: "/blog/categories",
|
|
310
297
|
CATEGORY_FORM: "/blog/categories/:categoryId"
|
|
311
298
|
};
|
|
312
|
-
function
|
|
313
|
-
return
|
|
299
|
+
function Pe() {
|
|
300
|
+
return N.POST_LIST;
|
|
314
301
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
302
|
+
function Ae(e) {
|
|
303
|
+
return aa(N.POST_FORM)({ postId: e.postId });
|
|
317
304
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
305
|
+
function Ee() {
|
|
306
|
+
return N.CATEGORY_LIST;
|
|
320
307
|
}
|
|
321
|
-
function
|
|
322
|
-
return
|
|
323
|
-
categoryId:
|
|
308
|
+
function $e(e) {
|
|
309
|
+
return aa(N.CATEGORY_FORM)({
|
|
310
|
+
categoryId: e.categoryId
|
|
324
311
|
});
|
|
325
312
|
}
|
|
326
|
-
function
|
|
327
|
-
return Array.from({ length }, (
|
|
313
|
+
function Ga(e) {
|
|
314
|
+
return Array.from({ length: e }, (a, n) => n);
|
|
328
315
|
}
|
|
329
|
-
function
|
|
330
|
-
return
|
|
316
|
+
function ae(e, a) {
|
|
317
|
+
return Ga(a).map(() => "—").join(" ") + " " + e;
|
|
331
318
|
}
|
|
332
|
-
const
|
|
333
|
-
{ label:
|
|
334
|
-
{ label:
|
|
335
|
-
{ label:
|
|
319
|
+
const la = (e) => [
|
|
320
|
+
{ label: e("blog:statusPublished"), value: "PUBLISHED" },
|
|
321
|
+
{ label: e("blog:statusDraft"), value: "DRAFT" },
|
|
322
|
+
{ label: e("blog:statusArchived"), value: "ARCHIVED" }
|
|
336
323
|
];
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
if (!post) {
|
|
324
|
+
function he(e, a, n, o, t) {
|
|
325
|
+
if (!e)
|
|
340
326
|
return {
|
|
341
327
|
title: "",
|
|
342
328
|
excerpt: "",
|
|
@@ -353,119 +339,116 @@ function convertPostToFormValues(post, languageOptionList, postOptionList, addit
|
|
|
353
339
|
language: null,
|
|
354
340
|
relatedPosts: [],
|
|
355
341
|
tags: "",
|
|
356
|
-
additionalFields:
|
|
357
|
-
(
|
|
342
|
+
additionalFields: o.map(
|
|
343
|
+
(s) => De.createFormField(s, null)
|
|
358
344
|
),
|
|
359
|
-
status:
|
|
360
|
-
statusDateEnabled:
|
|
345
|
+
status: t[0],
|
|
346
|
+
statusDateEnabled: !1,
|
|
361
347
|
statusDate: null
|
|
362
348
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
(option) => post.relatedPosts.some((relatedPost) => relatedPost.id === option.value)
|
|
369
|
-
);
|
|
370
|
-
const foundStatus = (_a = statusOptions.find(({ value }) => value === post.status)) != null ? _a : statusOptions[0];
|
|
349
|
+
const d = a.find(
|
|
350
|
+
(s) => s.value === e.language
|
|
351
|
+
), c = n.filter(
|
|
352
|
+
(s) => e.relatedPosts.some((b) => b.id === s.value)
|
|
353
|
+
), C = t.find(({ value: s }) => s === e.status) ?? t[0];
|
|
371
354
|
return {
|
|
372
|
-
title:
|
|
373
|
-
excerpt:
|
|
374
|
-
body:
|
|
375
|
-
datetime:
|
|
376
|
-
coverImage:
|
|
377
|
-
image:
|
|
378
|
-
imageMobile:
|
|
379
|
-
pageTitle:
|
|
380
|
-
pageDescription:
|
|
381
|
-
openGraphImage:
|
|
382
|
-
urlAlias:
|
|
383
|
-
categories:
|
|
384
|
-
value:
|
|
385
|
-
label:
|
|
355
|
+
title: e.title,
|
|
356
|
+
excerpt: e.excerpt,
|
|
357
|
+
body: e.body,
|
|
358
|
+
datetime: e.datetime ? e.datetime.substr(0, 10) : "",
|
|
359
|
+
coverImage: e.coverImage ? { id: ee(), file: e.coverImage } : null,
|
|
360
|
+
image: e.image ? { id: ee(), file: e.image } : null,
|
|
361
|
+
imageMobile: e.imageMobile ? { id: ee(), file: e.imageMobile } : null,
|
|
362
|
+
pageTitle: e.pageTitle ?? "",
|
|
363
|
+
pageDescription: e.pageDescription ?? "",
|
|
364
|
+
openGraphImage: e.openGraphImage ? { id: ee(), file: e.openGraphImage } : null,
|
|
365
|
+
urlAlias: e.urlAlias,
|
|
366
|
+
categories: e.categories.map((s) => ({
|
|
367
|
+
value: s.id,
|
|
368
|
+
label: s.name
|
|
386
369
|
})),
|
|
387
|
-
language:
|
|
388
|
-
relatedPosts:
|
|
389
|
-
tags:
|
|
390
|
-
additionalFields:
|
|
391
|
-
const
|
|
392
|
-
({ name }) =>
|
|
370
|
+
language: d ?? null,
|
|
371
|
+
relatedPosts: c,
|
|
372
|
+
tags: e.tags.join(","),
|
|
373
|
+
additionalFields: o.map((s) => {
|
|
374
|
+
const b = e.additionalFields.find(
|
|
375
|
+
({ name: v }) => v === s.name
|
|
393
376
|
);
|
|
394
|
-
return
|
|
395
|
-
|
|
396
|
-
|
|
377
|
+
return De.createFormField(
|
|
378
|
+
s,
|
|
379
|
+
b == null ? void 0 : b.value
|
|
397
380
|
);
|
|
398
381
|
}),
|
|
399
|
-
status:
|
|
400
|
-
statusDateEnabled:
|
|
401
|
-
statusDate:
|
|
382
|
+
status: C,
|
|
383
|
+
statusDateEnabled: e.status === "PUBLISHED" ? !!e.archiveAt : e.status === "DRAFT" ? !!e.publishAt : !1,
|
|
384
|
+
statusDate: e.status === "PUBLISHED" && e.archiveAt ? e.archiveAt.substr(0, 10) : e.status === "DRAFT" && e.publishAt ? e.publishAt.substr(0, 10) : null
|
|
402
385
|
};
|
|
403
386
|
}
|
|
404
|
-
function
|
|
405
|
-
var
|
|
387
|
+
function na(e) {
|
|
388
|
+
var a, n, o, t, d;
|
|
406
389
|
return {
|
|
407
|
-
title:
|
|
408
|
-
excerpt:
|
|
409
|
-
urlAlias:
|
|
410
|
-
body:
|
|
411
|
-
datetime:
|
|
412
|
-
coverImage: (
|
|
413
|
-
image: (
|
|
414
|
-
imageMobile: (
|
|
415
|
-
pageTitle:
|
|
416
|
-
pageDescription:
|
|
417
|
-
openGraphImage: (
|
|
418
|
-
categories:
|
|
419
|
-
language: (
|
|
420
|
-
relatedPosts:
|
|
421
|
-
(
|
|
390
|
+
title: e.title,
|
|
391
|
+
excerpt: e.excerpt,
|
|
392
|
+
urlAlias: e.urlAlias,
|
|
393
|
+
body: e.body,
|
|
394
|
+
datetime: e.datetime,
|
|
395
|
+
coverImage: ((a = e.coverImage) == null ? void 0 : a.file.id) ?? null,
|
|
396
|
+
image: ((n = e.image) == null ? void 0 : n.file.id) ?? null,
|
|
397
|
+
imageMobile: ((o = e.imageMobile) == null ? void 0 : o.file.id) ?? null,
|
|
398
|
+
pageTitle: e.pageTitle,
|
|
399
|
+
pageDescription: e.pageDescription,
|
|
400
|
+
openGraphImage: ((t = e.openGraphImage) == null ? void 0 : t.file.id) ?? null,
|
|
401
|
+
categories: e.categories.map((c) => c.value),
|
|
402
|
+
language: ((d = e.language) == null ? void 0 : d.value) ?? null,
|
|
403
|
+
relatedPosts: e.relatedPosts.map(
|
|
404
|
+
(c) => c.value
|
|
422
405
|
),
|
|
423
|
-
tags:
|
|
424
|
-
additionalFields:
|
|
425
|
-
name:
|
|
426
|
-
value:
|
|
406
|
+
tags: e.tags.split(",").filter((c) => c.trim().length > 0),
|
|
407
|
+
additionalFields: e.additionalFields.map((c) => ({
|
|
408
|
+
name: c.config.name,
|
|
409
|
+
value: De.getOutgoingValue(c)
|
|
427
410
|
})),
|
|
428
|
-
status:
|
|
429
|
-
archiveAt:
|
|
430
|
-
publishAt:
|
|
411
|
+
status: e.status.value,
|
|
412
|
+
archiveAt: e.status.value === "PUBLISHED" && e.statusDateEnabled && e.statusDate ? e.statusDate : null,
|
|
413
|
+
publishAt: e.status.value === "DRAFT" && e.statusDateEnabled && e.statusDate ? e.statusDate : null
|
|
431
414
|
};
|
|
432
415
|
}
|
|
433
|
-
function
|
|
416
|
+
function Na(e) {
|
|
434
417
|
return {
|
|
435
|
-
...
|
|
436
|
-
urlAlias:
|
|
418
|
+
...na(e),
|
|
419
|
+
urlAlias: e.urlAlias
|
|
437
420
|
};
|
|
438
421
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
441
|
-
value:
|
|
442
|
-
label:
|
|
422
|
+
function qa(e, a) {
|
|
423
|
+
return e.filter(({ language: n }) => a ? n === a : !0).map(({ id: n, name: o, depth: t }) => ({
|
|
424
|
+
value: n,
|
|
425
|
+
label: ae(o, t)
|
|
443
426
|
}));
|
|
444
427
|
}
|
|
445
|
-
function
|
|
446
|
-
return
|
|
447
|
-
(
|
|
448
|
-
).map((
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
428
|
+
function Va(e, a, n) {
|
|
429
|
+
return e.filter(
|
|
430
|
+
(o) => a ? o.categories.some(({ id: t }) => t === a.id) : !0
|
|
431
|
+
).map((o) => {
|
|
432
|
+
if (n.length > 0) {
|
|
433
|
+
const t = n.find(({ id: d }) => d === o.language);
|
|
451
434
|
return {
|
|
452
|
-
...
|
|
453
|
-
language:
|
|
435
|
+
...o,
|
|
436
|
+
language: t ? t.name : o.language
|
|
454
437
|
};
|
|
455
438
|
}
|
|
456
|
-
return
|
|
439
|
+
return o;
|
|
457
440
|
});
|
|
458
441
|
}
|
|
459
|
-
function
|
|
442
|
+
function Wa(e) {
|
|
460
443
|
return {
|
|
461
|
-
PUBLISHED:
|
|
462
|
-
DRAFT:
|
|
463
|
-
ARCHIVED:
|
|
444
|
+
PUBLISHED: e("blog:statusPublished"),
|
|
445
|
+
DRAFT: e("blog:statusDraft"),
|
|
446
|
+
ARCHIVED: e("blog:statusArchived")
|
|
464
447
|
};
|
|
465
448
|
}
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
|
|
449
|
+
function Ha(e, a) {
|
|
450
|
+
const n = e ? e.languages.length > 0 : !1;
|
|
451
|
+
return [
|
|
469
452
|
{
|
|
470
453
|
id: 1,
|
|
471
454
|
name: "ID",
|
|
@@ -475,586 +458,511 @@ function getPostTableColumnDefs(moduleConfig, t) {
|
|
|
475
458
|
},
|
|
476
459
|
{
|
|
477
460
|
id: 2,
|
|
478
|
-
name:
|
|
461
|
+
name: a("blog:status"),
|
|
479
462
|
field: "status",
|
|
480
463
|
style: { width: "140px" },
|
|
481
464
|
headStyle: { width: "140px" }
|
|
482
465
|
},
|
|
483
466
|
{
|
|
484
467
|
id: 3,
|
|
485
|
-
name:
|
|
468
|
+
name: a("blog:name"),
|
|
486
469
|
field: "name",
|
|
487
470
|
type: "name",
|
|
488
|
-
format: ({ row }) => ({
|
|
471
|
+
format: ({ row: t }) => ({
|
|
489
472
|
adminLink: {
|
|
490
|
-
text:
|
|
491
|
-
url:
|
|
473
|
+
text: t.title,
|
|
474
|
+
url: Ae({ postId: t.id })
|
|
492
475
|
},
|
|
493
476
|
websiteLink: {
|
|
494
|
-
text:
|
|
477
|
+
text: t.url,
|
|
495
478
|
url: [
|
|
496
|
-
|
|
497
|
-
|
|
479
|
+
process.env.VUE_APP_WEBSITE_URL || window.location.origin,
|
|
480
|
+
t.url
|
|
498
481
|
].join("")
|
|
499
482
|
}
|
|
500
483
|
})
|
|
501
484
|
},
|
|
502
485
|
{
|
|
503
486
|
id: 4,
|
|
504
|
-
name:
|
|
487
|
+
name: a("blog:image"),
|
|
505
488
|
field: "image",
|
|
506
489
|
type: "image",
|
|
507
490
|
style: { width: "250px" },
|
|
508
491
|
headStyle: { width: "250px" }
|
|
509
492
|
},
|
|
510
|
-
|
|
493
|
+
n ? { id: 5, name: a("blog:language"), field: "language" } : null,
|
|
511
494
|
{
|
|
512
495
|
id: 6,
|
|
513
|
-
name:
|
|
496
|
+
name: a("blog:date"),
|
|
514
497
|
field: "datetime",
|
|
515
498
|
type: "datetime",
|
|
516
|
-
options: { ignoreStartOfDayTime:
|
|
499
|
+
options: { ignoreStartOfDayTime: !0 }
|
|
517
500
|
},
|
|
518
501
|
{
|
|
519
502
|
id: 7,
|
|
520
|
-
name:
|
|
503
|
+
name: a("blog:categories"),
|
|
521
504
|
field: "categories",
|
|
522
|
-
format: ({ row }) =>
|
|
505
|
+
format: ({ row: t }) => t.categories.map((d) => d.name).join(", ")
|
|
523
506
|
},
|
|
524
507
|
{
|
|
525
508
|
id: 8,
|
|
526
|
-
name:
|
|
509
|
+
name: a("blog:actions"),
|
|
527
510
|
field: "actions",
|
|
528
511
|
style: { whiteSpace: "nowrap", width: "120px" },
|
|
529
512
|
headStyle: { whiteSpace: "nowrap", width: "120px" }
|
|
530
513
|
}
|
|
531
|
-
];
|
|
532
|
-
return COLUMN_DEFS.filter(notEmpty);
|
|
514
|
+
].filter(ke);
|
|
533
515
|
}
|
|
534
|
-
function
|
|
516
|
+
function za(e) {
|
|
535
517
|
return [
|
|
536
518
|
{
|
|
537
519
|
value: "datetime_desc",
|
|
538
|
-
label:
|
|
520
|
+
label: e("blog:sortDateTimeDesc")
|
|
539
521
|
},
|
|
540
522
|
{
|
|
541
523
|
value: "datetime_asc",
|
|
542
|
-
label:
|
|
524
|
+
label: e("blog:sortDateTimeAsc")
|
|
543
525
|
},
|
|
544
526
|
{
|
|
545
527
|
value: "title_asc",
|
|
546
|
-
label:
|
|
528
|
+
label: e("blog:sortTitleAsc")
|
|
547
529
|
},
|
|
548
530
|
{
|
|
549
531
|
value: "title_desc",
|
|
550
|
-
label:
|
|
532
|
+
label: e("blog:sortTitleDesc")
|
|
551
533
|
},
|
|
552
534
|
{
|
|
553
535
|
value: "status",
|
|
554
|
-
label:
|
|
536
|
+
label: e("blog:sortStatus")
|
|
555
537
|
}
|
|
556
538
|
];
|
|
557
539
|
}
|
|
558
|
-
const
|
|
559
|
-
function
|
|
560
|
-
t,
|
|
561
|
-
route,
|
|
562
|
-
categoryList,
|
|
563
|
-
languageList,
|
|
564
|
-
statusOptionList
|
|
540
|
+
const re = (e) => e.split("-").reverse().join(".");
|
|
541
|
+
function Ya({
|
|
542
|
+
t: e,
|
|
543
|
+
route: a,
|
|
544
|
+
categoryList: n,
|
|
545
|
+
languageList: o,
|
|
546
|
+
statusOptionList: t
|
|
565
547
|
}) {
|
|
566
|
-
const
|
|
567
|
-
() =>
|
|
568
|
-
value: String(
|
|
569
|
-
label:
|
|
548
|
+
const d = r(
|
|
549
|
+
() => n.value.map(({ id: l, name: m, depth: $ }) => ({
|
|
550
|
+
value: String(l),
|
|
551
|
+
label: ae(m, $)
|
|
570
552
|
}))
|
|
571
|
-
)
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
route.query,
|
|
553
|
+
), c = r(() => {
|
|
554
|
+
const l = ie(
|
|
555
|
+
a.query,
|
|
575
556
|
"category"
|
|
557
|
+
/* CATEGORY */
|
|
576
558
|
);
|
|
577
|
-
return
|
|
578
|
-
({ value }) =>
|
|
559
|
+
return d.value.filter(
|
|
560
|
+
({ value: m }) => l.some(($) => $ === m)
|
|
579
561
|
);
|
|
562
|
+
}), C = E(c.value);
|
|
563
|
+
G(c, () => {
|
|
564
|
+
C.value = c.value;
|
|
580
565
|
});
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
() => languageList.value.map(({ id, name }) => ({ value: id, label: name }))
|
|
587
|
-
);
|
|
588
|
-
const initialLanguageFilter = computed(() => {
|
|
589
|
-
const queryValue = getFilterParamAsStringArray(
|
|
590
|
-
route.query,
|
|
566
|
+
const s = r(
|
|
567
|
+
() => o.value.map(({ id: l, name: m }) => ({ value: l, label: m }))
|
|
568
|
+
), b = r(() => {
|
|
569
|
+
const l = ie(
|
|
570
|
+
a.query,
|
|
591
571
|
"language"
|
|
572
|
+
/* LANGUAGE */
|
|
592
573
|
);
|
|
593
|
-
return
|
|
594
|
-
({ value }) =>
|
|
574
|
+
return s.value.filter(
|
|
575
|
+
({ value: m }) => l.some(($) => $ === m)
|
|
595
576
|
);
|
|
577
|
+
}), v = E(b.value);
|
|
578
|
+
G(b, () => {
|
|
579
|
+
v.value = b.value;
|
|
596
580
|
});
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
|
|
581
|
+
const L = r(
|
|
582
|
+
() => Be(
|
|
583
|
+
a.query,
|
|
584
|
+
"from-date"
|
|
585
|
+
/* FROM_DATE */
|
|
586
|
+
) ?? ""
|
|
587
|
+
), F = E(L.value);
|
|
588
|
+
G(L, () => {
|
|
589
|
+
F.value = L.value;
|
|
600
590
|
});
|
|
601
|
-
const
|
|
602
|
-
() =>
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
});
|
|
611
|
-
const initialToDateFilter = computed(
|
|
612
|
-
() => {
|
|
613
|
-
var _a;
|
|
614
|
-
return (_a = getFilterParamAsString(route.query, "to-date")) != null ? _a : "";
|
|
615
|
-
}
|
|
616
|
-
);
|
|
617
|
-
const toDateFilter = ref(initialToDateFilter.value);
|
|
618
|
-
watch(initialToDateFilter, () => {
|
|
619
|
-
toDateFilter.value = initialToDateFilter.value;
|
|
591
|
+
const I = r(
|
|
592
|
+
() => Be(
|
|
593
|
+
a.query,
|
|
594
|
+
"to-date"
|
|
595
|
+
/* TO_DATE */
|
|
596
|
+
) ?? ""
|
|
597
|
+
), g = E(I.value);
|
|
598
|
+
G(I, () => {
|
|
599
|
+
g.value = I.value;
|
|
620
600
|
});
|
|
621
|
-
const
|
|
622
|
-
if (!
|
|
601
|
+
const f = r(() => {
|
|
602
|
+
if (!F.value && !g.value)
|
|
623
603
|
return null;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
toDateFilter.value
|
|
629
|
-
)}`;
|
|
630
|
-
}
|
|
631
|
-
if (fromDateFilter.value && !toDateFilter.value) {
|
|
632
|
-
label = `${t("blog:from")} ${dateFormat(fromDateFilter.value)}`;
|
|
633
|
-
}
|
|
634
|
-
if (!fromDateFilter.value && toDateFilter.value) {
|
|
635
|
-
label = `${t("blog:to")} ${dateFormat(toDateFilter.value)}`;
|
|
636
|
-
}
|
|
637
|
-
return {
|
|
604
|
+
let l = "";
|
|
605
|
+
return F.value && g.value && (l = `${re(F.value)} - ${re(
|
|
606
|
+
g.value
|
|
607
|
+
)}`), F.value && !g.value && (l = `${e("blog:from")} ${re(F.value)}`), !F.value && g.value && (l = `${e("blog:to")} ${re(g.value)}`), {
|
|
638
608
|
value: "",
|
|
639
|
-
label,
|
|
609
|
+
label: l,
|
|
640
610
|
name: "from-date",
|
|
641
|
-
title:
|
|
611
|
+
title: e("blog:dateOfPublication")
|
|
642
612
|
};
|
|
643
|
-
})
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
route.query,
|
|
613
|
+
}), h = r(() => {
|
|
614
|
+
const l = ie(
|
|
615
|
+
a.query,
|
|
647
616
|
"status"
|
|
617
|
+
/* STATUS */
|
|
648
618
|
);
|
|
649
|
-
return
|
|
650
|
-
({ value }) =>
|
|
619
|
+
return t.value.filter(
|
|
620
|
+
({ value: m }) => l.some(($) => $ === m)
|
|
651
621
|
);
|
|
622
|
+
}), D = E(h.value);
|
|
623
|
+
G(h, () => {
|
|
624
|
+
D.value = h.value;
|
|
652
625
|
});
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const filters = {
|
|
659
|
-
["category"]: categoryFilter.value.map(({ value }) => value),
|
|
660
|
-
["language"]: languageFilter.value.map(({ value }) => value),
|
|
661
|
-
["status"]: statusFilter.value.map(({ value }) => value)
|
|
626
|
+
const u = r(() => {
|
|
627
|
+
const l = {
|
|
628
|
+
category: C.value.map(({ value: m }) => m),
|
|
629
|
+
language: v.value.map(({ value: m }) => m),
|
|
630
|
+
status: D.value.map(({ value: m }) => m)
|
|
662
631
|
};
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
632
|
+
return F.value && (l[
|
|
633
|
+
"from-date"
|
|
634
|
+
/* FROM_DATE */
|
|
635
|
+
] = F.value), g.value && (l[
|
|
636
|
+
"to-date"
|
|
637
|
+
/* TO_DATE */
|
|
638
|
+
] = g.value), He(l);
|
|
670
639
|
});
|
|
671
|
-
function
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
)
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
({ value }) => value !== event.value
|
|
680
|
-
);
|
|
681
|
-
}
|
|
682
|
-
if (event.name === "from-date") {
|
|
683
|
-
fromDateFilter.value = "";
|
|
684
|
-
toDateFilter.value = "";
|
|
685
|
-
}
|
|
686
|
-
if (event.name === "status") {
|
|
687
|
-
statusFilter.value = statusFilter.value.filter(
|
|
688
|
-
({ value }) => value !== event.value
|
|
689
|
-
);
|
|
690
|
-
}
|
|
640
|
+
function V(l) {
|
|
641
|
+
l.name === "category" && (C.value = C.value.filter(
|
|
642
|
+
({ value: m }) => m !== l.value
|
|
643
|
+
)), l.name === "language" && (v.value = v.value.filter(
|
|
644
|
+
({ value: m }) => m !== l.value
|
|
645
|
+
)), l.name === "from-date" && (F.value = "", g.value = ""), l.name === "status" && (D.value = D.value.filter(
|
|
646
|
+
({ value: m }) => m !== l.value
|
|
647
|
+
));
|
|
691
648
|
}
|
|
692
|
-
const
|
|
649
|
+
const w = r(
|
|
693
650
|
() => [
|
|
694
|
-
...
|
|
695
|
-
value,
|
|
696
|
-
label,
|
|
651
|
+
...C.value.map(({ value: l, label: m }) => ({
|
|
652
|
+
value: l,
|
|
653
|
+
label: m,
|
|
697
654
|
name: "category",
|
|
698
|
-
title:
|
|
655
|
+
title: e("blog:category")
|
|
699
656
|
})),
|
|
700
|
-
...
|
|
701
|
-
value,
|
|
702
|
-
label,
|
|
657
|
+
...v.value.map(({ value: l, label: m }) => ({
|
|
658
|
+
value: l,
|
|
659
|
+
label: m,
|
|
703
660
|
name: "language",
|
|
704
|
-
title:
|
|
661
|
+
title: e("blog:language")
|
|
705
662
|
})),
|
|
706
|
-
|
|
707
|
-
...
|
|
708
|
-
value,
|
|
709
|
-
label,
|
|
663
|
+
f.value,
|
|
664
|
+
...D.value.map(({ value: l, label: m }) => ({
|
|
665
|
+
value: l,
|
|
666
|
+
label: m,
|
|
710
667
|
name: "status",
|
|
711
|
-
title:
|
|
668
|
+
title: e("blog:status")
|
|
712
669
|
}))
|
|
713
|
-
].filter(
|
|
714
|
-
)
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
({ language }) => languageFilter.value.some(({ value }) => value === language)
|
|
721
|
-
);
|
|
722
|
-
return selectedList.map(({ id, name, depth }) => ({
|
|
723
|
-
value: String(id),
|
|
724
|
-
label: getNameWithDepth(name, depth)
|
|
725
|
-
}));
|
|
726
|
-
});
|
|
670
|
+
].filter(Fe)
|
|
671
|
+
), W = r(() => v.value.length === 0 ? d.value : n.value.filter(
|
|
672
|
+
({ language: m }) => v.value.some(({ value: $ }) => $ === m)
|
|
673
|
+
).map(({ id: m, name: $, depth: q }) => ({
|
|
674
|
+
value: String(m),
|
|
675
|
+
label: ae($, q)
|
|
676
|
+
})));
|
|
727
677
|
return {
|
|
728
|
-
categoryFilter,
|
|
729
|
-
categoryOptionList:
|
|
730
|
-
languageFilter,
|
|
731
|
-
languageOptionList,
|
|
732
|
-
fromDateFilter,
|
|
733
|
-
toDateFilter,
|
|
734
|
-
statusFilter,
|
|
735
|
-
tagRemovalHandler,
|
|
736
|
-
tags,
|
|
737
|
-
filterParams
|
|
678
|
+
categoryFilter: C,
|
|
679
|
+
categoryOptionList: W,
|
|
680
|
+
languageFilter: v,
|
|
681
|
+
languageOptionList: s,
|
|
682
|
+
fromDateFilter: F,
|
|
683
|
+
toDateFilter: g,
|
|
684
|
+
statusFilter: D,
|
|
685
|
+
tagRemovalHandler: V,
|
|
686
|
+
tags: w,
|
|
687
|
+
filterParams: u
|
|
738
688
|
};
|
|
739
689
|
}
|
|
740
|
-
|
|
741
|
-
var _export_sfc = (sfc, props) => {
|
|
742
|
-
const target = sfc.__vccOpts || sfc;
|
|
743
|
-
for (const [key, val] of props) {
|
|
744
|
-
target[key] = val;
|
|
745
|
-
}
|
|
746
|
-
return target;
|
|
747
|
-
};
|
|
748
|
-
const _sfc_main$3 = defineComponent({
|
|
690
|
+
const Qa = pe({
|
|
749
691
|
name: "PostList",
|
|
750
692
|
components: {
|
|
751
|
-
DeleteIcon,
|
|
752
|
-
ContentCopyIcon,
|
|
753
|
-
EditIcon,
|
|
754
|
-
BaseButton,
|
|
755
|
-
FormField,
|
|
756
|
-
FormFieldMultiSelect,
|
|
757
|
-
AdvancedSearch,
|
|
758
|
-
Page,
|
|
759
|
-
DataTable
|
|
693
|
+
DeleteIcon: je,
|
|
694
|
+
ContentCopyIcon: ga,
|
|
695
|
+
EditIcon: Ke,
|
|
696
|
+
BaseButton: Qe,
|
|
697
|
+
FormField: Te,
|
|
698
|
+
FormFieldMultiSelect: Le,
|
|
699
|
+
AdvancedSearch: Ye,
|
|
700
|
+
Page: me,
|
|
701
|
+
DataTable: ze
|
|
760
702
|
},
|
|
761
703
|
setup() {
|
|
762
|
-
const { t } =
|
|
763
|
-
const route = useRoute();
|
|
764
|
-
const router = useRouter();
|
|
765
|
-
const categoryId = computed(() => {
|
|
766
|
-
var _a;
|
|
767
|
-
return Array.isArray(route.query.category) ? (_a = route.query.category[0]) != null ? _a : "" : route.query.category;
|
|
768
|
-
});
|
|
769
|
-
const statusOptionList = computed(() => getStatusOptions(t));
|
|
770
|
-
const { data: moduleConfig, loading: isModuleConfigLoading } = useFetchModuleConfig();
|
|
771
|
-
const languageList = computed(
|
|
704
|
+
const { t: e } = ue(), a = ge(), n = de(), o = r(() => Array.isArray(a.query.category) ? a.query.category[0] ?? "" : a.query.category), t = r(() => la(e)), { data: d, loading: c } = ce(), C = r(
|
|
772
705
|
() => {
|
|
773
|
-
var
|
|
774
|
-
return (
|
|
706
|
+
var P;
|
|
707
|
+
return ((P = d.value) == null ? void 0 : P.languages) ?? [];
|
|
775
708
|
}
|
|
776
|
-
)
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
handleChange,
|
|
818
|
-
pageNumber,
|
|
819
|
-
pageCount,
|
|
820
|
-
pageSize,
|
|
821
|
-
sort
|
|
822
|
-
} = useDataTable({
|
|
823
|
-
fetchEntityList: (params) => getPosts({
|
|
824
|
-
query: params.searchQuery,
|
|
825
|
-
pageNumber: params.pageNumber,
|
|
826
|
-
pageSize: params.pageSize,
|
|
827
|
-
sort: params.sort || void 0,
|
|
828
|
-
...filterParams.value
|
|
709
|
+
), { data: s, loading: b } = Ie(), v = r(
|
|
710
|
+
() => o.value ? s.value.find(
|
|
711
|
+
({ id: P }) => String(P) === String(o.value)
|
|
712
|
+
) ?? null : null
|
|
713
|
+
), L = r(() => v.value ? `${e("blog:postsByCategory")} "${v.value.name}"` : e("blog:posts")), F = r(
|
|
714
|
+
() => h.value.length > 1
|
|
715
|
+
), {
|
|
716
|
+
categoryFilter: I,
|
|
717
|
+
categoryOptionList: g,
|
|
718
|
+
languageFilter: f,
|
|
719
|
+
languageOptionList: h,
|
|
720
|
+
fromDateFilter: D,
|
|
721
|
+
toDateFilter: u,
|
|
722
|
+
filterParams: V,
|
|
723
|
+
tags: w,
|
|
724
|
+
tagRemovalHandler: W,
|
|
725
|
+
statusFilter: l
|
|
726
|
+
} = Ya({
|
|
727
|
+
t: e,
|
|
728
|
+
route: a,
|
|
729
|
+
categoryList: s,
|
|
730
|
+
languageList: C,
|
|
731
|
+
statusOptionList: t
|
|
732
|
+
}), m = za(e), {
|
|
733
|
+
fetchEntityList: $,
|
|
734
|
+
isLoading: q,
|
|
735
|
+
rowData: j,
|
|
736
|
+
errorMessage: X,
|
|
737
|
+
searchQuery: U,
|
|
738
|
+
handleChange: S,
|
|
739
|
+
pageNumber: k,
|
|
740
|
+
pageCount: _,
|
|
741
|
+
pageSize: K,
|
|
742
|
+
sort: ve
|
|
743
|
+
} = Ze({
|
|
744
|
+
fetchEntityList: (P) => ta({
|
|
745
|
+
query: P.searchQuery,
|
|
746
|
+
pageNumber: P.pageNumber,
|
|
747
|
+
pageSize: P.pageSize,
|
|
748
|
+
sort: P.sort || void 0,
|
|
749
|
+
...V.value
|
|
829
750
|
}),
|
|
830
751
|
initialValue: [],
|
|
831
752
|
resourceName: "Blog post list",
|
|
832
753
|
pageSize: 100,
|
|
833
|
-
defaultSort:
|
|
754
|
+
defaultSort: m[0].value
|
|
834
755
|
});
|
|
835
|
-
|
|
836
|
-
if (
|
|
756
|
+
G(V, () => {
|
|
757
|
+
if (c.value || b.value)
|
|
837
758
|
return;
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
...
|
|
841
|
-
...filterParams.value
|
|
759
|
+
const P = {
|
|
760
|
+
...ua(a.query, ["query", "pageNumber", "sort"]),
|
|
761
|
+
...V.value
|
|
842
762
|
};
|
|
843
|
-
|
|
844
|
-
router.replace({ query: newQuery });
|
|
845
|
-
fetchPostList();
|
|
846
|
-
}
|
|
763
|
+
We(a.query, P) || (n.replace({ query: P }), $());
|
|
847
764
|
});
|
|
848
|
-
const
|
|
765
|
+
const fe = r(
|
|
849
766
|
() => {
|
|
850
|
-
var
|
|
851
|
-
return
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
(
|
|
767
|
+
var P;
|
|
768
|
+
return Va(
|
|
769
|
+
j.value,
|
|
770
|
+
v.value,
|
|
771
|
+
((P = d.value) == null ? void 0 : P.languages) ?? []
|
|
855
772
|
);
|
|
856
773
|
}
|
|
857
|
-
)
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
const { isDeleting, handleResourceDelete } = useResourceDelete({
|
|
862
|
-
deleteResource: deleteBlogPost,
|
|
774
|
+
), le = r(
|
|
775
|
+
() => b.value || q.value || c.value
|
|
776
|
+
), { isDeleting: ne, handleResourceDelete: se } = Re({
|
|
777
|
+
deleteResource: $a,
|
|
863
778
|
resourceName: "Post",
|
|
864
|
-
onSuccess:
|
|
865
|
-
})
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
onSuccessRedirectTo: (data) => `/blog/posts/${data.id}`
|
|
779
|
+
onSuccess: $
|
|
780
|
+
}), { isCloning: i, handleResourceClone: O } = sa({
|
|
781
|
+
cloneResource: Ta,
|
|
782
|
+
confirmMessage: e("blog:cloneConfirm"),
|
|
783
|
+
successMessage: e("blog:cloneSuccess"),
|
|
784
|
+
failureMessage: e("blog:cloneFailure"),
|
|
785
|
+
onSuccessRedirectTo: (P) => `/blog/posts/${P.id}`
|
|
872
786
|
});
|
|
873
|
-
function
|
|
874
|
-
return
|
|
787
|
+
function H(P) {
|
|
788
|
+
return ne(P) || i(P) || le.value;
|
|
875
789
|
}
|
|
876
|
-
const
|
|
877
|
-
() =>
|
|
790
|
+
const z = r(
|
|
791
|
+
() => Ha(d.value, e)
|
|
878
792
|
);
|
|
879
793
|
return {
|
|
880
|
-
t,
|
|
881
|
-
formatDateTime,
|
|
882
|
-
columnDefs,
|
|
883
|
-
sortOptions,
|
|
884
|
-
sortValue:
|
|
885
|
-
rowData:
|
|
886
|
-
handleResourceDelete,
|
|
887
|
-
isDeleting,
|
|
888
|
-
categoryList,
|
|
889
|
-
isRowDataLoading,
|
|
890
|
-
errorMessage,
|
|
891
|
-
getBlogPostFormUrl,
|
|
892
|
-
pageTitle,
|
|
893
|
-
searchQuery,
|
|
894
|
-
handleChange,
|
|
895
|
-
pageNumber,
|
|
896
|
-
pageCount,
|
|
897
|
-
pageSize,
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
794
|
+
t: e,
|
|
795
|
+
formatDateTime: da,
|
|
796
|
+
columnDefs: z,
|
|
797
|
+
sortOptions: m,
|
|
798
|
+
sortValue: ve,
|
|
799
|
+
rowData: fe,
|
|
800
|
+
handleResourceDelete: se,
|
|
801
|
+
isDeleting: ne,
|
|
802
|
+
categoryList: s,
|
|
803
|
+
isRowDataLoading: le,
|
|
804
|
+
errorMessage: X,
|
|
805
|
+
getBlogPostFormUrl: Ae,
|
|
806
|
+
pageTitle: L,
|
|
807
|
+
searchQuery: U,
|
|
808
|
+
handleChange: S,
|
|
809
|
+
pageNumber: k,
|
|
810
|
+
pageCount: _,
|
|
811
|
+
pageSize: K,
|
|
812
|
+
// Advanced search
|
|
813
|
+
categoryFilter: I,
|
|
814
|
+
categoryOptionList: g,
|
|
815
|
+
isLangSpecific: F,
|
|
816
|
+
languageFilter: f,
|
|
817
|
+
languageOptionList: h,
|
|
818
|
+
fromDateFilter: D,
|
|
819
|
+
toDateFilter: u,
|
|
820
|
+
statusFilter: l,
|
|
821
|
+
statusOptionList: t,
|
|
822
|
+
tags: w,
|
|
823
|
+
tagRemovalHandler: W,
|
|
824
|
+
getStatuses: Wa,
|
|
825
|
+
// Clone
|
|
826
|
+
handleResourceClone: O,
|
|
827
|
+
isBusy: H
|
|
912
828
|
};
|
|
913
829
|
}
|
|
914
|
-
})
|
|
915
|
-
const
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
function
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
const _component_EditIcon = resolveComponent("EditIcon");
|
|
925
|
-
const _component_BaseButton = resolveComponent("BaseButton");
|
|
926
|
-
const _component_ContentCopyIcon = resolveComponent("ContentCopyIcon");
|
|
927
|
-
const _component_DeleteIcon = resolveComponent("DeleteIcon");
|
|
928
|
-
const _component_DataTable = resolveComponent("DataTable");
|
|
929
|
-
const _component_Page = resolveComponent("Page");
|
|
930
|
-
return openBlock(), createBlock(_component_Page, {
|
|
931
|
-
title: _ctx.pageTitle,
|
|
830
|
+
}), be = (e, a) => {
|
|
831
|
+
const n = e.__vccOpts || e;
|
|
832
|
+
for (const [o, t] of a)
|
|
833
|
+
n[o] = t;
|
|
834
|
+
return n;
|
|
835
|
+
}, Ka = { class: "filters" }, ja = { class: "filters" }, Za = { class: "status" }, Ja = { key: 0 }, Xa = { key: 1 };
|
|
836
|
+
function _a(e, a, n, o, t, d) {
|
|
837
|
+
const c = y("FormFieldMultiSelect"), C = y("FormField"), s = y("AdvancedSearch"), b = y("EditIcon"), v = y("BaseButton"), L = y("ContentCopyIcon"), F = y("DeleteIcon"), I = y("DataTable"), g = y("Page");
|
|
838
|
+
return T(), M(g, {
|
|
839
|
+
title: e.pageTitle,
|
|
932
840
|
"header-buttons": [
|
|
933
841
|
{
|
|
934
|
-
text:
|
|
935
|
-
href:
|
|
842
|
+
text: e.$i18n.t("blog:newPost"),
|
|
843
|
+
href: e.getBlogPostFormUrl({ postId: "create" })
|
|
936
844
|
}
|
|
937
845
|
]
|
|
938
846
|
}, {
|
|
939
|
-
content:
|
|
940
|
-
|
|
941
|
-
"column-defs":
|
|
942
|
-
"row-data":
|
|
943
|
-
loading:
|
|
944
|
-
"error-message":
|
|
945
|
-
"search-query":
|
|
847
|
+
content: A(() => [
|
|
848
|
+
p(I, {
|
|
849
|
+
"column-defs": e.columnDefs,
|
|
850
|
+
"row-data": e.rowData,
|
|
851
|
+
loading: e.isRowDataLoading,
|
|
852
|
+
"error-message": e.errorMessage,
|
|
853
|
+
"search-query": e.searchQuery,
|
|
946
854
|
pagination: {
|
|
947
|
-
pageNumber:
|
|
948
|
-
pageCount:
|
|
949
|
-
pageSize:
|
|
950
|
-
disabled:
|
|
855
|
+
pageNumber: e.pageNumber,
|
|
856
|
+
pageCount: e.pageCount,
|
|
857
|
+
pageSize: e.pageSize,
|
|
858
|
+
disabled: e.isRowDataLoading
|
|
951
859
|
},
|
|
952
|
-
sort: { options:
|
|
860
|
+
sort: { options: e.sortOptions, value: e.sortValue },
|
|
953
861
|
"data-table": "blog-post",
|
|
954
|
-
onChange:
|
|
862
|
+
onChange: e.handleChange
|
|
955
863
|
}, {
|
|
956
|
-
filters:
|
|
957
|
-
|
|
958
|
-
tags:
|
|
959
|
-
"onClick:tag":
|
|
864
|
+
filters: A(() => [
|
|
865
|
+
p(s, {
|
|
866
|
+
tags: e.tags,
|
|
867
|
+
"onClick:tag": e.tagRemovalHandler
|
|
960
868
|
}, {
|
|
961
|
-
default:
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
"selected-options":
|
|
965
|
-
"onUpdate:selected-options":
|
|
966
|
-
options:
|
|
869
|
+
default: A(() => [
|
|
870
|
+
Y("div", Ka, [
|
|
871
|
+
p(c, {
|
|
872
|
+
"selected-options": e.categoryFilter,
|
|
873
|
+
"onUpdate:selected-options": a[0] || (a[0] = (f) => e.categoryFilter = f),
|
|
874
|
+
options: e.categoryOptionList,
|
|
967
875
|
name: "categoryFilter",
|
|
968
|
-
searchable:
|
|
969
|
-
label:
|
|
876
|
+
searchable: !0,
|
|
877
|
+
label: e.$i18n.t("blog:category"),
|
|
970
878
|
class: "filter"
|
|
971
879
|
}, null, 8, ["selected-options", "options", "label"]),
|
|
972
|
-
|
|
880
|
+
e.isLangSpecific ? (T(), M(c, {
|
|
973
881
|
key: 0,
|
|
974
|
-
"selected-options":
|
|
975
|
-
"onUpdate:selected-options":
|
|
976
|
-
options:
|
|
882
|
+
"selected-options": e.languageFilter,
|
|
883
|
+
"onUpdate:selected-options": a[1] || (a[1] = (f) => e.languageFilter = f),
|
|
884
|
+
options: e.languageOptionList,
|
|
977
885
|
name: "languageFilter",
|
|
978
|
-
searchable:
|
|
979
|
-
label:
|
|
886
|
+
searchable: !0,
|
|
887
|
+
label: e.$i18n.t("blog:language"),
|
|
980
888
|
class: "filter"
|
|
981
|
-
}, null, 8, ["selected-options", "options", "label"])) :
|
|
982
|
-
|
|
983
|
-
"selected-options":
|
|
984
|
-
"onUpdate:selected-options":
|
|
985
|
-
options:
|
|
889
|
+
}, null, 8, ["selected-options", "options", "label"])) : B("", !0),
|
|
890
|
+
p(c, {
|
|
891
|
+
"selected-options": e.statusFilter,
|
|
892
|
+
"onUpdate:selected-options": a[2] || (a[2] = (f) => e.statusFilter = f),
|
|
893
|
+
options: e.statusOptionList,
|
|
986
894
|
name: "statusFilter",
|
|
987
|
-
searchable:
|
|
988
|
-
label:
|
|
895
|
+
searchable: !0,
|
|
896
|
+
label: e.$i18n.t("blog:status"),
|
|
989
897
|
class: "filter"
|
|
990
898
|
}, null, 8, ["selected-options", "options", "label"])
|
|
991
899
|
]),
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
value:
|
|
995
|
-
"onUpdate:value":
|
|
996
|
-
label:
|
|
900
|
+
Y("div", ja, [
|
|
901
|
+
p(C, {
|
|
902
|
+
value: e.fromDateFilter,
|
|
903
|
+
"onUpdate:value": a[3] || (a[3] = (f) => e.fromDateFilter = f),
|
|
904
|
+
label: e.$i18n.t("blog:dateOfPublicationFrom"),
|
|
997
905
|
name: "fromDateFilter",
|
|
998
906
|
type: "date",
|
|
999
|
-
max:
|
|
907
|
+
max: e.toDateFilter
|
|
1000
908
|
}, null, 8, ["value", "label", "max"]),
|
|
1001
|
-
|
|
1002
|
-
value:
|
|
1003
|
-
"onUpdate:value":
|
|
1004
|
-
label:
|
|
909
|
+
p(C, {
|
|
910
|
+
value: e.toDateFilter,
|
|
911
|
+
"onUpdate:value": a[4] || (a[4] = (f) => e.toDateFilter = f),
|
|
912
|
+
label: e.$i18n.t("blog:dateOfPublicationTo"),
|
|
1005
913
|
name: "toDateFilter",
|
|
1006
914
|
type: "date",
|
|
1007
|
-
min:
|
|
915
|
+
min: e.fromDateFilter
|
|
1008
916
|
}, null, 8, ["value", "label", "min"])
|
|
1009
917
|
])
|
|
1010
918
|
]),
|
|
1011
919
|
_: 1
|
|
1012
920
|
}, 8, ["tags", "onClick:tag"])
|
|
1013
921
|
]),
|
|
1014
|
-
"cell(status)":
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
])) :
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
])) :
|
|
922
|
+
"cell(status)": A(({ row: f }) => [
|
|
923
|
+
Y("div", Za, [
|
|
924
|
+
Y("span", null, x(e.getStatuses(e.$i18n.t)[f.status]), 1),
|
|
925
|
+
f.status === "PUBLISHED" && f.archiveAt ? (T(), Q("span", Ja, [
|
|
926
|
+
Se(x(e.$i18n.t("blog:archiveAtLabel")) + ": ", 1),
|
|
927
|
+
Y("i", null, x(e.formatDateTime(new Date(f.archiveAt), !0)), 1)
|
|
928
|
+
])) : B("", !0),
|
|
929
|
+
f.status === "DRAFT" && f.publishAt ? (T(), Q("span", Xa, [
|
|
930
|
+
Se(x(e.$i18n.t("blog:publishAtLabel")) + ": ", 1),
|
|
931
|
+
Y("i", null, x(e.formatDateTime(new Date(f.publishAt), !0)), 1)
|
|
932
|
+
])) : B("", !0)
|
|
1025
933
|
])
|
|
1026
934
|
]),
|
|
1027
|
-
"cell(actions)":
|
|
1028
|
-
|
|
935
|
+
"cell(actions)": A(({ row: f }) => [
|
|
936
|
+
p(v, {
|
|
1029
937
|
variant: "icon",
|
|
1030
|
-
title:
|
|
1031
|
-
disabled:
|
|
1032
|
-
href:
|
|
938
|
+
title: e.$i18n.t("blog:edit"),
|
|
939
|
+
disabled: e.isBusy(f.id),
|
|
940
|
+
href: e.getBlogPostFormUrl({ postId: f.id })
|
|
1033
941
|
}, {
|
|
1034
|
-
default:
|
|
1035
|
-
|
|
942
|
+
default: A(() => [
|
|
943
|
+
p(b)
|
|
1036
944
|
]),
|
|
1037
945
|
_: 2
|
|
1038
946
|
}, 1032, ["title", "disabled", "href"]),
|
|
1039
|
-
|
|
947
|
+
p(v, {
|
|
1040
948
|
variant: "icon",
|
|
1041
|
-
title:
|
|
1042
|
-
disabled:
|
|
1043
|
-
onClick: (
|
|
949
|
+
title: e.$i18n.t("blog:clone"),
|
|
950
|
+
disabled: e.isBusy(f.id),
|
|
951
|
+
onClick: (h) => e.handleResourceClone(f.id)
|
|
1044
952
|
}, {
|
|
1045
|
-
default:
|
|
1046
|
-
|
|
953
|
+
default: A(() => [
|
|
954
|
+
p(L)
|
|
1047
955
|
]),
|
|
1048
956
|
_: 2
|
|
1049
957
|
}, 1032, ["title", "disabled", "onClick"]),
|
|
1050
|
-
|
|
958
|
+
p(v, {
|
|
1051
959
|
variant: "icon",
|
|
1052
|
-
title:
|
|
1053
|
-
disabled:
|
|
1054
|
-
onClick: (
|
|
960
|
+
title: e.$i18n.t("blog:remove"),
|
|
961
|
+
disabled: e.isBusy(f.id),
|
|
962
|
+
onClick: (h) => e.handleResourceDelete(f.id)
|
|
1055
963
|
}, {
|
|
1056
|
-
default:
|
|
1057
|
-
|
|
964
|
+
default: A(() => [
|
|
965
|
+
p(F)
|
|
1058
966
|
]),
|
|
1059
967
|
_: 2
|
|
1060
968
|
}, 1032, ["title", "disabled", "onClick"])
|
|
@@ -1065,184 +973,140 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1065
973
|
_: 1
|
|
1066
974
|
}, 8, ["title", "header-buttons"]);
|
|
1067
975
|
}
|
|
1068
|
-
|
|
1069
|
-
var PostForm_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1070
|
-
const _sfc_main$2 = defineComponent({
|
|
976
|
+
const xa = /* @__PURE__ */ be(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97da"]]), et = pe({
|
|
1071
977
|
name: "BlogPostForm",
|
|
1072
978
|
components: {
|
|
1073
|
-
SeoFieldGroup,
|
|
1074
|
-
FormFieldMultiSelect,
|
|
1075
|
-
FormFieldFileInput,
|
|
1076
|
-
FormFieldRichTextInput,
|
|
1077
|
-
FormFieldCheckbox,
|
|
1078
|
-
FormFieldUrlAliasInput,
|
|
1079
|
-
FormField,
|
|
1080
|
-
FormFieldSelect,
|
|
1081
|
-
Page,
|
|
1082
|
-
DynamicField,
|
|
1083
|
-
ShortCodeConstructor,
|
|
1084
|
-
FormFooter
|
|
979
|
+
SeoFieldGroup: ea,
|
|
980
|
+
FormFieldMultiSelect: Le,
|
|
981
|
+
FormFieldFileInput: ca,
|
|
982
|
+
FormFieldRichTextInput: ma,
|
|
983
|
+
FormFieldCheckbox: xe,
|
|
984
|
+
FormFieldUrlAliasInput: _e,
|
|
985
|
+
FormField: Te,
|
|
986
|
+
FormFieldSelect: Xe,
|
|
987
|
+
Page: me,
|
|
988
|
+
DynamicField: Fa,
|
|
989
|
+
ShortCodeConstructor: pa,
|
|
990
|
+
FormFooter: Je
|
|
1085
991
|
},
|
|
1086
992
|
setup() {
|
|
1087
|
-
var
|
|
1088
|
-
const
|
|
1089
|
-
const router = useRouter();
|
|
1090
|
-
const toast = useToast();
|
|
1091
|
-
const { t } = useI18n();
|
|
1092
|
-
const postId = computed(() => route.params.postId);
|
|
1093
|
-
const isCreation = computed(() => postId.value === "create");
|
|
1094
|
-
const urlAliasChanged = ref(false);
|
|
1095
|
-
const statusOptions = computed(() => getStatusOptions(t));
|
|
1096
|
-
const { data: moduleConfig, loading: isModuleConfigLoading } = useFetchModuleConfig();
|
|
1097
|
-
const languageList = computed(
|
|
993
|
+
var se;
|
|
994
|
+
const e = ge(), a = de(), n = we(), { t: o } = ue(), t = r(() => e.params.postId), d = r(() => t.value === "create"), c = E(!1), C = r(() => la(o)), { data: s, loading: b } = ce(), v = r(
|
|
1098
995
|
() => {
|
|
1099
|
-
var
|
|
1100
|
-
return (
|
|
996
|
+
var i;
|
|
997
|
+
return ((i = s.value) == null ? void 0 : i.languages) ?? [];
|
|
1101
998
|
}
|
|
1102
|
-
)
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
label: name
|
|
999
|
+
), L = r(
|
|
1000
|
+
() => v.value.map(({ id: i, name: O }) => ({
|
|
1001
|
+
value: i,
|
|
1002
|
+
label: O
|
|
1107
1003
|
}))
|
|
1108
|
-
)
|
|
1109
|
-
|
|
1110
|
-
const { data: categoryList, loading: isCategoryListLoading } = useFetchCategories();
|
|
1111
|
-
const [fetchPost, { data: post, loading: isPostLoading }] = useResource({
|
|
1112
|
-
fetchResource: () => postId.value ? getPost(postId.value) : new Promise(() => null),
|
|
1004
|
+
), F = r(() => L.value.length > 0), { data: I, loading: g } = Ie(), [f, { data: h, loading: D }] = te({
|
|
1005
|
+
fetchResource: () => t.value ? La(t.value) : new Promise(() => null),
|
|
1113
1006
|
initialValue: null,
|
|
1114
1007
|
resourceName: "Post"
|
|
1115
1008
|
});
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
});
|
|
1121
|
-
watch(postId, () => {
|
|
1122
|
-
if (isCreation.value)
|
|
1123
|
-
return;
|
|
1124
|
-
fetchPost();
|
|
1009
|
+
oe(() => {
|
|
1010
|
+
d.value || f();
|
|
1011
|
+
}), G(t, () => {
|
|
1012
|
+
d.value || f();
|
|
1125
1013
|
});
|
|
1126
|
-
const { data:
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
label: (post2.status === "ARCHIVED" ? `${t("blog:statusArchived")} - ` : post2.status === "DRAFT" ? `${t("blog:statusDraft")} - ` : post2.datetime ? formatDate(new Date(post2.datetime)) + " - " : "") + post2.title
|
|
1014
|
+
const { data: u, loading: V } = wa(), w = r(
|
|
1015
|
+
() => u.value.filter((i) => {
|
|
1016
|
+
var O;
|
|
1017
|
+
return i.id !== ((O = h.value) == null ? void 0 : O.id);
|
|
1018
|
+
}).map((i) => ({
|
|
1019
|
+
value: i.id,
|
|
1020
|
+
label: (i.status === "ARCHIVED" ? `${o("blog:statusArchived")} - ` : i.status === "DRAFT" ? `${o("blog:statusDraft")} - ` : i.datetime ? ba(new Date(i.datetime)) + " - " : "") + i.title
|
|
1134
1021
|
}))
|
|
1135
|
-
)
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
(_b = (_a = moduleConfig.value) == null ? void 0 : _a.fields) != null ? _b : [],
|
|
1143
|
-
statusOptions.value
|
|
1022
|
+
), W = E(!1), l = E(
|
|
1023
|
+
he(
|
|
1024
|
+
h.value,
|
|
1025
|
+
L.value,
|
|
1026
|
+
w.value,
|
|
1027
|
+
((se = s.value) == null ? void 0 : se.fields) ?? [],
|
|
1028
|
+
C.value
|
|
1144
1029
|
)
|
|
1145
|
-
);
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
statusOptions.value
|
|
1030
|
+
), m = E({});
|
|
1031
|
+
G([h, L, w, s], () => {
|
|
1032
|
+
var i;
|
|
1033
|
+
l.value = he(
|
|
1034
|
+
h.value,
|
|
1035
|
+
L.value,
|
|
1036
|
+
w.value,
|
|
1037
|
+
((i = s.value) == null ? void 0 : i.fields) ?? [],
|
|
1038
|
+
C.value
|
|
1155
1039
|
);
|
|
1156
1040
|
});
|
|
1157
|
-
function
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
navigateBack(router, getBlogPostListUrl());
|
|
1170
|
-
}
|
|
1171
|
-
if (event.type === "create_create-another") {
|
|
1172
|
-
values.value = convertPostToFormValues(
|
|
1173
|
-
null,
|
|
1174
|
-
languageOptionList.value,
|
|
1175
|
-
postOptionList.value,
|
|
1176
|
-
(_b2 = (_a2 = moduleConfig.value) == null ? void 0 : _a2.fields) != null ? _b2 : [],
|
|
1177
|
-
statusOptions.value
|
|
1178
|
-
);
|
|
1179
|
-
}
|
|
1180
|
-
toast.show({
|
|
1041
|
+
function $(i) {
|
|
1042
|
+
W.value = !0;
|
|
1043
|
+
const O = na(l.value), H = Na(l.value);
|
|
1044
|
+
(d.value ? Ia(O) : Aa(t.value, H)).then(({ data: P }) => {
|
|
1045
|
+
var Z;
|
|
1046
|
+
m.value = {}, i.type === "create" && a.push(Ae({ postId: String(P.id) })), (i.type === "create_exit" || i.type === "save_exit") && Ge(a, Pe()), i.type === "create_create-another" && (l.value = he(
|
|
1047
|
+
null,
|
|
1048
|
+
L.value,
|
|
1049
|
+
w.value,
|
|
1050
|
+
((Z = s.value) == null ? void 0 : Z.fields) ?? [],
|
|
1051
|
+
C.value
|
|
1052
|
+
)), n.show({
|
|
1181
1053
|
variant: "success",
|
|
1182
|
-
title:
|
|
1183
|
-
body:
|
|
1054
|
+
title: o("blog:success"),
|
|
1055
|
+
body: d.value ? o("blog:blogPostWasSuccessfullyCreated") : o("blog:blogPostWasSuccessfullyUpdated")
|
|
1184
1056
|
});
|
|
1185
|
-
}).catch((
|
|
1186
|
-
console.error(
|
|
1187
|
-
errors.value = convertRequestErrorToMap(error);
|
|
1188
|
-
toast.show({
|
|
1057
|
+
}).catch((P) => {
|
|
1058
|
+
console.error(P), m.value = Ne(P), n.show({
|
|
1189
1059
|
variant: "danger",
|
|
1190
|
-
title:
|
|
1191
|
-
body:
|
|
1060
|
+
title: o("blog:error"),
|
|
1061
|
+
body: d.value ? o("blog:blogPostCreationWasFailed") : o("blog:blogPostUpdateWasFailed")
|
|
1192
1062
|
});
|
|
1193
1063
|
}).finally(() => {
|
|
1194
|
-
|
|
1064
|
+
W.value = !1;
|
|
1195
1065
|
});
|
|
1196
1066
|
}
|
|
1197
|
-
const
|
|
1067
|
+
const q = r(
|
|
1198
1068
|
() => {
|
|
1199
|
-
var
|
|
1200
|
-
return
|
|
1201
|
-
|
|
1202
|
-
(
|
|
1069
|
+
var i;
|
|
1070
|
+
return qa(
|
|
1071
|
+
I.value,
|
|
1072
|
+
((i = l.value.language) == null ? void 0 : i.value) ?? null
|
|
1203
1073
|
);
|
|
1204
1074
|
}
|
|
1205
1075
|
);
|
|
1206
|
-
|
|
1207
|
-
var
|
|
1208
|
-
function
|
|
1209
|
-
return
|
|
1210
|
-
(
|
|
1076
|
+
G([q, s], () => {
|
|
1077
|
+
var O;
|
|
1078
|
+
function i(H) {
|
|
1079
|
+
return q.value.some(
|
|
1080
|
+
(z) => z.value === H.value
|
|
1211
1081
|
);
|
|
1212
1082
|
}
|
|
1213
|
-
if (
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
return defaultIds.indexOf(item.value) !== -1;
|
|
1221
|
-
}
|
|
1222
|
-
);
|
|
1223
|
-
}
|
|
1083
|
+
if (d.value && (O = s == null ? void 0 : s.value) != null && O.defaultCategories) {
|
|
1084
|
+
const H = s.value.defaultCategories.map(
|
|
1085
|
+
(z) => z.id
|
|
1086
|
+
);
|
|
1087
|
+
l.value.categories = q.value.filter(
|
|
1088
|
+
(z) => H.indexOf(z.value) !== -1
|
|
1089
|
+
);
|
|
1224
1090
|
}
|
|
1225
|
-
|
|
1091
|
+
l.value.categories = l.value.categories.filter(i);
|
|
1226
1092
|
});
|
|
1227
|
-
const
|
|
1228
|
-
() =>
|
|
1093
|
+
const j = r(
|
|
1094
|
+
() => D.value || g.value || V.value || b.value
|
|
1229
1095
|
);
|
|
1230
|
-
function
|
|
1231
|
-
var
|
|
1232
|
-
return { uploadScenario: (
|
|
1096
|
+
function X() {
|
|
1097
|
+
var i;
|
|
1098
|
+
return { uploadScenario: (i = s.value) == null ? void 0 : i.fileScenarios.content };
|
|
1233
1099
|
}
|
|
1234
|
-
const
|
|
1235
|
-
var
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
const tabList = computed(() => {
|
|
1240
|
-
const hasErrors = createTabErrorFinder(errors.value);
|
|
1100
|
+
const U = r(() => {
|
|
1101
|
+
var O;
|
|
1102
|
+
return (process.env.VUE_APP_WEBSITE_URL || window.location.origin) + (((O = h.value) == null ? void 0 : O.urlTemplate) ?? "");
|
|
1103
|
+
}), S = r(() => {
|
|
1104
|
+
const i = va(m.value);
|
|
1241
1105
|
return [
|
|
1242
1106
|
{
|
|
1243
1107
|
id: "common",
|
|
1244
|
-
label:
|
|
1245
|
-
hasErrors:
|
|
1108
|
+
label: o("blog:common"),
|
|
1109
|
+
hasErrors: i([
|
|
1246
1110
|
"title",
|
|
1247
1111
|
"language",
|
|
1248
1112
|
"urlAlias",
|
|
@@ -1253,690 +1117,619 @@ const _sfc_main$2 = defineComponent({
|
|
|
1253
1117
|
},
|
|
1254
1118
|
{
|
|
1255
1119
|
id: "images",
|
|
1256
|
-
label:
|
|
1257
|
-
hasErrors:
|
|
1120
|
+
label: o("blog:images"),
|
|
1121
|
+
hasErrors: i(["coverImage", "image"])
|
|
1258
1122
|
},
|
|
1259
1123
|
{
|
|
1260
1124
|
id: "relations",
|
|
1261
|
-
label:
|
|
1262
|
-
hasErrors:
|
|
1125
|
+
label: o("blog:relations"),
|
|
1126
|
+
hasErrors: i(["categories", "relatedPosts", "tags"])
|
|
1263
1127
|
},
|
|
1264
|
-
|
|
1128
|
+
l.value.additionalFields.length > 0 ? {
|
|
1265
1129
|
id: "additional",
|
|
1266
|
-
label:
|
|
1267
|
-
hasErrors:
|
|
1130
|
+
label: o("blog:additionalFields"),
|
|
1131
|
+
hasErrors: i([])
|
|
1268
1132
|
} : null,
|
|
1269
1133
|
{
|
|
1270
1134
|
id: "seo",
|
|
1271
1135
|
label: "SEO",
|
|
1272
|
-
hasErrors:
|
|
1136
|
+
hasErrors: i([
|
|
1273
1137
|
"pageTitle",
|
|
1274
1138
|
"pageDescription",
|
|
1275
1139
|
"openGraphImage"
|
|
1276
1140
|
])
|
|
1277
1141
|
}
|
|
1278
|
-
].filter(
|
|
1279
|
-
})
|
|
1280
|
-
const selectedTabId = ref(tabList.value[0].id);
|
|
1281
|
-
const headerButtonList = computed(
|
|
1142
|
+
].filter(Fe);
|
|
1143
|
+
}), k = E(S.value[0].id), _ = r(
|
|
1282
1144
|
() => [
|
|
1283
|
-
|
|
1284
|
-
text:
|
|
1285
|
-
href:
|
|
1145
|
+
h.value ? {
|
|
1146
|
+
text: o("blog:viewPost"),
|
|
1147
|
+
href: process.env.VUE_APP_WEBSITE_URL + h.value.url,
|
|
1286
1148
|
target: "_blank"
|
|
1287
1149
|
} : null
|
|
1288
|
-
].filter(
|
|
1150
|
+
].filter(Fe)
|
|
1289
1151
|
);
|
|
1290
|
-
function
|
|
1291
|
-
title,
|
|
1292
|
-
description,
|
|
1293
|
-
image
|
|
1152
|
+
function K({
|
|
1153
|
+
title: i,
|
|
1154
|
+
description: O,
|
|
1155
|
+
image: H
|
|
1294
1156
|
}) {
|
|
1295
|
-
|
|
1296
|
-
values.value.pageDescription = description;
|
|
1297
|
-
values.value.openGraphImage = image;
|
|
1157
|
+
l.value.pageTitle = i, l.value.pageDescription = O, l.value.openGraphImage = H;
|
|
1298
1158
|
}
|
|
1299
|
-
function
|
|
1300
|
-
|
|
1301
|
-
values.value.urlAlias = urlTranslit(value);
|
|
1302
|
-
}
|
|
1159
|
+
function ve(i) {
|
|
1160
|
+
d.value && c.value === !1 && (l.value.urlAlias = Me(i));
|
|
1303
1161
|
}
|
|
1304
|
-
function
|
|
1305
|
-
|
|
1162
|
+
function fe() {
|
|
1163
|
+
c.value = !0;
|
|
1306
1164
|
}
|
|
1307
|
-
const
|
|
1308
|
-
if (!
|
|
1165
|
+
const le = r(() => {
|
|
1166
|
+
if (!s.value || !s.value.urlPostTemplate)
|
|
1309
1167
|
return "";
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
return result;
|
|
1319
|
-
});
|
|
1320
|
-
const handleCategoriesChange = (selectedOptions) => {
|
|
1321
|
-
const newSelectedOptions = [];
|
|
1322
|
-
selectedOptions.forEach((selectedOption) => {
|
|
1323
|
-
const findTreeSelectedCategory = (categoryId) => {
|
|
1324
|
-
const foundSelectedCategory = categoryList.value.find(
|
|
1325
|
-
({ id }) => id === categoryId
|
|
1168
|
+
let i = s.value.urlPostTemplate;
|
|
1169
|
+
return l.value.language && (i = i.replace("{language}", l.value.language.value)), t.value !== "create" && (i = i.replace("{id}", t.value)), i;
|
|
1170
|
+
}), ne = (i) => {
|
|
1171
|
+
const O = [];
|
|
1172
|
+
i.forEach((H) => {
|
|
1173
|
+
const z = (P) => {
|
|
1174
|
+
const Z = I.value.find(
|
|
1175
|
+
({ id: ye }) => ye === P
|
|
1326
1176
|
);
|
|
1327
|
-
if (!
|
|
1177
|
+
if (!Z)
|
|
1328
1178
|
return;
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
label: foundSelectedCategory.name
|
|
1179
|
+
const Oe = {
|
|
1180
|
+
value: Z.id,
|
|
1181
|
+
label: Z.name
|
|
1333
1182
|
};
|
|
1334
|
-
|
|
1335
|
-
({ value }) =>
|
|
1336
|
-
))
|
|
1337
|
-
newSelectedOptions.push(newSelectedOption);
|
|
1338
|
-
}
|
|
1339
|
-
if (foundSelectedCategory.parent) {
|
|
1340
|
-
findTreeSelectedCategory(foundSelectedCategory.parent.id);
|
|
1341
|
-
}
|
|
1183
|
+
O.some(
|
|
1184
|
+
({ value: ye }) => ye === Oe.value
|
|
1185
|
+
) || O.push(Oe), Z.parent && z(Z.parent.id);
|
|
1342
1186
|
};
|
|
1343
|
-
|
|
1344
|
-
});
|
|
1345
|
-
values.value.categories = newSelectedOptions;
|
|
1187
|
+
z(H.value);
|
|
1188
|
+
}), l.value.categories = O;
|
|
1346
1189
|
};
|
|
1347
1190
|
return {
|
|
1348
|
-
isCreation,
|
|
1349
|
-
postId,
|
|
1350
|
-
pagePath:
|
|
1351
|
-
categoryOptionList,
|
|
1352
|
-
values,
|
|
1353
|
-
errors,
|
|
1354
|
-
isContentLoading,
|
|
1355
|
-
postListUrl:
|
|
1356
|
-
submitForm
|
|
1357
|
-
isLangSpecific,
|
|
1358
|
-
languageOptionList,
|
|
1359
|
-
isSubmitting,
|
|
1360
|
-
moduleConfig,
|
|
1361
|
-
postOptionList,
|
|
1362
|
-
getUploadAdapterOptions,
|
|
1363
|
-
tabList,
|
|
1364
|
-
selectedTabId,
|
|
1365
|
-
headerButtonList,
|
|
1366
|
-
handleSeoFieldGroupChange,
|
|
1367
|
-
handleTitleChange,
|
|
1368
|
-
handleAliasChange,
|
|
1369
|
-
urlAliasTemplate,
|
|
1370
|
-
handleCategoriesChange,
|
|
1371
|
-
statusOptions
|
|
1191
|
+
isCreation: d,
|
|
1192
|
+
postId: t,
|
|
1193
|
+
pagePath: U,
|
|
1194
|
+
categoryOptionList: q,
|
|
1195
|
+
values: l,
|
|
1196
|
+
errors: m,
|
|
1197
|
+
isContentLoading: j,
|
|
1198
|
+
postListUrl: Pe(),
|
|
1199
|
+
submitForm: $,
|
|
1200
|
+
isLangSpecific: F,
|
|
1201
|
+
languageOptionList: L,
|
|
1202
|
+
isSubmitting: W,
|
|
1203
|
+
moduleConfig: s,
|
|
1204
|
+
postOptionList: w,
|
|
1205
|
+
getUploadAdapterOptions: X,
|
|
1206
|
+
tabList: S,
|
|
1207
|
+
selectedTabId: k,
|
|
1208
|
+
headerButtonList: _,
|
|
1209
|
+
handleSeoFieldGroupChange: K,
|
|
1210
|
+
handleTitleChange: ve,
|
|
1211
|
+
handleAliasChange: fe,
|
|
1212
|
+
urlAliasTemplate: le,
|
|
1213
|
+
handleCategoriesChange: ne,
|
|
1214
|
+
statusOptions: C
|
|
1372
1215
|
};
|
|
1373
1216
|
}
|
|
1374
|
-
})
|
|
1375
|
-
const _hoisted_1$1 = { class: "status" };
|
|
1376
|
-
const _hoisted_2 = { class: "status-value" };
|
|
1377
|
-
const _hoisted_3 = {
|
|
1217
|
+
}), at = { class: "status" }, tt = { class: "status-value" }, ot = {
|
|
1378
1218
|
key: 0,
|
|
1379
1219
|
class: "status-checkbox"
|
|
1380
|
-
}
|
|
1381
|
-
const _hoisted_4 = {
|
|
1220
|
+
}, lt = {
|
|
1382
1221
|
key: 1,
|
|
1383
1222
|
class: "status-date"
|
|
1384
1223
|
};
|
|
1385
|
-
function
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
const _component_FormFieldMultiSelect = resolveComponent("FormFieldMultiSelect");
|
|
1394
|
-
const _component_DynamicField = resolveComponent("DynamicField");
|
|
1395
|
-
const _component_SeoFieldGroup = resolveComponent("SeoFieldGroup");
|
|
1396
|
-
const _component_FormFooter = resolveComponent("FormFooter");
|
|
1397
|
-
const _component_Page = resolveComponent("Page");
|
|
1398
|
-
return openBlock(), createBlock(_component_Page, {
|
|
1399
|
-
title: _ctx.isCreation ? _ctx.$i18n.t("blog:createPost") : _ctx.$i18n.t("blog:updatePost"),
|
|
1400
|
-
"is-content-loading": _ctx.isContentLoading,
|
|
1401
|
-
"header-buttons": _ctx.headerButtonList,
|
|
1224
|
+
function nt(e, a, n, o, t, d) {
|
|
1225
|
+
const c = y("FormFieldSelect"), C = y("FormField"), s = y("FormFieldUrlAliasInput"), b = y("FormFieldCheckbox"), v = y("FormFieldRichTextInput"), L = y("ShortCodeConstructor"), F = y("FormFieldFileInput"), I = y("FormFieldMultiSelect"), g = y("DynamicField"), f = y("SeoFieldGroup"), h = y("FormFooter"), D = y("Page");
|
|
1226
|
+
return T(), M(D, {
|
|
1227
|
+
"tab-id": e.selectedTabId,
|
|
1228
|
+
"onUpdate:tab-id": a[16] || (a[16] = (u) => e.selectedTabId = u),
|
|
1229
|
+
title: e.isCreation ? e.$i18n.t("blog:createPost") : e.$i18n.t("blog:updatePost"),
|
|
1230
|
+
"is-content-loading": e.isContentLoading,
|
|
1231
|
+
"header-buttons": e.headerButtonList,
|
|
1402
1232
|
footer: {
|
|
1403
|
-
backHref:
|
|
1404
|
-
onSubmit:
|
|
1405
|
-
isSubmitting:
|
|
1233
|
+
backHref: e.postListUrl,
|
|
1234
|
+
onSubmit: e.submitForm,
|
|
1235
|
+
isSubmitting: e.isSubmitting
|
|
1406
1236
|
},
|
|
1407
|
-
|
|
1408
|
-
"onUpdate:tab-id": _cache[16] || (_cache[16] = ($event) => _ctx.selectedTabId = $event),
|
|
1409
|
-
tabs: _ctx.tabList
|
|
1237
|
+
tabs: e.tabList
|
|
1410
1238
|
}, {
|
|
1411
|
-
content:
|
|
1412
|
-
|
|
1239
|
+
content: A(() => [
|
|
1240
|
+
Y("form", {
|
|
1413
1241
|
novalidate: "",
|
|
1414
|
-
onSubmit:
|
|
1242
|
+
onSubmit: a[15] || (a[15] = Ve(() => {
|
|
1243
|
+
}, ["prevent"]))
|
|
1415
1244
|
}, [
|
|
1416
|
-
|
|
1417
|
-
|
|
1245
|
+
e.selectedTabId === "common" ? (T(), Q(J, { key: 0 }, [
|
|
1246
|
+
e.isCreation && e.isLangSpecific ? (T(), M(c, {
|
|
1418
1247
|
key: 0,
|
|
1419
|
-
value:
|
|
1420
|
-
"onUpdate:value":
|
|
1248
|
+
value: e.values.language,
|
|
1249
|
+
"onUpdate:value": a[0] || (a[0] = (u) => e.values.language = u),
|
|
1421
1250
|
name: "language",
|
|
1422
|
-
label:
|
|
1423
|
-
options:
|
|
1424
|
-
error:
|
|
1425
|
-
}, null, 8, ["value", "label", "options", "error"])) :
|
|
1426
|
-
|
|
1427
|
-
value:
|
|
1428
|
-
"onUpdate:value":
|
|
1251
|
+
label: e.$i18n.t("blog:language"),
|
|
1252
|
+
options: e.languageOptionList,
|
|
1253
|
+
error: e.errors.language
|
|
1254
|
+
}, null, 8, ["value", "label", "options", "error"])) : B("", !0),
|
|
1255
|
+
p(C, {
|
|
1256
|
+
value: e.values.title,
|
|
1257
|
+
"onUpdate:value": a[1] || (a[1] = (u) => e.values.title = u),
|
|
1429
1258
|
name: "title",
|
|
1430
|
-
label:
|
|
1431
|
-
error:
|
|
1432
|
-
onInput:
|
|
1259
|
+
label: e.$i18n.t("blog:title"),
|
|
1260
|
+
error: e.errors.title,
|
|
1261
|
+
onInput: e.handleTitleChange
|
|
1433
1262
|
}, null, 8, ["value", "label", "error", "onInput"]),
|
|
1434
|
-
|
|
1263
|
+
p(s, {
|
|
1435
1264
|
id: "urlAlias",
|
|
1436
|
-
value:
|
|
1437
|
-
"onUpdate:value":
|
|
1265
|
+
value: e.values.urlAlias,
|
|
1266
|
+
"onUpdate:value": a[2] || (a[2] = (u) => e.values.urlAlias = u),
|
|
1438
1267
|
name: "urlAlias",
|
|
1439
|
-
label:
|
|
1440
|
-
"url-template":
|
|
1441
|
-
error:
|
|
1442
|
-
onChange:
|
|
1268
|
+
label: e.$i18n.t("blog:link"),
|
|
1269
|
+
"url-template": e.urlAliasTemplate,
|
|
1270
|
+
error: e.errors.urlAlias,
|
|
1271
|
+
onChange: e.handleAliasChange
|
|
1443
1272
|
}, null, 8, ["value", "label", "url-template", "error", "onChange"]),
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
value:
|
|
1448
|
-
"onUpdate:value":
|
|
1273
|
+
Y("div", at, [
|
|
1274
|
+
Y("div", tt, [
|
|
1275
|
+
p(c, {
|
|
1276
|
+
value: e.values.status,
|
|
1277
|
+
"onUpdate:value": a[3] || (a[3] = (u) => e.values.status = u),
|
|
1449
1278
|
name: "status",
|
|
1450
|
-
error:
|
|
1451
|
-
label:
|
|
1452
|
-
"no-options-message":
|
|
1453
|
-
options:
|
|
1279
|
+
error: e.errors.status,
|
|
1280
|
+
label: e.$i18n.t("blog:status"),
|
|
1281
|
+
"no-options-message": e.$i18n.t("blog:noTemplates"),
|
|
1282
|
+
options: e.statusOptions
|
|
1454
1283
|
}, null, 8, ["value", "error", "label", "no-options-message", "options"])
|
|
1455
1284
|
]),
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
checked:
|
|
1459
|
-
"onUpdate:checked":
|
|
1285
|
+
e.values.status.value === "PUBLISHED" || e.values.status.value === "DRAFT" ? (T(), Q("div", ot, [
|
|
1286
|
+
p(b, {
|
|
1287
|
+
checked: e.values.statusDateEnabled,
|
|
1288
|
+
"onUpdate:checked": a[4] || (a[4] = (u) => e.values.statusDateEnabled = u),
|
|
1460
1289
|
name: "statusDateEnabled",
|
|
1461
|
-
label:
|
|
1462
|
-
|
|
1290
|
+
label: e.$i18n.t(
|
|
1291
|
+
e.values.status.value === "PUBLISHED" ? "blog:scheduleArchive" : "blog:schedulePublish"
|
|
1463
1292
|
),
|
|
1464
|
-
error:
|
|
1293
|
+
error: e.errors.status
|
|
1465
1294
|
}, null, 8, ["checked", "label", "error"])
|
|
1466
|
-
])) :
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
value:
|
|
1470
|
-
"onUpdate:value":
|
|
1295
|
+
])) : B("", !0),
|
|
1296
|
+
e.values.statusDateEnabled && (e.values.status.value === "PUBLISHED" || e.values.status.value === "DRAFT") ? (T(), Q("div", lt, [
|
|
1297
|
+
p(C, {
|
|
1298
|
+
value: e.values.statusDate,
|
|
1299
|
+
"onUpdate:value": a[5] || (a[5] = (u) => e.values.statusDate = u),
|
|
1471
1300
|
name: "statusDate",
|
|
1472
1301
|
type: "date",
|
|
1473
|
-
label:
|
|
1474
|
-
|
|
1302
|
+
label: e.$i18n.t(
|
|
1303
|
+
e.values.status.value === "PUBLISHED" ? "blog:archiveAt" : "blog:publishAt"
|
|
1475
1304
|
),
|
|
1476
|
-
error:
|
|
1305
|
+
error: e.errors.statusDate
|
|
1477
1306
|
}, null, 8, ["value", "label", "error"])
|
|
1478
|
-
])) :
|
|
1307
|
+
])) : B("", !0)
|
|
1479
1308
|
]),
|
|
1480
|
-
|
|
1481
|
-
value:
|
|
1482
|
-
"onUpdate:value":
|
|
1309
|
+
p(C, {
|
|
1310
|
+
value: e.values.datetime,
|
|
1311
|
+
"onUpdate:value": a[6] || (a[6] = (u) => e.values.datetime = u),
|
|
1483
1312
|
name: "datetime",
|
|
1484
|
-
label:
|
|
1313
|
+
label: e.$i18n.t("blog:date"),
|
|
1485
1314
|
type: "date",
|
|
1486
|
-
error:
|
|
1315
|
+
error: e.errors.datetime
|
|
1487
1316
|
}, null, 8, ["value", "label", "error"]),
|
|
1488
|
-
|
|
1489
|
-
value:
|
|
1490
|
-
"onUpdate:value":
|
|
1317
|
+
p(C, {
|
|
1318
|
+
value: e.values.excerpt,
|
|
1319
|
+
"onUpdate:value": a[7] || (a[7] = (u) => e.values.excerpt = u),
|
|
1491
1320
|
name: "excerpt",
|
|
1492
|
-
label:
|
|
1321
|
+
label: e.$i18n.t("blog:excerpt"),
|
|
1493
1322
|
type: "textarea",
|
|
1494
|
-
error:
|
|
1323
|
+
error: e.errors.excerpt
|
|
1495
1324
|
}, null, 8, ["value", "label", "error"]),
|
|
1496
|
-
|
|
1497
|
-
value:
|
|
1498
|
-
"onUpdate:value":
|
|
1325
|
+
p(v, {
|
|
1326
|
+
value: e.values.body,
|
|
1327
|
+
"onUpdate:value": a[8] || (a[8] = (u) => e.values.body = u),
|
|
1499
1328
|
name: "body",
|
|
1500
|
-
label:
|
|
1501
|
-
error:
|
|
1502
|
-
"get-upload-adapter-options":
|
|
1329
|
+
label: e.$i18n.t("blog:body"),
|
|
1330
|
+
error: e.errors.body,
|
|
1331
|
+
"get-upload-adapter-options": e.getUploadAdapterOptions
|
|
1503
1332
|
}, null, 8, ["value", "label", "error", "get-upload-adapter-options"]),
|
|
1504
|
-
|
|
1505
|
-
"short-code-config-list":
|
|
1333
|
+
p(L, {
|
|
1334
|
+
"short-code-config-list": e.moduleConfig ? e.moduleConfig.shortcodes : []
|
|
1506
1335
|
}, null, 8, ["short-code-config-list"])
|
|
1507
|
-
], 64)) :
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
value:
|
|
1511
|
-
"onUpdate:value":
|
|
1512
|
-
label:
|
|
1336
|
+
], 64)) : B("", !0),
|
|
1337
|
+
e.selectedTabId === "images" ? (T(), Q(J, { key: 1 }, [
|
|
1338
|
+
p(F, {
|
|
1339
|
+
value: e.values.coverImage,
|
|
1340
|
+
"onUpdate:value": a[9] || (a[9] = (u) => e.values.coverImage = u),
|
|
1341
|
+
label: e.$i18n.t("blog:coverImage"),
|
|
1513
1342
|
name: "coverImage",
|
|
1514
1343
|
"file-type": "image",
|
|
1515
|
-
scenario:
|
|
1344
|
+
scenario: e.moduleConfig ? e.moduleConfig.fileScenarios.cover : null
|
|
1516
1345
|
}, null, 8, ["value", "label", "scenario"]),
|
|
1517
|
-
|
|
1518
|
-
value:
|
|
1519
|
-
"onUpdate:value":
|
|
1346
|
+
p(F, {
|
|
1347
|
+
value: e.values.image,
|
|
1348
|
+
"onUpdate:value": a[10] || (a[10] = (u) => e.values.image = u),
|
|
1520
1349
|
name: "image",
|
|
1521
|
-
label:
|
|
1350
|
+
label: e.$i18n.t("blog:innerImage"),
|
|
1522
1351
|
"file-type": "image",
|
|
1523
|
-
scenario:
|
|
1352
|
+
scenario: e.moduleConfig ? e.moduleConfig.fileScenarios.image : null
|
|
1524
1353
|
}, null, 8, ["value", "label", "scenario"]),
|
|
1525
|
-
|
|
1526
|
-
value:
|
|
1527
|
-
"onUpdate:value":
|
|
1354
|
+
p(F, {
|
|
1355
|
+
value: e.values.imageMobile,
|
|
1356
|
+
"onUpdate:value": a[11] || (a[11] = (u) => e.values.imageMobile = u),
|
|
1528
1357
|
name: "imageMobile",
|
|
1529
|
-
label:
|
|
1358
|
+
label: e.$i18n.t("blog:innerImageMobile"),
|
|
1530
1359
|
"file-type": "image",
|
|
1531
|
-
scenario:
|
|
1360
|
+
scenario: e.moduleConfig ? e.moduleConfig.fileScenarios.imageMobile : null
|
|
1532
1361
|
}, null, 8, ["value", "label", "scenario"])
|
|
1533
|
-
], 64)) :
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
value:
|
|
1537
|
-
"onUpdate:value":
|
|
1362
|
+
], 64)) : B("", !0),
|
|
1363
|
+
e.selectedTabId === "relations" ? (T(), Q(J, { key: 2 }, [
|
|
1364
|
+
p(C, {
|
|
1365
|
+
value: e.values.tags,
|
|
1366
|
+
"onUpdate:value": a[12] || (a[12] = (u) => e.values.tags = u),
|
|
1538
1367
|
name: "tags",
|
|
1539
|
-
label:
|
|
1540
|
-
error:
|
|
1368
|
+
label: e.$i18n.t("blog:tags"),
|
|
1369
|
+
error: e.errors.tags
|
|
1541
1370
|
}, null, 8, ["value", "label", "error"]),
|
|
1542
|
-
|
|
1543
|
-
"selected-options":
|
|
1544
|
-
"onUpdate:selected-options":
|
|
1371
|
+
p(I, {
|
|
1372
|
+
"selected-options": e.values.categories,
|
|
1373
|
+
"onUpdate:selected-options": a[13] || (a[13] = (u) => e.values.categories = u),
|
|
1545
1374
|
name: "categories",
|
|
1546
|
-
label:
|
|
1547
|
-
options:
|
|
1548
|
-
error:
|
|
1549
|
-
onChange:
|
|
1375
|
+
label: e.$i18n.t("blog:categories"),
|
|
1376
|
+
options: e.categoryOptionList,
|
|
1377
|
+
error: e.errors.categories,
|
|
1378
|
+
onChange: e.handleCategoriesChange
|
|
1550
1379
|
}, null, 8, ["selected-options", "label", "options", "error", "onChange"]),
|
|
1551
|
-
|
|
1552
|
-
"selected-options":
|
|
1553
|
-
"onUpdate:selected-options":
|
|
1380
|
+
p(I, {
|
|
1381
|
+
"selected-options": e.values.relatedPosts,
|
|
1382
|
+
"onUpdate:selected-options": a[14] || (a[14] = (u) => e.values.relatedPosts = u),
|
|
1554
1383
|
name: "relatedPosts",
|
|
1555
|
-
label:
|
|
1556
|
-
options:
|
|
1557
|
-
error:
|
|
1558
|
-
searchable:
|
|
1384
|
+
label: e.$i18n.t("blog:relatedPosts"),
|
|
1385
|
+
options: e.postOptionList,
|
|
1386
|
+
error: e.errors.relatedPosts,
|
|
1387
|
+
searchable: !0
|
|
1559
1388
|
}, null, 8, ["selected-options", "label", "options", "error"])
|
|
1560
|
-
], 64)) :
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
}), 128)) : createCommentVNode("", true),
|
|
1567
|
-
_ctx.selectedTabId === "seo" ? (openBlock(), createBlock(_component_SeoFieldGroup, {
|
|
1389
|
+
], 64)) : B("", !0),
|
|
1390
|
+
e.selectedTabId === "additional" ? (T(!0), Q(J, { key: 3 }, ra(e.values.additionalFields, (u) => (T(), M(g, {
|
|
1391
|
+
key: u.id,
|
|
1392
|
+
field: u
|
|
1393
|
+
}, null, 8, ["field"]))), 128)) : B("", !0),
|
|
1394
|
+
e.selectedTabId === "seo" ? (T(), M(f, {
|
|
1568
1395
|
key: 4,
|
|
1569
|
-
title:
|
|
1570
|
-
"title-error-message":
|
|
1571
|
-
"title-label":
|
|
1572
|
-
description:
|
|
1573
|
-
"description-error-message":
|
|
1574
|
-
"description-label":
|
|
1575
|
-
image:
|
|
1576
|
-
"image-error-message":
|
|
1577
|
-
"image-label":
|
|
1578
|
-
"image-scenario":
|
|
1579
|
-
onChange:
|
|
1580
|
-
}, null, 8, ["title", "title-error-message", "title-label", "description", "description-error-message", "description-label", "image", "image-error-message", "image-label", "image-scenario", "onChange"])) :
|
|
1396
|
+
title: e.values.pageTitle,
|
|
1397
|
+
"title-error-message": e.errors.pageTitle,
|
|
1398
|
+
"title-label": e.$i18n.t("blog:pageTitle"),
|
|
1399
|
+
description: e.values.pageDescription,
|
|
1400
|
+
"description-error-message": e.errors.pageDescription,
|
|
1401
|
+
"description-label": e.$i18n.t("blog:pageDescription"),
|
|
1402
|
+
image: e.values.openGraphImage,
|
|
1403
|
+
"image-error-message": e.errors.openGraphImage,
|
|
1404
|
+
"image-label": e.$i18n.t("blog:openGraphImage"),
|
|
1405
|
+
"image-scenario": e.moduleConfig ? e.moduleConfig.fileScenarios.openGraph : null,
|
|
1406
|
+
onChange: e.handleSeoFieldGroupChange
|
|
1407
|
+
}, null, 8, ["title", "title-error-message", "title-label", "description", "description-error-message", "description-label", "image", "image-error-message", "image-label", "image-scenario", "onChange"])) : B("", !0)
|
|
1581
1408
|
], 32)
|
|
1582
1409
|
]),
|
|
1583
|
-
footer:
|
|
1584
|
-
|
|
1585
|
-
"back-href":
|
|
1586
|
-
"is-submitting":
|
|
1587
|
-
"is-creation":
|
|
1588
|
-
"can-create-another":
|
|
1589
|
-
onSubmit:
|
|
1410
|
+
footer: A(() => [
|
|
1411
|
+
p(h, {
|
|
1412
|
+
"back-href": e.postListUrl,
|
|
1413
|
+
"is-submitting": e.isSubmitting,
|
|
1414
|
+
"is-creation": e.isCreation,
|
|
1415
|
+
"can-create-another": e.isCreation,
|
|
1416
|
+
onSubmit: e.submitForm
|
|
1590
1417
|
}, null, 8, ["back-href", "is-submitting", "is-creation", "can-create-another", "onSubmit"])
|
|
1591
1418
|
]),
|
|
1592
1419
|
_: 1
|
|
1593
|
-
}, 8, ["title", "is-content-loading", "header-buttons", "footer", "
|
|
1420
|
+
}, 8, ["tab-id", "title", "is-content-loading", "header-buttons", "footer", "tabs"]);
|
|
1594
1421
|
}
|
|
1595
|
-
|
|
1596
|
-
function
|
|
1597
|
-
return
|
|
1598
|
-
if (
|
|
1599
|
-
const
|
|
1600
|
-
({ id }) =>
|
|
1422
|
+
const st = /* @__PURE__ */ be(et, [["render", nt], ["__scopeId", "data-v-be9f92cf"]]);
|
|
1423
|
+
function rt(e, a) {
|
|
1424
|
+
return e.map((n) => {
|
|
1425
|
+
if (a.length > 0) {
|
|
1426
|
+
const o = a.find(
|
|
1427
|
+
({ id: t }) => n.language === t
|
|
1601
1428
|
);
|
|
1602
1429
|
return {
|
|
1603
|
-
...
|
|
1604
|
-
language:
|
|
1430
|
+
...n,
|
|
1431
|
+
language: o ? o.name : n.language
|
|
1605
1432
|
};
|
|
1606
1433
|
}
|
|
1607
|
-
return
|
|
1434
|
+
return n;
|
|
1608
1435
|
});
|
|
1609
1436
|
}
|
|
1610
|
-
function
|
|
1611
|
-
const
|
|
1612
|
-
|
|
1437
|
+
function it(e, a) {
|
|
1438
|
+
const n = e ? e.languages.length > 0 : !1;
|
|
1439
|
+
return [
|
|
1613
1440
|
{
|
|
1614
1441
|
id: 1,
|
|
1615
|
-
name:
|
|
1442
|
+
name: a("blog:name"),
|
|
1616
1443
|
field: "name",
|
|
1617
1444
|
type: "name",
|
|
1618
|
-
format: ({ row }) => ({
|
|
1445
|
+
format: ({ row: t }) => ({
|
|
1619
1446
|
adminLink: {
|
|
1620
|
-
url:
|
|
1621
|
-
text:
|
|
1447
|
+
url: $e({ categoryId: t.id }),
|
|
1448
|
+
text: ae(t.name, t.depth)
|
|
1622
1449
|
},
|
|
1623
|
-
paramList:
|
|
1450
|
+
paramList: t.isDefault ? [{ name: a("blog:defaultCategory"), value: a("blog:yes") }] : []
|
|
1624
1451
|
})
|
|
1625
1452
|
},
|
|
1626
1453
|
{
|
|
1627
1454
|
id: 2,
|
|
1628
|
-
name:
|
|
1455
|
+
name: a("blog:link"),
|
|
1629
1456
|
field: "path",
|
|
1630
1457
|
type: "link",
|
|
1631
|
-
format: ({ row }) => ({
|
|
1632
|
-
url: `${
|
|
1633
|
-
text:
|
|
1458
|
+
format: ({ row: t }) => ({
|
|
1459
|
+
url: `${qe()}${t.url}`,
|
|
1460
|
+
text: t.url
|
|
1634
1461
|
}),
|
|
1635
1462
|
options: {
|
|
1636
|
-
shouldOpenNewTab:
|
|
1463
|
+
shouldOpenNewTab: !0
|
|
1637
1464
|
}
|
|
1638
1465
|
},
|
|
1639
|
-
|
|
1466
|
+
n ? { id: 3, name: a("blog:language"), field: "language" } : null,
|
|
1640
1467
|
{
|
|
1641
1468
|
id: 4,
|
|
1642
|
-
name:
|
|
1469
|
+
name: a("blog:posts"),
|
|
1643
1470
|
field: "linkToPosts",
|
|
1644
1471
|
style: { whiteSpace: "nowrap", width: "130px" }
|
|
1645
1472
|
},
|
|
1646
1473
|
{
|
|
1647
1474
|
id: 5,
|
|
1648
|
-
name:
|
|
1475
|
+
name: a("blog:actions"),
|
|
1649
1476
|
field: "actions",
|
|
1650
1477
|
style: { whiteSpace: "nowrap", width: "170px" },
|
|
1651
1478
|
headStyle: { whiteSpace: "nowrap", width: "170px" },
|
|
1652
1479
|
class: "actions-cell"
|
|
1653
1480
|
}
|
|
1654
|
-
];
|
|
1655
|
-
return COLUMN_DEFS.filter(notEmpty);
|
|
1481
|
+
].filter(ke);
|
|
1656
1482
|
}
|
|
1657
|
-
function
|
|
1658
|
-
return `${
|
|
1483
|
+
function ut(e) {
|
|
1484
|
+
return `${Pe()}?filter[category]=${e}`;
|
|
1659
1485
|
}
|
|
1660
|
-
function
|
|
1661
|
-
const
|
|
1662
|
-
() =>
|
|
1663
|
-
)
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
route.query,
|
|
1486
|
+
function gt({ languageList: e, route: a, t: n }) {
|
|
1487
|
+
const o = r(
|
|
1488
|
+
() => e.value.map(({ id: b, name: v }) => ({ value: b, label: v }))
|
|
1489
|
+
), t = r(() => {
|
|
1490
|
+
const b = ie(
|
|
1491
|
+
a.query,
|
|
1667
1492
|
"language"
|
|
1493
|
+
/* LANGUAGE */
|
|
1668
1494
|
);
|
|
1669
|
-
return
|
|
1670
|
-
({ value }) =>
|
|
1495
|
+
return o.value.filter(
|
|
1496
|
+
({ value: v }) => b.some((L) => L === v)
|
|
1671
1497
|
);
|
|
1498
|
+
}), d = E(t.value);
|
|
1499
|
+
G(t, () => {
|
|
1500
|
+
d.value = t.value;
|
|
1672
1501
|
});
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
});
|
|
1677
|
-
const filterParams = computed(
|
|
1678
|
-
() => getFilterParams({
|
|
1679
|
-
["language"]: languageFilter.value.map(({ value }) => value)
|
|
1502
|
+
const c = r(
|
|
1503
|
+
() => He({
|
|
1504
|
+
language: d.value.map(({ value: b }) => b)
|
|
1680
1505
|
})
|
|
1681
1506
|
);
|
|
1682
|
-
function
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
);
|
|
1687
|
-
}
|
|
1507
|
+
function C(b) {
|
|
1508
|
+
b.name === "language" && (d.value = d.value.filter(
|
|
1509
|
+
({ value: v }) => v !== b.value
|
|
1510
|
+
));
|
|
1688
1511
|
}
|
|
1689
|
-
const
|
|
1690
|
-
...
|
|
1691
|
-
value,
|
|
1692
|
-
label,
|
|
1512
|
+
const s = r(() => [
|
|
1513
|
+
...d.value.map(({ value: b, label: v }) => ({
|
|
1514
|
+
value: b,
|
|
1515
|
+
label: v,
|
|
1693
1516
|
name: "language",
|
|
1694
|
-
title:
|
|
1517
|
+
title: n("blog:language")
|
|
1695
1518
|
}))
|
|
1696
1519
|
]);
|
|
1697
1520
|
return {
|
|
1698
|
-
languageFilter,
|
|
1699
|
-
languageOptionList,
|
|
1700
|
-
tagRemovalHandler,
|
|
1701
|
-
tags,
|
|
1702
|
-
filterParams
|
|
1521
|
+
languageFilter: d,
|
|
1522
|
+
languageOptionList: o,
|
|
1523
|
+
tagRemovalHandler: C,
|
|
1524
|
+
tags: s,
|
|
1525
|
+
filterParams: c
|
|
1703
1526
|
};
|
|
1704
1527
|
}
|
|
1705
|
-
const
|
|
1528
|
+
const dt = pe({
|
|
1706
1529
|
name: "BlogCategoryList",
|
|
1707
1530
|
components: {
|
|
1708
|
-
DeleteIcon,
|
|
1709
|
-
SouthIcon,
|
|
1710
|
-
NorthIcon,
|
|
1711
|
-
EditIcon,
|
|
1712
|
-
BaseButton,
|
|
1713
|
-
CountButton,
|
|
1714
|
-
FormFieldMultiSelect,
|
|
1715
|
-
AdvancedSearch,
|
|
1716
|
-
Page,
|
|
1717
|
-
DataTable
|
|
1531
|
+
DeleteIcon: je,
|
|
1532
|
+
SouthIcon: ha,
|
|
1533
|
+
NorthIcon: ya,
|
|
1534
|
+
EditIcon: Ke,
|
|
1535
|
+
BaseButton: Qe,
|
|
1536
|
+
CountButton: fa,
|
|
1537
|
+
FormFieldMultiSelect: Le,
|
|
1538
|
+
AdvancedSearch: Ye,
|
|
1539
|
+
Page: me,
|
|
1540
|
+
DataTable: ze
|
|
1718
1541
|
},
|
|
1719
1542
|
setup() {
|
|
1720
|
-
const { t } =
|
|
1721
|
-
const route = useRoute();
|
|
1722
|
-
const router = useRouter();
|
|
1723
|
-
const { data: moduleConfig, loading: isModuleConfigLoading } = useFetchModuleConfig();
|
|
1724
|
-
const languageList = computed(
|
|
1543
|
+
const { t: e } = ue(), a = ge(), n = de(), { data: o, loading: t } = ce(), d = r(
|
|
1725
1544
|
() => {
|
|
1726
|
-
var
|
|
1727
|
-
return (
|
|
1545
|
+
var U;
|
|
1546
|
+
return ((U = o.value) == null ? void 0 : U.languages) ?? [];
|
|
1728
1547
|
}
|
|
1729
|
-
)
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
pageNumber: params.pageNumber,
|
|
1754
|
-
pageSize: params.pageSize,
|
|
1755
|
-
...filterParams.value
|
|
1548
|
+
), {
|
|
1549
|
+
languageFilter: c,
|
|
1550
|
+
languageOptionList: C,
|
|
1551
|
+
filterParams: s,
|
|
1552
|
+
tags: b,
|
|
1553
|
+
tagRemovalHandler: v
|
|
1554
|
+
} = gt({ languageList: d, route: a, t: e }), L = r(
|
|
1555
|
+
() => C.value.length > 1
|
|
1556
|
+
), {
|
|
1557
|
+
fetchEntityList: F,
|
|
1558
|
+
isLoading: I,
|
|
1559
|
+
rowData: g,
|
|
1560
|
+
errorMessage: f,
|
|
1561
|
+
searchQuery: h,
|
|
1562
|
+
handleChange: D,
|
|
1563
|
+
pageNumber: u,
|
|
1564
|
+
pageCount: V,
|
|
1565
|
+
pageSize: w
|
|
1566
|
+
} = Ze({
|
|
1567
|
+
fetchEntityList: (U) => oa({
|
|
1568
|
+
query: U.searchQuery,
|
|
1569
|
+
pageNumber: U.pageNumber,
|
|
1570
|
+
pageSize: U.pageSize,
|
|
1571
|
+
...s.value
|
|
1756
1572
|
}),
|
|
1757
1573
|
initialValue: [],
|
|
1758
1574
|
resourceName: "Blog categories",
|
|
1759
1575
|
pageSize: 100
|
|
1760
1576
|
});
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
if (isModuleConfigLoading.value || isCategoryListLoading.value) {
|
|
1764
|
-
return;
|
|
1765
|
-
}
|
|
1766
|
-
if (route.path !== BLOG_ROUTE_PATHS.CATEGORY_LIST) {
|
|
1577
|
+
G(s, () => {
|
|
1578
|
+
if (t.value || I.value || a.path !== N.CATEGORY_LIST)
|
|
1767
1579
|
return;
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
query: (_a = route.query.query) != null ? _a : ""
|
|
1580
|
+
const U = {
|
|
1581
|
+
...s.value,
|
|
1582
|
+
query: a.query.query ?? ""
|
|
1772
1583
|
};
|
|
1773
|
-
|
|
1774
|
-
router.replace({ query: newQuery });
|
|
1775
|
-
fetchCategoryList();
|
|
1776
|
-
}
|
|
1584
|
+
We(a.query, U) || (n.replace({ query: U }), F());
|
|
1777
1585
|
});
|
|
1778
|
-
const { isDeleting, handleResourceDelete:
|
|
1779
|
-
deleteResource:
|
|
1586
|
+
const { isDeleting: W, handleResourceDelete: l } = Re({
|
|
1587
|
+
deleteResource: Ea,
|
|
1780
1588
|
resourceName: "Post",
|
|
1781
|
-
onSuccess:
|
|
1782
|
-
});
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
if (response.success) {
|
|
1788
|
-
return fetchCategoryList();
|
|
1789
|
-
}
|
|
1589
|
+
onSuccess: F
|
|
1590
|
+
}), m = E(!1);
|
|
1591
|
+
function $(U, S) {
|
|
1592
|
+
m.value = !0, ka(U, S).then((k) => {
|
|
1593
|
+
if (k.success)
|
|
1594
|
+
return F();
|
|
1790
1595
|
}).catch(console.error).finally(() => {
|
|
1791
|
-
|
|
1596
|
+
m.value = !1;
|
|
1792
1597
|
});
|
|
1793
1598
|
}
|
|
1794
|
-
const
|
|
1795
|
-
() =>
|
|
1796
|
-
)
|
|
1797
|
-
|
|
1798
|
-
() => convertCategoryList(categoryList.value, languageList.value)
|
|
1799
|
-
);
|
|
1800
|
-
const columnDefs = computed(
|
|
1801
|
-
() => getCategoryTableColumnDefs(moduleConfig.value, t)
|
|
1599
|
+
const q = r(
|
|
1600
|
+
() => I.value || t.value
|
|
1601
|
+
), j = r(
|
|
1602
|
+
() => rt(g.value, d.value)
|
|
1802
1603
|
);
|
|
1803
1604
|
return {
|
|
1804
|
-
columnDefs
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1605
|
+
columnDefs: r(
|
|
1606
|
+
() => it(o.value, e)
|
|
1607
|
+
),
|
|
1608
|
+
rowData: j,
|
|
1609
|
+
isRowDataLoading: q,
|
|
1610
|
+
errorMessage: f,
|
|
1611
|
+
isLangSpecific: L,
|
|
1612
|
+
handleCategoryDelete: l,
|
|
1613
|
+
isDeleting: W,
|
|
1614
|
+
getBlogCategoryFormUrl: $e,
|
|
1615
|
+
getLinkToPostsByCategory: ut,
|
|
1616
|
+
startMoveCategory: $,
|
|
1617
|
+
isCategoryMoving: m,
|
|
1618
|
+
searchQuery: h,
|
|
1619
|
+
handleChange: D,
|
|
1620
|
+
pageNumber: u,
|
|
1621
|
+
pageCount: V,
|
|
1622
|
+
pageSize: w,
|
|
1623
|
+
languageFilter: c,
|
|
1624
|
+
languageOptionList: C,
|
|
1625
|
+
tags: b,
|
|
1626
|
+
tagRemovalHandler: v
|
|
1824
1627
|
};
|
|
1825
1628
|
}
|
|
1826
|
-
});
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
const _component_CountButton = resolveComponent("CountButton");
|
|
1832
|
-
const _component_EditIcon = resolveComponent("EditIcon");
|
|
1833
|
-
const _component_BaseButton = resolveComponent("BaseButton");
|
|
1834
|
-
const _component_NorthIcon = resolveComponent("NorthIcon");
|
|
1835
|
-
const _component_SouthIcon = resolveComponent("SouthIcon");
|
|
1836
|
-
const _component_DeleteIcon = resolveComponent("DeleteIcon");
|
|
1837
|
-
const _component_DataTable = resolveComponent("DataTable");
|
|
1838
|
-
const _component_Page = resolveComponent("Page");
|
|
1839
|
-
return openBlock(), createBlock(_component_Page, {
|
|
1840
|
-
title: _ctx.$i18n.t("blog:blogCategories"),
|
|
1629
|
+
}), pt = { class: "filters" };
|
|
1630
|
+
function mt(e, a, n, o, t, d) {
|
|
1631
|
+
const c = y("FormFieldMultiSelect"), C = y("AdvancedSearch"), s = y("CountButton"), b = y("EditIcon"), v = y("BaseButton"), L = y("NorthIcon"), F = y("SouthIcon"), I = y("DeleteIcon"), g = y("DataTable"), f = y("Page");
|
|
1632
|
+
return T(), M(f, {
|
|
1633
|
+
title: e.$i18n.t("blog:blogCategories"),
|
|
1841
1634
|
"header-buttons": [
|
|
1842
1635
|
{
|
|
1843
|
-
text:
|
|
1844
|
-
href:
|
|
1636
|
+
text: e.$i18n.t("blog:newCategory"),
|
|
1637
|
+
href: e.getBlogCategoryFormUrl({ categoryId: "create" })
|
|
1845
1638
|
}
|
|
1846
1639
|
]
|
|
1847
1640
|
}, {
|
|
1848
|
-
content:
|
|
1849
|
-
|
|
1850
|
-
"column-defs":
|
|
1851
|
-
"row-data":
|
|
1852
|
-
loading:
|
|
1853
|
-
"error-message":
|
|
1854
|
-
"search-query":
|
|
1641
|
+
content: A(() => [
|
|
1642
|
+
p(g, {
|
|
1643
|
+
"column-defs": e.columnDefs,
|
|
1644
|
+
"row-data": e.rowData,
|
|
1645
|
+
loading: e.isRowDataLoading,
|
|
1646
|
+
"error-message": e.errorMessage,
|
|
1647
|
+
"search-query": e.searchQuery,
|
|
1855
1648
|
pagination: {
|
|
1856
|
-
pageNumber:
|
|
1857
|
-
pageCount:
|
|
1858
|
-
pageSize:
|
|
1859
|
-
disabled:
|
|
1649
|
+
pageNumber: e.pageNumber,
|
|
1650
|
+
pageCount: e.pageCount,
|
|
1651
|
+
pageSize: e.pageSize,
|
|
1652
|
+
disabled: e.isRowDataLoading
|
|
1860
1653
|
},
|
|
1861
1654
|
"data-table": "blog-category",
|
|
1862
|
-
onChange:
|
|
1863
|
-
},
|
|
1864
|
-
"cell(link-to-posts)":
|
|
1865
|
-
|
|
1866
|
-
href:
|
|
1655
|
+
onChange: e.handleChange
|
|
1656
|
+
}, ia({
|
|
1657
|
+
"cell(link-to-posts)": A(({ row: h }) => [
|
|
1658
|
+
p(s, {
|
|
1659
|
+
href: e.getLinkToPostsByCategory(h.id),
|
|
1867
1660
|
variant: "outline-secondary",
|
|
1868
|
-
count:
|
|
1661
|
+
count: h.postsCount
|
|
1869
1662
|
}, {
|
|
1870
|
-
default:
|
|
1871
|
-
|
|
1663
|
+
default: A(() => [
|
|
1664
|
+
Se(x(e.$i18n.t("blog:posts")), 1)
|
|
1872
1665
|
]),
|
|
1873
1666
|
_: 2
|
|
1874
1667
|
}, 1032, ["href", "count"])
|
|
1875
1668
|
]),
|
|
1876
|
-
"cell(actions)":
|
|
1877
|
-
|
|
1669
|
+
"cell(actions)": A(({ row: h, rowIndex: D }) => [
|
|
1670
|
+
p(v, {
|
|
1878
1671
|
variant: "icon",
|
|
1879
|
-
title:
|
|
1880
|
-
disabled:
|
|
1881
|
-
href:
|
|
1672
|
+
title: e.$i18n.t("blog:edit"),
|
|
1673
|
+
disabled: e.isDeleting(h.id),
|
|
1674
|
+
href: e.getBlogCategoryFormUrl({ categoryId: h.id })
|
|
1882
1675
|
}, {
|
|
1883
|
-
default:
|
|
1884
|
-
|
|
1676
|
+
default: A(() => [
|
|
1677
|
+
p(b)
|
|
1885
1678
|
]),
|
|
1886
1679
|
_: 2
|
|
1887
1680
|
}, 1032, ["title", "disabled", "href"]),
|
|
1888
|
-
|
|
1681
|
+
p(v, {
|
|
1889
1682
|
variant: "icon",
|
|
1890
|
-
title:
|
|
1891
|
-
disabled:
|
|
1892
|
-
onClick: (
|
|
1683
|
+
title: e.$i18n.t("blog:moveUp"),
|
|
1684
|
+
disabled: D === 0 || e.isCategoryMoving,
|
|
1685
|
+
onClick: (u) => e.startMoveCategory(h.id, "up")
|
|
1893
1686
|
}, {
|
|
1894
|
-
default:
|
|
1895
|
-
|
|
1687
|
+
default: A(() => [
|
|
1688
|
+
p(L)
|
|
1896
1689
|
]),
|
|
1897
1690
|
_: 2
|
|
1898
1691
|
}, 1032, ["title", "disabled", "onClick"]),
|
|
1899
|
-
|
|
1692
|
+
p(v, {
|
|
1900
1693
|
variant: "icon",
|
|
1901
|
-
title:
|
|
1902
|
-
disabled:
|
|
1903
|
-
onClick: (
|
|
1694
|
+
title: e.$i18n.t("blog:moveDown"),
|
|
1695
|
+
disabled: D === e.rowData.length - 1 || e.isCategoryMoving,
|
|
1696
|
+
onClick: (u) => e.startMoveCategory(h.id, "down")
|
|
1904
1697
|
}, {
|
|
1905
|
-
default:
|
|
1906
|
-
|
|
1698
|
+
default: A(() => [
|
|
1699
|
+
p(F)
|
|
1907
1700
|
]),
|
|
1908
1701
|
_: 2
|
|
1909
1702
|
}, 1032, ["title", "disabled", "onClick"]),
|
|
1910
|
-
|
|
1703
|
+
p(v, {
|
|
1911
1704
|
variant: "icon",
|
|
1912
|
-
title:
|
|
1913
|
-
disabled:
|
|
1914
|
-
onClick: (
|
|
1705
|
+
title: e.$i18n.t("blog:remove"),
|
|
1706
|
+
disabled: e.isDeleting(h.id) || h.postsCount > 0,
|
|
1707
|
+
onClick: (u) => e.handleCategoryDelete(h.id)
|
|
1915
1708
|
}, {
|
|
1916
|
-
default:
|
|
1917
|
-
|
|
1709
|
+
default: A(() => [
|
|
1710
|
+
p(I)
|
|
1918
1711
|
]),
|
|
1919
1712
|
_: 2
|
|
1920
1713
|
}, 1032, ["title", "disabled", "onClick"])
|
|
1921
1714
|
]),
|
|
1922
1715
|
_: 2
|
|
1923
1716
|
}, [
|
|
1924
|
-
|
|
1717
|
+
e.isLangSpecific ? {
|
|
1925
1718
|
name: "filters",
|
|
1926
|
-
fn:
|
|
1927
|
-
|
|
1928
|
-
tags:
|
|
1929
|
-
"onClick:tag":
|
|
1719
|
+
fn: A(() => [
|
|
1720
|
+
p(C, {
|
|
1721
|
+
tags: e.tags,
|
|
1722
|
+
"onClick:tag": e.tagRemovalHandler
|
|
1930
1723
|
}, {
|
|
1931
|
-
default:
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
values:
|
|
1935
|
-
"onUpdate:values":
|
|
1936
|
-
options:
|
|
1724
|
+
default: A(() => [
|
|
1725
|
+
Y("div", pt, [
|
|
1726
|
+
p(c, {
|
|
1727
|
+
values: e.languageFilter,
|
|
1728
|
+
"onUpdate:values": a[0] || (a[0] = (h) => e.languageFilter = h),
|
|
1729
|
+
options: e.languageOptionList,
|
|
1937
1730
|
name: "languageFilter",
|
|
1938
|
-
searchable:
|
|
1939
|
-
label:
|
|
1731
|
+
searchable: !0,
|
|
1732
|
+
label: e.$i18n.t("blog:language"),
|
|
1940
1733
|
class: "filter"
|
|
1941
1734
|
}, null, 8, ["values", "options", "label"])
|
|
1942
1735
|
])
|
|
@@ -1951,401 +1744,373 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1951
1744
|
_: 1
|
|
1952
1745
|
}, 8, ["title", "header-buttons"]);
|
|
1953
1746
|
}
|
|
1954
|
-
|
|
1955
|
-
function
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
({ value }) => value === (category == null ? void 0 : category.language)
|
|
1747
|
+
const ct = /* @__PURE__ */ be(dt, [["render", mt]]);
|
|
1748
|
+
function Ce(e, a, n) {
|
|
1749
|
+
const o = a.find(
|
|
1750
|
+
({ value: t }) => t === (e == null ? void 0 : e.language)
|
|
1959
1751
|
);
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
isDefault:
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
openGraphTitle: (_d = category.openGraphTitle) != null ? _d : "",
|
|
1985
|
-
openGraphDescription: (_e = category.openGraphDescription) != null ? _e : "",
|
|
1986
|
-
openGraphImage: category.openGraphImage ? { id: createId(), file: category.openGraphImage } : null
|
|
1752
|
+
return e ? {
|
|
1753
|
+
language: o ?? null,
|
|
1754
|
+
isDefault: e.isDefault,
|
|
1755
|
+
name: e.name,
|
|
1756
|
+
parent: e.parent ? { value: e.parent.id, label: e.parent.name } : { value: null, label: n("blog:noParent") },
|
|
1757
|
+
urlAlias: e.urlAlias,
|
|
1758
|
+
pageTitle: e.pageTitle ?? "",
|
|
1759
|
+
pageDescription: e.pageDescription ?? "",
|
|
1760
|
+
pageKeywords: e.pageKeywords ?? "",
|
|
1761
|
+
openGraphTitle: e.openGraphTitle ?? "",
|
|
1762
|
+
openGraphDescription: e.openGraphDescription ?? "",
|
|
1763
|
+
openGraphImage: e.openGraphImage ? { id: ee(), file: e.openGraphImage } : null
|
|
1764
|
+
} : {
|
|
1765
|
+
language: o ?? null,
|
|
1766
|
+
name: "",
|
|
1767
|
+
parent: { value: null, label: n("blog:noParent") },
|
|
1768
|
+
urlAlias: "",
|
|
1769
|
+
isDefault: !1,
|
|
1770
|
+
pageTitle: "",
|
|
1771
|
+
pageDescription: "",
|
|
1772
|
+
pageKeywords: "",
|
|
1773
|
+
openGraphTitle: "",
|
|
1774
|
+
openGraphDescription: "",
|
|
1775
|
+
openGraphImage: null
|
|
1987
1776
|
};
|
|
1988
1777
|
}
|
|
1989
|
-
function
|
|
1990
|
-
var
|
|
1778
|
+
function bt(e) {
|
|
1779
|
+
var a, n;
|
|
1991
1780
|
return {
|
|
1992
|
-
language: (
|
|
1993
|
-
name:
|
|
1994
|
-
parent:
|
|
1995
|
-
urlAlias:
|
|
1996
|
-
isDefault:
|
|
1997
|
-
pageTitle:
|
|
1998
|
-
pageDescription:
|
|
1999
|
-
openGraphImage: (
|
|
1781
|
+
language: ((a = e.language) == null ? void 0 : a.value) ?? null,
|
|
1782
|
+
name: e.name,
|
|
1783
|
+
parent: e.parent.value,
|
|
1784
|
+
urlAlias: e.urlAlias,
|
|
1785
|
+
isDefault: e.isDefault,
|
|
1786
|
+
pageTitle: e.pageTitle,
|
|
1787
|
+
pageDescription: e.pageDescription,
|
|
1788
|
+
openGraphImage: ((n = e.openGraphImage) == null ? void 0 : n.file.id) ?? null
|
|
2000
1789
|
};
|
|
2001
1790
|
}
|
|
2002
|
-
function
|
|
1791
|
+
function vt(e, a, n) {
|
|
2003
1792
|
return [
|
|
2004
|
-
{ value: null, label:
|
|
2005
|
-
...
|
|
2006
|
-
value:
|
|
2007
|
-
label:
|
|
1793
|
+
{ value: null, label: n("blog:noParent") },
|
|
1794
|
+
...e.filter(({ language: o }) => a ? o === a : !0).map(({ id: o, name: t, depth: d }) => ({
|
|
1795
|
+
value: o,
|
|
1796
|
+
label: ae(t, d)
|
|
2008
1797
|
}))
|
|
2009
1798
|
];
|
|
2010
1799
|
}
|
|
2011
|
-
const
|
|
1800
|
+
const ft = pe({
|
|
2012
1801
|
name: "CategoryForm",
|
|
2013
1802
|
components: {
|
|
2014
|
-
Page,
|
|
2015
|
-
SeoFieldGroup,
|
|
2016
|
-
FormFieldCheckbox,
|
|
2017
|
-
TabList,
|
|
2018
|
-
FormFieldUrlAliasInput,
|
|
2019
|
-
FormField,
|
|
2020
|
-
FormFieldSelect,
|
|
2021
|
-
FormFooter
|
|
1803
|
+
Page: me,
|
|
1804
|
+
SeoFieldGroup: ea,
|
|
1805
|
+
FormFieldCheckbox: xe,
|
|
1806
|
+
TabList: Ca,
|
|
1807
|
+
FormFieldUrlAliasInput: _e,
|
|
1808
|
+
FormField: Te,
|
|
1809
|
+
FormFieldSelect: Xe,
|
|
1810
|
+
FormFooter: Je
|
|
2022
1811
|
},
|
|
2023
1812
|
setup() {
|
|
2024
|
-
const { t } =
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
const toast = useToast();
|
|
2028
|
-
const categoryId = computed(
|
|
2029
|
-
() => route.params.categoryId
|
|
2030
|
-
);
|
|
2031
|
-
const isCreation = computed(() => categoryId.value === "create");
|
|
2032
|
-
const { data: moduleConfig, loading: isModuleConfigLoading } = useFetchModuleConfig();
|
|
2033
|
-
const languageList = computed(
|
|
1813
|
+
const { t: e } = ue(), a = de(), n = ge(), o = we(), t = r(
|
|
1814
|
+
() => n.params.categoryId
|
|
1815
|
+
), d = r(() => t.value === "create"), { data: c, loading: C } = ce(), s = r(
|
|
2034
1816
|
() => {
|
|
2035
|
-
var
|
|
2036
|
-
return (
|
|
1817
|
+
var S;
|
|
1818
|
+
return ((S = c.value) == null ? void 0 : S.languages) ?? [];
|
|
2037
1819
|
}
|
|
2038
|
-
)
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
() => languageOptionList.value.length > 0
|
|
2044
|
-
);
|
|
2045
|
-
const imageScenario = computed(
|
|
1820
|
+
), b = r(
|
|
1821
|
+
() => s.value.map(({ id: S, name: k }) => ({ value: S, label: k }))
|
|
1822
|
+
), v = r(
|
|
1823
|
+
() => b.value.length > 0
|
|
1824
|
+
), L = r(
|
|
2046
1825
|
() => {
|
|
2047
|
-
var
|
|
2048
|
-
return (
|
|
1826
|
+
var S, k;
|
|
1827
|
+
return ((k = (S = c.value) == null ? void 0 : S.fileScenarios) == null ? void 0 : k.openGraph) ?? null;
|
|
2049
1828
|
}
|
|
2050
|
-
)
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
});
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
watch([category, languageOptionList], () => {
|
|
2062
|
-
values.value = convertCategoryToFormValues(
|
|
2063
|
-
category.value,
|
|
2064
|
-
languageOptionList.value,
|
|
2065
|
-
t
|
|
1829
|
+
), { data: F, loading: I } = Ie(), { data: g, loading: f } = Ma({
|
|
1830
|
+
categoryId: t,
|
|
1831
|
+
isCreation: d
|
|
1832
|
+
}), h = E(!1), D = E(
|
|
1833
|
+
Ce(g.value, b.value, e)
|
|
1834
|
+
), u = E({});
|
|
1835
|
+
G([g, b], () => {
|
|
1836
|
+
D.value = Ce(
|
|
1837
|
+
g.value,
|
|
1838
|
+
b.value,
|
|
1839
|
+
e
|
|
2066
1840
|
);
|
|
2067
1841
|
});
|
|
2068
|
-
function
|
|
2069
|
-
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
if (event.type === "create_exit" || event.type === "save_exit") {
|
|
2080
|
-
navigateBack(router, getBlogCategoryListUrl());
|
|
2081
|
-
}
|
|
2082
|
-
if (event.type === "create_create-another") {
|
|
2083
|
-
values.value = convertCategoryToFormValues(
|
|
2084
|
-
null,
|
|
2085
|
-
languageOptionList.value,
|
|
2086
|
-
t
|
|
2087
|
-
);
|
|
2088
|
-
}
|
|
2089
|
-
toast.show({
|
|
1842
|
+
function V(S) {
|
|
1843
|
+
h.value = !0;
|
|
1844
|
+
const k = bt(D.value);
|
|
1845
|
+
(d.value ? Ua(k) : Ba(t.value, k)).then(({ data: K }) => {
|
|
1846
|
+
u.value = {}, S.type === "create" && a.push(
|
|
1847
|
+
$e({ categoryId: String(K.id) })
|
|
1848
|
+
), (S.type === "create_exit" || S.type === "save_exit") && Ge(a, Ee()), S.type === "create_create-another" && (D.value = Ce(
|
|
1849
|
+
null,
|
|
1850
|
+
b.value,
|
|
1851
|
+
e
|
|
1852
|
+
)), o.show({
|
|
2090
1853
|
variant: "success",
|
|
2091
|
-
title:
|
|
2092
|
-
body:
|
|
1854
|
+
title: e("blog:success"),
|
|
1855
|
+
body: d.value ? e("blog:blogCategoryWasSuccessfullyCreated") : e("blog:blogCategoryWasSuccessfullyUpdated")
|
|
2093
1856
|
});
|
|
2094
|
-
}).catch((
|
|
2095
|
-
console.error(
|
|
2096
|
-
errors.value = convertRequestErrorToMap(error);
|
|
2097
|
-
toast.show({
|
|
1857
|
+
}).catch((K) => {
|
|
1858
|
+
console.error(K), u.value = Ne(K), o.show({
|
|
2098
1859
|
variant: "danger",
|
|
2099
|
-
title:
|
|
2100
|
-
body:
|
|
1860
|
+
title: e("blog:error"),
|
|
1861
|
+
body: d.value ? e("blog:blogCategoryCreationWasFailed") : e("blog:blogCategoryUpdateWasFailed")
|
|
2101
1862
|
});
|
|
2102
1863
|
}).finally(() => {
|
|
2103
|
-
|
|
1864
|
+
h.value = !1;
|
|
2104
1865
|
});
|
|
2105
1866
|
}
|
|
2106
|
-
const
|
|
1867
|
+
const w = r(
|
|
2107
1868
|
() => {
|
|
2108
|
-
var
|
|
2109
|
-
return
|
|
2110
|
-
|
|
2111
|
-
(
|
|
2112
|
-
|
|
1869
|
+
var S;
|
|
1870
|
+
return vt(
|
|
1871
|
+
F.value,
|
|
1872
|
+
((S = D.value.language) == null ? void 0 : S.value) ?? null,
|
|
1873
|
+
e
|
|
2113
1874
|
);
|
|
2114
1875
|
}
|
|
2115
|
-
)
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
var _a, _b;
|
|
2121
|
-
return `${getWebsiteOrigin()}${(_b = (_a = category.value) == null ? void 0 : _a.urlTemplate) != null ? _b : ""}`;
|
|
1876
|
+
), W = r(
|
|
1877
|
+
() => f.value || C.value || I.value
|
|
1878
|
+
), l = r(() => {
|
|
1879
|
+
var S;
|
|
1880
|
+
return `${qe()}${((S = g.value) == null ? void 0 : S.urlTemplate) ?? ""}`;
|
|
2122
1881
|
});
|
|
2123
|
-
function
|
|
2124
|
-
title,
|
|
2125
|
-
description,
|
|
2126
|
-
keywords,
|
|
2127
|
-
image
|
|
1882
|
+
function m({
|
|
1883
|
+
title: S,
|
|
1884
|
+
description: k,
|
|
1885
|
+
keywords: _,
|
|
1886
|
+
image: K
|
|
2128
1887
|
}) {
|
|
2129
|
-
|
|
2130
|
-
values.value.pageDescription = description;
|
|
2131
|
-
values.value.pageKeywords = keywords;
|
|
2132
|
-
values.value.openGraphImage = image;
|
|
1888
|
+
D.value.pageTitle = S, D.value.pageDescription = k, D.value.pageKeywords = _, D.value.openGraphImage = K;
|
|
2133
1889
|
}
|
|
2134
|
-
const
|
|
2135
|
-
{ id: "common", label:
|
|
2136
|
-
{ id: "seo", label:
|
|
2137
|
-
])
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
if (isCreation.value && !urlAliasChanged.value) {
|
|
2142
|
-
values.value.urlAlias = urlTranslit(value);
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
const handleAliasChange = () => {
|
|
2146
|
-
urlAliasChanged.value = true;
|
|
1890
|
+
const $ = r(() => [
|
|
1891
|
+
{ id: "common", label: e("blog:tabs.common") },
|
|
1892
|
+
{ id: "seo", label: e("blog:tabs.seo") }
|
|
1893
|
+
]), q = E($.value[0].id), j = E(!1), X = (S) => {
|
|
1894
|
+
d.value && !j.value && (D.value.urlAlias = Me(S));
|
|
1895
|
+
}, U = () => {
|
|
1896
|
+
j.value = !0;
|
|
2147
1897
|
};
|
|
2148
1898
|
return {
|
|
2149
|
-
isCreation,
|
|
2150
|
-
isContentLoading,
|
|
2151
|
-
values,
|
|
2152
|
-
errors,
|
|
2153
|
-
isLangSpecific,
|
|
2154
|
-
languageOptionList,
|
|
2155
|
-
pagePath:
|
|
2156
|
-
categoryListUrl:
|
|
2157
|
-
submitForm,
|
|
2158
|
-
isSubmitting,
|
|
2159
|
-
moduleConfig,
|
|
2160
|
-
parentCategoryOptionList,
|
|
2161
|
-
handleNameChange,
|
|
2162
|
-
handleAliasChange,
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
1899
|
+
isCreation: d,
|
|
1900
|
+
isContentLoading: W,
|
|
1901
|
+
values: D,
|
|
1902
|
+
errors: u,
|
|
1903
|
+
isLangSpecific: v,
|
|
1904
|
+
languageOptionList: b,
|
|
1905
|
+
pagePath: l,
|
|
1906
|
+
categoryListUrl: Ee(),
|
|
1907
|
+
submitForm: V,
|
|
1908
|
+
isSubmitting: h,
|
|
1909
|
+
moduleConfig: c,
|
|
1910
|
+
parentCategoryOptionList: w,
|
|
1911
|
+
handleNameChange: X,
|
|
1912
|
+
handleAliasChange: U,
|
|
1913
|
+
// SEO
|
|
1914
|
+
imageScenario: L,
|
|
1915
|
+
handleSeoFieldGroupChange: m,
|
|
1916
|
+
// Tabs
|
|
1917
|
+
tabList: $,
|
|
1918
|
+
selectedTabId: q
|
|
2167
1919
|
};
|
|
2168
1920
|
}
|
|
2169
1921
|
});
|
|
2170
|
-
function
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
const _component_FormFieldCheckbox = resolveComponent("FormFieldCheckbox");
|
|
2176
|
-
const _component_SeoFieldGroup = resolveComponent("SeoFieldGroup");
|
|
2177
|
-
const _component_FormFooter = resolveComponent("FormFooter");
|
|
2178
|
-
const _component_Page = resolveComponent("Page");
|
|
2179
|
-
return openBlock(), createBlock(_component_Page, {
|
|
2180
|
-
title: _ctx.isCreation ? _ctx.$i18n.t("blog:createBlogCategory") : _ctx.$i18n.t("blog:updateBlogCategory"),
|
|
2181
|
-
"is-content-loading": _ctx.isContentLoading
|
|
1922
|
+
function yt(e, a, n, o, t, d) {
|
|
1923
|
+
const c = y("FormFieldSelect"), C = y("FormField"), s = y("FormFieldUrlAliasInput"), b = y("TabList"), v = y("FormFieldCheckbox"), L = y("SeoFieldGroup"), F = y("FormFooter"), I = y("Page");
|
|
1924
|
+
return T(), M(I, {
|
|
1925
|
+
title: e.isCreation ? e.$i18n.t("blog:createBlogCategory") : e.$i18n.t("blog:updateBlogCategory"),
|
|
1926
|
+
"is-content-loading": e.isContentLoading
|
|
2182
1927
|
}, {
|
|
2183
|
-
content:
|
|
2184
|
-
|
|
1928
|
+
content: A(() => [
|
|
1929
|
+
Y("form", {
|
|
2185
1930
|
novalidate: "",
|
|
2186
|
-
onSubmit:
|
|
1931
|
+
onSubmit: a[10] || (a[10] = Ve(() => {
|
|
1932
|
+
}, ["prevent"]))
|
|
2187
1933
|
}, [
|
|
2188
|
-
|
|
2189
|
-
|
|
1934
|
+
e.isCreation ? (T(), Q(J, { key: 0 }, [
|
|
1935
|
+
e.isLangSpecific ? (T(), M(c, {
|
|
2190
1936
|
key: 0,
|
|
2191
|
-
value:
|
|
2192
|
-
"onUpdate:value":
|
|
1937
|
+
value: e.values.language,
|
|
1938
|
+
"onUpdate:value": a[0] || (a[0] = (g) => e.values.language = g),
|
|
2193
1939
|
name: "language",
|
|
2194
|
-
label:
|
|
2195
|
-
options:
|
|
2196
|
-
error:
|
|
2197
|
-
}, null, 8, ["value", "label", "options", "error"])) :
|
|
2198
|
-
|
|
2199
|
-
value:
|
|
2200
|
-
"onUpdate:value":
|
|
1940
|
+
label: e.$i18n.t("blog:language"),
|
|
1941
|
+
options: e.languageOptionList,
|
|
1942
|
+
error: e.errors.language
|
|
1943
|
+
}, null, 8, ["value", "label", "options", "error"])) : B("", !0),
|
|
1944
|
+
p(C, {
|
|
1945
|
+
value: e.values.name,
|
|
1946
|
+
"onUpdate:value": a[1] || (a[1] = (g) => e.values.name = g),
|
|
2201
1947
|
name: "name",
|
|
2202
|
-
label:
|
|
2203
|
-
error:
|
|
2204
|
-
onInput:
|
|
1948
|
+
label: e.$i18n.t("blog:name"),
|
|
1949
|
+
error: e.errors.name,
|
|
1950
|
+
onInput: e.handleNameChange
|
|
2205
1951
|
}, null, 8, ["value", "label", "error", "onInput"]),
|
|
2206
|
-
!
|
|
1952
|
+
!e.isLangSpecific || e.values.language ? (T(), M(c, {
|
|
2207
1953
|
key: 1,
|
|
2208
|
-
value:
|
|
2209
|
-
"onUpdate:value":
|
|
1954
|
+
value: e.values.parent,
|
|
1955
|
+
"onUpdate:value": a[2] || (a[2] = (g) => e.values.parent = g),
|
|
2210
1956
|
name: "parentCategory",
|
|
2211
|
-
label:
|
|
2212
|
-
options:
|
|
2213
|
-
error:
|
|
2214
|
-
}, null, 8, ["value", "label", "options", "error"])) :
|
|
2215
|
-
|
|
1957
|
+
label: e.$i18n.t("blog:parentCategory"),
|
|
1958
|
+
options: e.parentCategoryOptionList,
|
|
1959
|
+
error: e.errors.parent
|
|
1960
|
+
}, null, 8, ["value", "label", "options", "error"])) : B("", !0),
|
|
1961
|
+
p(s, {
|
|
2216
1962
|
id: "urlAlias",
|
|
2217
|
-
value:
|
|
2218
|
-
"onUpdate:value":
|
|
1963
|
+
value: e.values.urlAlias,
|
|
1964
|
+
"onUpdate:value": a[3] || (a[3] = (g) => e.values.urlAlias = g),
|
|
2219
1965
|
name: "urlAlias",
|
|
2220
|
-
label:
|
|
2221
|
-
"url-template":
|
|
2222
|
-
error:
|
|
2223
|
-
onChange:
|
|
1966
|
+
label: e.$i18n.t("blog:link"),
|
|
1967
|
+
"url-template": e.pagePath,
|
|
1968
|
+
error: e.errors.urlAlias,
|
|
1969
|
+
onChange: e.handleAliasChange
|
|
2224
1970
|
}, null, 8, ["value", "label", "url-template", "error", "onChange"])
|
|
2225
|
-
], 64)) : (
|
|
2226
|
-
|
|
2227
|
-
"tab-id":
|
|
2228
|
-
"onUpdate:tab-id":
|
|
2229
|
-
"tab-list":
|
|
1971
|
+
], 64)) : (T(), Q(J, { key: 1 }, [
|
|
1972
|
+
p(b, {
|
|
1973
|
+
"tab-id": e.selectedTabId,
|
|
1974
|
+
"onUpdate:tab-id": a[4] || (a[4] = (g) => e.selectedTabId = g),
|
|
1975
|
+
"tab-list": e.tabList
|
|
2230
1976
|
}, null, 8, ["tab-id", "tab-list"]),
|
|
2231
|
-
|
|
2232
|
-
|
|
1977
|
+
e.selectedTabId === "common" ? (T(), Q(J, { key: 0 }, [
|
|
1978
|
+
e.isLangSpecific ? (T(), M(c, {
|
|
2233
1979
|
key: 0,
|
|
2234
|
-
value:
|
|
2235
|
-
"onUpdate:value":
|
|
1980
|
+
value: e.values.language,
|
|
1981
|
+
"onUpdate:value": a[5] || (a[5] = (g) => e.values.language = g),
|
|
2236
1982
|
name: "language",
|
|
2237
|
-
label:
|
|
2238
|
-
options:
|
|
2239
|
-
error:
|
|
2240
|
-
}, null, 8, ["value", "label", "options", "error"])) :
|
|
2241
|
-
|
|
2242
|
-
checked:
|
|
2243
|
-
"onUpdate:checked":
|
|
1983
|
+
label: e.$i18n.t("blog:language"),
|
|
1984
|
+
options: e.languageOptionList,
|
|
1985
|
+
error: e.errors.language
|
|
1986
|
+
}, null, 8, ["value", "label", "options", "error"])) : B("", !0),
|
|
1987
|
+
p(v, {
|
|
1988
|
+
checked: e.values.isDefault,
|
|
1989
|
+
"onUpdate:checked": a[6] || (a[6] = (g) => e.values.isDefault = g),
|
|
2244
1990
|
name: "isDefault",
|
|
2245
|
-
label:
|
|
2246
|
-
error:
|
|
1991
|
+
label: e.$i18n.t("blog:defaultCategory"),
|
|
1992
|
+
error: e.errors.isDefault
|
|
2247
1993
|
}, null, 8, ["checked", "label", "error"]),
|
|
2248
|
-
|
|
2249
|
-
value:
|
|
2250
|
-
"onUpdate:value":
|
|
1994
|
+
p(C, {
|
|
1995
|
+
value: e.values.name,
|
|
1996
|
+
"onUpdate:value": a[7] || (a[7] = (g) => e.values.name = g),
|
|
2251
1997
|
name: "name",
|
|
2252
|
-
label:
|
|
2253
|
-
error:
|
|
1998
|
+
label: e.$i18n.t("blog:name"),
|
|
1999
|
+
error: e.errors.name
|
|
2254
2000
|
}, null, 8, ["value", "label", "error"]),
|
|
2255
|
-
!
|
|
2001
|
+
!e.isLangSpecific || e.values.language ? (T(), M(c, {
|
|
2256
2002
|
key: 1,
|
|
2257
|
-
value:
|
|
2258
|
-
"onUpdate:value":
|
|
2003
|
+
value: e.values.parent,
|
|
2004
|
+
"onUpdate:value": a[8] || (a[8] = (g) => e.values.parent = g),
|
|
2259
2005
|
name: "parentCategory",
|
|
2260
|
-
label:
|
|
2261
|
-
options:
|
|
2262
|
-
error:
|
|
2263
|
-
}, null, 8, ["value", "label", "options", "error"])) :
|
|
2264
|
-
|
|
2006
|
+
label: e.$i18n.t("blog:parentCategory"),
|
|
2007
|
+
options: e.parentCategoryOptionList,
|
|
2008
|
+
error: e.errors.parent
|
|
2009
|
+
}, null, 8, ["value", "label", "options", "error"])) : B("", !0),
|
|
2010
|
+
p(s, {
|
|
2265
2011
|
id: "urlAlias",
|
|
2266
|
-
value:
|
|
2267
|
-
"onUpdate:value":
|
|
2012
|
+
value: e.values.urlAlias,
|
|
2013
|
+
"onUpdate:value": a[9] || (a[9] = (g) => e.values.urlAlias = g),
|
|
2268
2014
|
name: "urlAlias",
|
|
2269
|
-
label:
|
|
2270
|
-
"url-template":
|
|
2271
|
-
error:
|
|
2015
|
+
label: e.$i18n.t("blog:link"),
|
|
2016
|
+
"url-template": e.pagePath,
|
|
2017
|
+
error: e.errors.urlAlias
|
|
2272
2018
|
}, null, 8, ["value", "label", "url-template", "error"])
|
|
2273
|
-
], 64)) :
|
|
2274
|
-
|
|
2019
|
+
], 64)) : B("", !0),
|
|
2020
|
+
e.selectedTabId === "seo" ? (T(), M(L, {
|
|
2275
2021
|
key: 1,
|
|
2276
|
-
title:
|
|
2277
|
-
"title-error-message":
|
|
2278
|
-
description:
|
|
2279
|
-
"description-error-message":
|
|
2280
|
-
"should-display-keywords":
|
|
2281
|
-
keywords:
|
|
2282
|
-
"keywords-error-message":
|
|
2283
|
-
image:
|
|
2284
|
-
"image-scenario":
|
|
2285
|
-
"image-error-message":
|
|
2286
|
-
onChange:
|
|
2287
|
-
}, null, 8, ["title", "title-error-message", "description", "description-error-message", "keywords", "keywords-error-message", "image", "image-scenario", "image-error-message", "onChange"])) :
|
|
2022
|
+
title: e.values.pageTitle,
|
|
2023
|
+
"title-error-message": e.errors.pageTitle,
|
|
2024
|
+
description: e.values.pageDescription,
|
|
2025
|
+
"description-error-message": e.errors.pageDescription,
|
|
2026
|
+
"should-display-keywords": !1,
|
|
2027
|
+
keywords: e.values.pageKeywords,
|
|
2028
|
+
"keywords-error-message": e.errors.pageKeywords,
|
|
2029
|
+
image: e.values.openGraphImage,
|
|
2030
|
+
"image-scenario": e.imageScenario,
|
|
2031
|
+
"image-error-message": e.errors.openGraphImage,
|
|
2032
|
+
onChange: e.handleSeoFieldGroupChange
|
|
2033
|
+
}, null, 8, ["title", "title-error-message", "description", "description-error-message", "keywords", "keywords-error-message", "image", "image-scenario", "image-error-message", "onChange"])) : B("", !0)
|
|
2288
2034
|
], 64))
|
|
2289
2035
|
], 32)
|
|
2290
2036
|
]),
|
|
2291
|
-
footer:
|
|
2292
|
-
|
|
2293
|
-
"back-href":
|
|
2294
|
-
"is-submitting":
|
|
2295
|
-
"is-creation":
|
|
2296
|
-
"can-create-another":
|
|
2297
|
-
onSubmit:
|
|
2037
|
+
footer: A(() => [
|
|
2038
|
+
p(F, {
|
|
2039
|
+
"back-href": e.categoryListUrl,
|
|
2040
|
+
"is-submitting": e.isSubmitting,
|
|
2041
|
+
"is-creation": e.isCreation,
|
|
2042
|
+
"can-create-another": e.isCreation,
|
|
2043
|
+
onSubmit: e.submitForm
|
|
2298
2044
|
}, null, 8, ["back-href", "is-submitting", "is-creation", "can-create-another", "onSubmit"])
|
|
2299
2045
|
]),
|
|
2300
2046
|
_: 1
|
|
2301
2047
|
}, 8, ["title", "is-content-loading"]);
|
|
2302
2048
|
}
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
component: BlogPostList,
|
|
2049
|
+
const ht = /* @__PURE__ */ be(ft, [["render", yt]]), Ut = {
|
|
2050
|
+
path: N.POST_LIST,
|
|
2051
|
+
component: xa,
|
|
2307
2052
|
name: "All posts",
|
|
2308
2053
|
meta: {
|
|
2309
|
-
getBreadcrumbs: (
|
|
2310
|
-
{ url: "/", text:
|
|
2311
|
-
{ url:
|
|
2054
|
+
getBreadcrumbs: (e, { t: a }) => [
|
|
2055
|
+
{ url: "/", text: a("blog:home") },
|
|
2056
|
+
{ url: N.POST_LIST, text: a("blog:allPosts") }
|
|
2312
2057
|
]
|
|
2313
2058
|
}
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
component: BlogPostForm,
|
|
2059
|
+
}, Bt = {
|
|
2060
|
+
path: N.POST_FORM,
|
|
2061
|
+
component: st,
|
|
2318
2062
|
name: "Post Form",
|
|
2319
2063
|
meta: {
|
|
2320
|
-
getBreadcrumbs: (
|
|
2321
|
-
{ url: "/", text:
|
|
2322
|
-
{ url:
|
|
2323
|
-
{ url:
|
|
2064
|
+
getBreadcrumbs: (e, { t: a }) => [
|
|
2065
|
+
{ url: "/", text: a("blog:home") },
|
|
2066
|
+
{ url: N.POST_LIST, text: a("blog:allPosts") },
|
|
2067
|
+
{ url: e.path, text: a("blog:postForm") }
|
|
2324
2068
|
]
|
|
2325
2069
|
}
|
|
2326
|
-
}
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
component: BlogCategoryList,
|
|
2070
|
+
}, Et = {
|
|
2071
|
+
path: N.CATEGORY_LIST,
|
|
2072
|
+
component: ct,
|
|
2330
2073
|
name: "All categories",
|
|
2331
2074
|
meta: {
|
|
2332
|
-
getBreadcrumbs: (
|
|
2333
|
-
{ url: "/", text:
|
|
2334
|
-
{ url:
|
|
2075
|
+
getBreadcrumbs: (e, { t: a }) => [
|
|
2076
|
+
{ url: "/", text: a("blog:home") },
|
|
2077
|
+
{ url: N.CATEGORY_LIST, text: a("blog:allCategories") }
|
|
2335
2078
|
]
|
|
2336
2079
|
}
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
component: BlogCategoryForm,
|
|
2080
|
+
}, kt = {
|
|
2081
|
+
path: N.CATEGORY_FORM,
|
|
2082
|
+
component: ht,
|
|
2341
2083
|
name: "Category Form",
|
|
2342
2084
|
meta: {
|
|
2343
|
-
getBreadcrumbs: (
|
|
2344
|
-
{ url: "/", text:
|
|
2345
|
-
{ url:
|
|
2346
|
-
{ url:
|
|
2085
|
+
getBreadcrumbs: (e, { t: a }) => [
|
|
2086
|
+
{ url: "/", text: a("blog:home") },
|
|
2087
|
+
{ url: N.CATEGORY_LIST, text: a("blog:allCategories") },
|
|
2088
|
+
{ url: e.path, text: a("blog:categoryForm") }
|
|
2347
2089
|
]
|
|
2348
2090
|
}
|
|
2349
2091
|
};
|
|
2350
|
-
|
|
2351
|
-
export {
|
|
2092
|
+
Pa();
|
|
2093
|
+
export {
|
|
2094
|
+
kt as BLOG_CATEGORY_FORM_ROUTE,
|
|
2095
|
+
Et as BLOG_CATEGORY_LIST_ROUTE,
|
|
2096
|
+
Bt as BLOG_POST_FORM_ROUTE,
|
|
2097
|
+
Ut as BLOG_POST_LIST_ROUTE,
|
|
2098
|
+
Ta as clonePost,
|
|
2099
|
+
Ia as createBlogPost,
|
|
2100
|
+
Ua as createCategory,
|
|
2101
|
+
$a as deleteBlogPost,
|
|
2102
|
+
Ea as deleteCategory,
|
|
2103
|
+
$e as getBlogCategoryFormUrl,
|
|
2104
|
+
Ee as getBlogCategoryListUrl,
|
|
2105
|
+
Ot as getBlogPostCount,
|
|
2106
|
+
Ae as getBlogPostFormUrl,
|
|
2107
|
+
Pe as getBlogPostListUrl,
|
|
2108
|
+
oa as getCategories,
|
|
2109
|
+
Oa as getCategory,
|
|
2110
|
+
Ra as getModuleConfig,
|
|
2111
|
+
La as getPost,
|
|
2112
|
+
ta as getPosts,
|
|
2113
|
+
ka as moveCategory,
|
|
2114
|
+
Aa as updateBlogPost,
|
|
2115
|
+
Ba as updateCategory
|
|
2116
|
+
};
|