Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
2af0a4e6
Unverified
Commit
2af0a4e6
authored
Feb 18, 2019
by
Glenn Fischer
Committed by
GitHub
Feb 18, 2019
Browse files
Options
Downloads
Plain Diff
Merge pull request #1911 from ProjectMirador/fix-get-metadata-selector
Fix metadata selector
parents
5edb867b
8d0038b0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/state/selectors/index.js
+7
-8
7 additions, 8 deletions
src/state/selectors/index.js
with
7 additions
and
8 deletions
src/state/selectors/index.js
+
7
−
8
View file @
2af0a4e6
...
@@ -150,19 +150,18 @@ export function getCanvasLabel(canvas, canvasIndex) {
...
@@ -150,19 +150,18 @@ export function getCanvasLabel(canvas, canvasIndex) {
}
}
/**
/**
* Return
canvas
metadata in a label / value structure
* Return metadata in a label / value structure
* This is a potential seam for pulling the i18n locale from
* This is a potential seam for pulling the i18n locale from
* state and plucking out the appropriate language.
* state and plucking out the appropriate language.
* For now we're just getting the first.
* For now we're just getting the first.
* @param {object} IIIF Resource
* @param {object}
Manifesto
IIIF Resource
(e.g. canvas, manifest)
* @return {Array[Object]}
* @return {Array[Object]}
*/
*/
export
function
getDestructuredMetadata
(
iiifResoruce
)
{
export
function
getDestructuredMetadata
(
iiifResource
)
{
return
(
iiifResoruce
return
(
iiifResource
&&
iiifResoruce
.
getMetadata
()
&&
iiifResource
.
getMetadata
().
map
(
labelValuePair
=>
({
&&
iiifResoruce
.
getMetadata
().
map
(
resource
=>
({
label
:
labelValuePair
.
getLabel
(),
label
:
resource
.
label
[
0
].
value
,
value
:
labelValuePair
.
getValue
(),
value
:
resource
.
value
[
0
].
value
,
}))
}))
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment