Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador annotations
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 annotations
Commits
2ba115e9
Commit
2ba115e9
authored
Feb 2, 2024
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Annotation can be saved but some data are undefined
parent
983dcb82
Branches
Branches containing commit
No related tags found
2 merge requests
!28
Resolve "Sauvegarder une annotation"
,
!10
Draft: MigratingAnnotationCreation to MUI5.
Pipeline
#1884
failed
Feb 2, 2024
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/AnnotationCreation.js
+42
-43
42 additions, 43 deletions
src/AnnotationCreation.js
src/WebAnnotation.js
+1
-10
1 addition, 10 deletions
src/WebAnnotation.js
with
43 additions
and
53 deletions
src/AnnotationCreation.js
+
42
−
43
View file @
2ba115e9
...
@@ -108,6 +108,7 @@ function AnnotationCreation(props) {
...
@@ -108,6 +108,7 @@ function AnnotationCreation(props) {
tstart
,
tstart
,
valueTime
:
[
0
,
1
],
valueTime
:
[
0
,
1
],
valuetextTime
:
''
,
valuetextTime
:
''
,
textBody
:
''
,
};
};
});
});
...
@@ -316,41 +317,41 @@ function AnnotationCreation(props) {
...
@@ -316,41 +317,41 @@ function AnnotationCreation(props) {
receiveAnnotation
,
receiveAnnotation
,
config
,
config
,
}
=
props
;
}
=
props
;
const
svg
=
<
svg
viewBox
=
"
0 0 100 100
"
xmlns
=
"
http://www.w3.org/2000/svg
"
><
circle
fill
=
"
red
"
cx
=
"
50
"
cy
=
"
50
"
r
=
"
50
"
/><
/svg
>
const
svg
=
<
svg
viewBox
=
"
0 0 100 100
"
xmlns
=
"
http://www.w3.org/2000/svg
"
><
circle
fill
=
"
red
"
cx
=
"
50
"
cy
=
"
50
"
r
=
"
50
"
/><
/svg>
;
const
dummyAnnot
=
{
// const dummyAnnot = {
title
:
'
dummyTitle
'
,
// title: 'dummyTitle',
textBody
:
'
dummyTextBody
'
,
// textBody:'dummyTextBody',
image
:{
// image:{
// id: null,
// svg: svg
// },
// tags: null,
// xywh:"220,470,450,50",
// tstart: 1880,
// tend:1905,
// textEditorStateBustingKey:0,
// konvaThing: ['SOME KONVA THING', 'AND ANOTHER KONVA THING', {thirdKonvaThing:'Third Konva thing here'}]
// }
// const title = dummyAnnot.title
const
dumbIimage
=
{
id
:
null
,
id
:
null
,
svg
:
svg
svg
,
},
};
tags
:
null
,
//
xywh
:
"
220,470,450,50
"
,
// const konvaThing = dummyAnnot.konvaThing;
tstart
:
1880
,
state
.
image
=
dumbIimage
;
tend
:
1905
,
state
.
konvaThing
=
[
'
SOME KONVA THING
'
,
'
AND ANOTHER KONVA THING
'
,
{
thirdKonvaThing
:
'
Third Konva thing here
'
}];
textEditorStateBustingKey
:
0
,
konvaThing
:
[
'
SOME KONVA THING
'
,
'
AND ANOTHER KONVA THING
'
,
{
thirdKonvaThing
:
'
Third Konva thing here
'
}]
const
{
}
textBody
,
const
title
=
dummyAnnot
.
title
tags
,
const
textBody
=
dummyAnnot
.
textBody
xywh
,
const
image
=
dummyAnnot
.
image
;
tstart
,
const
tags
=
dummyAnnot
.
tags
;
tend
,
const
xywh
=
dummyAnnot
.
xywh
;
image
,
const
tstart
=
dummyAnnot
.
tstart
;
konvaThing
,
const
tend
=
dummyAnnot
.
tend
;
}
=
state
;
const
textEditorStateBustingKey
=
dummyAnnot
.
textEditorStateBustingKey
;
const
konvaThing
=
dummyAnnot
.
konvaThing
;
// const {
// title,
// textBody,
// image,
// tags,
// xywh,
// tstart,
// tend,
// textEditorStateBustingKey,
// } = state;
// TODO rename variable for better comprenhension
// TODO rename variable for better comprenhension
// const svg = await getSvg();
// const svg = await getSvg();
...
@@ -371,7 +372,6 @@ function AnnotationCreation(props) {
...
@@ -371,7 +372,6 @@ function AnnotationCreation(props) {
manifestId
:
canvas
.
options
.
resource
.
id
,
manifestId
:
canvas
.
options
.
resource
.
id
,
svg
,
svg
,
tags
,
tags
,
title
,
konvaThing
,
konvaThing
,
}).
toJson
();
}).
toJson
();
if
(
annotation
)
{
if
(
annotation
)
{
...
@@ -389,7 +389,7 @@ function AnnotationCreation(props) {
...
@@ -389,7 +389,7 @@ function AnnotationCreation(props) {
props
.
closeCompanionWindow
(
'
annotationCreation
'
,
{
props
.
closeCompanionWindow
(
'
annotationCreation
'
,
{
id
,
id
,
position
:
'
right
'
,
position
:
'
right
'
,
})
})
;
// TODO this create a re-render too soon for react and crash the app
// TODO this create a re-render too soon for react and crash the app
setState
({
setState
({
image
:
{
id
:
null
},
image
:
{
id
:
null
},
...
@@ -397,7 +397,6 @@ function AnnotationCreation(props) {
...
@@ -397,7 +397,6 @@ function AnnotationCreation(props) {
tend
:
0
,
tend
:
0
,
textBody
:
''
,
textBody
:
''
,
textEditorStateBustingKey
:
textEditorStateBustingKey
+
1
,
textEditorStateBustingKey
:
textEditorStateBustingKey
+
1
,
title
:
''
,
tstart
:
0
,
tstart
:
0
,
xywh
:
null
,
xywh
:
null
,
});
});
...
...
This diff is collapsed.
Click to expand it.
src/WebAnnotation.js
+
1
−
10
View file @
2ba115e9
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
export
default
class
WebAnnotation
{
export
default
class
WebAnnotation
{
/** */
/** */
constructor
({
constructor
({
canvasId
,
id
,
fragsel
,
image
,
body
,
tags
,
svg
,
manifestId
,
title
,
konvaThing
canvasId
,
id
,
fragsel
,
image
,
body
,
tags
,
svg
,
manifestId
,
konvaThing
})
{
})
{
this
.
title
=
title
,
this
.
id
=
id
;
this
.
id
=
id
;
this
.
canvasId
=
canvasId
;
this
.
canvasId
=
canvasId
;
this
.
fragsel
=
fragsel
;
this
.
fragsel
=
fragsel
;
...
@@ -46,13 +45,6 @@ export default class WebAnnotation {
...
@@ -46,13 +45,6 @@ export default class WebAnnotation {
};
};
bodies
.
push
(
imgBody
);
bodies
.
push
(
imgBody
);
}
}
if
(
this
.
title
){
const
title
=
{
type
:
'
AnnotationTitle
'
,
value
:
this
.
title
,
}
bodies
.
push
(
title
)
}
if
(
this
.
konvaThing
){
if
(
this
.
konvaThing
){
const
konvaThing
=
{
const
konvaThing
=
{
...
@@ -61,7 +53,6 @@ export default class WebAnnotation {
...
@@ -61,7 +53,6 @@ export default class WebAnnotation {
}
}
bodies
.
push
(
konvaThing
)
bodies
.
push
(
konvaThing
)
}
}
if
(
this
.
tags
)
{
if
(
this
.
tags
)
{
bodies
=
bodies
.
concat
(
this
.
tags
.
map
((
tag
)
=>
({
bodies
=
bodies
.
concat
(
this
.
tags
.
map
((
tag
)
=>
({
purpose
:
'
tagging
'
,
purpose
:
'
tagging
'
,
...
...
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