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

fix: lists passed to GOVnotify work with no list items shown #1080

Merged
merged 2 commits into from
May 24, 2023

Conversation

ziggy-cyb
Copy link
Collaborator

Description

Fix of #1079 . The list that is parsed in the notifyModel is now appended to an empty string so that if no list items are shown, an empty string is passed to the personalisation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce
the testing if necessary.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation and versioning
  • I have updated the architecture diagrams as per Contribute.md OR added an architectural decision record entry

…d undefined being passed through to personalisation
@ziggy-cyb ziggy-cyb requested a review from jenbutongit May 24, 2023 09:40
Comment on lines 22 to 28
return (
"" +
list.items
.filter((item) => checkItemIsValid(model, state, item.condition))
.map((item) => `* ${item.value}\n`)
.join("")
);
Copy link
Contributor

Choose a reason for hiding this comment

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

does

Suggested change
return (
"" +
list.items
.filter((item) => checkItemIsValid(model, state, item.condition))
.map((item) => `* ${item.value}\n`)
.join("")
);
return `${list.items
.filter((item) => checkItemIsValid(model, state, item.condition))
.map((item) => `* ${item.value}\n`)
.join("")}`

work?

@jenbutongit jenbutongit self-requested a review May 24, 2023 10:20
@ziggy-cyb ziggy-cyb merged commit a4b627e into main May 24, 2023
@ziggy-cyb ziggy-cyb deleted the bug/empty-lists-break-notify-integration branch May 24, 2023 10:31
ziggy-cyb added a commit that referenced this pull request Jun 22, 2023
* List created for GOVnotify is now appended to an empty string to avoid undefined being passed through to personalisation

* Changed list parsing in notifyModel to wrap the array map in a template instead of appending to an empty string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants