Revize 048b4bc0
Přidáno uživatelem Lukáš Vlček před asi 2 roky(ů)
webapp/contexts/AnnotationContext.tsx | ||
---|---|---|
204 | 204 |
const AnnotationProvider = (props: { |
205 | 205 |
children: React.ReactNode; |
206 | 206 |
annotationId: string; |
207 |
isFinal: boolean; |
|
207 | 208 |
}) => { |
208 | 209 |
const [annotation, setAnnotation] = useState<AnnotationInfo | null>(null); |
209 | 210 |
|
... | ... | |
244 | 245 |
const id = subtagId ?? tagId; |
245 | 246 |
const type: ETagType = subtagId == null ? ETagType.Tag : ETagType.Subtag; |
246 | 247 |
const res = await annotationController |
247 |
.annotationAnnotationIdPost(props.annotationId, { |
|
248 |
.annotationAnnotationIdPost(props.annotationId, props.isFinal, {
|
|
248 | 249 |
id: id, |
249 | 250 |
instanceId, |
250 | 251 |
type, |
... | ... | |
295 | 296 |
ShowConfirm( |
296 | 297 |
() => |
297 | 298 |
annotationController |
298 |
.annotationAnnotationIdDonePut(props.annotationId, req) |
|
299 |
.annotationAnnotationIdDonePut(props.annotationId, props.isFinal, req)
|
|
299 | 300 |
.then(() => { |
300 |
router.push('/documents/annotator'); |
|
301 |
if (props.isFinal) { |
|
302 |
router.push('/documents/admin'); |
|
303 |
} else { |
|
304 |
router.push('/documents/annotator'); |
|
305 |
} |
|
306 |
|
|
301 | 307 |
ShowToast('Anotování bylo úspěšně dokončeno'); |
302 | 308 |
}), |
303 | 309 |
'dokončit anotování' |
... | ... | |
337 | 343 |
await annotationController.annotationAnnotationIdTagOccurenceIdNotePost( |
338 | 344 |
props.annotationId, |
339 | 345 |
occurrence.occurenceId, |
346 |
props.isFinal, |
|
340 | 347 |
{ note: newValue } |
341 | 348 |
); |
342 | 349 |
|
... | ... | |
361 | 368 |
await annotationController.annotationAnnotationIdInstanceIdSentimentPut( |
362 | 369 |
props.annotationId, |
363 | 370 |
occurrence.instance, |
371 |
props.isFinal, |
|
364 | 372 |
{ sentiment: newValue } |
365 | 373 |
); |
366 | 374 |
|
... | ... | |
391 | 399 |
|
392 | 400 |
async function refreshAnnotation() { |
393 | 401 |
const data = await annotationController.annotationAnnotationIdGet( |
394 |
props.annotationId |
|
402 |
props.annotationId, |
|
403 |
props.isFinal |
|
395 | 404 |
); |
396 | 405 |
|
397 | 406 |
remapAnnotations(data.data); |
Také k dispozici: Unified diff
Loading final annotation