@nocobase/app-template-default 1.0.0-beta.88 → 1.0.0-beta.90

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.
Files changed (103) hide show
  1. package/.agents/rules/components.md +3 -1
  2. package/.agents/rules/shell.md +12 -2
  3. package/AGENTS.md +1 -1
  4. package/LICENSE.txt +129 -0
  5. package/client/components/back-button.tsx +37 -12
  6. package/client/components/brand-loading-mark.tsx +5 -2
  7. package/client/components/brand-mark-geometry.ts +3 -3
  8. package/client/components/breadcrumbs.tsx +47 -3
  9. package/client/components/data-table/data-table.tsx +90 -19
  10. package/client/components/data-table/pagination.tsx +17 -2
  11. package/client/components/list-feedback.tsx +31 -22
  12. package/client/components/loading.tsx +127 -16
  13. package/client/components/pending-button.tsx +111 -0
  14. package/client/components/role-list.tsx +7 -0
  15. package/client/components/route-child-page.tsx +72 -1
  16. package/client/components/route-overlay.tsx +149 -15
  17. package/client/components/task-progress.tsx +155 -0
  18. package/client/components/use-route-overlay.ts +8 -11
  19. package/client/extensions/nocobase-file-component-ui/components/file-upload-field.tsx +62 -32
  20. package/client/extensions/nocobase-file-component-ui/locales/de-DE.ts +2 -0
  21. package/client/extensions/nocobase-file-component-ui/locales/en-US.ts +1 -0
  22. package/client/extensions/nocobase-file-component-ui/locales/es-ES.ts +1 -0
  23. package/client/extensions/nocobase-file-component-ui/locales/fr-FR.ts +1 -0
  24. package/client/extensions/nocobase-file-component-ui/locales/id-ID.ts +1 -0
  25. package/client/extensions/nocobase-file-component-ui/locales/ja-JP.ts +2 -0
  26. package/client/extensions/nocobase-file-component-ui/locales/pt-BR.ts +1 -0
  27. package/client/extensions/nocobase-file-component-ui/locales/vi-VN.ts +1 -0
  28. package/client/extensions/nocobase-file-component-ui/locales/zh-CN.ts +1 -0
  29. package/client/extensions/nocobase-file-component-ui/locales/zh-TW.ts +1 -0
  30. package/client/extensions/nocobase-workflow-management/README.md +5 -5
  31. package/client/extensions/nocobase-workflow-management/definition-list.tsx +2 -9
  32. package/client/extensions/nocobase-workflow-management/execution-list.tsx +2 -4
  33. package/client/layouts/app-layout.tsx +0 -4
  34. package/client/lib/navigation-transform.ts +29 -1
  35. package/client/locales/system/en-US.ts +23 -0
  36. package/client/locales/system/zh-CN.ts +23 -0
  37. package/client/pages/home/index.tsx +66 -51
  38. package/client/pages/settings/database-explorer/en-US.ts +33 -0
  39. package/client/pages/settings/database-explorer/index.tsx +358 -0
  40. package/client/pages/settings/database-explorer/routes.ts +14 -0
  41. package/client/pages/settings/database-explorer/zh-CN.ts +30 -0
  42. package/client/pages/settings/default-access.tsx +1 -1
  43. package/client/pages/settings/roles.tsx +27 -27
  44. package/client/pages/settings/routes.ts +15 -7
  45. package/client/pages/settings/user-detail.tsx +3 -17
  46. package/client/pages/settings/user-form.tsx +9 -15
  47. package/client/pages/settings/users.tsx +11 -27
  48. package/client/plugins.ts +8 -1
  49. package/client/routes.ts +2 -1
  50. package/client/routing/client-route.tsx +199 -37
  51. package/client/routing/navigation-destination.ts +42 -0
  52. package/client/routing/route-leave-boundary.tsx +13 -1
  53. package/client/styles.css +18 -1
  54. package/config.example.yml +17 -11
  55. package/index.html +8 -11
  56. package/package.json +27 -27
  57. package/server/config/auth.ts +1 -1
  58. package/server/config/index.ts +3 -0
  59. package/server/config/jobs.ts +16 -8
  60. package/server/config/queue.ts +14 -13
  61. package/server/config/realtime.ts +4 -0
  62. package/tests/client/auth-i18n.test.tsx +1 -1
  63. package/tests/client/authenticated-client-fixture.test.tsx +37 -0
  64. package/tests/client/back-button.test.tsx +34 -0
  65. package/tests/client/client-route-recovery.test.tsx +93 -1
  66. package/tests/client/client-routes.test.ts +5 -3
  67. package/tests/client/database-explorer-integration.test.tsx +30 -0
  68. package/tests/client/database-explorer.test.tsx +152 -0
  69. package/tests/client/foundation-integration.test.ts +42 -29
  70. package/tests/client/home.test.tsx +26 -85
  71. package/tests/client/layout-i18n.test.tsx +83 -2
  72. package/tests/client/list-feedback.test.tsx +5 -5
  73. package/tests/client/list-loading.test.tsx +397 -0
  74. package/tests/client/loading.test.tsx +20 -11
  75. package/tests/client/manual-list-retry.test.tsx +2 -2
  76. package/tests/client/navigation-parent.test.tsx +172 -0
  77. package/tests/client/pending-button.test.tsx +106 -0
  78. package/tests/client/permission-management-tabs.test.tsx +48 -12
  79. package/tests/client/primitive-labels.test.tsx +2 -2
  80. package/tests/client/role-return.test.tsx +21 -3
  81. package/tests/client/roles.test.tsx +84 -3
  82. package/tests/client/route-leave-recheck.test.tsx +74 -0
  83. package/tests/client/route-presentation.test.tsx +557 -0
  84. package/tests/client/session-preparation.test.tsx +20 -17
  85. package/tests/client/settings-continuity.test.tsx +35 -11
  86. package/tests/client/settings-home.test.tsx +4 -2
  87. package/tests/client/settings-idle-list.test.tsx +124 -0
  88. package/tests/client/settings-navigation.test.ts +20 -0
  89. package/tests/client/user-drawer.test.tsx +3 -4
  90. package/tests/fixtures/dialog-footer.html +12 -0
  91. package/tests/fixtures/dialog-footer.tsx +215 -0
  92. package/tests/helpers/authenticated-client.tsx +77 -22
  93. package/tests/playwright/dialog-footer.test.ts +227 -0
  94. package/tests/project/bootstrap-loading.test.ts +60 -0
  95. package/tests/server/app-server.test.ts +18 -12
  96. package/tests/server/auth-email-config.test.ts +21 -0
  97. package/tests/server/backends-config.test.ts +118 -0
  98. package/tests/server/concurrency.test.ts +1 -1
  99. package/tests/server/config.test.ts +22 -14
  100. package/tests/server/lifecycle.test.ts +2 -2
  101. package/tests/server/realtime-config.test.ts +114 -0
  102. package/client/pages/home/capabilities.ts +0 -62
  103. package/client/pages/home/prompt-dialog.tsx +0 -122
@@ -1,62 +0,0 @@
1
- import {
2
- Bell,
3
- CalendarClock,
4
- Database,
5
- KeyRound,
6
- Languages,
7
- Mail,
8
- Palette,
9
- Paperclip,
10
- ShieldCheck,
11
- Workflow,
12
- type LucideIcon,
13
- } from 'lucide-react';
14
-
15
- /**
16
- * A built-in capability the homepage introduces. Its title, description and prompts live in the locale files under
17
- * `home.capabilities.<id>`, one `prompts.<promptId>.label` and `prompts.<promptId>.text` per prompt, so the wording is
18
- * translated and reworded there rather than here.
19
- */
20
- export interface Capability {
21
- readonly id: string;
22
- readonly icon: LucideIcon;
23
- readonly prompts: readonly string[];
24
- }
25
-
26
- // The default prompts follow the examples in the documentation's Capabilities chapter, in the order of its sidebar.
27
- export const CAPABILITIES: readonly Capability[] = [
28
- {
29
- id: 'auth',
30
- icon: KeyRound,
31
- prompts: ['disableSignUp', 'companySso', 'apiKeys'],
32
- },
33
- {
34
- id: 'dataSources',
35
- icon: Database,
36
- prompts: ['postgres', 'externalDatabase'],
37
- },
38
- {
39
- id: 'authorization',
40
- icon: ShieldCheck,
41
- prompts: ['jobs', 'dataScopes', 'restrictions'],
42
- },
43
- {
44
- id: 'workflow',
45
- icon: Workflow,
46
- prompts: ['stages', 'backgroundExport', 'history'],
47
- },
48
- { id: 'file', icon: Paperclip, prompts: ['attachments', 'avatar'] },
49
- { id: 'i18n', icon: Languages, prompts: ['addLanguage', 'defaultLanguage'] },
50
- { id: 'theme', icon: Palette, prompts: ['changeTheme', 'newTheme'] },
51
- { id: 'notification', icon: Bell, prompts: ['inApp', 'email'] },
52
- {
53
- id: 'scheduler',
54
- icon: CalendarClock,
55
- prompts: ['reminder', 'weeklyReport'],
56
- },
57
- {
58
- id: 'mail',
59
- icon: Mail,
60
- prompts: ['providers', 'mailCenter', 'correspondence'],
61
- },
62
- ];
@@ -1,122 +0,0 @@
1
- import { useTranslation } from '@nocobase/i18n/client';
2
- import { CheckIcon, CopyIcon, RotateCcwIcon } from 'lucide-react';
3
- import { type ReactElement, useState } from 'react';
4
-
5
- import { Button } from '#components/ui/button';
6
- import {
7
- Dialog,
8
- DialogClose,
9
- DialogContent,
10
- DialogDescription,
11
- DialogFooter,
12
- DialogHeader,
13
- DialogTitle,
14
- } from '#components/ui/dialog';
15
- import { Tabs, TabsList, TabsTrigger } from '#components/ui/tabs';
16
- import { Textarea } from '#components/ui/textarea';
17
-
18
- import type { Capability } from './capabilities.js';
19
- import { useCopy } from './use-copy.js';
20
-
21
- export interface PromptDialogProps {
22
- readonly capability: Capability;
23
- readonly open: boolean;
24
- readonly onOpenChange: (open: boolean) => void;
25
- }
26
-
27
- /**
28
- * The prompts of one capability, ready to hand to a coding agent. Each prompt can be edited before copying. Edits are
29
- * not saved: the page mounts a new dialog each time one is opened, so it starts from the default wording again.
30
- */
31
- export function PromptDialog({
32
- capability,
33
- open,
34
- onOpenChange,
35
- }: PromptDialogProps): ReactElement {
36
- const { t } = useTranslation();
37
- const { copied, copy } = useCopy();
38
- const [current, setCurrent] = useState(capability.prompts[0]);
39
- // Edited text per prompt id; a prompt without an entry shows its default wording.
40
- const [edits, setEdits] = useState<Readonly<Record<string, string>>>({});
41
-
42
- const prefix = `home.capabilities.${capability.id}`;
43
- const defaultText = t(`${prefix}.prompts.${current}.text`);
44
- const text = edits[current] ?? defaultText;
45
- const Icon = capability.icon;
46
-
47
- return (
48
- <Dialog open={open} onOpenChange={onOpenChange}>
49
- <DialogContent className='gap-5 sm:max-w-2xl'>
50
- <DialogHeader className='flex-row items-center gap-3 pr-8'>
51
- <span className='flex size-10 shrink-0 items-center justify-center rounded-lg bg-primary/5 text-primary'>
52
- <Icon className='size-5' aria-hidden />
53
- </span>
54
- <div className='flex min-w-0 flex-col gap-1.5'>
55
- <DialogTitle>{t(`${prefix}.title`)}</DialogTitle>
56
- <DialogDescription>{t(`${prefix}.description`)}</DialogDescription>
57
- </div>
58
- </DialogHeader>
59
- <div className='flex flex-col gap-3'>
60
- {capability.prompts.length > 1 ? (
61
- <Tabs
62
- value={current}
63
- onValueChange={(value) => {
64
- if (typeof value === 'string') setCurrent(value);
65
- }}
66
- >
67
- <TabsList className='w-full'>
68
- {capability.prompts.map((id) => (
69
- <TabsTrigger key={id} value={id}>
70
- {t(`${prefix}.prompts.${id}.label`)}
71
- </TabsTrigger>
72
- ))}
73
- </TabsList>
74
- </Tabs>
75
- ) : null}
76
- <Textarea
77
- aria-label={t('home.prompt.label')}
78
- className='field-sizing-fixed h-60 max-h-[50dvh] resize-none leading-6'
79
- value={text}
80
- onChange={(event) =>
81
- setEdits((previous) => ({
82
- ...previous,
83
- [current]: event.target.value,
84
- }))
85
- }
86
- />
87
- <p className='text-xs text-muted-foreground'>
88
- {t('home.prompt.hint')}
89
- </p>
90
- </div>
91
- <DialogFooter className='sm:items-center'>
92
- <Button
93
- variant='ghost'
94
- className='sm:mr-auto'
95
- disabled={text === defaultText}
96
- onClick={() =>
97
- setEdits((previous) => {
98
- const rest = { ...previous };
99
- delete rest[current];
100
- return rest;
101
- })
102
- }
103
- >
104
- <RotateCcwIcon data-icon='inline-start' />
105
- {t('home.prompt.reset')}
106
- </Button>
107
- <DialogClose render={<Button variant='outline' />}>
108
- {t('actions.close')}
109
- </DialogClose>
110
- <Button disabled={text.trim() === ''} onClick={() => void copy(text)}>
111
- {copied ? (
112
- <CheckIcon data-icon='inline-start' />
113
- ) : (
114
- <CopyIcon data-icon='inline-start' />
115
- )}
116
- {copied ? t('home.prompt.copiedShort') : t('home.prompt.copy')}
117
- </Button>
118
- </DialogFooter>
119
- </DialogContent>
120
- </Dialog>
121
- );
122
- }