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
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
6f9ee63c
Commit
6f9ee63c
authored
2 years ago
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Revert "WIP thumbnail on accordion."
This reverts commit
08624ec6
.
parent
08624ec6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!17
WIP thumbnail on accordion.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/AnnotationManifestsAccordion.js
+28
-20
28 additions, 20 deletions
src/components/AnnotationManifestsAccordion.js
src/containers/AnnotationManifestsAccordion.js
+4
-26
4 additions, 26 deletions
src/containers/AnnotationManifestsAccordion.js
with
32 additions
and
46 deletions
src/components/AnnotationManifestsAccordion.js
+
28
−
20
View file @
6f9ee63c
...
...
@@ -22,6 +22,26 @@ export class AnnotationManifestsAccordion extends Component {
super
(
props
);
this
.
handleOpenManifestSideToSide
=
this
.
handleOpenManifestSideToSide
.
bind
(
this
);
this
.
handleOpenAccordion
=
this
.
handleOpenAccordion
.
bind
(
this
);
/** Search if the annotation is a manifest. URL must be resolvable for the annotation. So the manifest url is added at the end of the id */
function
searchManifestInID
(
id
)
{
const
match
=
id
.
match
(
/
((
http|https
)\:\/\/[
a-z0-9
\/
:%_+.,#?!@&=-
]
+
)
#
((
http|https
)\:\/\/[
a-z0-9
\/
:%_+.,#?!@&=-
]
+
)
/gi
,
);
return
match
?
match
[
0
].
split
(
'
#
'
).
slice
(
-
1
)
:
null
;
}
const
{
annotation
}
=
this
.
props
;
annotation
.
manifests
=
searchManifestInID
(
annotation
.
id
);
if
(
annotation
.
manifests
)
{
annotation
.
manifests
=
annotation
.
manifests
.
map
(
id
=>
({
id
}));
}
else
{
annotation
.
manifests
=
[];
}
this
.
state
=
{
annotation
};
}
...
...
@@ -37,7 +57,7 @@ export class AnnotationManifestsAccordion extends Component {
handleOpenAccordion
(
e
)
{
const
{
annotation
}
=
this
.
state
;
/** */
/*
async function load(manifests) {
async
function
load
(
manifests
)
{
return
Promise
.
all
(
manifests
.
map
((
manifest
)
=>
fetch
(
manifest
.
id
)
.
then
((
response
)
=>
response
.
json
())
.
then
((
data
)
=>
{
...
...
@@ -55,27 +75,20 @@ export class AnnotationManifestsAccordion extends Component {
this
.
setState
({
annotation
});
}
});
e.stopPropagation(); */
// We work onlu on the first manifest
/* const {
fetchManifest
} = this.props;
fetchManifest(annotation.manifests[0]); */
e
.
stopPropagation
();
}
/** */
render
()
{
const
{
classes
,
t
,
i18n
,
manifests
classes
,
t
,
i18n
,
}
=
this
.
props
;
const
language
=
i18n
.
language
;
const
{
annotation
}
=
this
.
state
;
if
(
manifests
===
null
||
manifests
.
length
===
0
)
{
if
(
annotation
.
manifests
===
null
||
annotation
.
manifests
.
length
===
0
)
{
return
null
;
}
...
...
@@ -89,7 +102,7 @@ export class AnnotationManifestsAccordion extends Component {
<
Typography
className
=
{
classes
.
heading
}
>
{
t
(
'
manifestFound
'
)}
<
/Typography
>
<
/AccordionSummary
>
<
AccordionDetails
className
=
{
classes
.
manifestContainer
}
>
{
manifests
.
map
(
manifest
=>
(
{
annotation
.
manifests
.
map
(
manifest
=>
(
<
Typography
>
<
Card
className
=
{
classes
.
root
}
>
<
CardActionArea
>
...
...
@@ -129,20 +142,15 @@ AnnotationManifestsAccordion.propsTypes = {
{
content
:
PropTypes
.
string
,
id
:
PropTypes
.
string
,
manifests
:
PropTypes
.
arrayOf
(
PropTypes
.
string
),
},
),
classes
:
PropTypes
.
objectOf
(
PropTypes
.
string
),
fetchManifest
:
PropTypes
.
func
.
isRequired
,
manifests
:
PropTypes
.
arrayOf
(
PropTypes
.
string
),
t
:
PropTypes
.
func
.
isRequired
,
thumbnail
:
PropTypes
.
string
,
title
:
PropTypes
.
string
,
};
AnnotationManifestsAccordion
.
defaultProps
=
{
classes
:
{},
htmlSanitizationRuleSet
:
'
iiif
'
,
listContainerComponent
:
'
li
'
,
manifests
:
[],
};
This diff is collapsed.
Click to expand it.
src/containers/AnnotationManifestsAccordion.js
+
4
−
26
View file @
6f9ee63c
...
...
@@ -5,33 +5,12 @@ import { withStyles } from '@material-ui/core/styles';
import
{
withPlugins
}
from
'
../extend/withPlugins
'
;
import
{
AnnotationManifestsAccordion
}
from
'
../components/AnnotationManifestsAccordion
'
;
import
*
as
actions
from
'
../state/actions
'
;
import
{
getConfig
,
getManifest
,
getManifestTitle
,
getManifestThumbnail
,
getCanvases
,
getManifestLogo
,
getManifestProvider
,
getWindowManifests
,
getManifestoInstance
,
getSequenceBehaviors
,
getManifestDescription
,
}
from
'
../state/selectors
'
;
/** Search if the annotation is a manifest. URL must be resolvable for the annotation. So the manifest url is added at the end of the id */
function
searchManifestInID
(
id
)
{
const
match
=
id
.
match
(
/
((
http|https
)\:\/\/[
a-z0-9
\/
:%_+.,#?!@&=-
]
+
)
#
((
http|https
)\:\/\/[
a-z0-9
\/
:%_+.,#?!@&=-
]
+
)
/gi
,
);
return
match
?
match
[
0
].
split
(
'
#
'
).
slice
(
-
1
)
:
null
;
}
import
{
getConfig
}
from
'
../state/selectors
'
;
/** For connect */
const
mapStateToProps
=
(
state
,
{
annotation
})
=>
{
const
manifestId
=
searchManifestInID
(
annotation
.
id
);
return
{
const
mapStateToProps
=
(
state
,
{
canvasId
,
windowId
})
=>
({
htmlSanitizationRuleSet
:
getConfig
(
state
).
annotations
.
htmlSanitizationRuleSet
,
manifests
:
new
Array
(
manifestId
),
thumbnail
:
getManifestThumbnail
(
state
,
{
manifestId
}),
title
:
getManifestTitle
(
state
,
{
manifestId
}),
};
};
});
/**
* mapDispatchToProps - to hook up connect
...
...
@@ -41,7 +20,6 @@ const mapStateToProps = (state, { annotation }) => {
const
mapDispatchToProps
=
{
addResource
:
actions
.
addResource
,
addWindow
:
actions
.
addWindow
,
};
/** For withStyles */
...
...
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