@tager/admin-blog 0.3.43 → 1.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/constants/paths.d.ts +6 -14
- package/dist/constants/routes.d.ts +5 -5
- package/dist/dev/App.vue.d.ts +5 -0
- package/dist/dev/config.d.ts +2 -0
- package/dist/dev/env.d.ts +1 -0
- package/dist/dev/main.d.ts +3 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/useFetchCategories.d.ts +3 -6
- package/dist/hooks/useFetchCategory.d.ts +7 -8
- package/dist/hooks/useFetchModuleConfig.d.ts +3 -6
- package/dist/hooks/useFetchPosts.d.ts +3 -6
- package/dist/index.mjs +2363 -0
- package/dist/locales/apply.d.ts +1 -0
- package/dist/locales/en.d.ts +87 -86
- package/dist/locales/ru.d.ts +3 -3
- package/dist/main.d.ts +3 -4
- package/dist/services/requests.d.ts +59 -59
- package/dist/style.css +1 -0
- package/dist/typings/common.d.ts +1 -1
- package/dist/typings/model.d.ts +106 -106
- package/dist/utils/common.d.ts +2 -2
- package/dist/utils/paths.d.ts +8 -0
- package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +7 -7
- package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +53 -116
- package/dist/views/Categories/CategoryForm/index.d.ts +1 -1
- package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +7 -7
- package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +26 -57
- package/dist/views/Categories/CategoryList/hooks/index.d.ts +1 -1
- package/dist/views/Categories/CategoryList/hooks/useAdvancedSearch.d.ts +19 -16
- package/dist/views/Categories/CategoryList/index.d.ts +1 -1
- package/dist/views/Posts/PostForm/PostForm.helpers.d.ts +32 -32
- package/dist/views/Posts/PostForm/PostForm.vue.d.ts +2768 -9398
- package/dist/views/Posts/PostForm/components/TabList/TabList.types.d.ts +5 -5
- package/dist/views/Posts/PostForm/components/TabList/TabList.vue.d.ts +23 -0
- package/dist/views/Posts/PostForm/components/TabList/index.d.ts +2 -2
- package/dist/views/Posts/PostForm/index.d.ts +1 -1
- package/dist/views/Posts/PostList/PostList.helpers.d.ts +7 -7
- package/dist/views/Posts/PostList/PostList.vue.d.ts +38 -78
- package/dist/views/Posts/PostList/hooks/index.d.ts +1 -1
- package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +27 -24
- package/dist/views/Posts/PostList/index.d.ts +1 -1
- package/package.json +51 -49
- package/src/constants/paths.ts +0 -22
- package/src/constants/routes.ts +9 -9
- package/src/dev/App.vue +56 -0
- package/src/dev/config.ts +23 -0
- package/src/dev/env.ts +17 -0
- package/src/dev/main.ts +49 -0
- package/src/hooks/useFetchCategories.ts +2 -7
- package/src/hooks/useFetchCategory.ts +3 -6
- package/src/hooks/useFetchModuleConfig.ts +2 -7
- package/src/hooks/useFetchPosts.ts +2 -5
- package/src/locales/apply.ts +9 -0
- package/src/locales/en.ts +3 -3
- package/src/locales/ru.ts +4 -2
- package/src/main.ts +3 -8
- package/src/utils/paths.ts +23 -0
- package/src/views/Categories/CategoryForm/CategoryForm.vue +81 -61
- package/src/views/Categories/CategoryList/CategoryList.helpers.ts +1 -1
- package/src/views/Categories/CategoryList/CategoryList.vue +86 -58
- package/src/views/Categories/CategoryList/hooks/useAdvancedSearch.ts +9 -12
- package/src/views/Posts/PostForm/PostForm.vue +262 -223
- package/src/views/Posts/PostForm/components/TabList/TabList.vue +2 -2
- package/src/views/Posts/PostList/PostList.helpers.ts +1 -1
- package/src/views/Posts/PostList/PostList.vue +168 -168
- package/src/views/Posts/PostList/hooks/useAdvancedSearch.ts +22 -30
- package/CHANGELOG.md +0 -13
- package/dist/constants/menu.d.ts +0 -5
- package/dist/dev.d.ts +0 -1
- package/dist/index.esm.js +0 -5294
- package/dist/index.umd.js +0 -5321
- package/dist/router/index.d.ts +0 -4
- package/src/constants/menu.ts +0 -31
- package/src/dev.ts +0 -34
- package/src/router/index.ts +0 -40
- package/src/typings/sfc.d.ts +0 -12
- package/src/typings/shims-tsx.d.ts +0 -13
- package/src/typings/shims-vue.d.ts +0 -11
- package/src/typings/translate.d.ts +0 -10
- package/src/views/App.vue +0 -22
- package/src/views/Home.vue +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare type TabType = {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
hasErrors?: boolean;
|
|
5
|
-
};
|
|
1
|
+
export declare type TabType = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
hasErrors?: boolean;
|
|
5
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TabType } from './TabList.types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
tabList: {
|
|
4
|
+
type: () => TabType[];
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
selectedTabId: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
handleTabClick: (tabId: TabType['id']) => void;
|
|
13
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
|
+
tabList: {
|
|
15
|
+
type: () => TabType[];
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
selectedTabId: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
}>>, {}>;
|
|
23
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './TabList.vue';
|
|
2
|
-
export * from './TabList.types';
|
|
1
|
+
export { default } from './TabList.vue';
|
|
2
|
+
export * from './TabList.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './PostForm.vue';
|
|
1
|
+
export { default } from './PostForm.vue';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { Nullable } from '@tager/admin-services';
|
|
3
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
4
|
-
import { Category, ModuleConfig, Language, PostShort } from '../../../typings/model';
|
|
5
|
-
export declare function convertPostList(postList: PostShort[], selectedCategory: Nullable<Category>, languages: Language[]): PostShort[];
|
|
6
|
-
export declare function getStatuses(t: TFunction): Record<string, string>;
|
|
7
|
-
export declare function getPostTableColumnDefs(moduleConfig: Nullable<ModuleConfig>, t: TFunction): ColumnDefinition<PostShort>[];
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
2
|
+
import { Nullable } from '@tager/admin-services';
|
|
3
|
+
import { ColumnDefinition } from '@tager/admin-ui';
|
|
4
|
+
import { Category, ModuleConfig, Language, PostShort } from '../../../typings/model';
|
|
5
|
+
export declare function convertPostList(postList: PostShort[], selectedCategory: Nullable<Category>, languages: Language[]): PostShort[];
|
|
6
|
+
export declare function getStatuses(t: TFunction): Record<string, string>;
|
|
7
|
+
export declare function getPostTableColumnDefs(moduleConfig: Nullable<ModuleConfig>, t: TFunction): ColumnDefinition<PostShort>[];
|
|
@@ -1,78 +1,38 @@
|
|
|
1
|
-
import { ColumnDefinition, OptionType, formatDateTime } from '@tager/admin-ui';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
[x: string]: any;
|
|
40
|
-
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
41
|
-
[x: string]: any;
|
|
42
|
-
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
43
|
-
t: import("i18next").TFunction;
|
|
44
|
-
formatDateTime: typeof formatDateTime;
|
|
45
|
-
columnDefs: import("@vue/composition-api").ComputedRef<ColumnDefinition<PostShort>[]>;
|
|
46
|
-
rowData: import("@vue/composition-api").ComputedRef<PostShort[]>;
|
|
47
|
-
handleResourceDelete: (entityId: string | number) => void;
|
|
48
|
-
isDeleting: (entityId: string | number) => boolean;
|
|
49
|
-
categoryList: import("@vue/composition-api").Ref<Category[]>;
|
|
50
|
-
isRowDataLoading: import("@vue/composition-api").ComputedRef<boolean>;
|
|
51
|
-
errorMessage: import("@vue/composition-api").Ref<string | null>;
|
|
52
|
-
getBlogPostFormUrl: typeof getBlogPostFormUrl;
|
|
53
|
-
pageTitle: import("@vue/composition-api").ComputedRef<string>;
|
|
54
|
-
searchQuery: import("@vue/composition-api").Ref<string>;
|
|
55
|
-
handleChange: (event: import("@tager/admin-ui").TableChangeEvent) => void;
|
|
56
|
-
pageNumber: import("@vue/composition-api").Ref<number>;
|
|
57
|
-
pageCount: import("@vue/composition-api").ComputedRef<number>;
|
|
58
|
-
pageSize: import("@vue/composition-api").Ref<number>;
|
|
59
|
-
categoryFilter: import("@vue/composition-api").Ref<OptionType<string>[]>;
|
|
60
|
-
categoryOptionList: import("@vue/composition-api").ComputedRef<OptionType<string>[]>;
|
|
61
|
-
isLangSpecific: import("@vue/composition-api").ComputedRef<boolean>;
|
|
62
|
-
languageFilter: import("@vue/composition-api").Ref<OptionType<string>[]>;
|
|
63
|
-
languageOptionList: import("@vue/composition-api").ComputedRef<OptionType<string>[]>;
|
|
64
|
-
fromDateFilter: import("@vue/composition-api").Ref<string>;
|
|
65
|
-
toDateFilter: import("@vue/composition-api").Ref<string>;
|
|
66
|
-
statusFilter: import("@vue/composition-api").Ref<OptionType<string>[]>;
|
|
67
|
-
statusOptionList: import("@vue/composition-api").ComputedRef<OptionType<string>[]>;
|
|
68
|
-
tags: import("@vue/composition-api").ComputedRef<import("@tager/admin-ui").FilterTagType[]>;
|
|
69
|
-
tagRemovalHandler: (event: import("@tager/admin-ui").FilterTagType) => void;
|
|
70
|
-
getStatuses: typeof getStatuses;
|
|
71
|
-
handleResourceClone: (entityId: string | number) => void;
|
|
72
|
-
isBusy: (postId: number) => boolean;
|
|
73
|
-
}>, {
|
|
74
|
-
[x: string]: any;
|
|
75
|
-
}, {}, {}, {
|
|
76
|
-
[x: string]: any;
|
|
77
|
-
}>);
|
|
78
|
-
export default _default;
|
|
1
|
+
import { ColumnDefinition, OptionType, formatDateTime } from '@tager/admin-ui';
|
|
2
|
+
import { Nullable } from '@tager/admin-services';
|
|
3
|
+
import { getBlogPostFormUrl } from '../../../utils/paths';
|
|
4
|
+
import { Category, PostShort } from '../../../typings/model';
|
|
5
|
+
import { getStatuses } from './PostList.helpers';
|
|
6
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
7
|
+
t: import("i18next").TFunction;
|
|
8
|
+
formatDateTime: typeof formatDateTime;
|
|
9
|
+
columnDefs: import("vue").ComputedRef<ColumnDefinition<PostShort>[]>;
|
|
10
|
+
rowData: import("vue").ComputedRef<PostShort[]>;
|
|
11
|
+
handleResourceDelete: (entityId: string | number) => void;
|
|
12
|
+
isDeleting: (entityId: string | number) => boolean;
|
|
13
|
+
categoryList: import("vue").Ref<Category[]>;
|
|
14
|
+
isRowDataLoading: import("vue").ComputedRef<boolean>;
|
|
15
|
+
errorMessage: import("vue").Ref<Nullable<string>>;
|
|
16
|
+
getBlogPostFormUrl: typeof getBlogPostFormUrl;
|
|
17
|
+
pageTitle: import("vue").ComputedRef<string>;
|
|
18
|
+
searchQuery: import("vue").Ref<string>;
|
|
19
|
+
handleChange: (event: import("@tager/admin-ui/dist/components/DataTable/DataTable.types").TableChangeEvent) => void;
|
|
20
|
+
pageNumber: import("vue").Ref<number>;
|
|
21
|
+
pageCount: import("vue").ComputedRef<number>;
|
|
22
|
+
pageSize: import("vue").Ref<number>;
|
|
23
|
+
categoryFilter: import("vue").Ref<OptionType<string>[]>;
|
|
24
|
+
categoryOptionList: import("vue").ComputedRef<OptionType<string>[]>;
|
|
25
|
+
isLangSpecific: import("vue").ComputedRef<boolean>;
|
|
26
|
+
languageFilter: import("vue").Ref<OptionType<string>[]>;
|
|
27
|
+
languageOptionList: import("vue").ComputedRef<OptionType<string>[]>;
|
|
28
|
+
fromDateFilter: import("vue").Ref<string>;
|
|
29
|
+
toDateFilter: import("vue").Ref<string>;
|
|
30
|
+
statusFilter: import("vue").Ref<OptionType<string>[]>;
|
|
31
|
+
statusOptionList: import("vue").ComputedRef<OptionType<string>[]>;
|
|
32
|
+
tags: import("vue").ComputedRef<import("@tager/admin-ui").FilterTagType[]>;
|
|
33
|
+
tagRemovalHandler: (event: import("@tager/admin-ui").FilterTagType) => void;
|
|
34
|
+
getStatuses: typeof getStatuses;
|
|
35
|
+
handleResourceClone: (entityId: string | number) => void;
|
|
36
|
+
isBusy: (postId: number) => boolean;
|
|
37
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
38
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useAdvancedSearch } from './useAdvancedSearch';
|
|
1
|
+
export { useAdvancedSearch } from './useAdvancedSearch';
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { ComputedRef, Ref
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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';
|
|
6
|
+
interface Params {
|
|
7
|
+
categoryList: Ref<Category[]>;
|
|
8
|
+
languageList: ComputedRef<Language[]>;
|
|
9
|
+
statusOptionList: ComputedRef<OptionType[]>;
|
|
10
|
+
t: TFunction;
|
|
11
|
+
route: RouteLocationNormalizedLoaded;
|
|
12
|
+
}
|
|
13
|
+
interface State {
|
|
14
|
+
categoryFilter: Ref<OptionType[]>;
|
|
15
|
+
categoryOptionList: ComputedRef<OptionType[]>;
|
|
16
|
+
languageFilter: Ref<OptionType[]>;
|
|
17
|
+
languageOptionList: ComputedRef<OptionType[]>;
|
|
18
|
+
fromDateFilter: Ref<string>;
|
|
19
|
+
toDateFilter: Ref<string>;
|
|
20
|
+
statusFilter: Ref<OptionType[]>;
|
|
21
|
+
filterParams: ComputedRef<Record<string, string | string[]>>;
|
|
22
|
+
tags: ComputedRef<FilterTagType[]>;
|
|
23
|
+
tagRemovalHandler(event: FilterTagType): void;
|
|
24
|
+
}
|
|
25
|
+
export declare const dateFormat: (date: string) => string;
|
|
26
|
+
export declare function useAdvancedSearch({ t, route, categoryList, languageList, statusOptionList, }: Params): State;
|
|
27
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './PostList.vue';
|
|
1
|
+
export { default } from './PostList.vue';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tager/admin-blog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -10,65 +10,67 @@
|
|
|
10
10
|
"typings",
|
|
11
11
|
"src"
|
|
12
12
|
],
|
|
13
|
+
"exports": {
|
|
14
|
+
"./css": "./dist/style.css",
|
|
15
|
+
".": "./dist/index.mjs"
|
|
16
|
+
},
|
|
13
17
|
"scripts": {
|
|
18
|
+
"build:js": "vite build",
|
|
19
|
+
"build:package": "concurrently --success first \"yarn build:js\" \"yarn emit-declarations\"",
|
|
20
|
+
"emit-declarations": "vue-tsc --project tsconfig.json --emitDeclarationOnly",
|
|
14
21
|
"start": "vue-cli-service serve",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"prepare": "yarn build",
|
|
18
|
-
"tager:update": "node scripts/tager-update.js",
|
|
19
|
-
"yalc:clean": "yalc remove --all"
|
|
22
|
+
"prepare": "yarn build:package",
|
|
23
|
+
"tager:update": "yarn upgrade --latest --scope @tager"
|
|
20
24
|
},
|
|
21
25
|
"dependencies": {
|
|
26
|
+
"filesize": "^9.0.11",
|
|
22
27
|
"lodash.isequal": "^4.5.0",
|
|
28
|
+
"lodash.kebabcase": "^4.1.1",
|
|
23
29
|
"lodash.pick": "^4.4.0",
|
|
24
30
|
"path-to-regexp": "^6.1.0"
|
|
25
31
|
},
|
|
26
32
|
"devDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@tager/admin-
|
|
31
|
-
"@tager/admin-
|
|
32
|
-
"@tager/admin-
|
|
33
|
-
"@
|
|
34
|
-
"@types/
|
|
35
|
-
"@types/
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@vue/cli-plugin-
|
|
42
|
-
"@vue/cli-
|
|
43
|
-
"@vue/
|
|
44
|
-
"@vue/eslint-config-prettier": "^
|
|
45
|
-
"@vue/eslint-config-typescript": "^
|
|
46
|
-
"
|
|
47
|
-
"core-js": "^3.
|
|
48
|
-
"eslint": "^
|
|
49
|
-
"eslint-
|
|
50
|
-
"eslint-plugin-
|
|
51
|
-
"eslint-plugin-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"vue": "2.
|
|
59
|
-
"vue-router": "^
|
|
60
|
-
"vue-
|
|
33
|
+
"@babel/core": "^7.17.9",
|
|
34
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
35
|
+
"@rushstack/eslint-patch": "^1.1.2",
|
|
36
|
+
"@tager/admin-dynamic-field": "^1.0.0",
|
|
37
|
+
"@tager/admin-layout": "^1.0.0",
|
|
38
|
+
"@tager/admin-services": "^1.0.0",
|
|
39
|
+
"@tager/admin-ui": "^1.0.1",
|
|
40
|
+
"@types/filesize": "^5.0.0",
|
|
41
|
+
"@types/lodash.isequal": "^4.5.6",
|
|
42
|
+
"@types/lodash.pick": "^4.4.7",
|
|
43
|
+
"@types/node": "16.x",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
45
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
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",
|
|
53
|
+
"core-js": "^3.22.3",
|
|
54
|
+
"eslint": "^8.14.0",
|
|
55
|
+
"eslint-config-prettier": "^8.5.0",
|
|
56
|
+
"eslint-plugin-import": "^2.26.0",
|
|
57
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
58
|
+
"eslint-plugin-vue": "^8.7.1",
|
|
59
|
+
"pinia": "^2.0.21",
|
|
60
|
+
"sass": "^1.51.0",
|
|
61
|
+
"sass-loader": "^12.6.0",
|
|
62
|
+
"typescript": "^4.6.3",
|
|
63
|
+
"vite": "^2.9.6",
|
|
64
|
+
"vue": "^3.2.31",
|
|
65
|
+
"vue-router": "^4.0.14",
|
|
66
|
+
"vue-tsc": "^0.34.10"
|
|
61
67
|
},
|
|
62
68
|
"peerDependencies": {
|
|
63
|
-
"@tager/admin-
|
|
64
|
-
"@tager/admin-
|
|
65
|
-
"@tager/admin-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"vue": "2.6.x"
|
|
69
|
-
},
|
|
70
|
-
"resolutions": {
|
|
71
|
-
"prettier": "2.x"
|
|
69
|
+
"@tager/admin-layout": "^1.0.0",
|
|
70
|
+
"@tager/admin-services": "^1.0.0",
|
|
71
|
+
"@tager/admin-ui": "^1.0.1",
|
|
72
|
+
"vue": "^3.2.31",
|
|
73
|
+
"vue-router": "^4.0.14"
|
|
72
74
|
},
|
|
73
75
|
"publishConfig": {
|
|
74
76
|
"access": "public"
|
package/src/constants/paths.ts
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import { compile } from 'path-to-regexp';
|
|
2
|
-
|
|
3
1
|
export const BLOG_ROUTE_PATHS = {
|
|
4
2
|
POST_LIST: '/blog/posts',
|
|
5
3
|
POST_FORM: '/blog/posts/:postId',
|
|
6
4
|
CATEGORY_LIST: '/blog/categories',
|
|
7
5
|
CATEGORY_FORM: '/blog/categories/:categoryId',
|
|
8
6
|
} as const;
|
|
9
|
-
|
|
10
|
-
export function getBlogPostListUrl() {
|
|
11
|
-
return BLOG_ROUTE_PATHS.POST_LIST;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function getBlogPostFormUrl(params: { postId: number | string }) {
|
|
15
|
-
return compile(BLOG_ROUTE_PATHS.POST_FORM)({ postId: params.postId });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function getBlogCategoryListUrl() {
|
|
19
|
-
return BLOG_ROUTE_PATHS.CATEGORY_LIST;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function getBlogCategoryFormUrl(params: {
|
|
23
|
-
categoryId: number | string;
|
|
24
|
-
}) {
|
|
25
|
-
return compile(BLOG_ROUTE_PATHS.CATEGORY_FORM)({
|
|
26
|
-
categoryId: params.categoryId,
|
|
27
|
-
});
|
|
28
|
-
}
|
package/src/constants/routes.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type RouteRecordRaw } from 'vue-router';
|
|
2
2
|
|
|
3
3
|
import BlogPostList from '../views/Posts/PostList';
|
|
4
4
|
import BlogPostForm from '../views/Posts/PostForm';
|
|
@@ -7,24 +7,24 @@ import BlogCategoryForm from '../views/Categories/CategoryForm';
|
|
|
7
7
|
|
|
8
8
|
import { BLOG_ROUTE_PATHS } from './paths';
|
|
9
9
|
|
|
10
|
-
export const BLOG_POST_LIST_ROUTE:
|
|
10
|
+
export const BLOG_POST_LIST_ROUTE: RouteRecordRaw = {
|
|
11
11
|
path: BLOG_ROUTE_PATHS.POST_LIST,
|
|
12
12
|
component: BlogPostList,
|
|
13
13
|
name: 'All posts',
|
|
14
14
|
meta: {
|
|
15
|
-
getBreadcrumbs: (route, t) => [
|
|
15
|
+
getBreadcrumbs: (route, { t }) => [
|
|
16
16
|
{ url: '/', text: t('blog:home') },
|
|
17
17
|
{ url: BLOG_ROUTE_PATHS.POST_LIST, text: t('blog:allPosts') },
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const BLOG_POST_FORM_ROUTE:
|
|
22
|
+
export const BLOG_POST_FORM_ROUTE: RouteRecordRaw = {
|
|
23
23
|
path: BLOG_ROUTE_PATHS.POST_FORM,
|
|
24
24
|
component: BlogPostForm,
|
|
25
25
|
name: 'Post Form',
|
|
26
26
|
meta: {
|
|
27
|
-
getBreadcrumbs: (route
|
|
27
|
+
getBreadcrumbs: (route, { t }) => [
|
|
28
28
|
{ url: '/', text: t('blog:home') },
|
|
29
29
|
{ url: BLOG_ROUTE_PATHS.POST_LIST, text: t('blog:allPosts') },
|
|
30
30
|
{ url: route.path, text: t('blog:postForm') },
|
|
@@ -32,24 +32,24 @@ export const BLOG_POST_FORM_ROUTE: CustomRouteConfig = {
|
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export const BLOG_CATEGORY_LIST_ROUTE:
|
|
35
|
+
export const BLOG_CATEGORY_LIST_ROUTE: RouteRecordRaw = {
|
|
36
36
|
path: BLOG_ROUTE_PATHS.CATEGORY_LIST,
|
|
37
37
|
component: BlogCategoryList,
|
|
38
38
|
name: 'All categories',
|
|
39
39
|
meta: {
|
|
40
|
-
getBreadcrumbs: (route, t) => [
|
|
40
|
+
getBreadcrumbs: (route, { t }) => [
|
|
41
41
|
{ url: '/', text: t('blog:home') },
|
|
42
42
|
{ url: BLOG_ROUTE_PATHS.CATEGORY_LIST, text: t('blog:allCategories') },
|
|
43
43
|
],
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
export const BLOG_CATEGORY_FORM_ROUTE:
|
|
47
|
+
export const BLOG_CATEGORY_FORM_ROUTE: RouteRecordRaw = {
|
|
48
48
|
path: BLOG_ROUTE_PATHS.CATEGORY_FORM,
|
|
49
49
|
component: BlogCategoryForm,
|
|
50
50
|
name: 'Category Form',
|
|
51
51
|
meta: {
|
|
52
|
-
getBreadcrumbs: (route
|
|
52
|
+
getBreadcrumbs: (route, { t }) => [
|
|
53
53
|
{ url: '/', text: t('blog:home') },
|
|
54
54
|
{ url: BLOG_ROUTE_PATHS.CATEGORY_LIST, text: t('blog:allCategories') },
|
|
55
55
|
{ url: route.path, text: t('blog:categoryForm') },
|
package/src/dev/App.vue
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PageLayout :sidebar-menu-list="sidebarMenuList">
|
|
3
|
+
<router-view />
|
|
4
|
+
</PageLayout>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { defineComponent } from 'vue';
|
|
9
|
+
|
|
10
|
+
import { MenuItemType, PageLayout } from '@tager/admin-layout';
|
|
11
|
+
import { ViewListIcon } from '@tager/admin-ui';
|
|
12
|
+
import { useI18n } from '@tager/admin-services';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
getBlogCategoryFormUrl,
|
|
16
|
+
getBlogCategoryListUrl,
|
|
17
|
+
getBlogPostFormUrl,
|
|
18
|
+
getBlogPostListUrl,
|
|
19
|
+
} from '../utils/paths';
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
name: 'App',
|
|
23
|
+
components: {
|
|
24
|
+
PageLayout,
|
|
25
|
+
},
|
|
26
|
+
setup() {
|
|
27
|
+
const i18n = useI18n();
|
|
28
|
+
|
|
29
|
+
const sidebarMenuList: Array<MenuItemType> = [
|
|
30
|
+
{
|
|
31
|
+
id: 'blog',
|
|
32
|
+
text: i18n.t('blog:blog'),
|
|
33
|
+
icon: ViewListIcon,
|
|
34
|
+
children: [
|
|
35
|
+
{
|
|
36
|
+
text: i18n.t('blog:createPost'),
|
|
37
|
+
url: getBlogPostFormUrl({ postId: 'create' }),
|
|
38
|
+
},
|
|
39
|
+
{ text: i18n.t('blog:posts'), url: getBlogPostListUrl() },
|
|
40
|
+
{
|
|
41
|
+
text: i18n.t('blog:createCategory'),
|
|
42
|
+
url: getBlogCategoryFormUrl({ categoryId: 'create' }),
|
|
43
|
+
},
|
|
44
|
+
{ text: i18n.t('blog:categories'), url: getBlogCategoryListUrl() },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
sidebarMenuList,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AppConfigType } from '@tager/admin-services';
|
|
2
|
+
|
|
3
|
+
export const OZITAG_CONFIG: AppConfigType = {
|
|
4
|
+
APP_NAME: 'OZiTAG_ADMIN',
|
|
5
|
+
TITLE_TEMPLATE: 'OZiTAG Admin - {{title}}',
|
|
6
|
+
LANGUAGE: 'EN',
|
|
7
|
+
BRAND: {
|
|
8
|
+
small: {
|
|
9
|
+
logo: 'logo-small.svg',
|
|
10
|
+
},
|
|
11
|
+
large: {
|
|
12
|
+
logo: 'logo.svg',
|
|
13
|
+
label: 'OZiTAG',
|
|
14
|
+
'label-color': '#DD6900',
|
|
15
|
+
},
|
|
16
|
+
subtitle: '',
|
|
17
|
+
},
|
|
18
|
+
SPLASH_SCREEN: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
logo: 'logo-white.svg',
|
|
21
|
+
background: '#1e1e1e',
|
|
22
|
+
},
|
|
23
|
+
};
|
package/src/dev/env.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { initializeEnvironment } from '@tager/admin-services';
|
|
2
|
+
|
|
3
|
+
export function populateEnvironment() {
|
|
4
|
+
initializeEnvironment({
|
|
5
|
+
publicPath: process.env.VUE_APP_PUBLIC_PATH,
|
|
6
|
+
appEnv: process.env.VUE_APP_ENV,
|
|
7
|
+
apiUrl: process.env.VUE_APP_API_URL,
|
|
8
|
+
accessToken: process.env.VUE_APP_ACCESS_TOKEN,
|
|
9
|
+
websiteUrl: process.env.VUE_APP_WEBSITE_URL,
|
|
10
|
+
websiteButtonUrl: process.env.VUE_APP_WEBSITE_BUTTON_URL,
|
|
11
|
+
sentryDsn: process.env.VUE_APP_SENTRY_DSN,
|
|
12
|
+
sentryEnv: process.env.VUE_APP_SENTRY_ENVIRONMENT,
|
|
13
|
+
baseUrl: process.env.BASE_URL,
|
|
14
|
+
nodeEnv: process.env.NODE_ENV,
|
|
15
|
+
version: process.env.VUE_APP_VERSION,
|
|
16
|
+
});
|
|
17
|
+
}
|
package/src/dev/main.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createApp } from 'vue';
|
|
2
|
+
import { createPinia } from 'pinia';
|
|
3
|
+
|
|
4
|
+
import { configStore, i18n, i18nPlugin } from '@tager/admin-services';
|
|
5
|
+
import { createRouter } from '@tager/admin-layout';
|
|
6
|
+
import '@tager/admin-ui/css';
|
|
7
|
+
import '@tager/admin-layout/css';
|
|
8
|
+
import '@tager/admin-dynamic-field/css';
|
|
9
|
+
|
|
10
|
+
import { applyTranslations } from '../locales/apply';
|
|
11
|
+
import {
|
|
12
|
+
BLOG_POST_LIST_ROUTE,
|
|
13
|
+
BLOG_CATEGORY_FORM_ROUTE,
|
|
14
|
+
BLOG_CATEGORY_LIST_ROUTE,
|
|
15
|
+
BLOG_POST_FORM_ROUTE,
|
|
16
|
+
} from '../constants/routes';
|
|
17
|
+
|
|
18
|
+
import { OZITAG_CONFIG } from './config';
|
|
19
|
+
import App from './App.vue';
|
|
20
|
+
import { populateEnvironment } from './env';
|
|
21
|
+
|
|
22
|
+
populateEnvironment();
|
|
23
|
+
|
|
24
|
+
configStore.setConfig(OZITAG_CONFIG);
|
|
25
|
+
|
|
26
|
+
const router = createRouter(
|
|
27
|
+
{
|
|
28
|
+
routes: [
|
|
29
|
+
BLOG_POST_LIST_ROUTE,
|
|
30
|
+
BLOG_CATEGORY_FORM_ROUTE,
|
|
31
|
+
BLOG_CATEGORY_LIST_ROUTE,
|
|
32
|
+
BLOG_POST_FORM_ROUTE,
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{ useTitleSync: false }
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const app = createApp(App);
|
|
39
|
+
const pinia = createPinia();
|
|
40
|
+
|
|
41
|
+
app.use(router);
|
|
42
|
+
app.use(i18nPlugin);
|
|
43
|
+
app.use(pinia);
|
|
44
|
+
|
|
45
|
+
applyTranslations();
|
|
46
|
+
|
|
47
|
+
i18n.init({ debug: true, lng: 'ru' }).then(() => {
|
|
48
|
+
app.mount('#app');
|
|
49
|
+
});
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { onMounted
|
|
1
|
+
import { onMounted } from 'vue';
|
|
2
2
|
|
|
3
3
|
import { ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
5
|
import { Category } from '../typings/model';
|
|
6
6
|
import { getCategories } from '../services/requests';
|
|
7
7
|
|
|
8
|
-
export function useFetchCategories({
|
|
9
|
-
context,
|
|
10
|
-
}: {
|
|
11
|
-
context: SetupContext;
|
|
12
|
-
}): ResourceRef<Category[]> {
|
|
8
|
+
export function useFetchCategories(): ResourceRef<Category[]> {
|
|
13
9
|
const [fetchCategories, resource] = useResource<Category[]>({
|
|
14
10
|
fetchResource: getCategories,
|
|
15
11
|
initialValue: [],
|
|
16
|
-
context,
|
|
17
12
|
resourceName: 'Blog categories',
|
|
18
13
|
});
|
|
19
14
|
|