3
0

Fix workflow importing and referencing

* Page blocks used invalid ref. formats & value setters.
* Some default values were skipped due to how yaml decoder works.
This commit is contained in:
Tomaž Jerman
2023-04-02 09:09:36 +02:00
parent ef94c90da1
commit b041e4fb32
4 changed files with 58 additions and 2 deletions

View File

@@ -261,14 +261,14 @@ func getPageBlockAutomationRefs(b types.PageBlock, index int) (refs map[string]e
refs = make(map[string]envoyx.Ref)
bb, _ := b.Options["buttons"].([]interface{})
for _, b := range bb {
for buttonIx, b := range bb {
button, _ := b.(map[string]interface{})
id := optString(button, "workflow", "workflowID")
if id == "" || id == "0" {
return
}
refs[fmt.Sprintf("Blocks.%d.Options.WorkflowID", index)] = envoyx.Ref{
refs[fmt.Sprintf("Blocks.%d.Options.buttons.%d.WorkflowID", index, buttonIx)] = envoyx.Ref{
ResourceType: automationTypes.WorkflowResourceType,
Identifiers: envoyx.MakeIdentifiers(id),
}