@nocobase/app 3.0.0-alpha.6 → 3.0.0-alpha.7

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.
@@ -75,7 +75,7 @@ function runBrowserChecker(options: RunBrowserCheckerOptions) {
75
75
  }
76
76
 
77
77
  describe('v2 browser checker', () => {
78
- it.each([undefined, 'modern-default', 'modern-only'] as const)(
78
+ it.each([undefined, 'modern-default', 'modern-only', 'settings-default'] as const)(
79
79
  'lets the modern client handle its root for entry mode %s',
80
80
  (appClientEntryMode) => {
81
81
  expect(
@@ -87,7 +87,7 @@ describe('v2 browser checker', () => {
87
87
  },
88
88
  );
89
89
 
90
- it.each([undefined, 'modern-default', 'modern-only'] as const)(
90
+ it.each([undefined, 'modern-default', 'modern-only', 'settings-default'] as const)(
91
91
  'lets scoped modern clients handle their roots for entry mode %s',
92
92
  (appClientEntryMode) => {
93
93
  expect(
@@ -54,7 +54,7 @@ if (basename !== '/' && currentPath === basenameWithoutTrailingSlash) {
54
54
  // This client-side redirect is still needed because legacy `index.html` is
55
55
  // not always served through the node gateway. In nginx/static delivery paths
56
56
  // the browser may already be running the legacy shell by the time entry-mode
57
- // logic is evaluated, so the last hop into the modern entry has to be
57
+ // logic is evaluated, so the last hop into the configured default entry has to be
58
58
  // recoverable in the browser as well.
59
59
  const normalizedPath = normalizePathname(currentPath);
60
60
  const relativePath =
@@ -66,15 +66,22 @@ if (basename !== '/' && currentPath === basenameWithoutTrailingSlash) {
66
66
  ? normalizePathname(normalizedPath.slice(basename.length - 1))
67
67
  : null;
68
68
  const modernBase = `${trimTrailingSlash(basename)}/${modernClientPrefix}/`.replace(/\/{2,}/g, '/');
69
+ const settingsBase = `${basename}settings/`;
69
70
  const isModernDefault = appClientEntryMode === 'modern-default';
70
71
  const isModernOnly = appClientEntryMode === 'modern-only';
72
+ const isSettingsDefault = appClientEntryMode === 'settings-default';
73
+ const targetBase = isSettingsDefault ? settingsBase : modernBase;
71
74
  if (
72
75
  relativePath &&
73
76
  isClientDocumentEntryPath(relativePath) &&
74
- (isModernDefault || isModernOnly) &&
75
- !normalizedPath.startsWith(modernBase)
77
+ (isModernDefault || isModernOnly || isSettingsDefault) &&
78
+ !normalizedPath.startsWith(targetBase)
76
79
  ) {
77
- const targetPath = isModernDefault
80
+ const targetPath = isSettingsDefault
81
+ ? relativePath === '/' || relativePath === '/index.html'
82
+ ? settingsBase
83
+ : null
84
+ : isModernDefault
78
85
  ? relativePath === '/' || relativePath === '/index.html'
79
86
  ? relativePath === '/index.html'
80
87
  ? `${modernBase}index.html`