Projekt

Obecné

Profil

« Předchozí | Další » 

Revize afd6a1e8

Přidáno uživatelem Lukáš Vlček před asi 2 roky(ů)

AnnotationStrings refactor

Zobrazit rozdíly:

webapp/pages/documents/annotator/index.tsx
9 9
import { LoggedUserContext } from '../../../contexts/LoggedUserContext';
10 10
import { MainLayout } from '../../../layouts/MainLayout';
11 11
import { userController } from '../../../controllers';
12
import { AnnotationListInfo } from '../../../api';
12
import { AnnotationListInfo, EState } from '../../../api';
13
import {
14
    getAnnotationStateString,
15
    getAnnotationStateColor,
16
} from '../../../utils/strings';
13 17

  
14 18
function UserDocumentPage() {
15 19
    const redirecting = useUnauthRedirect('/login');
......
43 47
            title: 'Stav anotace',
44 48
            key: 'state',
45 49
            dataIndex: 'state',
46
            render: (state: string) => {
47
                let color = 'green';
48
                let label = 'Hotovo';
49
                if (state === 'NEW') {
50
                    color = 'volcano';
51
                    label = 'Nový';
52
                }
53
                if (state === 'IN_PROGRESS') {
54
                    color = 'orange';
55
                    label = 'Rozpracováno';
56
                }
50
            render: (state: EState) => {
51
                const color = getAnnotationStateColor(state);
52
                const label = getAnnotationStateString(state);
53

  
57 54
                return (
58 55
                    <Tag color={color} key={label}>
59 56
                        {label.toUpperCase()}

Také k dispozici: Unified diff