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
33e158c3
Commit
33e158c3
authored
2 years ago
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Disable searching manifest in annotation content
parent
36f409e1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!15
Add research field and undo research manifest in annotation content
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/AnnotationManifestsAccordion.js
+1
-15
1 addition, 15 deletions
src/components/AnnotationManifestsAccordion.js
src/helper/utils.js
+0
-6
0 additions, 6 deletions
src/helper/utils.js
with
1 addition
and
21 deletions
src/components/AnnotationManifestsAccordion.js
+
1
−
15
View file @
33e158c3
...
...
@@ -24,16 +24,6 @@ export class AnnotationManifestsAccordion extends Component {
this
.
handleOpenManifestSideToSide
=
this
.
handleOpenManifestSideToSide
.
bind
(
this
);
this
.
handleOpenAccordion
=
this
.
handleOpenAccordion
.
bind
(
this
);
/** Search manifest directly in content. We consider all the links with #manifest at the end are manifest */
function
searchManifestInContent
(
text
)
{
if
(
text
==
null
)
{
return
null
;
}
return
text
.
match
(
/
((
http|https
)\:\/\/[
a-z0-9
\/
:%_+.,#?!@&=-
]
+
)
#manifest/gi
,
);
}
/** 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
(
...
...
@@ -45,17 +35,13 @@ export class AnnotationManifestsAccordion extends Component {
const
{
annotation
}
=
this
.
props
;
/** Merge array even if some are null) */
const
concat
=
(...
arrays
)
=>
[].
concat
(...
arrays
.
filter
(
Array
.
isArray
));
annotation
.
manifests
=
concat
(
searchManifestInContent
(
annotation
.
content
),
searchManifestInID
(
annotation
.
id
));
annotation
.
manifests
=
searchManifestInID
(
annotation
.
id
);
if
(
annotation
.
manifests
)
{
annotation
.
manifests
=
annotation
.
manifests
.
map
(
id
=>
({
id
}));
}
else
{
annotation
.
manifests
=
[];
}
annotation
.
manifests
=
removeDuplicates
(
annotation
.
manifests
);
this
.
state
=
{
annotation
};
}
...
...
This diff is collapsed.
Click to expand it.
src/helper/utils.js
+
0
−
6
View file @
33e158c3
/**
* Remove duplicate elements in array
*
* */
export
const
removeDuplicates
=
(
arr
)
=>
[...
new
Map
(
arr
.
map
(
v
=>
[
v
.
id
,
v
])).
values
()];
/**
* Filter annotation with a query string. Search in ID and value
* */
...
...
This diff is collapsed.
Click to expand it.
Anthony
@anthony
mentioned in commit
ec328a33
·
2 years ago
mentioned in commit
ec328a33
mentioned in commit ec328a33355caae6ce3459f9c29cdfc6b38a1c2a
Toggle commit list
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