Skip to content

Fix button text and dismissible not showing for announcements - #47833

Merged
dmcavoy merged 6 commits into
stagingfrom
announcement-error
Sep 8, 2022
Merged

Fix button text and dismissible not showing for announcements#47833
dmcavoy merged 6 commits into
stagingfrom
announcement-error

Conversation

@dmcavoy

@dmcavoy dmcavoy commented Aug 26, 2022

Copy link
Copy Markdown
Contributor

Dan reported that the button text was showing in the preview on the unit edit page but not on the unit overview page. (slack) . I traced this back to when we set up the redux store for announcements. I did not update the add announcements in my last PR to account for the new fields.

I tested it locally and now the fields are reflected on the Unit Overview page.
Screen Shot 2022-08-26 at 10 33 54 AM
Screen Shot 2022-08-26 at 10 33 41 AM

Links

https://codedotorg.atlassian.net/browse/PLAT-1946

Testing story

  • Local testing

@dmcavoy
dmcavoy requested a review from a team August 26, 2022 14:35
announcement.visibility
announcement.visibility,
announcement.dismissible,
announcement.buttonText

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is quite a lot of positional arguments. you could reduce the risk of error here by using object destructuring in the method definition:

export const addAnnouncement = ({
  notice,
  details,
  link,
  type,
  visibility,
  dismissible,
  buttonText
}) => ({
store.dispatch(addAnnouncement(announcement))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh cool! Ya I'll do that

@dmcavoy
dmcavoy merged commit f11b9cc into staging Sep 8, 2022
@dmcavoy
dmcavoy deleted the announcement-error branch September 8, 2022 15:35
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