-
Notifications
You must be signed in to change notification settings - Fork 71
Fix button URLs for WA templates #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #720 +/- ##
==========================================
+ Coverage 74.41% 74.43% +0.02%
==========================================
Files 110 110
Lines 13335 13336 +1
==========================================
+ Hits 9923 9927 +4
+ Misses 2690 2689 -1
+ Partials 722 720 -2 ☔ View full report in Codecov by Sentry. |
@@ -92,6 +92,7 @@ func GetTemplatePayload(templating *MsgTemplating) *Template { | |||
|
|||
for _, p := range v { | |||
if p.Type == "url" { | |||
component.SubType = "url" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not convinced we've modeled this correctly since we now need to infer component type from param type... and these params should be just type text
.. param type was just supposed to tell the editor what kinda of widget to display. Maybe templating
should include component type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we could add the component type to the components we save? in addition to the content and params keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least that is needed for the buttons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tied adding the type to components nyaruka/rapidpro#5111 however that will require we change the
https://github.com/nyaruka/goflow/blob/545576482f9968644052b66f00544c972aa1cc33/flows/msg.go#L177
instead of
Params_ map[string][]TemplateParam `json:"params,omitempty"`
We have a array of components
Components_ []TemplateComponen
type TemplateComponen struct {
Name string // what was used as key in the previous map
Type string
Params []TemplateParam
}
And that could make the loop
for _, k := range compKeys { |
No description provided.