@tager/admin-administrators 0.2.6 → 1.0.1
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 -6
- 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/index.mjs +940 -0
- package/dist/locales/apply.d.ts +1 -0
- package/dist/locales/en.d.ts +44 -41
- package/dist/locales/ru.d.ts +2 -3
- package/dist/main.d.ts +3 -3
- package/dist/services/requests.d.ts +36 -32
- package/dist/style.css +1 -0
- package/dist/typings/model.d.ts +27 -25
- package/dist/utils/paths.d.ts +8 -8
- package/dist/views/AdminForm/AdminForm.helpers.d.ts +15 -14
- package/dist/views/AdminForm/AdminForm.vue.d.ts +2686 -61
- package/dist/views/AdminForm/index.d.ts +1 -1
- package/dist/views/AdminList/AdminList.vue.d.ts +14 -33
- package/dist/views/AdminList/index.d.ts +1 -1
- package/dist/views/RoleForm/RoleForm.helpers.d.ts +13 -13
- package/dist/views/RoleForm/RoleForm.vue.d.ts +24 -59
- package/dist/views/RoleForm/index.d.ts +1 -1
- package/dist/views/RoleList/RoleList.vue.d.ts +20 -46
- package/dist/views/RoleList/index.d.ts +1 -1
- package/package.json +52 -50
- package/src/constants/routes.ts +19 -19
- package/src/dev/App.vue +57 -0
- package/src/dev/config.ts +23 -0
- package/src/dev/env.ts +17 -0
- package/src/dev/main.ts +50 -0
- package/src/locales/apply.ts +9 -0
- package/src/locales/en.ts +6 -3
- package/src/locales/ru.ts +6 -4
- package/src/main.ts +5 -9
- package/src/services/requests.ts +13 -0
- package/src/typings/model.ts +3 -0
- package/src/views/AdminForm/AdminForm.helpers.ts +10 -3
- package/src/views/AdminForm/AdminForm.vue +136 -43
- package/src/views/AdminList/AdminList.vue +54 -49
- package/src/views/RoleForm/RoleForm.vue +86 -81
- package/src/views/RoleList/RoleList.vue +78 -64
- package/CHANGELOG.md +0 -0
- package/dist/dev.d.ts +0 -1
- package/dist/index.esm.js +0 -1336
- package/dist/index.umd.js +0 -1359
- package/src/config/config.json +0 -20
- package/src/dev.ts +0 -51
- 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/views/App.vue +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './AdminForm.vue';
|
|
1
|
+
export { default } from './AdminForm.vue';
|
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
2
|
-
import { AdminType } from '../../typings/model';
|
|
3
|
-
import { getAdminFormUrl } from '../../utils/paths';
|
|
4
|
-
declare const _default: import("vue").
|
|
5
|
-
t: import("i18next").TFunction;
|
|
6
|
-
columnDefs: ColumnDefinition<AdminType>[];
|
|
7
|
-
rowData: import("
|
|
8
|
-
isRowDataLoading: import("
|
|
9
|
-
errorMessage: import("
|
|
10
|
-
isBusy: (adminId: number) => boolean;
|
|
11
|
-
handleAdminDelete: (entityId: string | number) => void;
|
|
12
|
-
getAdminFormUrl: typeof getAdminFormUrl;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
}, {}, {}, unknown, {
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
20
|
-
t: import("i18next").TFunction;
|
|
21
|
-
columnDefs: ColumnDefinition<AdminType>[];
|
|
22
|
-
rowData: import("@vue/composition-api").Ref<AdminType[]>;
|
|
23
|
-
isRowDataLoading: import("@vue/composition-api").ComputedRef<boolean>;
|
|
24
|
-
errorMessage: import("@vue/composition-api").Ref<import("@tager/admin-services").Nullable<string>>;
|
|
25
|
-
isBusy: (adminId: number) => boolean;
|
|
26
|
-
handleAdminDelete: (entityId: string | number) => void;
|
|
27
|
-
getAdminFormUrl: typeof getAdminFormUrl;
|
|
28
|
-
}>, {
|
|
29
|
-
[x: string]: any;
|
|
30
|
-
}, {}, {}, {
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
}, {}, true>);
|
|
33
|
-
export default _default;
|
|
1
|
+
import { ColumnDefinition } from '@tager/admin-ui';
|
|
2
|
+
import { AdminType } from '../../typings/model';
|
|
3
|
+
import { getAdminFormUrl } from '../../utils/paths';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
|
+
t: import("i18next").TFunction;
|
|
6
|
+
columnDefs: ColumnDefinition<AdminType>[];
|
|
7
|
+
rowData: import("vue").Ref<AdminType[]>;
|
|
8
|
+
isRowDataLoading: import("vue").ComputedRef<boolean>;
|
|
9
|
+
errorMessage: import("vue").Ref<import("@tager/admin-services").Nullable<string>>;
|
|
10
|
+
isBusy: (adminId: number) => boolean;
|
|
11
|
+
handleAdminDelete: (entityId: string | number) => void;
|
|
12
|
+
getAdminFormUrl: typeof getAdminFormUrl;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './AdminList.vue';
|
|
1
|
+
export { default } from './AdminList.vue';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Nullable } from '@tager/admin-services';
|
|
2
|
-
import { OptionType } from '@tager/admin-ui';
|
|
3
|
-
import { RoleType, ScopeGroupsData } from '../../typings/model';
|
|
4
|
-
import { RoleCreationPayload, RoleUpdatePayload } from '../../services/requests';
|
|
5
|
-
export declare type FormValues = {
|
|
6
|
-
name: string;
|
|
7
|
-
scopes: Array<OptionType>;
|
|
8
|
-
isSuperAdmin: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare function convertRoleToFormValues(role: Nullable<RoleType>): FormValues;
|
|
11
|
-
export declare function convertFormValuesToRoleCreationPayload(values: FormValues): RoleCreationPayload;
|
|
12
|
-
export declare function convertFormValuesToRoleUpdatePayload(values: FormValues): RoleUpdatePayload;
|
|
13
|
-
export declare function convertScopeDataToOptions(scopeData: Nullable<ScopeGroupsData>): Array<OptionType>;
|
|
1
|
+
import { Nullable } from '@tager/admin-services';
|
|
2
|
+
import { OptionType } from '@tager/admin-ui';
|
|
3
|
+
import { RoleType, ScopeGroupsData } from '../../typings/model';
|
|
4
|
+
import { RoleCreationPayload, RoleUpdatePayload } from '../../services/requests';
|
|
5
|
+
export declare type FormValues = {
|
|
6
|
+
name: string;
|
|
7
|
+
scopes: Array<OptionType>;
|
|
8
|
+
isSuperAdmin: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function convertRoleToFormValues(role: Nullable<RoleType>): FormValues;
|
|
11
|
+
export declare function convertFormValuesToRoleCreationPayload(values: FormValues): RoleCreationPayload;
|
|
12
|
+
export declare function convertFormValuesToRoleUpdatePayload(values: FormValues): RoleUpdatePayload;
|
|
13
|
+
export declare function convertScopeDataToOptions(scopeData: Nullable<ScopeGroupsData>): Array<OptionType>;
|
|
@@ -1,59 +1,24 @@
|
|
|
1
|
-
import { Nullable } from '@tager/admin-services';
|
|
2
|
-
import { OptionType, TagerFormSubmitEvent } from '@tager/admin-ui';
|
|
3
|
-
import { RoleType } from '../../typings/model';
|
|
4
|
-
declare const _default: import("vue").
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
scopeOptionList: import("@vue/composition-api").ComputedRef<OptionType<string>[]>;
|
|
26
|
-
}> & {
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
}, {}, {}, unknown, {
|
|
29
|
-
[x: string]: any;
|
|
30
|
-
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
33
|
-
t: import("i18next").TFunction;
|
|
34
|
-
backButtonUrl: "/roles";
|
|
35
|
-
values: import("@vue/composition-api").Ref<{
|
|
36
|
-
name: string;
|
|
37
|
-
scopes: {
|
|
38
|
-
value: string;
|
|
39
|
-
label: string;
|
|
40
|
-
disabled?: boolean | undefined;
|
|
41
|
-
}[];
|
|
42
|
-
isSuperAdmin: boolean;
|
|
43
|
-
}>;
|
|
44
|
-
errors: import("@vue/composition-api").Ref<{
|
|
45
|
-
[x: string]: string;
|
|
46
|
-
}>;
|
|
47
|
-
isSubmitting: import("@vue/composition-api").Ref<boolean>;
|
|
48
|
-
submitForm: (event: TagerFormSubmitEvent) => void;
|
|
49
|
-
isContentLoading: import("@vue/composition-api").ComputedRef<boolean>;
|
|
50
|
-
role: import("@vue/composition-api").Ref<Nullable<RoleType>>;
|
|
51
|
-
pageTitle: import("@vue/composition-api").ComputedRef<string>;
|
|
52
|
-
isCreation: import("@vue/composition-api").ComputedRef<boolean>;
|
|
53
|
-
scopeOptionList: import("@vue/composition-api").ComputedRef<OptionType<string>[]>;
|
|
54
|
-
}>, {
|
|
55
|
-
[x: string]: any;
|
|
56
|
-
}, {}, {}, {
|
|
57
|
-
[x: string]: any;
|
|
58
|
-
}, {}, true>);
|
|
59
|
-
export default _default;
|
|
1
|
+
import { Nullable } from '@tager/admin-services';
|
|
2
|
+
import { OptionType, TagerFormSubmitEvent } from '@tager/admin-ui';
|
|
3
|
+
import { RoleType } from '../../typings/model';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
|
+
backButtonUrl: "/roles";
|
|
6
|
+
values: import("vue").Ref<{
|
|
7
|
+
name: string;
|
|
8
|
+
scopes: {
|
|
9
|
+
value: string;
|
|
10
|
+
label: string;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
12
|
+
}[];
|
|
13
|
+
isSuperAdmin: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
errors: import("vue").Ref<Record<string, string>>;
|
|
16
|
+
isSubmitting: import("vue").Ref<boolean>;
|
|
17
|
+
submitForm: (event: TagerFormSubmitEvent) => void;
|
|
18
|
+
isContentLoading: import("vue").ComputedRef<boolean>;
|
|
19
|
+
role: import("vue").Ref<Nullable<RoleType>>;
|
|
20
|
+
pageTitle: import("vue").ComputedRef<string>;
|
|
21
|
+
isCreation: import("vue").ComputedRef<boolean>;
|
|
22
|
+
scopeOptionList: import("vue").ComputedRef<OptionType<string>[]>;
|
|
23
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
24
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './RoleForm.vue';
|
|
1
|
+
export { default } from './RoleForm.vue';
|
|
@@ -1,46 +1,20 @@
|
|
|
1
|
-
/// <reference types="webpack-env" />
|
|
2
|
-
import { ColumnDefinition } from
|
|
3
|
-
import { RoleType, ScopeType } from '../../typings/model';
|
|
4
|
-
import { getRoleFormUrl } from '../../utils/paths';
|
|
5
|
-
declare const _default: import("vue").
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[key: string]: unknown;
|
|
22
|
-
}, {}, {}, unknown, {
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
25
|
-
[x: string]: any;
|
|
26
|
-
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
27
|
-
t: import("i18next").TFunction;
|
|
28
|
-
columnDefs: ColumnDefinition<RoleType>[];
|
|
29
|
-
rowData: import("@vue/composition-api").Ref<RoleType[]>;
|
|
30
|
-
isRowDataLoading: import("@vue/composition-api").ComputedRef<boolean>;
|
|
31
|
-
errorMessage: import("@vue/composition-api").Ref<import("@tager/admin-services").Nullable<string>>;
|
|
32
|
-
isBusy: (roleId: number) => boolean;
|
|
33
|
-
handleRoleDelete: (entityId: string | number) => void;
|
|
34
|
-
getRoleFormUrl: typeof getRoleFormUrl;
|
|
35
|
-
getScopeGroupList: (scopes: Array<ScopeType>) => {
|
|
36
|
-
module: string;
|
|
37
|
-
scopes: ScopeType;
|
|
38
|
-
}[];
|
|
39
|
-
getRestScopesText: (restPrivilegesCount: number) => string;
|
|
40
|
-
scopesPerModuleCount: number;
|
|
41
|
-
}>, {
|
|
42
|
-
[x: string]: any;
|
|
43
|
-
}, {}, {}, {
|
|
44
|
-
[x: string]: any;
|
|
45
|
-
}, {}, true>);
|
|
46
|
-
export default _default;
|
|
1
|
+
/// <reference types="webpack-env" />
|
|
2
|
+
import { type ColumnDefinition } from "@tager/admin-ui";
|
|
3
|
+
import { RoleType, ScopeType } from '../../typings/model';
|
|
4
|
+
import { getRoleFormUrl } from '../../utils/paths';
|
|
5
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
6
|
+
columnDefs: ColumnDefinition<RoleType>[];
|
|
7
|
+
rowData: import("vue").Ref<RoleType[]>;
|
|
8
|
+
isRowDataLoading: import("vue").ComputedRef<boolean>;
|
|
9
|
+
errorMessage: import("vue").Ref<import("@tager/admin-services").Nullable<string>>;
|
|
10
|
+
isBusy: (roleId: number) => boolean;
|
|
11
|
+
handleRoleDelete: (entityId: string | number) => void;
|
|
12
|
+
getRoleFormUrl: typeof getRoleFormUrl;
|
|
13
|
+
getScopeGroupList: (scopes: Array<ScopeType>) => {
|
|
14
|
+
module: string;
|
|
15
|
+
scopes: ScopeType;
|
|
16
|
+
}[];
|
|
17
|
+
getRestScopesText: (restPrivilegesCount: number) => string;
|
|
18
|
+
scopesPerModuleCount: number;
|
|
19
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './RoleList.vue';
|
|
1
|
+
export { default } from './RoleList.vue';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tager/admin-administrators",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
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
|
+
"lodash.isequal": "^4.5.0",
|
|
27
|
+
"lodash.kebabcase": "^4.1.1",
|
|
28
|
+
"lodash.pick": "^4.4.0",
|
|
22
29
|
"path-to-regexp": "^6.1.0"
|
|
23
30
|
},
|
|
24
31
|
"devDependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@tager/admin-
|
|
29
|
-
"@tager/admin-
|
|
30
|
-
"@tager/admin-
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@vue/cli-
|
|
39
|
-
"@vue/
|
|
40
|
-
"@vue/
|
|
41
|
-
"@vue/eslint-config-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"eslint
|
|
46
|
-
"eslint-
|
|
47
|
-
"eslint-plugin-
|
|
48
|
-
"prettier": "^
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"sass-loader": "^
|
|
53
|
-
"typescript": "
|
|
54
|
-
"
|
|
55
|
-
"vue
|
|
56
|
-
"vue-
|
|
32
|
+
"@babel/core": "^7.17.9",
|
|
33
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
34
|
+
"@rushstack/eslint-patch": "^1.1.2",
|
|
35
|
+
"@tager/admin-dynamic-field": "^1.0.0",
|
|
36
|
+
"@tager/admin-layout": "^1.0.6",
|
|
37
|
+
"@tager/admin-services": "^1.1.3",
|
|
38
|
+
"@tager/admin-ui": "^1.0.7",
|
|
39
|
+
"@types/lodash.isequal": "^4.5.6",
|
|
40
|
+
"@types/lodash.pick": "^4.4.7",
|
|
41
|
+
"@types/node": "16.x",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
43
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
44
|
+
"@vitejs/plugin-vue": "^2.3.1",
|
|
45
|
+
"@vue/cli-plugin-babel": "^5.0.4",
|
|
46
|
+
"@vue/cli-plugin-typescript": "^5.0.4",
|
|
47
|
+
"@vue/cli-service": "~5.0.0",
|
|
48
|
+
"@vue/eslint-config-prettier": "^7.0.0",
|
|
49
|
+
"@vue/eslint-config-typescript": "^10.0.0",
|
|
50
|
+
"concurrently": "^7.1.0",
|
|
51
|
+
"core-js": "^3.22.3",
|
|
52
|
+
"eslint": "^8.14.0",
|
|
53
|
+
"eslint-config-prettier": "^8.5.0",
|
|
54
|
+
"eslint-plugin-import": "^2.26.0",
|
|
55
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
56
|
+
"eslint-plugin-vue": "^8.7.1",
|
|
57
|
+
"pinia": "^2.0.18",
|
|
58
|
+
"sass": "^1.51.0",
|
|
59
|
+
"sass-loader": "^12.6.0",
|
|
60
|
+
"typescript": "^4.6.3",
|
|
61
|
+
"vite": "^2.9.6",
|
|
62
|
+
"vue": "^3.2.31",
|
|
63
|
+
"vue-router": "^4.0.14",
|
|
64
|
+
"vue-tsc": "^0.34.10"
|
|
57
65
|
},
|
|
58
66
|
"peerDependencies": {
|
|
59
|
-
"@tager/admin-
|
|
60
|
-
"@tager/admin-
|
|
61
|
-
"@tager/admin-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"vue": "2.6.x"
|
|
65
|
-
},
|
|
66
|
-
"resolutions": {
|
|
67
|
-
"prettier": "2.x"
|
|
67
|
+
"@tager/admin-layout": "^1.0.0",
|
|
68
|
+
"@tager/admin-services": "^1.0.0",
|
|
69
|
+
"@tager/admin-ui": "^1.0.1",
|
|
70
|
+
"vue": "^3.2.31",
|
|
71
|
+
"vue-router": "^4.0.14"
|
|
68
72
|
},
|
|
69
73
|
"publishConfig": {
|
|
70
74
|
"access": "public"
|
|
71
|
-
}
|
|
72
|
-
"repository": "https://m.malkovich:1230978b@github.com/ozitag/tager-admin-administrators.git",
|
|
73
|
-
"author": "m.malkovich <m.malkovich@ozitag.com>"
|
|
75
|
+
}
|
|
74
76
|
}
|
package/src/constants/routes.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RouteRecordRaw } from "vue-router";
|
|
2
2
|
|
|
3
3
|
import AdminList from '../views/AdminList';
|
|
4
4
|
import AdminForm from '../views/AdminForm';
|
|
@@ -7,64 +7,64 @@ import RoleForm from '../views/RoleForm';
|
|
|
7
7
|
|
|
8
8
|
import { ADMINISTRATOR_ROUTE_PATHS } from './paths';
|
|
9
9
|
|
|
10
|
-
export const ADMIN_LIST_ROUTE:
|
|
10
|
+
export const ADMIN_LIST_ROUTE: RouteRecordRaw = {
|
|
11
11
|
path: ADMINISTRATOR_ROUTE_PATHS.ADMIN_LIST,
|
|
12
12
|
component: AdminList,
|
|
13
13
|
name: 'AdminList',
|
|
14
14
|
meta: {
|
|
15
|
-
getBreadcrumbs: (route,
|
|
16
|
-
{ url: '/', text: t('administrators:home') },
|
|
15
|
+
getBreadcrumbs: (route, i18n) => [
|
|
16
|
+
{ url: '/', text: i18n.t('administrators:home') },
|
|
17
17
|
{
|
|
18
18
|
url: ADMINISTRATOR_ROUTE_PATHS.ADMIN_LIST,
|
|
19
|
-
text: t('administrators:adminList'),
|
|
19
|
+
text: i18n.t('administrators:adminList'),
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export const ADMIN_FORM_ROUTE:
|
|
25
|
+
export const ADMIN_FORM_ROUTE: RouteRecordRaw = {
|
|
26
26
|
path: ADMINISTRATOR_ROUTE_PATHS.ADMIN_FORM,
|
|
27
27
|
component: AdminForm,
|
|
28
28
|
name: 'AdminForm',
|
|
29
29
|
meta: {
|
|
30
|
-
getBreadcrumbs: (route,
|
|
31
|
-
{ url: '/', text: t('administrators:home') },
|
|
30
|
+
getBreadcrumbs: (route, i18n) => [
|
|
31
|
+
{ url: '/', text: i18n.t('administrators:home') },
|
|
32
32
|
{
|
|
33
33
|
url: ADMINISTRATOR_ROUTE_PATHS.ADMIN_LIST,
|
|
34
|
-
text: t('administrators:adminList'),
|
|
34
|
+
text: i18n.t('administrators:adminList'),
|
|
35
35
|
},
|
|
36
|
-
{ url: route.path, text: t('administrators:adminForm') },
|
|
36
|
+
{ url: route.path, text: i18n.t('administrators:adminForm') },
|
|
37
37
|
],
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
export const ROLE_LIST_ROUTE:
|
|
41
|
+
export const ROLE_LIST_ROUTE: RouteRecordRaw = {
|
|
42
42
|
path: ADMINISTRATOR_ROUTE_PATHS.ROLE_LIST,
|
|
43
43
|
component: RoleList,
|
|
44
44
|
name: 'RoleList',
|
|
45
45
|
meta: {
|
|
46
|
-
getBreadcrumbs: (route,
|
|
47
|
-
{ url: '/', text: t('administrators:home') },
|
|
46
|
+
getBreadcrumbs: (route, i18n) => [
|
|
47
|
+
{ url: '/', text: i18n.t('administrators:home') },
|
|
48
48
|
{
|
|
49
49
|
url: ADMINISTRATOR_ROUTE_PATHS.ROLE_LIST,
|
|
50
|
-
text: t('administrators:roleList'),
|
|
50
|
+
text: i18n.t('administrators:roleList'),
|
|
51
51
|
},
|
|
52
52
|
],
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export const ROLE_FORM_ROUTE:
|
|
56
|
+
export const ROLE_FORM_ROUTE: RouteRecordRaw = {
|
|
57
57
|
path: ADMINISTRATOR_ROUTE_PATHS.ROLE_FORM,
|
|
58
58
|
component: RoleForm,
|
|
59
59
|
name: 'RoleForm',
|
|
60
60
|
meta: {
|
|
61
|
-
getBreadcrumbs: (route,
|
|
62
|
-
{ url: '/', text: t('administrators:home') },
|
|
61
|
+
getBreadcrumbs: (route, i18n) => [
|
|
62
|
+
{ url: '/', text: i18n.t('administrators:home') },
|
|
63
63
|
{
|
|
64
64
|
url: ADMINISTRATOR_ROUTE_PATHS.ROLE_LIST,
|
|
65
|
-
text: t('administrators:roleList'),
|
|
65
|
+
text: i18n.t('administrators:roleList'),
|
|
66
66
|
},
|
|
67
|
-
{ url: route.path, text: t('administrators:roleForm') },
|
|
67
|
+
{ url: route.path, text: i18n.t('administrators:roleForm') },
|
|
68
68
|
],
|
|
69
69
|
},
|
|
70
70
|
};
|
package/src/dev/App.vue
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
|
|
12
|
+
import {ViewListIcon} from "@tager/admin-ui";
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
getAdminFormUrl,
|
|
16
|
+
getAdminListUrl,
|
|
17
|
+
getRoleFormUrl,
|
|
18
|
+
getRoleListUrl,
|
|
19
|
+
} from '../utils/paths';
|
|
20
|
+
import {useI18n} from "@tager/admin-services";
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
name: 'App',
|
|
24
|
+
components: {
|
|
25
|
+
PageLayout,
|
|
26
|
+
},
|
|
27
|
+
setup() {
|
|
28
|
+
const i18n = useI18n();
|
|
29
|
+
|
|
30
|
+
const sidebarMenuList: Array<MenuItemType> = [
|
|
31
|
+
{
|
|
32
|
+
id: 'admins',
|
|
33
|
+
text: i18n.t('administrators:administrators'),
|
|
34
|
+
icon: ViewListIcon,
|
|
35
|
+
children: [
|
|
36
|
+
{url: getRoleListUrl(), text: i18n.t('administrators:roles')},
|
|
37
|
+
{
|
|
38
|
+
url: getRoleFormUrl({roleId: 'create'}),
|
|
39
|
+
text: i18n.t('administrators:createRole'),
|
|
40
|
+
},
|
|
41
|
+
{url: getAdminListUrl(), text: i18n.t('administrators:admins')},
|
|
42
|
+
{
|
|
43
|
+
url: getAdminFormUrl({adminId: 'create'}),
|
|
44
|
+
text: i18n.t('administrators:createAdmin'),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
sidebarMenuList,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<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,50 @@
|
|
|
1
|
+
import { createApp } from 'vue';
|
|
2
|
+
|
|
3
|
+
import { configStore, i18n, i18nPlugin } from '@tager/admin-services';
|
|
4
|
+
import { createRouter } from '@tager/admin-layout';
|
|
5
|
+
import '@tager/admin-ui/css';
|
|
6
|
+
import '@tager/admin-layout/css';
|
|
7
|
+
import '@tager/admin-dynamic-field/css';
|
|
8
|
+
|
|
9
|
+
import { applyTranslations } from '../locales/apply';
|
|
10
|
+
import {
|
|
11
|
+
ADMIN_FORM_ROUTE,
|
|
12
|
+
ADMIN_LIST_ROUTE,
|
|
13
|
+
ROLE_FORM_ROUTE,
|
|
14
|
+
ROLE_LIST_ROUTE,
|
|
15
|
+
} from '../constants/routes';
|
|
16
|
+
|
|
17
|
+
import { OZITAG_CONFIG } from './config';
|
|
18
|
+
import App from './App.vue';
|
|
19
|
+
import { populateEnvironment } from './env';
|
|
20
|
+
|
|
21
|
+
import { createPinia } from 'pinia';
|
|
22
|
+
|
|
23
|
+
populateEnvironment();
|
|
24
|
+
|
|
25
|
+
configStore.setConfig(OZITAG_CONFIG);
|
|
26
|
+
|
|
27
|
+
const router = createRouter(
|
|
28
|
+
{
|
|
29
|
+
routes: [
|
|
30
|
+
ADMIN_LIST_ROUTE,
|
|
31
|
+
ADMIN_FORM_ROUTE,
|
|
32
|
+
ROLE_LIST_ROUTE,
|
|
33
|
+
ROLE_FORM_ROUTE,
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{ useTitleSync: false }
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const app = createApp(App);
|
|
40
|
+
const pinia = createPinia();
|
|
41
|
+
|
|
42
|
+
app.use(router);
|
|
43
|
+
app.use(i18nPlugin);
|
|
44
|
+
app.use(pinia);
|
|
45
|
+
|
|
46
|
+
applyTranslations();
|
|
47
|
+
|
|
48
|
+
i18n.init({ debug: true, lng: 'ru' }).then(() => {
|
|
49
|
+
app.mount('#app');
|
|
50
|
+
});
|
package/src/locales/en.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const EN = {
|
|
1
|
+
export const EN = {
|
|
2
2
|
home: 'Home',
|
|
3
3
|
administrators: 'Administrators',
|
|
4
4
|
role: 'Role',
|
|
@@ -37,6 +37,9 @@ const EN = {
|
|
|
37
37
|
roleList: 'Role List',
|
|
38
38
|
roleForm: 'Role form',
|
|
39
39
|
andMorePrivilege: 'and more {{count}} privilege...',
|
|
40
|
-
};
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
tabs: {
|
|
42
|
+
general: 'General',
|
|
43
|
+
params: 'Template',
|
|
44
|
+
},
|
|
45
|
+
};
|