Skip to content
Snippets Groups Projects
Commit e1c1e6e3 authored by Antoine Roy's avatar Antoine Roy
Browse files

correctif pour que le title soit dans le body et bien affiché en haut du panel

parent aa9e049a
Branches
No related tags found
2 merge requests!15Merge title,!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1704 failed
mirador @ 39561392
Subproject commit fd236dcb8581ca647b90793e29578fbdd2709bc0 Subproject commit 3956139233904c4666e611a2b3aa09143cb67b57
...@@ -144,7 +144,6 @@ class AnnotationCreation extends Component { ...@@ -144,7 +144,6 @@ class AnnotationCreation extends Component {
...annoState, ...annoState,
valuetextTime: '', valuetextTime: '',
mediaVideo: null, mediaVideo: null,
title: 'defaultTitle',
}; };
this.submitForm = this.submitForm.bind(this); this.submitForm = this.submitForm.bind(this);
...@@ -327,7 +326,6 @@ class AnnotationCreation extends Component { ...@@ -327,7 +326,6 @@ class AnnotationCreation extends Component {
} = this.state; } = this.state;
const t = (tstart && tend) ? `${tstart},${tend}` : null; const t = (tstart && tend) ? `${tstart},${tend}` : null;
const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody }; const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody };
canvases.forEach((canvas) => { canvases.forEach((canvas) => {
const storageAdapter = config.annotation.adapter(canvas.id); const storageAdapter = config.annotation.adapter(canvas.id);
...@@ -429,6 +427,7 @@ class AnnotationCreation extends Component { ...@@ -429,6 +427,7 @@ class AnnotationCreation extends Component {
image, image,
valueTime, valueTime,
mediaVideo, mediaVideo,
title
} = this.state; } = this.state;
// TODO : Vérifier ce code, c'est étrange de comprarer un typeof à une chaine de caractère. // TODO : Vérifier ce code, c'est étrange de comprarer un typeof à une chaine de caractère.
...@@ -437,12 +436,10 @@ class AnnotationCreation extends Component { ...@@ -437,12 +436,10 @@ class AnnotationCreation extends Component {
valueTime[0] = tstart; valueTime[0] = tstart;
valueTime[1] = tend; valueTime[1] = tend;
} }
const isVideoDataLoaded = mediaVideo && mediaVideo.video && !isNaN(mediaVideo.video.duration) && mediaVideo.video.duration > 0; const isVideoDataLoaded = mediaVideo && mediaVideo.video && !isNaN(mediaVideo.video.duration) && mediaVideo.video.duration > 0;
return ( return (
<CompanionWindow <CompanionWindow
title={annotation ? annotation.title : 'New Annotation'} title={title ? title.value : 'New Annotation'}
windowId={windowId} windowId={windowId}
id={id} id={id}
> >
......
...@@ -4,7 +4,7 @@ export default class WebAnnotation { ...@@ -4,7 +4,7 @@ export default class WebAnnotation {
constructor({ constructor({
canvasId, id, fragsel, image, body, tags, svg, manifestId, title canvasId, id, fragsel, image, body, tags, svg, manifestId, title
}) { }) {
this.title = title; this.title = title,
this.id = id; this.id = id;
this.canvasId = canvasId; this.canvasId = canvasId;
this.fragsel = fragsel; this.fragsel = fragsel;
...@@ -18,7 +18,6 @@ export default class WebAnnotation { ...@@ -18,7 +18,6 @@ export default class WebAnnotation {
/** */ /** */
toJson() { toJson() {
return { return {
title: this.title,
body: this.createBody(), body: this.createBody(),
id: this.id, id: this.id,
motivation: 'commenting', motivation: 'commenting',
...@@ -46,7 +45,6 @@ export default class WebAnnotation { ...@@ -46,7 +45,6 @@ export default class WebAnnotation {
}; };
bodies.push(imgBody); bodies.push(imgBody);
} }
if(this.title){ if(this.title){
const title={ const title={
type: 'AnnotationTitle', type: 'AnnotationTitle',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment