Projekt

Obecné

Profil

« Předchozí | Další » 

Revize e7eca311

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

Required annotations count changing - modal - done

Zobrazit rozdíly:

webapp/pages/documents/admin/index.tsx
25 25
    getUserInfoAlt,
26 26
} from '../../../utils/strings';
27 27
import { ABadge, BadgeStyle } from '../../../components/common/ABadge';
28
import SetRequiredAnnotationsCountModal from '../../../components/modals/SetRequiredAnnotationsCountModal';
28 29

  
29 30
function AdminDocumentPage() {
30 31
    const redirecting = useUnauthRedirect('/login');
31 32
    const { logout, role } = useContext(LoggedUserContext);
32 33
    const [visibleAdd, setVisibleAdd] = React.useState(false);
33 34
    const [visibleAssign, setVisibleAssign] = React.useState(false);
35
    const [visibleSetCount, setVisibleSetCount] = React.useState(false);
36

  
34 37
    const router = useRouter();
35 38

  
36 39
    const [documents, setDocuments] = useState<TableDocInfo[]>([]);
......
64 67
            setVisibleAssign(true);
65 68
        }
66 69
    };
67

  
70
    const showRequiredAnnotationsCountModal = () => {
71
        if (selectedDocs.length == 0) {
72
            ShowToast(
73
                'Vyberte dokument, pro které chcete nastavit požadovaný počet anotací',
74
                'warning',
75
                3000,
76
                'top-end'
77
            );
78
        } else {
79
            setVisibleSetCount(true);
80
        }
81
    };
68 82
    const showAddModal = () => {
69 83
        setVisibleAdd(true);
70 84
    };
......
73 87
        fetchData();
74 88
        setVisibleAdd(false);
75 89
        setVisibleAssign(false);
90
        setVisibleSetCount(false);
76 91
    };
77 92

  
78 93
    const columns = [
......
179 194
                Nahrát dokument
180 195
            </Button>
181 196
            <Button onClick={showAssignModal}>Přiřadit dokumenty</Button>
197
            <Button onClick={showRequiredAnnotationsCountModal}>
198
                Nastavit požadovaný počet anotací
199
            </Button>
182 200
            {visibleAdd && <AddDocumentModal onCancel={hideModal} />}
183 201
            {visibleAssign && (
184 202
                <AssignDocumentModal documentsIds={selectedDocs} onCancel={hideModal} />
185 203
            )}
204
            {visibleSetCount && (
205
                <SetRequiredAnnotationsCountModal
206
                    documentsIds={selectedDocs}
207
                    onCancel={hideModal}
208
                />
209
            )}
186 210

  
187 211
            <Table
188 212
                rowSelection={{

Také k dispozici: Unified diff