Skip to content

Commit

Permalink
Merge pull request #1190 from nyaruka/optin_deps
Browse files Browse the repository at this point in the history
Fix inspecting optin refs
  • Loading branch information
rowanseymour authored Sep 23, 2023
2 parents e0116ec + 2d2582d commit 2e50571
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flows/inspect/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ func CheckReference(sa flows.SessionAssets, ref assets.Reference) bool {
return sa.Groups().Get(typed.UUID) != nil
case *assets.LabelReference:
return sa.Labels().Get(typed.UUID) != nil
case *assets.OptInReference:
return sa.OptIns().Get(typed.UUID) != nil
case *assets.TemplateReference:
return sa.Templates().Get(typed.UUID) != nil
case *assets.TicketerReference:
Expand Down
7 changes: 7 additions & 0 deletions flows/inspect/dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func TestDependencies(t *testing.T) {
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewGroupReference("46057a92-6580-4e93-af36-2bb9c9d61e51", "Testers")),
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewGroupReference("377c3101-a7fc-47b1-9136-980348e362c0", "Customers")),
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewLabelReference("31c06b7c-010d-4f91-9590-d3fbdc2fb7ac", "Spam")),
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewOptInReference("c14b2e3f-997a-4547-a04e-6e9d5065c677", "Jokes")),
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewTemplateReference("ff958d30-f50e-48ab-a524-37ed1e9620d9", "Welcome")),
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewTicketerReference("fb9cab80-4450-4a9d-ba9b-cb8df40dd233", "Support")),
flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewTopicReference("531d3fc7-64f4-4170-927d-b477e8145dd3", "Weather")),
Expand Down Expand Up @@ -121,6 +122,12 @@ func TestDependencies(t *testing.T) {
"type": "label",
"uuid": "31c06b7c-010d-4f91-9590-d3fbdc2fb7ac"
},
{
"missing": true,
"name": "Jokes",
"type": "optin",
"uuid": "c14b2e3f-997a-4547-a04e-6e9d5065c677"
},
{
"missing": true,
"name": "Welcome",
Expand Down

0 comments on commit 2e50571

Please sign in to comment.