Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
feat(chapters): add support for the "href" property in chapters by sh…
Browse files Browse the repository at this point in the history
…owing it in the chapters tab
  • Loading branch information
monkeydom committed Sep 5, 2018
1 parent 73f6d74 commit f7240f2
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 37 deletions.
4 changes: 2 additions & 2 deletions src/components/tabs/chapters/ChapterEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@
.link {
display: flex;
max-width: calc(40%);
}
}
.timer {
min-width: 4.4em;
min-width: 4.4em;
display: block;
text-align: right;
@include font-monospace();
Expand Down
2 changes: 1 addition & 1 deletion src/effects/chapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const parseChapters = duration => (result, chapter, index, chapters) => {
end: toPlayerTime(end.start),
title: get(chapter, 'title'),
image: get(chapter, 'image'),
href: get(chapter, 'href'),
href: get(chapter, 'href') ? get(chapter, 'href') : null,
link_title: get(chapter, 'href') ? new URL(get(chapter, 'href')).hostname.replace(/^(www\.)/,"") : null
}
]
Expand Down
41 changes: 30 additions & 11 deletions src/effects/chapters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ test.cb(
{
start: '00:01:15.911',
title: 'chapter 3',
image: 'dummy'
image: 'dummy',
href: 'https://github.com/podlove/podlove-web-player/blob/development/CONTRIBUTING.md#-git-commit-guidelines'
}
]

Expand All @@ -94,23 +95,29 @@ test.cb(
start: 0,
title: 'chapter 1',
index: 1,
image: 'dummy'
image: 'dummy',
href: null,
link_title: null
},
{
active: true,
end: 75911,
start: 43137,
title: 'chapter 2',
index: 2,
image: undefined
},
image: undefined,
href: null,
link_title: null
},
{
active: false,
end: 100000,
start: 75911,
title: 'chapter 3',
index: 3,
image: 'dummy'
image: 'dummy',
href: 'https://github.com/podlove/podlove-web-player/blob/development/CONTRIBUTING.md#-git-commit-guidelines',
link_title: 'github.com'
}
])
t.end()
Expand Down Expand Up @@ -156,23 +163,29 @@ test.cb(
start: 0,
title: 'chapter 1',
index: 1,
image: 'dummy'
image: 'dummy',
href: null,
link_title: null
},
{
active: true,
end: 75911,
start: 43137,
title: 'chapter 2',
index: 2,
image: undefined
image: undefined,
href: null,
link_title: null
},
{
active: false,
end: 100000,
start: 75911,
title: 'chapter 3',
index: 3,
image: 'dummy'
image: 'dummy',
href: null,
link_title: null
}
])
t.end()
Expand Down Expand Up @@ -220,23 +233,29 @@ test.cb(
start: 0,
title: 'chapter 1',
index: 1,
image: 'dummy'
image: 'dummy',
href: null,
link_title: null
},
{
active: true,
end: 75911,
start: 43137,
title: 'chapter 2',
index: 2,
image: undefined
image: undefined,
href: null,
link_title: null
},
{
active: false,
end: 100000,
start: 75911,
title: 'chapter 3',
index: 3,
image: 'dummy'
image: 'dummy',
href: null,
link_title: null
}
])
t.end()
Expand Down
1 change: 1 addition & 0 deletions src/store/chapters/reducer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const generateTestData = (chapters, active) => {
const fallback = {
start: null,
end: null,
href: null,
title: null,
index: -1
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/chapters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ test('currentChapter should return undefined if no matches', t => {
t.deepEqual(currentChapter([]), {
start: null,
end: null,
href: null,
title: null,
index: -1
})
Expand Down
52 changes: 29 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3374,10 +3374,6 @@ [email protected], commander@^2.15.1:
version "2.17.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"

[email protected]:
version "2.6.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d"

commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
Expand Down Expand Up @@ -3509,19 +3505,19 @@ concordance@^3.0.0:
semver "^5.3.0"
well-known-symbols "^1.0.0"

concurrently@^3.6.1:
version "3.6.1"
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.6.1.tgz#2f95baec5c4051294dfbb55b57a3b98a3e2b45ec"
concurrently@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-4.0.1.tgz#f6310fbadf2f476dd95df952edb5c0ab789f672c"
dependencies:
chalk "^2.4.1"
commander "2.6.0"
date-fns "^1.23.0"
lodash "^4.5.1"
read-pkg "^3.0.0"
rx "2.3.24"
lodash "^4.17.10"
read-pkg "^4.0.1"
rxjs "6.2.2"
spawn-command "^0.0.2-1"
supports-color "^3.2.3"
supports-color "^4.5.0"
tree-kill "^1.1.0"
yargs "^12.0.1"

configstore@^3.0.0:
version "3.1.2"
Expand Down Expand Up @@ -7967,7 +7963,7 @@ lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"

[email protected], lodash@^4.0.0, lodash@^4.11.2, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1, lodash@~4.17.10:
[email protected], lodash@^4.0.0, lodash@^4.11.2, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"

Expand Down Expand Up @@ -10441,6 +10437,14 @@ read-pkg@^3.0.0:
normalize-package-data "^2.3.2"
path-type "^3.0.0"

read-pkg@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237"
dependencies:
normalize-package-data "^2.3.2"
parse-json "^4.0.0"
pify "^3.0.0"

[email protected]:
version "1.0.5"
resolved "https://registry.yarnpkg.com/read/-/read-1.0.5.tgz#007a3d169478aa710a491727e453effb92e76203"
Expand Down Expand Up @@ -10985,26 +10989,22 @@ rx-lite@*, rx-lite@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444"

[email protected]:
version "2.3.24"
resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7"

rx@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"

[email protected], rxjs@^6.1.0:
version "6.2.2"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9"
dependencies:
tslib "^1.9.0"

rxjs@^5.0.0-beta.11, rxjs@^5.5.2:
version "5.5.11"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.11.tgz#f733027ca43e3bec6b994473be4ab98ad43ced87"
dependencies:
symbol-observable "1.0.1"

rxjs@^6.1.0:
version "6.2.2"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9"
dependencies:
tslib "^1.9.0"

[email protected]:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
Expand Down Expand Up @@ -11989,6 +11989,12 @@ supports-color@^3.1.2, supports-color@^3.2.3:
dependencies:
has-flag "^1.0.0"

supports-color@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b"
dependencies:
has-flag "^2.0.0"

supports-color@^5.0.0, supports-color@^5.1.0, supports-color@^5.3.0, supports-color@^5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54"
Expand Down

0 comments on commit f7240f2

Please sign in to comment.