Revize b80a6919
Přidáno uživatelem Lukáš Vlček před asi 2 roky(ů)
webapp/contexts/AnnotationContext.tsx | ||
---|---|---|
77 | 77 |
*/ |
78 | 78 |
changeSentiment: (occurrence: TagInstanceInfo, newValue: ETagSentiment) => void; |
79 | 79 |
|
80 |
makeOccurrenceFinal: (occurrence: TagInstanceInfo) => void; |
|
81 |
|
|
80 | 82 |
annotation: AnnotationInfo | null; |
81 | 83 |
mappedTags: Tag[] | null; |
82 | 84 |
refreshAnnotation: () => void; |
... | ... | |
92 | 94 |
|
93 | 95 |
selectedOccurrenceId: string | null; |
94 | 96 |
setSelectedOccurrenceId: (newId: string | null) => void; |
97 |
|
|
98 |
isFinal: boolean; |
|
95 | 99 |
} |
96 | 100 |
|
97 | 101 |
/** |
... | ... | |
194 | 198 |
setSelectedOccurrenceId: (newId: string | null) => { |
195 | 199 |
return; |
196 | 200 |
}, |
201 |
|
|
202 |
isFinal: false, |
|
203 |
makeOccurrenceFinal: (occurrence: TagInstanceInfo) => { |
|
204 |
return; |
|
205 |
}, |
|
197 | 206 |
}); |
198 | 207 |
|
199 | 208 |
/** |
... | ... | |
282 | 291 |
annotationController |
283 | 292 |
.annotationAnnotationIdOccurenceIdDelete( |
284 | 293 |
props.annotationId, |
285 |
occurrence.occurenceId ?? '' |
|
294 |
occurrence.occurenceId ?? '', |
|
295 |
props.isFinal |
|
286 | 296 |
) |
287 | 297 |
.then(() => refreshAnnotation()); |
288 | 298 |
}, 'značku'); |
... | ... | |
397 | 407 |
setMappedTags(Array.from(map.values())); |
398 | 408 |
}; |
399 | 409 |
|
410 |
async function makeOccurrenceFinal(occurrence: TagInstanceInfo) { |
|
411 |
if (!occurrence?.occurenceId) { |
|
412 |
return; |
|
413 |
} |
|
414 |
|
|
415 |
await annotationController.annotationAnnotationIdOccurenceIdFinalPut( |
|
416 |
props.annotationId, |
|
417 |
occurrence.occurenceId, |
|
418 |
{ isFinal: true } |
|
419 |
); |
|
420 |
|
|
421 |
await refreshAnnotation(); |
|
422 |
} |
|
423 |
|
|
400 | 424 |
async function refreshAnnotation() { |
401 | 425 |
const data = await annotationController.annotationAnnotationIdGet( |
402 | 426 |
props.annotationId, |
... | ... | |
436 | 460 |
setSelectedInstanceId, |
437 | 461 |
selectedOccurrenceId, |
438 | 462 |
setSelectedOccurrenceId, |
463 |
isFinal: props.isFinal, |
|
464 |
makeOccurrenceFinal, |
|
439 | 465 |
}} |
440 | 466 |
> |
441 | 467 |
{props.children} |
Také k dispozici: Unified diff
Document finalization