@nocobase/app 3.0.0-alpha.1 → 3.0.0-alpha.3
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/__tests__/browserChecker.test.ts +24 -40
- package/client-v2/public/browser-checker.js +1 -5
- package/dist/client/assets/{index-b8e6cdd9.js → index-38b2037d.js} +4 -4
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/dist/client/settings/assets/{index-222fdff7.js → index-a1af4e61.js} +3 -3
- package/dist/client/settings/browser-checker.js +1 -5
- package/dist/client/settings/index.html +1 -1
- package/dist/client/v/assets/{index-b2d53e82.js → index-42d9798f.js} +3 -3
- package/dist/client/v/browser-checker.js +1 -5
- package/dist/client/v/index.html +1 -1
- package/package.json +7 -7
- /package/dist/client/assets/{index-b8e6cdd9.js.LICENSE.txt → index-38b2037d.js.LICENSE.txt} +0 -0
- /package/dist/client/settings/assets/{index-222fdff7.js.LICENSE.txt → index-a1af4e61.js.LICENSE.txt} +0 -0
- /package/dist/client/v/assets/{index-b2d53e82.js.LICENSE.txt → index-42d9798f.js.LICENSE.txt} +0 -0
|
@@ -75,47 +75,31 @@ function runBrowserChecker(options: RunBrowserCheckerOptions) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
describe('v2 browser checker', () => {
|
|
78
|
-
it('
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
pathname: '/v/',
|
|
90
|
-
}).replacements,
|
|
91
|
-
).toEqual([]);
|
|
92
|
-
|
|
93
|
-
expect(
|
|
94
|
-
runBrowserChecker({
|
|
95
|
-
pathname: '/v/',
|
|
96
|
-
}).replacements,
|
|
97
|
-
).toEqual([]);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('redirects scoped modern client roots to scoped Settings only in modern-only mode', () => {
|
|
101
|
-
expect(
|
|
102
|
-
runBrowserChecker({
|
|
103
|
-
appClientEntryMode: 'modern-only',
|
|
104
|
-
pathname: '/v/apps/demo',
|
|
105
|
-
search: '?from=admin',
|
|
106
|
-
hash: '#portal',
|
|
107
|
-
}).replacements,
|
|
108
|
-
).toEqual(['https://example.test/settings/apps/demo?from=admin#portal']);
|
|
78
|
+
it.each([undefined, 'modern-default', 'modern-only'] as const)(
|
|
79
|
+
'redirects the modern client root to Settings for entry mode %s',
|
|
80
|
+
(appClientEntryMode) => {
|
|
81
|
+
expect(
|
|
82
|
+
runBrowserChecker({
|
|
83
|
+
appClientEntryMode,
|
|
84
|
+
pathname: '/v/',
|
|
85
|
+
}).replacements,
|
|
86
|
+
).toEqual(['https://example.test/settings']);
|
|
87
|
+
},
|
|
88
|
+
);
|
|
109
89
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
90
|
+
it.each([undefined, 'modern-default', 'modern-only'] as const)(
|
|
91
|
+
'redirects scoped modern client roots to scoped Settings for entry mode %s',
|
|
92
|
+
(appClientEntryMode) => {
|
|
93
|
+
expect(
|
|
94
|
+
runBrowserChecker({
|
|
95
|
+
appClientEntryMode,
|
|
96
|
+
pathname: '/v/apps/demo',
|
|
97
|
+
search: '?from=admin',
|
|
98
|
+
hash: '#portal',
|
|
99
|
+
}).replacements,
|
|
100
|
+
).toEqual(['https://example.test/settings/apps/demo?from=admin#portal']);
|
|
101
|
+
},
|
|
102
|
+
);
|
|
119
103
|
|
|
120
104
|
it('keeps Settings scoped trailing slash normalization independent from entry mode', () => {
|
|
121
105
|
expect(
|
|
@@ -81,11 +81,7 @@ function resolveScopedSettingsRootPath(publicPath, pathname) {
|
|
|
81
81
|
const basename = normalizePublicPath(window['__nocobase_public_path__'] || '/');
|
|
82
82
|
const currentPath = ensureLeadingSlash(String(window.location.pathname || '/').trim() || '/').replace(/\/{2,}/g, '/');
|
|
83
83
|
const basenameWithoutTrailingSlash = basename === '/' ? '/' : basename.replace(/\/+$/, '');
|
|
84
|
-
const
|
|
85
|
-
const settingsRootPath =
|
|
86
|
-
appClientEntryMode === 'modern-only'
|
|
87
|
-
? resolveSettingsRootPath(basename, window['__nocobase_modern_client_prefix__'], currentPath)
|
|
88
|
-
: null;
|
|
84
|
+
const settingsRootPath = resolveSettingsRootPath(basename, window['__nocobase_modern_client_prefix__'], currentPath);
|
|
89
85
|
const scopedSettingsRootPath = isSettingsBrowserCheckerScript(document.currentScript)
|
|
90
86
|
? resolveScopedSettingsRootPath(basename, currentPath)
|
|
91
87
|
: null;
|