Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Use selectedService prop in psammead-radio-schedules & psammead-most-read stories #3291

Merged
merged 15 commits into from
Mar 25, 2020

Conversation

Bopchy
Copy link
Contributor

@Bopchy Bopchy commented Mar 23, 2020

Resolves #3183

Overall change: Fixes the stories broken for variants on the RadioSchedule component by using the withServicesKnob selectedService prop added here. Remove workaround for stories with variants being broken in psammead-most-read stories.

Code changes:

  • Use the selectedService prop in psammead-radio-schedule and psammead-most-read stories.
  • Remove getServiceVariant() from psammead-most-read.
  • Update version of psammead-storybook-helpers.

Radio schedule stories with variants should be appearing as expected on storybook.
Screenshot 2020-03-24 at 17 14 06


  • I have assigned myself to this PR and the corresponding issues
  • Automated jest tests added (for new features) or updated (for existing features)
  • This PR requires manual testing

@Bopchy Bopchy added blocked This issue should not be worked on until another internal issue is completed - see desc for details ws-home Tasks for the WS Home Team labels Mar 23, 2020
@Bopchy Bopchy self-assigned this Mar 23, 2020
@Bopchy
Copy link
Contributor Author

Bopchy commented Mar 23, 2020

Blocked on #3279. Once this is merged, the new withServicesKnob version can be pulled in here.

UPDATE: Above issue has now been merged.

@Bopchy Bopchy changed the title Fix stories broken for variants Use selectedService prop in psammead-radio-schedules & psammead-most-read Mar 23, 2020
@Bopchy Bopchy changed the title Use selectedService prop in psammead-radio-schedules & psammead-most-read Use selectedService prop in psammead-radio-schedules & psammead-most-read stories Mar 23, 2020
@Bopchy Bopchy marked this pull request as ready for review March 24, 2020 14:19
@Bopchy Bopchy removed the blocked This issue should not be worked on until another internal issue is completed - see desc for details label Mar 24, 2020
@@ -15317,7 +15317,7 @@
"dependencies": {
"abbrev": {
"version": "1.1.1",
"resolved": "",
"resolved": false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please remove these "resolved": false changes? I think they just get added when we run npm install/npm ci

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been resolved

@@ -82,7 +82,7 @@
"@bbc/psammead-sitewide-links": "^4.0.10",
"@bbc/psammead-story-promo": "^5.1.0",
"@bbc/psammead-story-promo-list": "^4.0.5",
"@bbc/psammead-storybook-helpers": "^8.2.5",
"@bbc/psammead-storybook-helpers": "^8.2.6",
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this was bumped up, CHANGELOG.md should be updated in psammead too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CHANGELOG, package-lock.json and package.json are now updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed updates to CHANGELOG, package-lock.json and package.json as since the version change in psammead-stoybook-helpers is minor, the changes in the package are already in use. This means psammead-stoybook-helpers doesn't need to be upgraded && this resolves the issue highlighted above

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the updates 👍 I can still see some changes in package-lock.json though, Jenkins should stop complaining after you remove them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My statement above was a bit off. Since the minor change is still being noted and being installed, an update to the CHANGELOG and version numbers is still required.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Can you make sure that psammead-storybook-helpers version is bumped up in package.json too, not just in package-lock.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bumped the version. Sorry for the back and forth.

Copy link
Contributor

@DenisHdz DenisHdz left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup 💅🏼

Going through the stories to double-check we don't get the error anymore I found the following warning in the MostRead->Rank->default story because the listIndex knob is a string but it expects to be a number.

rank warning

You could also fix it in this PR or we can do it in a separate one ;)

import { MostReadRank, MostReadLink, MostReadList } from './index';
import notes from '../README.md';

const newsServiceDecorator = withServicesKnob({
defaultService: 'news',
});
const listIndexRange = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one 👍

Copy link
Contributor

@OlgaLyubin OlgaLyubin left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@PriyaKR PriyaKR self-assigned this Mar 25, 2020
@PriyaKR
Copy link
Contributor

PriyaKR commented Mar 25, 2020

LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Radio Schedule stories broken for variants
5 participants