@nocobase/app-template-default 1.0.0-beta.75 → 1.0.0-beta.76
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/.agents/rules/build-and-deploy.md +4 -0
- package/.agents/rules/components.md +3 -1
- package/README.MD +2 -2
- package/client/components/data-table/data-table.tsx +2 -0
- package/client/components/data-table/pagination.tsx +6 -6
- package/client/components/flow-diagram.tsx +645 -83
- package/client/components/flow-layout.ts +117 -7
- package/client/components/lifecycle-diagram.tsx +175 -37
- package/client/components/record-link.tsx +20 -0
- package/client/components/required-role-setup.tsx +93 -0
- package/client/components/role-list.tsx +21 -5
- package/client/components/setup-readiness-state.ts +135 -0
- package/client/components/setup-readiness.tsx +91 -0
- package/client/components/ui/combobox.tsx +300 -0
- package/client/extensions/nocobase-workflow-management/README.md +3 -1
- package/client/extensions/nocobase-workflow-management/definition-list.tsx +19 -13
- package/client/extensions/nocobase-workflow-management/layout.tsx +1 -1
- package/client/hooks/use-table-url-state.ts +93 -0
- package/client/lib/required-role-setup.ts +98 -0
- package/client/lib/return-to.ts +19 -0
- package/client/locales/system/en-US.ts +10 -0
- package/client/locales/system/settings-en-US.ts +37 -1
- package/client/locales/system/settings-zh-CN.ts +33 -2
- package/client/locales/system/zh-CN.ts +10 -0
- package/client/pages/settings/default-access-form.tsx +4 -1
- package/client/pages/settings/default-access.tsx +40 -8
- package/client/pages/settings/role-form.tsx +1 -1
- package/client/pages/settings/roles.tsx +44 -6
- package/client/pages/settings/shared.tsx +15 -13
- package/client/pages/settings/user-detail.tsx +15 -259
- package/client/pages/settings/user-form.tsx +299 -147
- package/client/pages/settings/users.tsx +211 -123
- package/config.example.yml +6 -5
- package/package.json +11 -11
- package/tests/components/default-access.test.tsx +141 -2
- package/tests/components/settings-continuity.test.tsx +426 -0
- package/tests/components/settings-feedback.test.tsx +304 -0
- package/tests/components/settings.test.tsx +1 -1
- package/tests/components/setup-readiness.test.tsx +370 -0
- package/tests/components/table-url-state.test.tsx +95 -0
- package/tests/components/user-drawer.test.tsx +526 -0
- package/tests/logic/return-to.test.ts +19 -0
- package/tsconfig.json +1 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Read this before changing the build, packing a deployment archive, building or editing the Docker image, setting `CDN_BASE_URL`, or building for another platform. The deployment process itself is in the [deployment Skill](../skills/nocobase-deployment/SKILL.md), and dependency placement and the build failure table are in [where to declare a dependency](../skills/nocobase-app-development/references/dependencies.md).
|
|
4
4
|
|
|
5
|
+
## Client typechecking
|
|
6
|
+
|
|
7
|
+
Keep `types: ["node"]` in the client `tsconfig.json`. Shared contracts from database and lifecycle packages resolve to their TypeScript sources in a workspace and require Node.js declarations during typechecking. Declare that requirement explicitly instead of relying on unrelated plugin imports to load the declarations; type-only imports still disappear from the browser bundle.
|
|
8
|
+
|
|
5
9
|
## CDN assets at build time
|
|
6
10
|
|
|
7
11
|
`CDN_BASE_URL` sets Vite's `base` only during a production build: `CDN_BASE_URL=https://cdn.example.com/my-app/v1/ pnpm build`. Use a full HTTPS URL ending in `/`; unset, empty or whitespace-only values keep the default `./`. `pnpm build` reads it from the process environment, then `.env.local`, then `.env`; development ignores it and continues using `APP_BASE_PATH`. It is a build parameter, absent from `config variables` and `dist/variables.json`, with no `config.yml` setting. Changing it requires rebuilding.
|
|
@@ -35,4 +35,6 @@ The default brand palette and density live in `client/theme/themes/*.css`; share
|
|
|
35
35
|
|
|
36
36
|
## Standard process management
|
|
37
37
|
|
|
38
|
-
The template includes `FlowDiagram`, `LifecycleDiagram` and `client/extensions/nocobase-workflow-management/` source. Reuse them when business workflows are introduced; preinstallation does not register a settings route or sample process. `LifecycleDiagram.configuration` automatically offers configuration for authorized native parameter bindings, using the application’s real parameter editor and API. Read [Lifecycle UI](../skills/nocobase-app-development/references/lifecycle-ui.md) before wiring the workflow directory, definition and execution pages.
|
|
38
|
+
The template includes `FlowDiagram`, `LifecycleDiagram` and `client/extensions/nocobase-workflow-management/` source. Reuse them when business workflows are introduced; preinstallation does not register a settings route or sample process. `LifecycleDiagram.configuration` automatically offers configuration for authorized native parameter bindings, using the application’s real parameter editor and API. Read [Lifecycle UI](../skills/nocobase-app-development/references/lifecycle-ui.md) before wiring the workflow directory, definition and execution pages. The existing `LifecycleDiagram` supports `presentation="process"` for compact approval/work cards and start/outcome pills, with `stateKind` supplied by the application; omitting it keeps the classic presentation. Preserve configuration and recorded-history behavior when selecting a presentation. UI Library names are shadcn registry items, not npm package names; an npm 404 is not evidence that a component is unavailable.
|
|
39
|
+
|
|
40
|
+
Use `RecordLink` from `#components/record-link` for clickable record names and identifiers in lists and tables. It uses foreground text with medium weight, an underline on hover, and an underline plus focus outline for keyboard navigation. Preserve the native link semantics and route query context. Do not give record fields a permanent underline, primary-blue text, or a button-shaped surface. Keep action buttons and menu items on their own components; do not globally restyle every link in the application.
|
package/README.MD
CHANGED
|
@@ -403,9 +403,9 @@ Tests live in `tests/`, never beside the source they cover. Put logic and integr
|
|
|
403
403
|
|
|
404
404
|
Application tests use the `/server`, `/client` and `/cli` entries of `@nocobase/app-testing`. Start page tests from `tests/components/page-harness.test.tsx`: it uses `renderWithApp()` with real application hooks, strict translations, permission checks and a test toaster. Answer requests through `answerApi()` and replace external services through `services`, without also registering their owning plugins. The template's Vitest configuration includes client plugins in custom package scopes so their contexts and service tokens remain shared. See `.agents/skills/nocobase-app-development/references/testing.md` for fixture ownership and complete server, migration and CLI examples.
|
|
405
405
|
|
|
406
|
-
### Notification
|
|
406
|
+
### Notification verification
|
|
407
407
|
|
|
408
|
-
|
|
408
|
+
Exercise the application's business notification flow, or use a server-side command resolving `notificationServiceToken` and calling `send()` with complete messages and explicit recipients. Inspect the returned notification ID through the protected `/api/notifications/logs` API or the logs page installed by the application. Log access requires `page:notification.logs` `access`.
|
|
409
409
|
|
|
410
410
|
## API documentation
|
|
411
411
|
|
|
@@ -107,6 +107,8 @@ export function DataTable<TData, TValue = unknown>({
|
|
|
107
107
|
data: tableData,
|
|
108
108
|
columns,
|
|
109
109
|
manualPagination,
|
|
110
|
+
// Controlled hosts own URL page resets and correction after writes.
|
|
111
|
+
autoResetPageIndex: paginationState === undefined,
|
|
110
112
|
rowCount,
|
|
111
113
|
manualSorting,
|
|
112
114
|
...(onPaginationChange ? { onPaginationChange } : {}),
|
|
@@ -69,9 +69,9 @@ export function DataTablePagination<TData>({
|
|
|
69
69
|
})
|
|
70
70
|
: null}
|
|
71
71
|
</div>
|
|
72
|
-
<div className='flex flex-wrap items-center gap-6 lg:gap-8'>
|
|
73
|
-
<div className='flex items-center gap-2'>
|
|
74
|
-
<p className='text-sm font-medium'>
|
|
72
|
+
<div className='flex min-w-0 flex-wrap items-center justify-end gap-x-6 gap-y-3 lg:gap-x-8'>
|
|
73
|
+
<div className='flex shrink-0 items-center gap-2'>
|
|
74
|
+
<p className='text-sm font-medium whitespace-nowrap'>
|
|
75
75
|
{t('dataTable.rowsPerPage', { defaultValue: 'Rows per page' })}
|
|
76
76
|
</p>
|
|
77
77
|
<Select
|
|
@@ -83,7 +83,7 @@ export function DataTablePagination<TData>({
|
|
|
83
83
|
>
|
|
84
84
|
<SelectTrigger
|
|
85
85
|
size='sm'
|
|
86
|
-
className='w-[70px]'
|
|
86
|
+
className='w-[70px] shrink-0'
|
|
87
87
|
aria-label={t('dataTable.rowsPerPage', {
|
|
88
88
|
defaultValue: 'Rows per page',
|
|
89
89
|
})}
|
|
@@ -102,14 +102,14 @@ export function DataTablePagination<TData>({
|
|
|
102
102
|
</SelectContent>
|
|
103
103
|
</Select>
|
|
104
104
|
</div>
|
|
105
|
-
<div className='
|
|
105
|
+
<div className='shrink-0 text-sm font-medium whitespace-nowrap tabular-nums'>
|
|
106
106
|
{t('dataTable.pageOf', {
|
|
107
107
|
defaultValue: 'Page {{page}} of {{pageCount}}',
|
|
108
108
|
page: pageIndex + 1,
|
|
109
109
|
pageCount,
|
|
110
110
|
})}
|
|
111
111
|
</div>
|
|
112
|
-
<div className='flex items-center gap-2'>
|
|
112
|
+
<div className='flex shrink-0 items-center gap-2'>
|
|
113
113
|
<Button
|
|
114
114
|
variant='outline'
|
|
115
115
|
size='icon-sm'
|