commit a547b12c520affc7e590dab7ff4d5bfb412e36cb
Author: Lukáš Vlček <vlcek@net-inout.cz>
Date:   Tue May 17 19:19:21 2022 +0200

    Occurrence - like canceling

diff --git a/webapp/components/annotation/AnnotationOccurrenceItem.tsx b/webapp/components/annotation/AnnotationOccurrenceItem.tsx
index fff6908..cacf6b1 100644
--- a/webapp/components/annotation/AnnotationOccurrenceItem.tsx
+++ b/webapp/components/annotation/AnnotationOccurrenceItem.tsx
@@ -3,7 +3,12 @@ import { Tag } from '../types/tag';
 import { ChangeEvent, useContext } from 'react';
 import 'antd/dist/antd.css';
 import { Button, Input, Select } from 'antd';
-import { DeleteOutlined, EyeOutlined, LikeOutlined } from '@ant-design/icons';
+import {
+    DeleteOutlined,
+    DislikeOutlined,
+    EyeOutlined,
+    LikeOutlined,
+} from '@ant-design/icons';
 import { AnnotationContext } from '../../contexts/AnnotationContext';
 import { ETagSentiment, TagInstanceInfo } from '../../api';
 import { getNameTruncated, getTextMaxLength } from '../../utils/strings';
@@ -153,12 +158,30 @@ export function AnnotationOccurrenceItem(props: {
                     />
                     {isFinal && (
                         <Button
-                            icon={<LikeOutlined />}
-                            title={'Označit jako správné řešení'}
+                            icon={
+                                props.occurrence.isFinal ? (
+                                    <DislikeOutlined />
+                                ) : (
+                                    <LikeOutlined />
+                                )
+                            }
+                            title={
+                                props.occurrence.isFinal
+                                    ? 'ZRUŠIT označení správného řešení'
+                                    : 'Označit jako správné řešení'
+                            }
                             onClick={() => {
-                                ShowConfirm(() => {
-                                    makeOccurrenceFinal(props.occurrence);
-                                }, 'označit toto řešení jako správné');
+                                ShowConfirm(
+                                    () => {
+                                        makeOccurrenceFinal(
+                                            props.occurrence,
+                                            !props.occurrence.isFinal
+                                        );
+                                    },
+                                    props.occurrence.isFinal
+                                        ? 'ZRUŠIT označené správného řešení'
+                                        : 'označit toto řešení jako správné'
+                                );
                             }}
                             className={'mt-1'}
                         />
diff --git a/webapp/contexts/AnnotationContext.tsx b/webapp/contexts/AnnotationContext.tsx
index 81b29ed..b31b3d1 100644
--- a/webapp/contexts/AnnotationContext.tsx
+++ b/webapp/contexts/AnnotationContext.tsx
@@ -79,7 +79,7 @@ interface IAnnotationContextProvider {
      */
     changeSentiment: (occurrence: TagInstanceInfo, newValue: ETagSentiment) => void;
 
-    makeOccurrenceFinal: (occurrence: TagInstanceInfo) => void;
+    makeOccurrenceFinal: (occurrence: TagInstanceInfo, final: boolean) => void;
 
     annotation: AnnotationInfo | null;
     mappedTags: Tag[] | null;
@@ -206,7 +206,7 @@ export const AnnotationContext = createContext<IAnnotationContextProvider>({
     },
 
     isFinal: false,
-    makeOccurrenceFinal: (occurrence: TagInstanceInfo) => {
+    makeOccurrenceFinal: (occurrence: TagInstanceInfo, final: boolean) => {
         return;
     },
 });
@@ -425,7 +425,10 @@ const AnnotationProvider = (props: {
         setMappedTags(Array.from(map.values()));
     };
 
-    async function makeOccurrenceFinal(occurrence: TagInstanceInfo) {
+    async function makeOccurrenceFinal(
+        occurrence: TagInstanceInfo,
+        final: boolean = true
+    ) {
         if (!occurrence?.occurenceId) {
             return;
         }
@@ -433,7 +436,7 @@ const AnnotationProvider = (props: {
         await annotationController.annotationAnnotationIdOccurenceIdFinalPut(
             props.annotationId,
             occurrence.occurenceId,
-            { isFinal: true }
+            { isFinal: final }
         );
 
         await refreshAnnotation();
