Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Fix button URLs for WA templates #720

wants to merge 1 commit into from

Conversation

norkans7
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.43%. Comparing base (d9467e3) to head (2a7887a).

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.
📢 Have feedback on the report? Share it here.

@norkans7 norkans7 requested a review from rowanseymour March 18, 2024 13:35
@@ -92,6 +92,7 @@ func GetTemplatePayload(templating *MsgTemplating) *Template {

for _, p := range v {
if p.Type == "url" {
component.SubType = "url"
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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 {
easier as well

@rowanseymour rowanseymour deleted the fix-WA-buttons branch March 20, 2024 22:01
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants