Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ff61085f

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

Annotators in documents management

Zobrazit rozdíly:

webapp/pages/documents/admin/index.tsx
9 9
import { LoggedUserContext } from '../../../contexts/LoggedUserContext';
10 10
import { MainLayout } from '../../../layouts/MainLayout';
11 11
import AddDocumentModal from '../../../components/modals/AddDocumentModal';
12
import { AnnotationListInfo, DocumentListInfo, UserInfo } from '../../../api';
12
import {
13
    AnnotationListInfo,
14
    DocumentListInfo,
15
    DocumentUserInfo,
16
    EState,
17
    UserInfo,
18
} from '../../../api';
13 19
import { documentController, userController } from '../../../controllers';
14 20
import AssignDocumentModal from '../../../components/modals/AssignDocumentModal';
15 21
import { ShowToast } from '../../../utils/alerts';
16 22
import { TableDocInfo } from '../../../components/types/TableDocInfo';
23
import {
24
    getAnnotationStateColor,
25
    getNameTruncated,
26
    getUserInfoAlt,
27
} from '../../../utils/strings';
17 28

  
18 29
function AdminDocumentPage() {
19 30
    const redirecting = useUnauthRedirect('/login');
......
79 90
            title: 'Anotátoři',
80 91
            dataIndex: 'annotatingUsers',
81 92
            key: 'annotatingUsers',
82
            render: (columnData: UserInfo[], record: DocumentListInfo, index: number) => {
93
            render: (
94
                columnData: DocumentUserInfo[],
95
                record: DocumentListInfo,
96
                index: number
97
            ) => {
83 98
                return (
84 99
                    <div>
85 100
                        {columnData.map((e) => (
86 101
                            <span
87 102
                                key={e.username + '.' + record.id}
88
                                title={e.username ?? ''}
103
                                title={getUserInfoAlt(e) + '\nStav: ' + e.state}
104
                                style={{
105
                                    color: getAnnotationStateColor(e.state),
106
                                    padding: 3,
107
                                }}
108
                                className={'me-3'}
89 109
                            >
90 110
                                <FontAwesomeIcon
91 111
                                    icon={faUser}
92
                                    title={e.username ?? ''}
112
                                    title={getUserInfoAlt(e)}
93 113
                                    className={'me-2'}
94 114
                                />
115
                                {getNameTruncated(e)}
95 116
                            </span>
96 117
                        ))}
97 118
                    </div>

Také k dispozici: Unified diff