feat(plugin-workflow): migrate workflow settings page to client-v2#9645
Open
Molunerfinn wants to merge 7 commits into
Open
feat(plugin-workflow): migrate workflow settings page to client-v2#9645Molunerfinn wants to merge 7 commits into
Molunerfinn wants to merge 7 commits into
Conversation
- Add client-v2 entry (root shims, plugin, locale); move the 4 FlowModels from src/client/models to src/client-v2/models and re-reference from v1 via a relative path (lazy registerModelLoaders). - Add a v2 trigger extension point (registerTrigger + createConfigFormLoader) with built-in collection/schedule create-config forms; resilient to v1-style class registrations. - Migrate the WorkflowPane settings page to v2 (list, category tabs, create/edit drawer, duplicate, execution-history drawer) with FlowEngine + antd, token styling, no Formily. - Extract a reusable SortableCategoryTabs into @nocobase/client-v2 and adopt it in both plugin-workflow and plugin-data-source-manager. - Defer canvas actions (Configure / View execution / version link) to v1; add request-layer tests. The legacy src/client/ canvas stays intact as the v1 surface that downstream workflow plugins consume.
The i18n template parser closed the key on a character class that
accepted any quote type, so a key such as
{{t('... "Post-action event" ...')}} was truncated at the first inner
quote and the translation lookup fell back to the raw English key.
Capture the opening quote and backreference it so only the matching
quote type closes the key (escaped chars are kept inside as well).
- Render the trigger-type dropdown options as a gold Tag plus a secondary description (v1 TriggerOptionRender parity); add an optional `description` to the trigger registration options and supply it for the built-in collection and schedule triggers. - Wrap the trigger-specific create-config form in a titled, bordered "Trigger configuration" group, matching v1's Fieldset. - Register the settings tab under the `index` key so the route is /settings/workflow instead of /settings/workflow/workflows.
Replace the title-only search on the workflow list and the status-only dropdown on the execution-history drawer with the shared CollectionFilter condition-group UI, matching v1's field sets via nonfilterableFieldNames and resolving the trigger-type / status enum templates for the value Select. Drop the execution Actions-column separator and align its button spacing with the workflow list. Add Version ID / Parent execution ID / Triggered manually keys across all 17 locales.
Register standalone full-screen pages under the `admin.workflow` namespace (`/admin/workflow/workflows/:id` and `/admin/workflow/executions/:id`), bypassing the settings layout's sidebar to match v1. The canvas content area is a placeholder while the node-graph editor migration is deferred. Replicate the v1 header functionality as extracted client-v2 components: breadcrumb + sync/async tag, version dropdown, enable switch, the "..." menu (details / refresh / execution history / copy-to-new-version / delete), and the execution-view header (executions dropdown with prev/next windowed loading, status tag with reason, cancel, refresh). Wire the execution-history drawer's "View" link to the new execution page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a ...
Motivation
Establish the v2 (
client-v2/ FlowEngine) surface for@nocobase/plugin-workflow. The legacysrc/client/schema-driven canvas stays intact (it is the v1 surface consumed by ~30 downstream workflow plugins); this PR adds the v2 client entry, moves the existing FlowModels into it, and migrates the Workflow settings page to v2.Description
Key changes:
client-v2.js/client-v2.d.ts),src/client-v2/{index,plugin,locale}, and@nocobase/client-v2peer dep. The 4 FlowModels move fromsrc/client/models/tosrc/client-v2/models/(base classes now from@nocobase/client-v2,tExprfrom locallocale.ts, no inline styles); v1 re-references them via relative path. Registered lazily viaregisterModelLoaders(withextendsfor sub-model discovery).registerTrigger(type, { title, sync?, createConfigFormLoader })on the v2 plugin (mirrorsplugin-auth'sregisterType). Built-incollection/scheduleregister their create-config forms via async loaders. The registry ignores v1-style class registrations so downstream plugins that still callpm.get('workflow').registerTrigger(type, TriggerClass)are a no-op (no crash).id.SortableCategoryTabsinto@nocobase/client-v2and adopted it in bothplugin-workflowandplugin-data-source-manager(removed DSM's inline duplicate).Deferred (still served by the v1 canvas): the "Configure" / execution "View" / version-link actions navigate into the v1 workflow/execution canvas, which is not migrated.
Risks / testing:
@nocobase/plugin-workflow/client.filterByTkpinned) / delete, plus a regression test for v1-style trigger registrations.tsc --noEmitpasses with 0 errors across the touched graph.Related issues
Showcase
Workflow settings page (list, category tabs, create/edit drawer, execution-history drawer) rendered under the v2 client. Screenshots shared in the team review thread.
Changelog
@nocobase/client-v2.@nocobase/client-v2。Docs
Checklists