@tager/admin-blog 1.0.3 → 2.0.0
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 +674 -4
- 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 +1418 -1653
- 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 +9 -9
- package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +4 -4
- package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +3134 -9
- package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +4 -4
- package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +2409 -11
- 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 +28823 -1809
- package/dist/views/Posts/PostList/PostList.helpers.d.ts +4 -4
- package/dist/views/Posts/PostList/PostList.vue.d.ts +2512 -17
- package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +5 -5
- package/package.json +29 -33
- package/src/dev/App.vue +1 -1
- package/src/dev/config.ts +0 -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 +10 -10
- package/src/views/Categories/CategoryForm/CategoryForm.helpers.ts +6 -6
- package/src/views/Categories/CategoryForm/CategoryForm.vue +11 -11
- 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 +13 -13
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ComputedRef, Ref } from 'vue';
|
|
2
|
-
import { TFunction } from 'i18next';
|
|
3
|
-
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
4
|
-
import { FilterTagType, OptionType } from '@tager/admin-ui';
|
|
5
|
-
import { Category, Language } from '../../../../typings/model';
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import { type TFunction } from 'i18next';
|
|
3
|
+
import { type RouteLocationNormalizedLoaded } from 'vue-router';
|
|
4
|
+
import { type FilterTagType, type OptionType } from '@tager/admin-ui';
|
|
5
|
+
import { type Category, type Language } from '../../../../typings/model';
|
|
6
6
|
interface Params {
|
|
7
7
|
categoryList: Ref<Category[]>;
|
|
8
8
|
languageList: ComputedRef<Language[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tager/admin-blog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build:js": "vite build",
|
|
19
|
-
"build:package": "
|
|
19
|
+
"build:package": "yarn build:js && yarn emit-declarations",
|
|
20
20
|
"emit-declarations": "vue-tsc --project tsconfig.json --emitDeclarationOnly",
|
|
21
|
-
"start": "
|
|
21
|
+
"start": "vite",
|
|
22
22
|
"prepare": "yarn build:package",
|
|
23
|
-
"tager:update": "yarn upgrade --latest --scope @tager"
|
|
23
|
+
"tager:update": "yarn upgrade --latest --scope @tager",
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"format": "prettier --write src"
|
|
24
26
|
},
|
|
25
27
|
"dependencies": {
|
|
26
28
|
"filesize": "^9.0.11",
|
|
@@ -30,46 +32,40 @@
|
|
|
30
32
|
"path-to-regexp": "^6.1.0"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@tager/admin-
|
|
37
|
-
"@tager/admin-
|
|
38
|
-
"@tager/admin-services": "^1.1.11",
|
|
39
|
-
"@tager/admin-ui": "^1.0.54",
|
|
35
|
+
"@eslint/js": "^9.39.5",
|
|
36
|
+
"@tager/admin-dynamic-field": "^2.0.0",
|
|
37
|
+
"@tager/admin-layout": "^2.0.0",
|
|
38
|
+
"@tager/admin-services": "^2.0.1",
|
|
39
|
+
"@tager/admin-ui": "^2.0.8",
|
|
40
40
|
"@types/filesize": "^5.0.0",
|
|
41
41
|
"@types/lodash.isequal": "^4.5.6",
|
|
42
42
|
"@types/lodash.pick": "^4.4.7",
|
|
43
43
|
"@types/node": "16.x",
|
|
44
|
-
"@
|
|
45
|
-
"@typescript
|
|
46
|
-
"@vitejs/plugin-vue": "^2.3.1",
|
|
47
|
-
"@vue/cli-plugin-babel": "^5.0.4",
|
|
48
|
-
"@vue/cli-plugin-typescript": "^5.0.4",
|
|
49
|
-
"@vue/cli-service": "~5.0.0",
|
|
50
|
-
"@vue/eslint-config-prettier": "^7.0.0",
|
|
51
|
-
"@vue/eslint-config-typescript": "^10.0.0",
|
|
52
|
-
"concurrently": "^7.1.0",
|
|
44
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
45
|
+
"@vue/eslint-config-typescript": "^14.9.0",
|
|
53
46
|
"core-js": "^3.22.3",
|
|
54
|
-
"eslint": "^
|
|
55
|
-
"eslint-config-prettier": "^
|
|
56
|
-
"eslint-
|
|
57
|
-
"eslint-plugin-
|
|
58
|
-
"eslint-plugin-vue": "^
|
|
47
|
+
"eslint": "^9.39.5",
|
|
48
|
+
"eslint-config-prettier": "^10.1.8",
|
|
49
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
50
|
+
"eslint-plugin-import": "^2.32.0",
|
|
51
|
+
"eslint-plugin-vue": "^10.12.0",
|
|
52
|
+
"globals": "^16.5.0",
|
|
59
53
|
"pinia": "^2.0.21",
|
|
54
|
+
"prettier": "^3.9.10",
|
|
60
55
|
"sass": "^1.51.0",
|
|
61
56
|
"sass-loader": "^12.6.0",
|
|
62
|
-
"typescript": "^
|
|
63
|
-
"vite": "^
|
|
64
|
-
"vue": "^3.
|
|
57
|
+
"typescript": "^5.9.3",
|
|
58
|
+
"vite": "^6.4.5",
|
|
59
|
+
"vue": "^3.5.0",
|
|
60
|
+
"vue-eslint-parser": "^10.4.1",
|
|
65
61
|
"vue-router": "^4.0.14",
|
|
66
|
-
"vue-tsc": "^
|
|
62
|
+
"vue-tsc": "^3.3.14"
|
|
67
63
|
},
|
|
68
64
|
"peerDependencies": {
|
|
69
|
-
"@tager/admin-layout": "^
|
|
70
|
-
"@tager/admin-services": "^
|
|
71
|
-
"@tager/admin-ui": "^
|
|
72
|
-
"vue": "^3.
|
|
65
|
+
"@tager/admin-layout": "^2.0.0",
|
|
66
|
+
"@tager/admin-services": "^2.0.0",
|
|
67
|
+
"@tager/admin-ui": "^2.0.0",
|
|
68
|
+
"vue": "^3.4.0",
|
|
73
69
|
"vue-router": "^4.0.14"
|
|
74
70
|
},
|
|
75
71
|
"publishConfig": {
|
package/src/dev/App.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import { defineComponent } from 'vue';
|
|
9
9
|
|
|
10
|
-
import { MenuItemType, PageLayout } from '@tager/admin-layout';
|
|
10
|
+
import { type MenuItemType, PageLayout } from '@tager/admin-layout';
|
|
11
11
|
import { ViewListIcon } from '@tager/admin-ui';
|
|
12
12
|
import { useI18n } from '@tager/admin-services';
|
|
13
13
|
|
package/src/dev/config.ts
CHANGED
package/src/dev/env.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { initializeEnvironment } from '@tager/admin-services';
|
|
|
2
2
|
|
|
3
3
|
export function populateEnvironment() {
|
|
4
4
|
initializeEnvironment({
|
|
5
|
-
publicPath:
|
|
6
|
-
appEnv:
|
|
7
|
-
apiUrl:
|
|
8
|
-
accessToken:
|
|
9
|
-
websiteUrl:
|
|
10
|
-
websiteButtonUrl:
|
|
11
|
-
sentryDsn:
|
|
12
|
-
sentryEnv:
|
|
13
|
-
baseUrl:
|
|
14
|
-
nodeEnv:
|
|
15
|
-
version:
|
|
5
|
+
publicPath: import.meta.env.VUE_APP_PUBLIC_PATH,
|
|
6
|
+
appEnv: import.meta.env.VUE_APP_ENV,
|
|
7
|
+
apiUrl: import.meta.env.VUE_APP_API_URL,
|
|
8
|
+
accessToken: import.meta.env.VUE_APP_ACCESS_TOKEN,
|
|
9
|
+
websiteUrl: import.meta.env.VUE_APP_WEBSITE_URL,
|
|
10
|
+
websiteButtonUrl: import.meta.env.VUE_APP_WEBSITE_BUTTON_URL,
|
|
11
|
+
sentryDsn: import.meta.env.VUE_APP_SENTRY_DSN,
|
|
12
|
+
sentryEnv: import.meta.env.VUE_APP_SENTRY_ENVIRONMENT,
|
|
13
|
+
baseUrl: import.meta.env.BASE_URL,
|
|
14
|
+
nodeEnv: import.meta.env.MODE,
|
|
15
|
+
version: import.meta.env.VUE_APP_VERSION,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { onMounted } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
|
-
import { Category } from '../typings/model';
|
|
5
|
+
import { type Category } from '../typings/model';
|
|
6
6
|
import { getCategories } from '../services/requests';
|
|
7
7
|
|
|
8
8
|
export function useFetchCategories(): ResourceRef<Category[]> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { onMounted, Ref, watch } from 'vue';
|
|
1
|
+
import { onMounted, type Ref, watch } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { Nullable, ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type Nullable, type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
|
-
import { Category } from '../typings/model';
|
|
5
|
+
import { type Category } from '../typings/model';
|
|
6
6
|
import { getCategory } from '../services/requests';
|
|
7
7
|
|
|
8
8
|
export function useFetchCategory({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { onMounted } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { Nullable, ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type Nullable, type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
|
-
import { ModuleConfig } from '../typings/model';
|
|
5
|
+
import { type ModuleConfig } from '../typings/model';
|
|
6
6
|
import { getModuleConfig } from '../services/requests';
|
|
7
7
|
|
|
8
8
|
export function useFetchModuleConfig(): ResourceRef<Nullable<ModuleConfig>> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { onMounted } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
|
-
import { PostShort } from '../typings/model';
|
|
5
|
+
import { type PostShort } from '../typings/model';
|
|
6
6
|
import { getPosts } from '../services/requests';
|
|
7
7
|
|
|
8
8
|
export function useFetchPosts(): ResourceRef<PostShort[]> {
|
package/src/services/requests.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { request, Nullable, ResponseBody } from '@tager/admin-services';
|
|
2
|
-
import { FieldShortType, OutgoingValueUnion } from '@tager/admin-dynamic-field';
|
|
1
|
+
import { request, type Nullable, type ResponseBody } from '@tager/admin-services';
|
|
2
|
+
import { type FieldShortType, type OutgoingValueUnion } from '@tager/admin-dynamic-field';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
Category,
|
|
6
|
-
ModuleConfig,
|
|
7
|
-
PostShort,
|
|
8
|
-
PostFull,
|
|
9
|
-
CategoryPayload,
|
|
5
|
+
type Category,
|
|
6
|
+
type ModuleConfig,
|
|
7
|
+
type PostShort,
|
|
8
|
+
type PostFull,
|
|
9
|
+
type CategoryPayload,
|
|
10
10
|
} from '../typings/model';
|
|
11
11
|
|
|
12
12
|
/** Blog Posts */
|
package/src/typings/model.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Nullable, FileType } from '@tager/admin-services';
|
|
1
|
+
import { type Nullable, type FileType } from '@tager/admin-services';
|
|
2
2
|
import {
|
|
3
|
-
FieldConfigUnion,
|
|
4
|
-
FieldShortType,
|
|
5
|
-
IncomingValueUnion,
|
|
3
|
+
type FieldConfigUnion,
|
|
4
|
+
type FieldShortType,
|
|
5
|
+
type IncomingValueUnion,
|
|
6
6
|
} from '@tager/admin-dynamic-field';
|
|
7
7
|
import {
|
|
8
|
-
OptionType,
|
|
9
|
-
ShortCodeItemType,
|
|
10
|
-
SingleFileInputValueType,
|
|
8
|
+
type OptionType,
|
|
9
|
+
type ShortCodeItemType,
|
|
10
|
+
type SingleFileInputValueType,
|
|
11
11
|
} from '@tager/admin-ui';
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type SeoInfo = {
|
|
14
14
|
readonly pageTitle: Nullable<string>;
|
|
15
15
|
readonly pageDescription: Nullable<string>;
|
|
16
16
|
readonly pageKeywords: Nullable<string>;
|
|
@@ -19,7 +19,7 @@ export interface SeoInfo {
|
|
|
19
19
|
readonly openGraphImage: Nullable<FileType>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export type Category = SeoInfo & {
|
|
23
23
|
readonly id: number;
|
|
24
24
|
readonly name: string;
|
|
25
25
|
readonly isDefault: boolean;
|
|
@@ -32,7 +32,7 @@ export interface Category extends SeoInfo {
|
|
|
32
32
|
readonly depth: number;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export
|
|
35
|
+
export type PostShort = {
|
|
36
36
|
readonly id: number;
|
|
37
37
|
readonly title: string;
|
|
38
38
|
readonly url: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { createId, Nullable } from '@tager/admin-services';
|
|
4
|
-
import { OptionType } from '@tager/admin-ui';
|
|
3
|
+
import { createId, type Nullable } from '@tager/admin-services';
|
|
4
|
+
import { type OptionType } from '@tager/admin-ui';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
Category,
|
|
8
|
-
CategoryFormValues,
|
|
9
|
-
CategoryPayload,
|
|
7
|
+
type Category,
|
|
8
|
+
type CategoryFormValues,
|
|
9
|
+
type CategoryPayload,
|
|
10
10
|
} from '../../../typings/model';
|
|
11
11
|
import { getNameWithDepth } from '../../../utils/common';
|
|
12
12
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:is-content-loading="isContentLoading"
|
|
9
9
|
>
|
|
10
10
|
<template #content>
|
|
11
|
-
<form novalidate @submit.prevent
|
|
11
|
+
<form novalidate @submit.prevent>
|
|
12
12
|
<template v-if="isCreation">
|
|
13
13
|
<FormFieldSelect
|
|
14
14
|
v-if="isLangSpecific"
|
|
@@ -95,15 +95,15 @@
|
|
|
95
95
|
|
|
96
96
|
<template v-if="selectedTabId === 'seo'">
|
|
97
97
|
<SeoFieldGroup
|
|
98
|
-
:title="values.pageTitle"
|
|
98
|
+
:title="values.pageTitle ?? ''"
|
|
99
99
|
:title-error-message="errors.pageTitle"
|
|
100
|
-
:description="values.pageDescription"
|
|
100
|
+
:description="values.pageDescription ?? ''"
|
|
101
101
|
:description-error-message="errors.pageDescription"
|
|
102
102
|
:should-display-keywords="false"
|
|
103
|
-
:keywords="values.pageKeywords"
|
|
103
|
+
:keywords="values.pageKeywords ?? ''"
|
|
104
104
|
:keywords-error-message="errors.pageKeywords"
|
|
105
105
|
:image="values.openGraphImage"
|
|
106
|
-
:image-scenario="imageScenario"
|
|
106
|
+
:image-scenario="imageScenario ?? undefined"
|
|
107
107
|
:image-error-message="errors.openGraphImage"
|
|
108
108
|
@change="handleSeoFieldGroupChange"
|
|
109
109
|
/>
|
|
@@ -132,17 +132,17 @@ import {
|
|
|
132
132
|
convertRequestErrorToMap,
|
|
133
133
|
getWebsiteOrigin,
|
|
134
134
|
navigateBack,
|
|
135
|
-
Nullable,
|
|
135
|
+
type Nullable,
|
|
136
136
|
urlTranslit,
|
|
137
137
|
useI18n,
|
|
138
138
|
useToast,
|
|
139
139
|
} from '@tager/admin-services';
|
|
140
140
|
import {
|
|
141
|
-
OptionType,
|
|
141
|
+
type OptionType,
|
|
142
142
|
FormFooter,
|
|
143
|
-
TagerFormSubmitEvent,
|
|
144
|
-
SeoChangeEvent,
|
|
145
|
-
TabType,
|
|
143
|
+
type TagerFormSubmitEvent,
|
|
144
|
+
type SeoChangeEvent,
|
|
145
|
+
type TabType,
|
|
146
146
|
FormFieldSelect,
|
|
147
147
|
FormField,
|
|
148
148
|
FormFieldUrlAliasInput,
|
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
getBlogCategoryFormUrl,
|
|
162
162
|
getBlogCategoryListUrl,
|
|
163
163
|
} from '../../../utils/paths';
|
|
164
|
-
import { CategoryFormValues, Language } from '../../../typings/model';
|
|
164
|
+
import { type CategoryFormValues, type Language } from '../../../typings/model';
|
|
165
165
|
import { createCategory, updateCategory } from '../../../services/requests';
|
|
166
166
|
|
|
167
167
|
import {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { getWebsiteOrigin, notEmpty, Nullable } from '@tager/admin-services';
|
|
4
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
+
import { getWebsiteOrigin, notEmpty, type Nullable } from '@tager/admin-services';
|
|
4
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
5
5
|
|
|
6
|
-
import { Category, Language, ModuleConfig } from '../../../typings/model';
|
|
6
|
+
import { type Category, type Language, type ModuleConfig } from '../../../typings/model';
|
|
7
7
|
import {
|
|
8
8
|
getBlogCategoryFormUrl,
|
|
9
9
|
getBlogPostListUrl,
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
getCategories,
|
|
119
119
|
moveCategory,
|
|
120
120
|
} from '../../../services/requests';
|
|
121
|
-
import { Category, Language } from '../../../typings/model';
|
|
121
|
+
import { type Category, type Language } from '../../../typings/model';
|
|
122
122
|
import { BLOG_ROUTE_PATHS } from '../../../constants/paths';
|
|
123
123
|
|
|
124
124
|
import {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { computed, ComputedRef, Ref, ref,
|
|
2
|
-
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
3
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { computed, type ComputedRef, type Ref, ref, watch } from 'vue';
|
|
2
|
+
import { type RouteLocationNormalizedLoaded } from 'vue-router';
|
|
3
|
+
import { type TFunction } from 'i18next';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
FilterTagType,
|
|
6
|
+
type FilterTagType,
|
|
7
7
|
getFilterParamAsStringArray,
|
|
8
8
|
getFilterParams,
|
|
9
|
-
OptionType,
|
|
9
|
+
type OptionType,
|
|
10
10
|
} from '@tager/admin-ui';
|
|
11
11
|
|
|
12
|
-
import { Language } from '../../../../typings/model';
|
|
12
|
+
import { type Language } from '../../../../typings/model';
|
|
13
13
|
|
|
14
14
|
interface Params {
|
|
15
15
|
t: TFunction;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { createId, Nullable } from '@tager/admin-services';
|
|
4
|
-
import { OptionType, SingleFileInputValueType } from '@tager/admin-ui';
|
|
3
|
+
import { createId, type Nullable } from '@tager/admin-services';
|
|
4
|
+
import { type OptionType, type SingleFileInputValueType } from '@tager/admin-ui';
|
|
5
5
|
import {
|
|
6
|
-
FieldConfigUnion,
|
|
7
|
-
FieldUnion,
|
|
6
|
+
type FieldConfigUnion,
|
|
7
|
+
type FieldUnion,
|
|
8
8
|
universalFieldUtils
|
|
9
9
|
} from '@tager/admin-dynamic-field';
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
-
PostCreationPayload,
|
|
13
|
-
PostUpdatePayload
|
|
12
|
+
type PostCreationPayload,
|
|
13
|
+
type PostUpdatePayload
|
|
14
14
|
} from '../../../services/requests';
|
|
15
15
|
import { getNameWithDepth } from '../../../utils/common';
|
|
16
|
-
import { Category, PostFull } from '../../../typings/model';
|
|
16
|
+
import { type Category, type PostFull } from '../../../typings/model';
|
|
17
17
|
|
|
18
18
|
export const getStatusOptions = (t: TFunction): OptionType[] => [
|
|
19
19
|
{ label: t('blog:statusPublished'), value: 'PUBLISHED' },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Page
|
|
3
|
+
v-model:tab-id="selectedTabId"
|
|
3
4
|
:title="
|
|
4
5
|
isCreation ? $i18n.t('blog:createPost') : $i18n.t('blog:updatePost')
|
|
5
6
|
"
|
|
@@ -9,11 +10,10 @@
|
|
|
9
10
|
backHref: postListUrl,
|
|
10
11
|
onSubmit: submitForm,
|
|
11
12
|
isSubmitting: isSubmitting,
|
|
12
|
-
}"
|
|
13
|
-
v-model:tab-id="selectedTabId" :tabs="tabList"
|
|
13
|
+
}" :tabs="tabList"
|
|
14
14
|
>
|
|
15
15
|
<template #content>
|
|
16
|
-
<form novalidate @submit.prevent
|
|
16
|
+
<form novalidate @submit.prevent>
|
|
17
17
|
|
|
18
18
|
<template v-if="selectedTabId === 'common'">
|
|
19
19
|
<FormFieldSelect
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
<template v-if="selectedTabId === 'additional'">
|
|
188
188
|
<DynamicField
|
|
189
189
|
v-for="field of values.additionalFields"
|
|
190
|
-
:key="field.
|
|
190
|
+
:key="field.id"
|
|
191
191
|
:field="field"
|
|
192
192
|
/>
|
|
193
193
|
</template>
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
:image-error-message="errors.openGraphImage"
|
|
205
205
|
:image-label="$i18n.t('blog:openGraphImage')"
|
|
206
206
|
:image-scenario="
|
|
207
|
-
moduleConfig ? moduleConfig.fileScenarios.openGraph :
|
|
207
|
+
moduleConfig ? (moduleConfig.fileScenarios.openGraph ?? undefined) : undefined
|
|
208
208
|
"
|
|
209
209
|
@change="handleSeoFieldGroupChange"
|
|
210
210
|
/>
|
|
@@ -231,7 +231,7 @@ import { useRoute, useRouter } from 'vue-router';
|
|
|
231
231
|
import {
|
|
232
232
|
convertRequestErrorToMap,
|
|
233
233
|
isNotNullish,
|
|
234
|
-
Nullable,
|
|
234
|
+
type Nullable,
|
|
235
235
|
useResource,
|
|
236
236
|
urlTranslit,
|
|
237
237
|
useI18n,
|
|
@@ -240,12 +240,12 @@ import {
|
|
|
240
240
|
} from '@tager/admin-services';
|
|
241
241
|
import {
|
|
242
242
|
createTabErrorFinder,
|
|
243
|
-
OptionType,
|
|
244
|
-
TabType,
|
|
243
|
+
type OptionType,
|
|
244
|
+
type TabType,
|
|
245
245
|
ShortCodeConstructor,
|
|
246
|
-
SeoChangeEvent,
|
|
246
|
+
type SeoChangeEvent,
|
|
247
247
|
FormFooter,
|
|
248
|
-
TagerFormSubmitEvent,
|
|
248
|
+
type TagerFormSubmitEvent,
|
|
249
249
|
FormFieldSelect,
|
|
250
250
|
FormField,
|
|
251
251
|
FormFieldUrlAliasInput,
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
FormFieldFileInput,
|
|
255
255
|
FormFieldMultiSelect,
|
|
256
256
|
SeoFieldGroup,
|
|
257
|
-
|
|
257
|
+
formatDate,
|
|
258
258
|
} from '@tager/admin-ui';
|
|
259
259
|
import { DynamicField } from '@tager/admin-dynamic-field';
|
|
260
260
|
import { Page } from '@tager/admin-layout';
|
|
@@ -265,7 +265,7 @@ import {
|
|
|
265
265
|
getPost,
|
|
266
266
|
updateBlogPost,
|
|
267
267
|
} from '../../../services/requests';
|
|
268
|
-
import { Language, PostFull } from '../../../typings/model';
|
|
268
|
+
import { type Language, type PostFull } from '../../../typings/model';
|
|
269
269
|
import {
|
|
270
270
|
useFetchModuleConfig,
|
|
271
271
|
useFetchCategories,
|
|
@@ -277,7 +277,7 @@ import {
|
|
|
277
277
|
convertFormValuesToCreationPayload,
|
|
278
278
|
convertFormValuesToUpdatePayload,
|
|
279
279
|
convertPostToFormValues,
|
|
280
|
-
FormValues,
|
|
280
|
+
type FormValues,
|
|
281
281
|
getStatusOptions,
|
|
282
282
|
} from './PostForm.helpers';
|
|
283
283
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { notEmpty, Nullable } from '@tager/admin-services';
|
|
4
|
-
import { ColumnDefinition, OptionType } from '@tager/admin-ui';
|
|
3
|
+
import { notEmpty, type Nullable } from '@tager/admin-services';
|
|
4
|
+
import { type ColumnDefinition, type OptionType } from '@tager/admin-ui';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
Category,
|
|
8
|
-
ModuleConfig,
|
|
9
|
-
Language,
|
|
10
|
-
PostShort,
|
|
7
|
+
type Category,
|
|
8
|
+
type ModuleConfig,
|
|
9
|
+
type Language,
|
|
10
|
+
type PostShort,
|
|
11
11
|
} from '../../../typings/model';
|
|
12
12
|
import { getBlogPostFormUrl } from '../../../utils/paths';
|
|
13
13
|
|
|
@@ -132,8 +132,8 @@ import pick from 'lodash.pick';
|
|
|
132
132
|
import {useRoute, useRouter} from 'vue-router';
|
|
133
133
|
|
|
134
134
|
import {
|
|
135
|
-
ColumnDefinition,
|
|
136
|
-
OptionType,
|
|
135
|
+
type ColumnDefinition,
|
|
136
|
+
type OptionType,
|
|
137
137
|
useDataTable,
|
|
138
138
|
formatDateTime,
|
|
139
139
|
AdvancedSearch,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
DataTable,
|
|
147
147
|
} from '@tager/admin-ui';
|
|
148
148
|
import {
|
|
149
|
-
Nullable,
|
|
149
|
+
type Nullable,
|
|
150
150
|
useI18n,
|
|
151
151
|
useResourceClone,
|
|
152
152
|
useResourceDelete,
|
|
@@ -161,10 +161,10 @@ import {
|
|
|
161
161
|
} from '../../../services/requests';
|
|
162
162
|
import {getBlogPostFormUrl} from '../../../utils/paths';
|
|
163
163
|
import {
|
|
164
|
-
Category,
|
|
165
|
-
Language,
|
|
166
|
-
PostFull,
|
|
167
|
-
PostShort,
|
|
164
|
+
type Category,
|
|
165
|
+
type Language,
|
|
166
|
+
type PostFull,
|
|
167
|
+
type PostShort,
|
|
168
168
|
} from '../../../typings/model';
|
|
169
169
|
import {getStatusOptions} from '../PostForm/PostForm.helpers';
|
|
170
170
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { computed, ComputedRef, Ref, ref, watch } from 'vue';
|
|
2
|
-
import { TFunction } from 'i18next';
|
|
3
|
-
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
1
|
+
import { computed, type ComputedRef, type Ref, ref, watch } from 'vue';
|
|
2
|
+
import { type TFunction } from 'i18next';
|
|
3
|
+
import { type RouteLocationNormalizedLoaded } from 'vue-router';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
FilterTagType,
|
|
6
|
+
type FilterTagType,
|
|
7
7
|
getFilterParamAsString,
|
|
8
8
|
getFilterParamAsStringArray,
|
|
9
9
|
getFilterParams,
|
|
10
|
-
OptionType,
|
|
10
|
+
type OptionType,
|
|
11
11
|
} from '@tager/admin-ui';
|
|
12
12
|
import { isNotNullish } from '@tager/admin-services';
|
|
13
13
|
|
|
14
|
-
import { Category, Language } from '../../../../typings/model';
|
|
14
|
+
import { type Category, type Language } from '../../../../typings/model';
|
|
15
15
|
import { getNameWithDepth } from '../../../../utils/common';
|
|
16
16
|
|
|
17
17
|
interface Params {
|