@vc-shell/framework 1.1.89 → 1.1.91-alpha.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/CHANGELOG.md +13 -0
- package/core/composables/useUser/index.ts +74 -171
- package/core/composables/useUserManagement/index.ts +67 -25
- package/core/interceptors/index.ts +19 -56
- package/core/plugins/signalR/index.ts +27 -1
- package/core/providers/README.md +176 -0
- package/core/providers/auth-provider-manager.ts +74 -0
- package/core/providers/example-custom-auth-provider.ts +161 -0
- package/core/providers/index.ts +3 -0
- package/core/providers/platform-auth-provider.ts +205 -0
- package/core/types/auth-provider.ts +44 -0
- package/core/types/index.ts +2 -0
- package/dist/core/composables/useUser/index.d.ts +18 -9
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/composables/useUserManagement/index.d.ts +7 -7
- package/dist/core/composables/useUserManagement/index.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts +2 -1
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts +2 -0
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/providers/auth-provider-manager.d.ts +34 -0
- package/dist/core/providers/auth-provider-manager.d.ts.map +1 -0
- package/dist/core/providers/example-custom-auth-provider.d.ts +45 -0
- package/dist/core/providers/example-custom-auth-provider.d.ts.map +1 -0
- package/dist/core/providers/index.d.ts +3 -0
- package/dist/core/providers/index.d.ts.map +1 -0
- package/dist/core/providers/platform-auth-provider.d.ts +34 -0
- package/dist/core/providers/platform-auth-provider.d.ts.map +1 -0
- package/dist/core/types/auth-provider.d.ts +27 -0
- package/dist/core/types/auth-provider.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +5537 -5420
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +2 -1
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/package.json +7 -5
- package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -2
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +15 -1
- package/ui/components/organisms/vc-app/vc-app.vue +20 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-app.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-app/vc-app.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vc-app.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-app/vc-app.vue"],"names":[],"mappings":"AA+UA,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAWD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;CACrC,CAAC;AAiSF,QAAA,MAAM,eAAe;mCA3Se,IAAI;;uCAAJ,IAAI;kFAkTtC,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.91-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"@fullhuman/postcss-purgecss": "^7.0.2",
|
|
91
91
|
"@laynezh/vite-plugin-lib-assets": "v1.1.0",
|
|
92
92
|
"@types/dompurify": "^3.0.5",
|
|
93
|
-
"@vc-shell/api-client-generator": "^1.1.
|
|
94
|
-
"@vc-shell/config-generator": "^1.1.
|
|
95
|
-
"@vc-shell/ts-config": "^1.1.
|
|
93
|
+
"@vc-shell/api-client-generator": "^1.1.91-alpha.0",
|
|
94
|
+
"@vc-shell/config-generator": "^1.1.91-alpha.0",
|
|
95
|
+
"@vc-shell/ts-config": "^1.1.91-alpha.0",
|
|
96
96
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
97
97
|
"@vue/test-utils": "^2.4.5",
|
|
98
98
|
"cypress-signalr-mock": "^1.5.0",
|
|
@@ -111,5 +111,7 @@
|
|
|
111
111
|
"publishConfig": {
|
|
112
112
|
"access": "public",
|
|
113
113
|
"registry": "https://registry.npmjs.org/"
|
|
114
|
-
}
|
|
114
|
+
},
|
|
115
|
+
"stableVersion": "1.1.90",
|
|
116
|
+
"npmTag": "alpha"
|
|
115
117
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@contextmenu.prevent
|
|
7
7
|
>
|
|
8
8
|
<GenericDropdown
|
|
9
|
-
|
|
9
|
+
opened
|
|
10
10
|
:items="appsList"
|
|
11
11
|
:is-item-active="(item) => locationHandler(item.relativeUrl ?? '')"
|
|
12
12
|
max-height="auto"
|
|
@@ -72,7 +72,7 @@ const switchApp = (app: AppDescriptor) => {
|
|
|
72
72
|
@apply tw-relative tw-flex tw-shrink-0 tw-h-full;
|
|
73
73
|
|
|
74
74
|
&__item {
|
|
75
|
-
@apply tw-flex tw-items-center tw-w-full tw-p-3
|
|
75
|
+
@apply tw-flex tw-items-center tw-w-full tw-p-3;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&__item-icon {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { computed, Ref, ref } from "vue";
|
|
1
|
+
import { computed, Ref, ref, inject } from "vue";
|
|
2
2
|
import { AppDescriptor, AppsClient } from "../../../../../core/api/platform";
|
|
3
3
|
import { usePermissions } from "../../../../../core/composables";
|
|
4
4
|
import { notification } from "./../../../notifications";
|
|
5
5
|
import { i18n } from "../../../../../core/plugins";
|
|
6
|
+
import { AuthProviderKey } from "../../../../../injection-keys";
|
|
7
|
+
import { IAuthProvider } from "../../../../../core/types/auth-provider";
|
|
8
|
+
import { PlatformAuthProvider } from "../../../../../core/providers/platform-auth-provider";
|
|
6
9
|
|
|
7
10
|
interface IUseAppSwitcher {
|
|
8
11
|
readonly appsList: Ref<AppDescriptor[]>;
|
|
@@ -14,12 +17,23 @@ export function useAppSwitcher(): IUseAppSwitcher {
|
|
|
14
17
|
const { hasAccess } = usePermissions();
|
|
15
18
|
const appsList = ref<AppDescriptor[]>([]);
|
|
16
19
|
|
|
20
|
+
// Inject auth provider to check if platform features should be enabled
|
|
21
|
+
const authProvider = inject(AuthProviderKey);
|
|
22
|
+
|
|
17
23
|
async function getApiClient(): Promise<AppsClient> {
|
|
18
24
|
const client = new AppsClient();
|
|
19
25
|
return client;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
async function getApps() {
|
|
29
|
+
// Skip loading apps for custom authentication providers
|
|
30
|
+
if (authProvider && !(authProvider instanceof PlatformAuthProvider)) {
|
|
31
|
+
console.log("[useAppSwitcher] Skipping getApps - custom authentication provider detected");
|
|
32
|
+
appsList.value = []; // Ensure empty list for custom providers
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log("[useAppSwitcher] Loading apps from platform");
|
|
23
37
|
const client = await getApiClient();
|
|
24
38
|
|
|
25
39
|
try {
|
|
@@ -60,10 +60,11 @@ import { ChangePasswordButton } from "../../../../shared/components/change-passw
|
|
|
60
60
|
import { LogoutButton } from "../../../../shared/components/logout-button";
|
|
61
61
|
import { provideGlobalSearch } from "../../../../core/composables/useGlobalSearch";
|
|
62
62
|
import { provideDashboardService } from "../../../../core/composables/useDashboard";
|
|
63
|
-
import { DynamicModulesKey, EMBEDDED_MODE } from "../../../../injection-keys";
|
|
63
|
+
import { DynamicModulesKey, EMBEDDED_MODE, AuthProviderKey } from "../../../../injection-keys";
|
|
64
64
|
import { provideMenuService } from "../../../../core/composables/useMenuService";
|
|
65
65
|
import { provideAppBarMobileButtonsService } from "../../../../core/composables/useAppBarMobileButtons";
|
|
66
66
|
import { useUserManagement } from "../../../../core/composables/useUserManagement";
|
|
67
|
+
import { PlatformAuthProvider } from "../../../../core/providers/platform-auth-provider";
|
|
67
68
|
|
|
68
69
|
export interface Props {
|
|
69
70
|
isReady: boolean;
|
|
@@ -97,6 +98,23 @@ console.debug("vc-app: Init vc-app");
|
|
|
97
98
|
const internalRoutes = inject("bladeRoutes") as BladeRoutesRecord[];
|
|
98
99
|
const dynamicModules = inject(DynamicModulesKey, undefined);
|
|
99
100
|
|
|
101
|
+
// Inject auth provider to check if platform features should be enabled
|
|
102
|
+
const authProvider = inject(AuthProviderKey);
|
|
103
|
+
|
|
104
|
+
// Automatically disable app switcher for custom authentication providers
|
|
105
|
+
const shouldDisableAppSwitcher = computed(() => {
|
|
106
|
+
// If explicitly disabled via prop, respect that
|
|
107
|
+
if (props.disableAppSwitcher) return true;
|
|
108
|
+
|
|
109
|
+
// If using custom auth provider, disable platform-specific features
|
|
110
|
+
if (authProvider && !(authProvider instanceof PlatformAuthProvider)) {
|
|
111
|
+
console.log("[VcApp] App Switcher disabled - custom authentication provider detected");
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return false;
|
|
116
|
+
});
|
|
117
|
+
|
|
100
118
|
const isAppReady = ref(props.isReady);
|
|
101
119
|
|
|
102
120
|
const route = useRoute();
|
|
@@ -223,7 +241,7 @@ provideAppSlots(
|
|
|
223
241
|
slots,
|
|
224
242
|
{
|
|
225
243
|
disableMenu: props.disableMenu,
|
|
226
|
-
disableAppSwitcher:
|
|
244
|
+
disableAppSwitcher: shouldDisableAppSwitcher.value,
|
|
227
245
|
version: props.version,
|
|
228
246
|
avatar: props.avatar,
|
|
229
247
|
name: props.name,
|