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

Use updated media indicator in Story Promo and Index Alsos #3073

Merged
merged 47 commits into from
Feb 10, 2020
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1a5b4dd
Install psammead-media-indicator@3
sareh Feb 6, 2020
fc51960
Update styles to work with new major version of media indicator
sareh Feb 6, 2020
a393ea3
Use @bbc/[email protected]
sareh Feb 6, 2020
710f61f
Update snapshots
sareh Feb 6, 2020
b55b9d0
Merge branch 'latest' into use-updated-media-indicator
sareh Feb 6, 2020
934e0a8
Use new version of Media Indicator in Grid story, by making an exampl…
sareh Feb 6, 2020
5c903bc
Update version of media indicator package
sareh Feb 6, 2020
c174d66
Update package version
sareh Feb 6, 2020
041e6da
Update to [email protected]
sareh Feb 6, 2020
cfbc50a
Merge branch 'latest' into use-updated-media-indicator
sareh Feb 6, 2020
a84c589
Pass script to MediaIndicator
sareh Feb 6, 2020
7bfaee6
Pass script to MediaIndicator
sareh Feb 6, 2020
2c63894
Merge branch 'use-updated-media-indicator' of github.com:bbc/psammead…
sareh Feb 6, 2020
55dabf7
Use long text example for heading to more easily show wrapping behavi…
sareh Feb 6, 2020
36bc53e
Remove styled span around media indicator
sareh Feb 6, 2020
288050c
Update time to StyledTime
sareh Feb 6, 2020
7ebc7d5
Add styled time with spacing
sareh Feb 6, 2020
e14d290
Remove the padding reset
sareh Feb 6, 2020
079d74f
Lint fixes
sareh Feb 7, 2020
32f3a02
Lint fixes
sareh Feb 7, 2020
3472c16
Update padding/height adjustments
sareh Feb 7, 2020
3e5a7ec
Reset Media Indicator SVG margin when used in Index Alsos
DenisHdz Feb 7, 2020
2d94265
Fix linting
sareh Feb 7, 2020
8074830
Fix linting
sareh Feb 7, 2020
80cdd4a
Merge branch 'latest' into use-updated-media-indicator
sareh Feb 7, 2020
f6ed784
Merge branch 'latest' of github.com:bbc/psammead into use-updated-med…
DenisHdz Feb 7, 2020
5e7a0cd
Merge branch 'use-updated-media-indicator' of github.com:bbc/psammead…
DenisHdz Feb 7, 2020
011ec7b
Tidy MediaIndicator props
sareh Feb 7, 2020
dddfd62
Refactor conditionalStyles to use implicit return
DenisHdz Feb 7, 2020
294f850
Merge branch 'use-updated-media-indicator' of github.com:bbc/psammead…
DenisHdz Feb 7, 2020
eb2e5ab
Reorder StoryPromo props
DenisHdz Feb 7, 2020
3f1da5c
Fix Grid version conflict
DenisHdz Feb 7, 2020
eff3204
Remove conditional styles as the svg margin should be reset just when…
DenisHdz Feb 7, 2020
6ef0f88
Reset svg inside the TextGridItem
DenisHdz Feb 7, 2020
9d97cff
Fix issue with the > *
DenisHdz Feb 7, 2020
46ae8c7
Merge branch 'latest' of github.com:bbc/psammead into use-updated-med…
DenisHdz Feb 7, 2020
9fa98aa
Merge branch 'latest' into use-updated-media-indicator
EinsteinNjoroge Feb 7, 2020
67d3a92
Update CHANGELOG.md
sareh Feb 7, 2020
55ecdaa
Fix conflicts
DenisHdz Feb 10, 2020
5452907
Update Time component used in test
sareh Feb 10, 2020
4f9c76d
Merge branch 'latest' into use-updated-media-indicator
DenisHdz Feb 10, 2020
2065c8e
Removing extra styles from ExampleMediaIndicator - the relevant style…
sareh Feb 10, 2020
1b96a75
Merge branch 'use-updated-media-indicator' of github.com:bbc/psammead…
sareh Feb 10, 2020
6bd8289
Merge branch 'latest' into use-updated-media-indicator
DenisHdz Feb 10, 2020
a97ce1d
Fix conflicts
DenisHdz Feb 10, 2020
1df46a9
Merge branch 'use-updated-media-indicator' of github.com:bbc/psammead…
DenisHdz Feb 10, 2020
713afe3
Merge branch 'latest' into 'use-updated-media-indicator'
sareh Feb 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 2.0.73 | [PR#3073](https://github.com/bbc/psammead/pull/3073) Update `@bbc/psammead-media-indicator` to major version 4 & update relvant usage in packages. |
sareh marked this conversation as resolved.
Show resolved Hide resolved
| 2.0.72 | [PR#3038](https://github.com/bbc/psammead/pull/3038) Refactor no-JS scenarios for @bbc/psammead-media-player, adding jest-dom |
| 2.0.71 | [PR#3051](https://github.com/bbc/psammead/pull/3051) Bumping dependencies |
| 2.0.70 | [PR#2988](https://github.com/bbc/psammead/pull/2988) Add @bbc/psammead-timestamp-container to dependencies |
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead",
"version": "2.0.72",
"version": "2.0.73",
"description": "Core Components Library Developed & Maintained By The Articles and Reach & Languages Team",
"main": "index.js",
"private": true,
Expand Down Expand Up @@ -59,7 +59,7 @@
"@bbc/psammead-image-placeholder": "^1.2.33",
"@bbc/psammead-inline-link": "^1.3.20",
"@bbc/psammead-locales": "^4.1.1",
"@bbc/psammead-media-indicator": "^2.6.27",
"@bbc/psammead-media-indicator": "^4.0.1",
"@bbc/psammead-paragraph": "^2.2.24",
"@bbc/psammead-story-promo": "2.8.0-alpha.1",
"@bbc/psammead-storybook-helpers": "^8.2.3",
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-grid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.1.7 | [PR#3073](https://github.com/bbc/psammead/pull/3073) Update Grid Stories to include new major version of MediaIndicator |
Copy link
Contributor

@DenisHdz DenisHdz Feb 10, 2020

Choose a reason for hiding this comment

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

After this PR gets merged, we have to bump the psammead-story-promo in the root package.json, to make sure these changes are applied correctly.

| 1.1.6 | [PR#3076](https://github.com/bbc/psammead/pull/3076) Add `parentEnableGelGutters` to documentation |
| 1.1.5 | [PR#3030](https://github.com/bbc/psammead/pull/3030) Talos - Bump Dependencies - @bbc/psammead-styles |
| 1.1.4 | [PR#2978](https://github.com/bbc/psammead/pull/2978) Talos - Bump Dependencies - @bbc/gel-foundations |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-grid/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/psammead-grid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-grid",
"version": "1.1.6",
"version": "1.1.7",
"description": "Grid component",
"main": "dist/index.js",
"module": "esm/index.js",
Expand Down
26 changes: 17 additions & 9 deletions packages/components/psammead-grid/src/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import {
buildRTLSubstories,
} from '@bbc/psammead-storybook-helpers';
import Image from '@bbc/psammead-image';
import MediaIndicator from '@bbc/psammead-media-indicator';
import StoryPromo, { Headline, Summary, Link } from '@bbc/psammead-story-promo';
import IndexAlsosContainer from '../../psammead-story-promo/testHelpers/IndexAlsosContainer';
import relatedItems from '../../psammead-story-promo/testHelpers/relatedItems';
import Grid from '.';
import { ExampleImage, ExampleParagraph } from './testHelpers';
import {
ExampleImage,
ExampleParagraph,
ExampleMediaIndicator,
ExampleTime,
} from './testHelpers';
import notes from '../README.md';

const STORY_KIND = 'Components|Grid';
Expand Down Expand Up @@ -1167,13 +1171,16 @@ storiesOf(STORY_KIND, module)
({ service, script, dir, text }) => {
// eslint-disable-next-line react/prop-types
const generateStory = ({ topStory, alsoItems = null, mediaType }) => {
const MediaIndicatorComponent = type => (
<MediaIndicator
duration={type !== 'photogallery' && '2:15'}
datetime="PT2M15S"
const MediaIndicatorComponent = () => (
<ExampleMediaIndicator
script={script}
service={service}
type={type}
/>
type={mediaType}
>
{mediaType !== 'photogallery' && (
<ExampleTime dateTime="PT2M15S">2:15</ExampleTime>
)}
</ExampleMediaIndicator>
);

const Info = (
Expand Down Expand Up @@ -1210,7 +1217,8 @@ storiesOf(STORY_KIND, module)
image={Img}
info={Info}
mediaIndicator={
mediaType && MediaIndicatorComponent(mediaType, service)
mediaType &&
MediaIndicatorComponent({ script, service, mediaType })
}
topStory={topStory}
/>
Expand Down
30 changes: 29 additions & 1 deletion packages/components/psammead-grid/src/testHelpers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ import styled from 'styled-components';
import Paragraph from '@bbc/psammead-paragraph';
import { cyrillicAndLatin } from '@bbc/gel-foundations/scripts';
import Image from '@bbc/psammead-image';
import { GEL_SPACING } from '@bbc/gel-foundations/dist/spacings';
import {
GEL_SPACING_HLF,
GEL_SPACING,
GEL_SPACING_QUAD,
} from '@bbc/gel-foundations/spacings';
import {
GEL_GROUP_1_SCREEN_WIDTH_MAX,
GEL_GROUP_2_SCREEN_WIDTH_MIN,
} from '@bbc/gel-foundations/breakpoints';
import MediaIndicator from '@bbc/psammead-media-indicator';

export const ExampleParagraph = ({ identifier }) => (
<Paragraph script={cyrillicAndLatin} service="news">
Expand Down Expand Up @@ -38,6 +47,25 @@ export const ExampleImage = () => (
</ImageSpacing>
);

export const ExampleMediaIndicator = styled(MediaIndicator)`
@media (min-width: ${GEL_GROUP_2_SCREEN_WIDTH_MIN}) {
position: absolute;
bottom: 0;
}
> * {
@media (max-width: ${GEL_GROUP_1_SCREEN_WIDTH_MAX}) {
height: 1.25rem;
padding: ${GEL_SPACING_HLF} ${GEL_SPACING_HLF} 0;
}
height: ${GEL_SPACING_QUAD};
padding: ${GEL_SPACING} ${GEL_SPACING_HLF};
}
`;

export const ExampleTime = styled.time`
padding: 0 ${GEL_SPACING_HLF};
`;

ExampleParagraph.propTypes = {
identifier: string,
};
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-story-promo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------- | ----------- |
| 4.0.0-alpha.8 | [PR#3073](https://github.com/bbc/psammead/pull/3073) Use new major version of MediaIndicator. StoryPromo has updated styling around the MediaIndicator. Index Alsos test helper now using prop `isInline` for the MediaIndicator. |
| 4.0.0-alpha.7 | [PR#3027](https://github.com/bbc/psammead/pull/3027) Use mobile and tablet stylings |
| 4.0.0-alpha.6 | [PR#3030](https://github.com/bbc/psammead/pull/3030) Talos - Bump Dependencies - @bbc/psammead-styles |
| 4.0.0-alpha.5 | [PR#3026](https://github.com/bbc/psammead/pull/3026) Apply Pica to the regular story promo headline across all breakpoints |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-story-promo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/psammead-story-promo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-story-promo",
"version": "4.0.0-alpha.7",
"version": "4.0.0-alpha.8",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,29 @@ exports[`Index Alsos should render multiple correctly 1`] = `
height: 0.75rem;
}

.c6 > svg {
margin: 0;
.c5 {
color: #222222;
background-color: #FFFFFF;
font-family: ReithSans,Helvetica,Arial,sans-serif;
font-weight: 400;
font-style: normal;
font-size: 0.75rem;
line-height: 1rem;
display: inline-block;
vertical-align: middle;
padding-right: 0.5rem;
}

.c6 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 100%;
}

.c1 {
Expand Down Expand Up @@ -43,10 +64,6 @@ exports[`Index Alsos should render multiple correctly 1`] = `
margin: 0;
}

.c5 {
padding-right: 0.5rem;
}

.c8 {
display: inline;
vertical-align: middle;
Expand All @@ -73,6 +90,24 @@ exports[`Index Alsos should render multiple correctly 1`] = `
color: #6E6E73;
}

.c4 svg {
margin: 0;
}

@media (min-width:20rem) and (max-width:37.4375rem) {
.c5 {
font-size: 0.75rem;
line-height: 1rem;
}
}

@media (min-width:37.5rem) {
.c5 {
font-size: 0.75rem;
line-height: 1rem;
}
}

@media (min-width:20rem) and (max-width:37.4375rem) {
.c4 {
font-size: 0.875rem;
Expand Down Expand Up @@ -108,12 +143,11 @@ exports[`Index Alsos should render multiple correctly 1`] = `
class="c4"
href="/hausa/labarai-48916590"
>
<span
<div
aria-hidden="true"
class="c5"
dir="ltr"
>
<span
aria-hidden="true"
<div
class="c6"
>
<svg
Expand All @@ -128,8 +162,8 @@ exports[`Index Alsos should render multiple correctly 1`] = `
points="3,32 29,16 3,0"
/>
</svg>
</span>
</span>
</div>
</div>
<span
class=""
role="text"
Expand Down Expand Up @@ -177,8 +211,29 @@ exports[`Index Alsos should render one correctly 1`] = `
height: 0.75rem;
}

.c5 > svg {
margin: 0;
.c4 {
color: #222222;
background-color: #FFFFFF;
font-family: ReithSans,Helvetica,Arial,sans-serif;
font-weight: 400;
font-style: normal;
font-size: 0.75rem;
line-height: 1rem;
display: inline-block;
vertical-align: middle;
padding-right: 0.5rem;
}

.c5 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 100%;
}

.c1 {
Expand All @@ -204,10 +259,6 @@ exports[`Index Alsos should render one correctly 1`] = `
padding: 0.5rem 0;
}

.c4 {
padding-right: 0.5rem;
}

.c7 {
display: inline;
vertical-align: middle;
Expand All @@ -234,6 +285,24 @@ exports[`Index Alsos should render one correctly 1`] = `
color: #6E6E73;
}

.c3 svg {
margin: 0;
}

@media (min-width:20rem) and (max-width:37.4375rem) {
.c4 {
font-size: 0.75rem;
line-height: 1rem;
}
}

@media (min-width:37.5rem) {
.c4 {
font-size: 0.75rem;
line-height: 1rem;
}
}

@media (min-width:20rem) and (max-width:37.4375rem) {
.c3 {
font-size: 0.875rem;
Expand Down Expand Up @@ -264,12 +333,11 @@ exports[`Index Alsos should render one correctly 1`] = `
class="c3"
href="/hausa/labarai-48916590"
>
<span
<div
aria-hidden="true"
class="c4"
dir="ltr"
>
<span
aria-hidden="true"
<div
class="c5"
>
<svg
Expand All @@ -284,8 +352,8 @@ exports[`Index Alsos should render one correctly 1`] = `
points="3,32 29,16 3,0"
/>
</svg>
</span>
</span>
</div>
</div>
<span
class=""
role="text"
Expand Down
Loading