umbraco / Umbraco.Forms.Issues

Public issue tracker for Umbraco Forms
29 stars 0 forks source link

Custom Workflow Settings not displaying property fields #1299

Open rizman opened 2 hours ago

rizman commented 2 hours ago

Some time ago I started work on a custom workflowtype and it worked (don't remember which version of Umbraco Forms that was with). I got interrupted.

Since then, I upgraded to v14.1.3 (same behaviour with 14.1.2)

Here is the code for my test custom workflow:

` using Umbraco.Forms.Core.Enums; using Umbraco.Forms.Core; using Umbraco.Forms.Core.Attributes;

namespace FormsExtensions {

public class TestWorkflow : WorkflowType
{
    [Setting("Test", 
        Description = "Test description", IsMandatory = true
        )]
    public string TestProperty { get; set; }

    [Setting("Test2",
       Description = "Test description", IsMandatory = true, View = "TextField"
       )]
    public string TestProperty2 { get; set; }

    public TestWorkflow()
    {
        this.Name = "Test";
        this.Id = new Guid("E6A2C406-CF89-11DE-B075-55B055D89593");
        this.Description = "Test Workflow";
    }

    public override Task<WorkflowExecutionStatus> ExecuteAsync(WorkflowExecutionContext context)
    {
        return Task.FromResult(WorkflowExecutionStatus.Completed);

    }

    public override List<Exception> ValidateSettings()
    {
        var list = new List<Exception>();
        return list;
    }
}

} `

I see it on Umbraco Forms backend, but the labels are not shown correctly: image

I have the same with a custom workflow I tried to copy from y Gist (Post to URL as JSON): https://gist.github.com/hetfirma/b0da14502f0cbf1e3d4f99707a45da9d

Is this probably a bug or am I missing something?

Kind regards

AndyButland commented 2 hours ago

Yes, it looks like you are missing a couple of things with the move to 14.

One is the names of the views - they are now property editor UIs - so View = "TextField" isn't recognised and that's why your second field is missing. See description of the View attribute here.

Then you need a front-end file with the translations for these labels (see here).

It's worth a read of that page from top to bottom actually, as there are a few changes in this area when it comes to 14, particularly if you are looking to use your own property editor UI.

One more useful page is this one, which will detail which property editor UIs are used on the existing setting types provided in the package.