@vc-shell/create-vc-app 1.0.110 → 1.0.111
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/CHANGELOG.md +9 -0
- package/dist/template/base/.vscode/settings.json +2 -1
- package/dist/template/base/package.json.ejs +1 -1
- package/dist/template/base/src/main.ts.ejs +26 -19
- package/dist/template/base/src/router/index.ts.ejs +5 -7
- package/dist/template/base/vite.config.ts.ejs +1 -1
- package/dist/template/code/blade/src/modules/default/index.ts +1 -1
- package/package.json +1 -1
- package/dist/template/base/public/assets/1.jpg +0 -0
- package/dist/template/base/public/assets/2.jpg +0 -0
- package/dist/template/base/public/assets/3.jpg +0 -0
- package/dist/template/base/public/assets/4.jpg +0 -0
- package/dist/template/base/public/assets/5.jpg +0 -0
- package/dist/template/base/public/assets/6.jpg +0 -0
- package/dist/template/base/public/assets/7.jpg +0 -0
- package/dist/template/base/public/assets/8.jpg +0 -0
- package/dist/template/base/public/assets/9.jpg +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [1.0.111](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.110...v1.0.111) (2023-10-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* dynamic modules ([ed4af3a](https://github.com/VirtoCommerce/vc-shell/commit/ed4af3ad65e47b0d633d6e2eb23e9c90d73ff50d))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [1.0.110](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.109...v1.0.110) (2023-10-16)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import VirtoShellFramework, { notification } from "@vc-shell/framework";
|
|
1
|
+
import VirtoShellFramework, { notification, useUser } from "@vc-shell/framework";
|
|
2
2
|
import { createApp } from "vue";
|
|
3
3
|
import { router } from "./router";
|
|
4
4
|
import * as locales from "./locales";
|
|
@@ -16,26 +16,33 @@ import "@fortawesome/fontawesome-free/css/all.min.css";
|
|
|
16
16
|
import "roboto-fontface/css/roboto/roboto-fontface.css";
|
|
17
17
|
import "@vc-shell/framework/dist/index.css";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
useLogin,
|
|
22
|
-
}<% } -%>)
|
|
23
|
-
<% if(bladeModuleStarter === true) { -%>
|
|
24
|
-
.use(Default, { router })
|
|
25
|
-
<% } -%>
|
|
19
|
+
async function startApp() {
|
|
20
|
+
const { loadUser } = useUser();
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
await loadUser();
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
const app = createApp(RouterView)
|
|
25
|
+
.use(VirtoShellFramework)
|
|
26
|
+
<% if(bladeModuleStarter === true) { -%>
|
|
27
|
+
.use(Default, { router })
|
|
28
|
+
<% } -%>
|
|
29
|
+
.use(router)
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
app.config.errorHandler = (err) => {
|
|
36
|
-
notification.error(err.toString(), {
|
|
37
|
-
timeout: 5000,
|
|
31
|
+
Object.entries(locales).forEach(([key, message]) => {
|
|
32
|
+
app.config.globalProperties.$mergeLocaleMessage(key, message);
|
|
38
33
|
});
|
|
39
|
-
};
|
|
40
34
|
|
|
41
|
-
app.
|
|
35
|
+
app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
|
|
36
|
+
|
|
37
|
+
app.config.errorHandler = (err) => {
|
|
38
|
+
notification.error(err.toString(), {
|
|
39
|
+
timeout: 5000,
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
await router.isReady();
|
|
44
|
+
|
|
45
|
+
app.mount("#app");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
startApp()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
|
|
2
2
|
<% if(commonPages === true || bladeModuleStarter === true) { -%>
|
|
3
3
|
import { inject } from "vue";
|
|
4
|
+
import { useLogin } from "../composables";
|
|
4
5
|
<% } -%>
|
|
5
6
|
import {
|
|
6
7
|
usePermissions,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
ResetPassword,
|
|
14
15
|
Invite,
|
|
15
16
|
<% } -%>} from "@vc-shell/framework";
|
|
16
|
-
import { useCookies } from "@vueuse/integrations/useCookies";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Pages
|
|
@@ -53,6 +53,7 @@ const routes: RouteRecordRaw[] = [
|
|
|
53
53
|
name: "Login",
|
|
54
54
|
component: Login,
|
|
55
55
|
props: () => ({
|
|
56
|
+
composable: useLogin,
|
|
56
57
|
logo: whiteLogoImage,
|
|
57
58
|
background: bgImage,
|
|
58
59
|
title: "<%= appName %>",
|
|
@@ -97,7 +98,7 @@ export const router = createRouter({
|
|
|
97
98
|
|
|
98
99
|
<% if(commonPages === true || bladeModuleStarter === true) { -%>
|
|
99
100
|
router.beforeEach(async (to, from) => {
|
|
100
|
-
const {
|
|
101
|
+
const { hasAccess } = usePermissions();
|
|
101
102
|
const { resolveBlades } = useBladeNavigation();
|
|
102
103
|
const { isAuthenticated } = useUser();
|
|
103
104
|
const pages = inject<BladePageComponent[]>("pages");
|
|
@@ -105,16 +106,13 @@ router.beforeEach(async (to, from) => {
|
|
|
105
106
|
<% if(commonPages === true) { -%>
|
|
106
107
|
if (to.name !== "Login" && to.name !== "ResetPassword" && to.name !== "Invite") {
|
|
107
108
|
try {
|
|
108
|
-
// Fetch permissions if not any
|
|
109
|
-
await fetchUserPermissions();
|
|
110
|
-
|
|
111
109
|
const component = pages.find((blade) => blade?.url === to.path);
|
|
112
110
|
|
|
113
|
-
const
|
|
111
|
+
const _hasAccess = hasAccess(component?.permissions);
|
|
114
112
|
|
|
115
113
|
if (!(await isAuthenticated()) && to.name !== "Login") {
|
|
116
114
|
return { name: "Login" };
|
|
117
|
-
} else if (
|
|
115
|
+
} else if (_hasAccess && to.name !== "Login") {
|
|
118
116
|
const resolvedBladeUrl = resolveBlades(to);
|
|
119
117
|
return resolvedBladeUrl ? resolvedBladeUrl : true;
|
|
120
118
|
} else if (!hasAccess) {
|
|
@@ -42,6 +42,6 @@ export default getApplicationConfiguration({
|
|
|
42
42
|
splitVendorChunkPlugin(),
|
|
43
43
|
],
|
|
44
44
|
optimizeDeps: {
|
|
45
|
-
include: mode === "development" ? ["ace-builds", "client-oauth2", "quill-delta", "quill", "url-pattern"] : [],
|
|
45
|
+
include: mode === "development" ? ["ace-builds", "client-oauth2", "quill-delta", "quill", "url-pattern", "vee-validate"] : [],
|
|
46
46
|
},
|
|
47
47
|
});
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|