@tager/admin-blog 1.0.2 → 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 +1403 -1642
- 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 +8 -7
- 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 +1900 -417
- 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 +24 -28
- 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 -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,7 +1,7 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { Nullable } from '@tager/admin-services';
|
|
3
|
-
import { ColumnDefinition, OptionType } from '@tager/admin-ui';
|
|
4
|
-
import { Category, ModuleConfig, Language, PostShort } from '../../../typings/model';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
|
+
import { type Nullable } from '@tager/admin-services';
|
|
3
|
+
import { type ColumnDefinition, type OptionType } from '@tager/admin-ui';
|
|
4
|
+
import { type Category, type ModuleConfig, type Language, type PostShort } from '../../../typings/model';
|
|
5
5
|
export declare function convertPostList(postList: PostShort[], selectedCategory: Nullable<Category>, languages: Language[]): PostShort[];
|
|
6
6
|
export declare function getStatuses(t: TFunction): Record<string, string>;
|
|
7
7
|
export declare function getPostTableColumnDefs(moduleConfig: Nullable<ModuleConfig>, t: TFunction): ColumnDefinition<PostShort>[];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ColumnDefinition, OptionType, formatDateTime } from '@tager/admin-ui';
|
|
2
|
-
import { Nullable } from '@tager/admin-services';
|
|
1
|
+
import { type ColumnDefinition, type OptionType, formatDateTime } from '@tager/admin-ui';
|
|
2
|
+
import { type Nullable } from '@tager/admin-services';
|
|
3
3
|
import { getBlogPostFormUrl } from '../../../utils/paths';
|
|
4
|
-
import { Category, PostShort } from '../../../typings/model';
|
|
4
|
+
import { type Category, type PostShort } from '../../../typings/model';
|
|
5
5
|
import { getStatuses } from './PostList.helpers';
|
|
6
|
-
declare const _default:
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
7
9
|
t: import("i18next").TFunction;
|
|
8
10
|
formatDateTime: typeof formatDateTime;
|
|
9
11
|
columnDefs: import("vue").ComputedRef<ColumnDefinition<PostShort>[]>;
|
|
@@ -37,4 +39,3 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
37
39
|
handleResourceClone: (entityId: string | number) => void;
|
|
38
40
|
isBusy: (postId: number) => boolean;
|
|
39
41
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
40
|
-
export default _default;
|
|
@@ -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": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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,40 +32,34 @@
|
|
|
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.3",
|
|
39
|
-
"@tager/admin-ui": "^1.0.15",
|
|
35
|
+
"@eslint/js": "^9.39.5",
|
|
36
|
+
"@tager/admin-dynamic-field": "^1.0.2",
|
|
37
|
+
"@tager/admin-layout": "^1.0.11",
|
|
38
|
+
"@tager/admin-services": "^1.1.11",
|
|
39
|
+
"@tager/admin-ui": "^1.0.54",
|
|
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": "^
|
|
57
|
+
"typescript": "^5.9.3",
|
|
58
|
+
"vite": "^6.4.5",
|
|
64
59
|
"vue": "^3.2.31",
|
|
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
65
|
"@tager/admin-layout": "^1.0.0",
|
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/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,13 +1,13 @@
|
|
|
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
13
|
export interface SeoInfo {
|
|
@@ -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"
|
|
@@ -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
|
+
}" :tabs="tabList"
|
|
13
14
|
>
|
|
14
15
|
<template #content>
|
|
15
|
-
<form novalidate @submit.prevent
|
|
16
|
-
<TabList v-model:tab-id="selectedTabId" :tab-list="tabList" />
|
|
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>
|
|
@@ -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
|
|
|
@@ -292,7 +292,6 @@ export default defineComponent({
|
|
|
292
292
|
FormFieldUrlAliasInput,
|
|
293
293
|
FormField,
|
|
294
294
|
FormFieldSelect,
|
|
295
|
-
TabList,
|
|
296
295
|
Page,
|
|
297
296
|
DynamicField,
|
|
298
297
|
ShortCodeConstructor,
|
|
@@ -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 {
|