UVE inline editing: add `action` API (draft | publish) to SDK editable-text components
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
Today, all inline-editing entry points always fire the default Save workflow action — there's no API to choose. We want a simple action API with two values: draft (default — current behavior, system Save) and publish (fires the system Publish workflow action).
Affected APIs:
@dotcms/react→DotCMSEditableText(core-web/libs/sdk/react/src/lib/next/components/DotCMSEditableText/DotCMSEditableText.tsx)@dotcms/angular→DotCMSEditableTextComponent(core-web/libs/sdk/angular/src/lib/components/dotcms-editable-text/dotcms-editable-text.component.ts)@dotcms/uve→initInlineEditing/enableBlockEditorInline(core-web/libs/sdk/uve/src/lib/editor/public.ts)
Proposed API
// React
<DotCMSEditableText
contentlet={contentlet}
fieldName="title"
mode="full"
format="text"
action="publish" // NEW — "draft" (default) | "publish"
/>
<!-- Angular -->
<dotcms-editable-text
[contentlet]="contentlet"
fieldName="title"
mode="full"
format="text"
action="publish"></dotcms-editable-text>
// @dotcms/uve
import { initInlineEditing, enableBlockEditorInline } from '@dotcms/uve';
initInlineEditing('BLOCK_EDITOR', {
inode,
language,
contentType,
fieldName,
content,
action: 'publish' // NEW — "draft" (default) | "publish"
});
enableBlockEditorInline(contentlet, 'body', { action: 'publish' });
Shared type:
type DotCMSEditableTextAction = 'draft' | 'publish'; // default: 'draft'
All three SDKs forward action in the UPDATE_CONTENTLET_INLINE_EDITING postMessage payload. The UVE host (edit-ema's dot-uve-actions-handler.service.ts) reads it and fires the matching workflow action; when action is omitted or 'draft', behavior is unchanged.
Acceptance Criteria
- Add
action?: 'draft' | 'publish'(default'draft') to:DotCMSEditableTextprop (React)DotCMSEditableTextComponentinput (Angular)InlineEditEventDatain@dotcms/uvesoinitInlineEditingandenableBlockEditorInlineaccept it
- Extend the
UPDATE_CONTENTLET_INLINE_EDITINGpayload type in@dotcms/types/@dotcms/uveto includeaction. - UVE host handler (
dot-uve-actions-handler.service.ts) honorsaction:'publish'fires the system Publish workflow action; otherwise (or when omitted) keeps the currentsaveContentletSave behavior. - Keep both
initInlineEditingandenableBlockEditorInlinefor now (back-compat + ergonomics), but make sure the newactionprop lands on both so they stay in sync. If we want to simplify, deprecateenableBlockEditorInlinein favor of a unifiedinitInlineEditing(contentlet, fieldName, opts)and remove it in the next major. - Add deprecation notes for
enableBlockEditorInline:- JSDoc
@deprecatedtag on the function incore-web/libs/sdk/uve/src/lib/editor/public.tspointing users to the unifiedinitInlineEditing(contentlet, fieldName, opts)form. - TypeScript
@deprecatedso IDEs surface a strikethrough on usage. - "Deprecated" entry in
sdk/uveCHANGELOG and README, including a migration snippet (before/after). - Note the planned removal target (next major) in the deprecation message.
- JSDoc
- Unit tests for both code paths (
draftvspublish) in:DotCMSEditableText.test.tsxdotcms-editable-text.component.spec.ts- uve SDK
public.spec.ts(forinitInlineEditing/enableBlockEditorInline) dot-uve-actions-handler.service.spec.ts
- Backward compatibility: omitting
actionproduces the exact same behavior as today. - Document the new field in
sdk/react,sdk/angular, andsdk/uveREADMEs/CHANGELOG.
Priority
Medium
Additional Context
Related: #22241 added data-workflow-fire for legacy VTL inline-edit. This ticket scopes a minimal, opinionated draft | publish API for the modern SDK surface.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the listed React, Angular, and UVE entry points, then run the named component, SDK, and dot-uve-actions-handler.service.spec.ts tests. Trace the UPDATE_CONTENTLET_INLINE_EDITING payload through dot-uve-actions-handler.service.ts. Done means draft or omitted action preserves Save behavior, publish triggers Publish, both UVE paths stay compatible, and the requested deprecation and documentation updates are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, react, typescript
- Domain
- api, documentation, frontend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100