feat(12.1-02): read-only preview screen with a status hint and record actions
- config_form.yaml preview block (optional headerPartial), reported in the form schema as preview
- fields with context: preview show only on the preview screen and are never written
- form messages preview and edit; recordActions without a preview block stops boot
- SPA route {id}/preview, PreviewView and PreviewField, record actions in the footer
- mapWinterUrl maps preview/:id; the update form returns to the preview
- summer-callout partial style classes for status hints
- README, docs, OpenAPI document, TS types and the embedded build updated
This commit is contained in:
@@ -24,6 +24,14 @@ describe('mapWinterUrl', () => {
|
||||
expect(mapWinterUrl('acme/demo/widgets/update/9', ID)).toBe(`${LIST}/9`)
|
||||
})
|
||||
|
||||
it('substitutes :id in preview/:id and falls back to the list without a usable id (D-11)', () => {
|
||||
expect(mapWinterUrl('acme/demo/widgets/preview/:id', ID, 42)).toBe(`${LIST}/42/preview`)
|
||||
expect(mapWinterUrl('acme/demo/widgets/preview/9', ID)).toBe(`${LIST}/9/preview`)
|
||||
expect(mapWinterUrl('acme/demo/widgets/preview/:id', ID)).toBe(LIST)
|
||||
expect(mapWinterUrl('acme/demo/widgets/preview/abc', ID)).toBe(LIST)
|
||||
expect(mapWinterUrl('acme/demo/gadgets/preview/:id', ID, 1)).toBe(LIST)
|
||||
})
|
||||
|
||||
it('falls back to the list when update has no usable id', () => {
|
||||
expect(mapWinterUrl('acme/demo/widgets/update/:id', ID)).toBe(LIST)
|
||||
expect(mapWinterUrl('acme/demo/widgets/update/:id', ID, null)).toBe(LIST)
|
||||
@@ -41,7 +49,7 @@ describe('mapWinterUrl', () => {
|
||||
it('ignores the query and hash, matches the owner case-insensitively and rejects unknown actions', () => {
|
||||
expect(mapWinterUrl('acme/demo/widgets/create?x=1#top', ID)).toBe(`${LIST}/create`)
|
||||
expect(mapWinterUrl('Acme/Demo/Widgets/update/:id', ID, 3)).toBe(`${LIST}/3`)
|
||||
expect(mapWinterUrl('acme/demo/widgets/preview/3', ID)).toBe(LIST)
|
||||
expect(mapWinterUrl('acme/demo/widgets/history/3', ID)).toBe(LIST)
|
||||
expect(mapWinterUrl('acme/demo/widgets/update/3/extra', ID)).toBe(LIST)
|
||||
expect(mapWinterUrl('acme/demo/widgets/CREATE', ID)).toBe(LIST)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user