@vc-shell/create-vc-app 1.0.127 → 1.0.128

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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.128](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.127...v1.0.128) (2023-12-14)
2
+
3
+
4
+
1
5
  ## [1.0.127](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.126...v1.0.127) (2023-12-13)
2
6
 
3
7
 
@@ -1,4 +1,4 @@
1
1
  APP_LOG_ENABLED=true
2
2
  APP_LOG_LEVEL=debug
3
- APP_PLATFORM_URL=https://vcmp-dev.paas.govirto.com/
3
+ #APP_PLATFORM_URL=add_platform_url_here
4
4
  APP_BASE_PATH=/apps/application/
@@ -21,8 +21,8 @@
21
21
  "@types/lodash-es": "^4.17.7",
22
22
  "@typescript-eslint/eslint-plugin": "^5.59.7",
23
23
  "@typescript-eslint/parser": "^5.59.7",
24
- "@vc-shell/api-client-generator": "^1.0.127",
25
- "@vc-shell/ts-config": "^1.0.127",
24
+ "@vc-shell/api-client-generator": "^1.0.128",
25
+ "@vc-shell/ts-config": "^1.0.128",
26
26
  "@vitejs/plugin-vue": "^4.2.3",
27
27
  "@vue/eslint-config-prettier": "^7.1.0",
28
28
  "@vue/eslint-config-typescript": "^11.0.3",
@@ -54,8 +54,8 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@fortawesome/fontawesome-free": "^5.15.3",
57
- "@vc-shell/config-generator": "^1.0.127",
58
- "@vc-shell/framework": "^1.0.127",
57
+ "@vc-shell/config-generator": "^1.0.128",
58
+ "@vc-shell/framework": "^1.0.128",
59
59
  "@vueuse/core": "^10.1.2",
60
60
  "@vueuse/integrations": "^10.1.2",
61
61
  "moment": "^2.29.4",
@@ -2,9 +2,16 @@ import { getApplicationConfiguration } from "@vc-shell/config-generator";
2
2
  import { VitePWA } from "vite-plugin-pwa";
3
3
  import { splitVendorChunkPlugin } from "vite";
4
4
 
5
+ // Remove it after you added APP_PLATFORM_URL to .env file. Demo mode works only with yarn serve
6
+ const isDemo = !process.env.APP_PLATFORM_URL;
7
+
5
8
  const mode = process.env.APP_ENV as string;
6
9
 
7
10
  export default getApplicationConfiguration({
11
+ define: {
12
+ // Set demo mode
13
+ __DEMO_MODE__: isDemo,
14
+ },
8
15
  plugins: [
9
16
  VitePWA({
10
17
  includeAssets: ["favicon.ico", "apple-touch-icon.png"],
@@ -29,7 +29,7 @@ async function startApp() {
29
29
  app.config.globalProperties.$mergeLocaleMessage(key, message);
30
30
  });
31
31
 
32
- app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
32
+ // app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
33
33
 
34
34
  app.config.errorHandler = (err) => {
35
35
  notification.error(err.toString(), {
@@ -99,7 +99,7 @@ const { appsList, switchApp, getApps } = useAppSwitcher();
99
99
  const { notifications, loadFromHistory, markAllAsRead } = useNotifications();
100
100
  const route = useRoute();
101
101
  const router = useRouter();
102
- const isAuthorized = ref(true);
102
+ const isAuthorized = ref(false);
103
103
  const isReady = ref(false);
104
104
  const pages = inject<BladeInstanceConstructor[]>("pages");
105
105
  const isDesktop = inject<Ref<boolean>>("isDesktop");
@@ -131,6 +131,14 @@ watch(
131
131
  { deep: true }
132
132
  );
133
133
 
134
+ watch(
135
+ user,
136
+ (value) => {
137
+ isAuthorized.value = !!value?.userName;
138
+ },
139
+ { immediate: true }
140
+ );
141
+
134
142
  console.debug(`Initializing App`);
135
143
 
136
144
  const toolbarItems = computed(() =>
@@ -26,7 +26,7 @@ async function startApp() {
26
26
  app.config.globalProperties.$mergeLocaleMessage(key, message);
27
27
  });
28
28
 
29
- app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
29
+ // app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
30
30
 
31
31
  app.config.errorHandler = (err) => {
32
32
  notification.error(err.toString(), {
@@ -98,7 +98,7 @@ const { appsList, switchApp, getApps } = useAppSwitcher();
98
98
  const { notifications, loadFromHistory, markAllAsRead } = useNotifications();
99
99
  const route = useRoute();
100
100
  const router = useRouter();
101
- const isAuthorized = ref(true);
101
+ const isAuthorized = ref(false);
102
102
  const isReady = ref(false);
103
103
  const pages = inject<BladeInstanceConstructor[]>("pages");
104
104
  const isDesktop = inject<Ref<boolean>>("isDesktop");
@@ -130,6 +130,15 @@ watch(
130
130
  { deep: true }
131
131
  );
132
132
 
133
+
134
+ watch(
135
+ user,
136
+ (value) => {
137
+ isAuthorized.value = !!value?.userName;
138
+ },
139
+ { immediate: true }
140
+ );
141
+
133
142
  console.debug(`Initializing App`);
134
143
 
135
144
  const toolbarItems = computed(() =>
@@ -26,7 +26,7 @@ async function startApp() {
26
26
  app.config.globalProperties.$mergeLocaleMessage(key, message);
27
27
  });
28
28
 
29
- app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
29
+ // app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
30
30
 
31
31
  app.config.errorHandler = (err) => {
32
32
  notification.error(err.toString(), {
@@ -98,7 +98,7 @@ const { appsList, switchApp, getApps } = useAppSwitcher();
98
98
  const { notifications, loadFromHistory, markAllAsRead } = useNotifications();
99
99
  const route = useRoute();
100
100
  const router = useRouter();
101
- const isAuthorized = ref(true);
101
+ const isAuthorized = ref(false);
102
102
  const isReady = ref(false);
103
103
  const pages = inject<BladeInstanceConstructor[]>("pages");
104
104
  const isDesktop = inject<Ref<boolean>>("isDesktop");
@@ -110,10 +110,10 @@ provide("internalRoutes", internalRoutes);
110
110
 
111
111
  onMounted(async () => {
112
112
  try {
113
- await getApps();
114
- langInit();
115
- await customizationHandler();
116
- await loadFromHistory();
113
+ // await getApps();
114
+ // langInit();
115
+ // await customizationHandler();
116
+ // await loadFromHistory();
117
117
 
118
118
  isReady.value = true;
119
119
  } catch (e) {
@@ -130,6 +130,14 @@ watch(
130
130
  { deep: true }
131
131
  );
132
132
 
133
+ watch(
134
+ user,
135
+ (value) => {
136
+ isAuthorized.value = !!value?.userName;
137
+ },
138
+ { immediate: true }
139
+ );
140
+
133
141
  console.debug(`Initializing App`);
134
142
 
135
143
  const toolbarItems = computed(() =>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vc-shell/create-vc-app",
3
3
  "description": "Application scaffolding",
4
- "version": "1.0.127",
4
+ "version": "1.0.128",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
7
7
  "files": [
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/prompts": "^2.4.4",
16
- "@vc-shell/ts-config": "^1.0.127",
16
+ "@vc-shell/ts-config": "^1.0.128",
17
17
  "copyfiles": "^2.4.1",
18
18
  "cross-env": "^7.0.3",
19
19
  "shx": "^0.3.4",