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 project is archived. Its data is
read-only
.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
9b40273f
Commit
9b40273f
authored
Mar 20, 2019
by
Chris Beer
Browse files
Options
Downloads
Patches
Plain Diff
Update GalleryView to use selectors
parent
9a66442b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
__tests__/src/components/GalleryView.test.js
+2
-2
2 additions, 2 deletions
__tests__/src/components/GalleryView.test.js
src/components/GalleryView.js
+4
-14
4 additions, 14 deletions
src/components/GalleryView.js
src/containers/GalleryView.js
+4
-1
4 additions, 1 deletion
src/containers/GalleryView.js
with
10 additions
and
17 deletions
__tests__/src/components/GalleryView.test.js
+
2
−
2
View file @
9b40273f
import
React
from
'
react
'
;
import
{
shallow
,
mount
}
from
'
enzyme
'
;
import
{
shallow
}
from
'
enzyme
'
;
import
manifesto
from
'
manifesto.js
'
;
import
manifestJson
from
'
../../fixtures/version-2/019.json
'
;
import
{
GalleryView
}
from
'
../../../src/components/GalleryView
'
;
...
...
@@ -9,7 +9,7 @@ function createWrapper(props) {
return
shallow
(
<
GalleryView
window
=
{{
id
:
'
1234
'
,
canvasIndex
:
0
}}
m
an
if
es
t
=
{
{
manifestation
:
manifesto
.
create
(
manifestJson
)
}
}
c
an
vas
es
=
{
manifesto
.
create
(
manifestJson
)
.
getSequences
()[
0
].
getCanvases
()
}
setCanvas
=
{()
=>
{}}
{...
props
}
/>
,
...
...
...
...
This diff is collapsed.
Click to expand it.
src/components/GalleryView.js
+
4
−
14
View file @
9b40273f
...
...
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import
PropTypes
from
'
prop-types
'
;
import
Typography
from
'
@material-ui/core/Typography
'
;
import
ManifestoCanvas
from
'
../lib/ManifestoCanvas
'
;
import
{
getCanvasLabel
,
getManifestCanvases
}
from
'
../state/selectors
'
;
import
{
getCanvasLabel
}
from
'
../state/selectors
'
;
import
{
CanvasThumbnail
}
from
'
./CanvasThumbnail
'
;
import
ns
from
'
../config/css-ns
'
;
...
...
@@ -12,16 +12,6 @@ import ns from '../config/css-ns';
* OSD and Navigation
*/
export
class
GalleryView
extends
Component
{
/**
* @param {Object} props
*/
constructor
(
props
)
{
super
(
props
);
const
{
manifest
}
=
this
.
props
;
this
.
canvases
=
manifest
.
manifestation
.
getSequences
()[
0
].
getCanvases
();
}
/**
* container classes
*/
...
...
@@ -35,7 +25,7 @@ export class GalleryView extends Component {
* Renders things
*/
render
()
{
const
{
window
,
m
an
if
es
t
,
setCanvas
}
=
this
.
props
;
const
{
window
,
c
an
vas
es
,
setCanvas
}
=
this
.
props
;
return
(
<>
<
section
...
...
@@ -43,7 +33,7 @@ export class GalleryView extends Component {
id
=
{
`
${
window
.
id
}
-gallery`
}
>
{
getManifestCanvases
(
manifest
)
.
map
((
canvas
)
=>
{
canvases
.
map
((
canvas
)
=>
{
const
manifestoCanvas
=
new
ManifestoCanvas
(
canvas
);
return
(
<
div
...
...
@@ -75,7 +65,7 @@ export class GalleryView extends Component {
}
GalleryView
.
propTypes
=
{
m
an
if
es
t
:
PropTypes
.
object
.
isRequired
,
// eslint-disable-line react/forbid-prop-types
c
an
vas
es
:
PropTypes
.
array
.
isRequired
,
// eslint-disable-line react/forbid-prop-types
window
:
PropTypes
.
object
.
isRequired
,
// eslint-disable-line react/forbid-prop-types
setCanvas
:
PropTypes
.
func
.
isRequired
,
};
This diff is collapsed.
Click to expand it.
src/containers/GalleryView.js
+
4
−
1
View file @
9b40273f
...
...
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import
*
as
actions
from
'
../state/actions
'
;
import
{
withPlugins
}
from
'
../extend
'
;
import
{
GalleryView
}
from
'
../components/GalleryView
'
;
import
{
getManifestCanvases
}
from
'
../state/selectors
'
;
/**
* mapStateToProps - to hook up connect
...
...
@@ -10,7 +11,9 @@ import { GalleryView } from '../components/GalleryView';
* @private
*/
const
mapStateToProps
=
state
=>
(
{}
{
canvases
:
getManifestCanvases
(
state
,
{
windowId
:
window
.
id
}),
}
);
/**
...
...
...
...
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
sign in
to comment