Skip to content
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

Prep for support for more WA templates components #664

Merged
merged 8 commits into from
Jan 15, 2024

Conversation

norkans7
Copy link
Contributor

No description provided.

@norkans7 norkans7 marked this pull request as draft November 29, 2023 21:51
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 49 lines in your changes are missing coverage. Please review.

Comparison is base (e1151d6) 74.44% compared to head (64c3db3) 74.14%.

Files Patch % Lines
handlers/meta/whatsapp/templates.go 0.00% 49 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #664      +/-   ##
==========================================
- Coverage   74.44%   74.14%   -0.31%     
==========================================
  Files          98       98              
  Lines       13130    13166      +36     
==========================================
- Hits         9775     9762      -13     
- Misses       2665     2714      +49     
  Partials      690      690              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@norkans7 norkans7 force-pushed the WA-templates-params branch from cd73dc8 to adc3c7a Compare November 30, 2023 09:53
if len(templating.Params) == 0 {
component := &Component{Type: "body"}

for _, v := range templating.Variables {
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 kept supporting the templating variables so this can be deployed even if the goflow changes are not yet done

@@ -39,3 +44,67 @@ func GetTemplating(msg courier.MsgOut) (*MsgTemplating, error) {

return metadata.Templating, nil
}

func GetTemplatePayload(templating MsgTemplating, lang string) *Template {
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 used this method to keep the code DRY between WAC and D3C channels

component := &Component{Type: "body"}
for k, v := range templating.Params {
if k == "body" {
component := &Component{Type: "body"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just body to keep the same features but no new components supported for legacy WA channels

@norkans7 norkans7 marked this pull request as ready for review November 30, 2023 12:01
@norkans7 norkans7 force-pushed the WA-templates-params branch from 9d2da92 to 1b66fce Compare January 15, 2024 13:44
Params map[string][]struct {
Type string `json:"type"`
Value string `json:"value"`
} `json:"params"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this parameters to match the meta side of things

@rowanseymour rowanseymour merged commit bbbf42f into main Jan 15, 2024
5 of 7 checks passed
@rowanseymour rowanseymour deleted the WA-templates-params branch January 15, 2024 16:34
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 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