Skip to content

Conversation

@midigofrank
Copy link
Collaborator

Description

Implement UI and backend integration for publishing workflows as templates and updating existing templates. This feature is restricted to superusers and requires workflows to be saved before publishing.

Frontend changes:

  • Add TemplatePublishPanel component with form for name, description, and tags
  • Add TextAreaField form component with tag management UI
  • Add publish/update template button to CodeViewPanel
  • Integrate workflow_template state into SessionContextStore
  • Add template_updated channel listener
  • Add useWorkflowTemplate hook for accessing template data
  • Show button state based on unsaved changes and user permissions

Backend integration:

  • Connect to publish_template channel request
  • Send YAML workflow code and positions to backend
  • Handle template_updated messages from server
  • Support both create and update operations

Test updates:

  • Add workflow_template field to session context mocks
  • Mock useUser, useWorkflowTemplate, and useURLState in CodeViewPanel tests
  • Update all session context factory functions with template support

Closes #3921

Validation steps

  1. Ensure you are a support user
  2. Open the Workflow settings -> Then workflow YAML
  3. You should find a button to publish template

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@midigofrank midigofrank self-assigned this Nov 17, 2025
@github-project-automation github-project-automation bot moved this to New Issues in v2 Nov 17, 2025
@midigofrank midigofrank force-pushed the 3921-publish-templates branch from 332a3ea to 4f8355f Compare November 17, 2025 09:14
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.83%. Comparing base (3964acb) to head (cde67f8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3994   +/-   ##
=======================================
  Coverage   88.82%   88.83%           
=======================================
  Files         422      422           
  Lines       19069    19085   +16     
=======================================
+ Hits        16938    16954   +16     
  Misses       2131     2131           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@midigofrank midigofrank marked this pull request as ready for review November 17, 2025 09:47
midigofrank and others added 3 commits November 20, 2025 16:00
Implement UI and backend integration for publishing workflows as templates
and updating existing templates. This feature is restricted to superusers
and requires workflows to be saved before publishing.

Frontend changes:
- Add TemplatePublishPanel component with form for name, description, and tags
- Add TextAreaField form component with tag management UI
- Add publish/update template button to CodeViewPanel
- Integrate workflow_template state into SessionContextStore
- Add template_updated channel listener
- Add useWorkflowTemplate hook for accessing template data
- Show button state based on unsaved changes and user permissions

Backend integration:
- Connect to publish_template channel request
- Send YAML workflow code and positions to backend
- Handle template_updated messages from server
- Support both create and update operations

Test updates:
- Add workflow_template field to session context mocks
- Mock useUser, useWorkflowTemplate, and useURLState in CodeViewPanel tests
- Update all session context factory functions with template support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@midigofrank midigofrank force-pushed the 3921-publish-templates branch from cde67f8 to 0bde8dd Compare November 20, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Workflow Templates and Publishing Controls

2 participants