commit 0e4d7bd0f792f21f0d58ed08de923cd74c1eb749
Author: Dominik Poch <dpoch@email.cz>
Date:   Sun May 15 13:41:55 2022 +0200

    Added sentiment to tags management

diff --git a/webapp/api/api.ts b/webapp/api/api.ts
index 50cf8c7..20b6213 100644
--- a/webapp/api/api.ts
+++ b/webapp/api/api.ts
@@ -974,6 +974,12 @@ export interface TagInfo {
      * @memberof TagInfo
      */
     'subTags'?: Array<SubTagInfo> | null;
+    /**
+     * 
+     * @type {boolean}
+     * @memberof TagInfo
+     */
+    'sentimentEnabled'?: boolean;
 }
 /**
  * 
diff --git a/webapp/components/modals/TagModal.tsx b/webapp/components/modals/TagModal.tsx
index 9041c79..439fe83 100644
--- a/webapp/components/modals/TagModal.tsx
+++ b/webapp/components/modals/TagModal.tsx
@@ -1,5 +1,5 @@
 import React from 'react';
-import { Form, Input, Modal } from 'antd';
+import { Form, Input, Modal, Switch } from 'antd';
 
 /**
  * All values that the modal window can show.
@@ -8,6 +8,7 @@ export interface TagModalValues {
     name?: string;
     color?: string;
     description?: string;
+    sentimentEnabled?: boolean;
 }
 
 /**
@@ -32,12 +33,14 @@ function TagModal(props: {
             name: props.defaultValues.name ?? '',
             color: props.defaultValues.color ?? 'black',
             description: props.defaultValues.description ?? '',
+            sentimentEnabled: props.defaultValues.sentimentEnabled ?? false,
         };
     } else {
         values = {
             name: '',
             color: 'black',
             description: '',
+            sentimentEnabled: false,
         };
     }
     /**
@@ -61,6 +64,7 @@ function TagModal(props: {
             name: values.name,
             color: values.color,
             description: values.description,
+            sentimentEnabled: values.sentimentEnabled,
         });
     };
 
@@ -85,7 +89,7 @@ function TagModal(props: {
                     });
             }}
         >
-            <Form form={form} labelCol={{ span: 4 }} initialValues={values}>
+            <Form form={form} labelCol={{ span: 8 }} initialValues={values}>
                 <Form.Item
                     label="Název"
                     name="name"
@@ -100,6 +104,19 @@ function TagModal(props: {
                 >
                     <Input type="color" />
                 </Form.Item>
+                <Form.Item
+                    label="Povolit sentiment"
+                    name="sentimentEnabled"
+                    valuePropName="checked"
+                    rules={[
+                        {
+                            required: true,
+                            message: 'Prosím zadejte zda má být povolený sentiment',
+                        },
+                    ]}
+                >
+                    <Switch />
+                </Form.Item>
                 <Form.Item label="Popis" name="description">
                     <Input.TextArea />
                 </Form.Item>
diff --git a/webapp/pages/tags/index.tsx b/webapp/pages/tags/index.tsx
index 7f54b6d..1adff48 100644
--- a/webapp/pages/tags/index.tsx
+++ b/webapp/pages/tags/index.tsx
@@ -89,6 +89,14 @@ function TagsPage() {
             render: (columnData: boolean | undefined, record: any, index: number) =>
                 columnData !== undefined && <Checkbox checked={columnData} disabled />,
         },
+        {
+            title: 'Povolit sentiment',
+            dataIndex: 'sentimentEnabled',
+            key: 'sentimentEnabled',
+            width: 150,
+            render: (columnData: boolean | undefined, record: any, index: number) =>
+                columnData !== undefined && <Checkbox checked={columnData} disabled />,
+        },
         { title: 'Popis', dataIndex: 'description', key: 'description' },
         {
             title: '',
@@ -184,6 +192,7 @@ function TagsPage() {
                 name: val.name,
                 description: val.description,
                 color: val.color,
+                sentimentEnabled: val.sentimentEnabled,
             })
             .then(() => loadData());
 
@@ -208,6 +217,7 @@ function TagsPage() {
                 name: val.name,
                 description: val.description,
                 color: val.color,
+                sentimentEnabled: val.sentimentEnabled,
             })
             .then(() => loadData());
 
@@ -331,6 +341,7 @@ function TagsPage() {
                             name: tagInfo.name,
                             description: tagInfo.description,
                             color: tagInfo.color,
+                            sentimentEnabled: tagInfo.sentimentEnabled,
                             depth: 1,
                             ...(tagInfo.subTags?.length && {
                                 children: tagInfo.subTags?.map((subInfo: any) => {
