tycho-components 0.22.1 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/Localization.js +2 -0
- package/dist/configs/api.d.ts +8 -0
- package/dist/configs/api.js +13 -3
- package/dist/configs/services/ParserListService.js +3 -3
- package/dist/features/DocumentDrawer/Actions/Actions.d.ts +6 -1
- package/dist/features/DocumentDrawer/Actions/Actions.js +51 -7
- package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.d.ts +7 -0
- package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.js +23 -0
- package/dist/features/DocumentDrawer/DocumentDrawer.d.ts +6 -1
- package/dist/features/DocumentDrawer/DocumentDrawer.js +7 -7
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.d.ts +8 -0
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.js +18 -0
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.d.ts +7 -0
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.js +68 -0
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.d.ts +27 -0
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.js +29 -0
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.d.ts +6 -0
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.js +8 -0
- package/dist/features/DocumentDrawer/Inconsistency/style.scss +58 -0
- package/dist/features/DocumentDrawer/index.d.ts +2 -0
- package/dist/features/DocumentDrawer/index.js +1 -0
- package/dist/features/DocumentDrawer/localization/ActionsTexts.d.ts +18 -0
- package/dist/features/DocumentDrawer/localization/ActionsTexts.js +18 -0
- package/dist/features/DocumentDrawer/localization/InconsistencyTexts.d.ts +95 -0
- package/dist/features/DocumentDrawer/localization/InconsistencyTexts.js +95 -0
- package/dist/features/DocumentDrawer/services/AutomaticParserService.js +3 -3
- package/dist/features/DocumentDrawer/services/BoundingBoxService.js +4 -4
- package/dist/features/DocumentDrawer/services/LexiconService.d.ts +1 -4
- package/dist/features/DocumentDrawer/services/LexiconService.js +2 -5
- package/dist/features/DocumentDrawer/services/MetadataService.d.ts +1 -5
- package/dist/features/DocumentDrawer/services/MetadataService.js +0 -8
- package/dist/features/DocumentDrawer/services/PageService.d.ts +2 -0
- package/dist/features/DocumentDrawer/services/PageService.js +4 -1
- package/dist/features/DocumentDrawer/services/SentenceService.js +2 -2
- package/dist/features/DocumentDrawer/style.scss +2 -2
- package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.d.ts +3 -0
- package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.js +14 -0
- package/dist/features/Participants/ParticipantService.js +6 -4
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.js +1 -0
- package/dist/shell/Header/HeaderCorpora/HeaderCorpora.js +1 -1
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ import PageTexts from '../features/DocumentDrawer/localization/PageTexts';
|
|
|
20
20
|
import { ExportTexts } from '../features/DocumentDrawer/localization/ExportTexts';
|
|
21
21
|
import { GithubTexts } from '../features/DocumentDrawer/localization/GithubTexts';
|
|
22
22
|
import ParserTexts from '../features/DocumentDrawer/localization/ParserTexts';
|
|
23
|
+
import { InconsistencyTexts } from '../features/DocumentDrawer/localization/InconsistencyTexts';
|
|
23
24
|
function buildResources(namespaces) {
|
|
24
25
|
return {
|
|
25
26
|
en: Object.fromEntries(Object.entries(namespaces).map(([key, texts]) => [key, texts.en])),
|
|
@@ -49,6 +50,7 @@ const FEATURE_NAMESPACES = {
|
|
|
49
50
|
export: ExportTexts,
|
|
50
51
|
github: GithubTexts,
|
|
51
52
|
parser: ParserTexts,
|
|
53
|
+
inconsistency: InconsistencyTexts,
|
|
52
54
|
};
|
|
53
55
|
export const commonResources = buildResources(CORE_NAMESPACES);
|
|
54
56
|
export const featureResources = buildResources(FEATURE_NAMESPACES);
|
package/dist/configs/api.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/** Platform API roots (formerly separate env vars per service). */
|
|
2
|
+
export declare const platformApi: {
|
|
3
|
+
base: string;
|
|
4
|
+
revision: string;
|
|
5
|
+
catalog: string;
|
|
6
|
+
editor: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const parserApiBase: string;
|
|
1
9
|
declare const api: import("axios").AxiosInstance;
|
|
2
10
|
export default api;
|
package/dist/configs/api.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import CookieStorage from './CookieStorage';
|
|
3
|
+
const platformApiBase = import.meta.env.VITE_APP_PLATFORM_API;
|
|
4
|
+
/** Platform API roots (formerly separate env vars per service). */
|
|
5
|
+
export const platformApi = {
|
|
6
|
+
base: platformApiBase,
|
|
7
|
+
revision: `${platformApiBase}/revision`,
|
|
8
|
+
catalog: `${platformApiBase}/catalog`,
|
|
9
|
+
editor: `${platformApiBase}/editor`,
|
|
10
|
+
};
|
|
11
|
+
export const parserApiBase = import.meta.env.VITE_APP_PARSER_API;
|
|
3
12
|
const api = axios.create({
|
|
4
13
|
headers: {
|
|
5
14
|
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
@@ -7,10 +16,11 @@ const api = axios.create({
|
|
|
7
16
|
'Content-Type': 'application/json',
|
|
8
17
|
Accept: 'application/json',
|
|
9
18
|
},
|
|
10
|
-
baseURL:
|
|
19
|
+
baseURL: platformApiBase,
|
|
11
20
|
});
|
|
12
21
|
const isStorybook = () => typeof window !== 'undefined' &&
|
|
13
|
-
(window.location.port === '6006' ||
|
|
22
|
+
(window.location.port === '6006' ||
|
|
23
|
+
window.__STORYBOOK__);
|
|
14
24
|
api.interceptors.response.use((response) => response, async (error) => {
|
|
15
25
|
if (error.response?.status === 401) {
|
|
16
26
|
CookieStorage.removeJwtToken();
|
|
@@ -21,7 +31,7 @@ api.interceptors.response.use((response) => response, async (error) => {
|
|
|
21
31
|
}
|
|
22
32
|
}
|
|
23
33
|
else if (error.response?.status === 403 && !isStorybook()) {
|
|
24
|
-
window.location.href =
|
|
34
|
+
window.location.href = import.meta.env.VITE_APP_UNAUTHORIZED_URL;
|
|
25
35
|
}
|
|
26
36
|
else if (error.status === null) {
|
|
27
37
|
console.log(JSON.stringify(error));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import api from '../api';
|
|
1
|
+
import api, { parserApiBase } from '../api';
|
|
2
2
|
function listParsers() {
|
|
3
|
-
return api.get(`${
|
|
3
|
+
return api.get(`${parserApiBase}/open/list`);
|
|
4
4
|
}
|
|
5
5
|
function listUDParsers() {
|
|
6
|
-
return api.get(`${
|
|
6
|
+
return api.get(`${parserApiBase}/open/ud/list`);
|
|
7
7
|
}
|
|
8
8
|
const ParserListService = { listParsers, listUDParsers };
|
|
9
9
|
export default ParserListService;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import CatalogSearchFilter from '../types/CatalogSearchFilter';
|
|
2
|
+
import type { DocumentDrawerActionId } from '../types/DocumentDrawerActionId';
|
|
2
3
|
import { Document } from '../deps';
|
|
3
4
|
import './style.scss';
|
|
4
5
|
type Props = {
|
|
@@ -7,6 +8,10 @@ type Props = {
|
|
|
7
8
|
setFilter: (p: CatalogSearchFilter) => void;
|
|
8
9
|
handleClickDocument: (uid: string) => void;
|
|
9
10
|
useGrid: boolean;
|
|
11
|
+
pageUid?: string;
|
|
12
|
+
pageOrder?: number;
|
|
13
|
+
onPageReload?: () => void;
|
|
14
|
+
hiddenActions?: DocumentDrawerActionId[];
|
|
10
15
|
};
|
|
11
|
-
export default function Actions({ document, setOpenFile, setFilter, handleClickDocument, useGrid, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function Actions({ document, setOpenFile, setFilter, handleClickDocument, useGrid, pageUid, pageOrder, onPageReload, hiddenActions, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
17
|
export {};
|
|
@@ -1,33 +1,51 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import AutomaticParser from '../AutomaticParser';
|
|
3
3
|
import DocumentRemove from '../DocumentRemove';
|
|
4
|
+
import InconsistencyActions from '../Inconsistency/InconsistencyActions';
|
|
4
5
|
import DocumentService from '../services/DocumentService';
|
|
5
6
|
import SentenceService from '../services/SentenceService';
|
|
6
|
-
import
|
|
7
|
+
import PageRemoveSentences from './PageRemoveSentences';
|
|
8
|
+
import { useMemo, useState } from 'react';
|
|
7
9
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { ToolsUtils, useMessageUtils } from '../deps';
|
|
10
|
+
import { ToolsUtils, useCorpusUtils, useMessageUtils } from '../deps';
|
|
9
11
|
import { Icon } from 'tycho-storybook';
|
|
10
12
|
import './style.scss';
|
|
11
|
-
export default function Actions({ document, setOpenFile, setFilter, handleClickDocument, useGrid, }) {
|
|
13
|
+
export default function Actions({ document, setOpenFile, setFilter, handleClickDocument, useGrid, pageUid, pageOrder, onPageReload, hiddenActions = [], }) {
|
|
12
14
|
const { t } = useTranslation(['actions', 'main']);
|
|
15
|
+
const { getCorpus } = useCorpusUtils();
|
|
13
16
|
const [openRemove, setOpenRemove] = useState(false);
|
|
17
|
+
const [openRemoveSentences, setOpenRemoveSentences] = useState(false);
|
|
14
18
|
const { dispatchError, dispatchMessage } = useMessageUtils();
|
|
15
19
|
const [openAutomatic, setOpenAutomatic] = useState(false);
|
|
20
|
+
const hidden = useMemo(() => new Set(hiddenActions), [hiddenActions]);
|
|
21
|
+
const navigateSameWindow = (url) => {
|
|
22
|
+
window.location.assign(url);
|
|
23
|
+
};
|
|
16
24
|
const handleResume = () => {
|
|
17
25
|
SentenceService.resume(document.uid).then((r) => {
|
|
18
26
|
if (!r.data) {
|
|
19
27
|
dispatchError({ err: 'warning.syntactic.review', t });
|
|
20
28
|
return;
|
|
21
29
|
}
|
|
22
|
-
|
|
30
|
+
navigateSameWindow(`${import.meta.env.VITE_APP_REVISION_URL}/tree/${r.data.uid}`);
|
|
23
31
|
});
|
|
24
32
|
};
|
|
25
33
|
const handleReview = () => {
|
|
26
|
-
const baseUrl = import.meta.env.
|
|
34
|
+
const baseUrl = import.meta.env.VITE_APP_REVISION_URL;
|
|
27
35
|
const url = document.defaultTool === 'DESIGN'
|
|
28
36
|
? `${baseUrl}/box/${document.uid}`
|
|
29
37
|
: `${baseUrl}/${document.uid}`;
|
|
30
|
-
|
|
38
|
+
navigateSameWindow(url);
|
|
39
|
+
};
|
|
40
|
+
const handleDocuments = () => {
|
|
41
|
+
window.location.href = `${import.meta.env.VITE_APP_CATALOG_URL}/${getCorpus().uid}`;
|
|
42
|
+
};
|
|
43
|
+
const handleTranscription = () => {
|
|
44
|
+
if (!pageUid) {
|
|
45
|
+
dispatchError({ err: 'error.page.required', t });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
setOpenRemoveSentences(true);
|
|
31
49
|
};
|
|
32
50
|
const handleSyncSearch = () => {
|
|
33
51
|
DocumentService.syncSearch(document.uid)
|
|
@@ -36,6 +54,14 @@ export default function Actions({ document, setOpenFile, setFilter, handleClickD
|
|
|
36
54
|
};
|
|
37
55
|
const actionOptions = [
|
|
38
56
|
{
|
|
57
|
+
id: 'documents',
|
|
58
|
+
iconName: 'list',
|
|
59
|
+
title: t('label.documents.title'),
|
|
60
|
+
description: t('label.documents.description'),
|
|
61
|
+
onClick: handleDocuments,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'edition',
|
|
39
65
|
iconName: ToolsUtils.getIcon(document.defaultTool),
|
|
40
66
|
title: t('label.edition.title'),
|
|
41
67
|
description: t('label.edition.description'),
|
|
@@ -43,35 +69,53 @@ export default function Actions({ document, setOpenFile, setFilter, handleClickD
|
|
|
43
69
|
buttonClassName: document.defaultTool === 'DESIGN' ? 'action-design' : undefined,
|
|
44
70
|
},
|
|
45
71
|
{
|
|
72
|
+
id: 'syntactic',
|
|
46
73
|
iconName: 'graph_4',
|
|
47
74
|
title: t('label.syntactic.title'),
|
|
48
75
|
description: t('label.syntactic.description'),
|
|
49
76
|
onClick: handleReview,
|
|
50
77
|
},
|
|
51
78
|
{
|
|
79
|
+
id: 'resume',
|
|
52
80
|
iconName: 'play_arrow',
|
|
53
81
|
title: t('label.resume.title'),
|
|
54
82
|
description: t('label.resume.description'),
|
|
55
83
|
onClick: handleResume,
|
|
56
84
|
},
|
|
57
85
|
{
|
|
86
|
+
id: 'transcription',
|
|
87
|
+
iconName: 'checkbook',
|
|
88
|
+
title: t('label.transcription.title'),
|
|
89
|
+
description: t('label.transcription.description', {
|
|
90
|
+
pageNumber: pageOrder,
|
|
91
|
+
}),
|
|
92
|
+
onClick: handleTranscription,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'automatic',
|
|
58
96
|
iconName: 'settings_timelapse',
|
|
59
97
|
title: t('label.automatic.title'),
|
|
60
98
|
description: t('label.automatic.description'),
|
|
61
99
|
onClick: () => setOpenAutomatic(true),
|
|
62
100
|
},
|
|
63
101
|
{
|
|
102
|
+
id: 'sync',
|
|
64
103
|
iconName: 'sync',
|
|
65
104
|
title: t('label.sync.title'),
|
|
66
105
|
description: t('label.sync.description'),
|
|
67
106
|
onClick: handleSyncSearch,
|
|
68
107
|
},
|
|
69
108
|
{
|
|
109
|
+
id: 'remove',
|
|
70
110
|
iconName: 'delete',
|
|
71
111
|
title: t('actions.label.remove'),
|
|
72
112
|
description: t('actions.label.remove.description'),
|
|
73
113
|
onClick: () => setOpenRemove(true),
|
|
74
114
|
},
|
|
75
115
|
];
|
|
76
|
-
|
|
116
|
+
const visibleActions = actionOptions.filter((action) => !hidden.has(action.id));
|
|
117
|
+
return (_jsxs("div", { className: "file-actions-container", children: [_jsx("div", { className: "header", children: _jsx("div", { className: "title", children: t('actions.label.title') }) }), _jsxs("div", { className: "body", children: [visibleActions.map(({ id, iconName, title, description, onClick, buttonClassName }) => (_jsxs("div", { className: "action-line", onClick: onClick, children: [_jsx("div", { className: `action-button${buttonClassName ? ` ${buttonClassName}` : ''}`, children: _jsx(Icon, { name: iconName, size: "medium" }) }), _jsxs("div", { className: "action-desc", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { children: description })] })] }, id))), !hidden.has('inconsistency') && (_jsx(InconsistencyActions, { document: document }))] }), openRemove && (_jsx(DocumentRemove, { document: document, setFilter: setFilter, onClose: () => setOpenRemove(false), useGrid: useGrid, setOpenFile: setOpenFile })), openAutomatic && (_jsx(AutomaticParser, { document: document, onClose: () => setOpenAutomatic(false) })), openRemoveSentences && pageUid && (_jsx(PageRemoveSentences, { pageUid: pageUid, onClose: () => setOpenRemoveSentences(false), onSuccess: () => {
|
|
118
|
+
onPageReload?.();
|
|
119
|
+
setOpenFile(false);
|
|
120
|
+
} }))] }));
|
|
77
121
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import PageService from '../services/PageService';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { AppModalConfirm, useMessageUtils } from '../deps';
|
|
5
|
+
export default function PageRemoveSentences({ pageUid, onClose, onSuccess, }) {
|
|
6
|
+
const { t } = useTranslation('actions');
|
|
7
|
+
const { dispatchError, dispatchLoading } = useMessageUtils();
|
|
8
|
+
const handleRemoveSentences = () => {
|
|
9
|
+
dispatchLoading(true);
|
|
10
|
+
PageService.removeSentences(pageUid)
|
|
11
|
+
.then(() => {
|
|
12
|
+
onSuccess?.();
|
|
13
|
+
onClose();
|
|
14
|
+
})
|
|
15
|
+
.catch((err) => {
|
|
16
|
+
dispatchError({ err, t });
|
|
17
|
+
})
|
|
18
|
+
.finally(() => {
|
|
19
|
+
dispatchLoading(false);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return (_jsx(AppModalConfirm, { title: t('label.transcription.title'), subtitle: t('modal.description.sentences.remove'), onClose: onClose, onConfirm: handleRemoveSentences }));
|
|
23
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CatalogSearchFilter from './types/CatalogSearchFilter';
|
|
2
2
|
import Category from './types/Category';
|
|
3
|
+
import type { DocumentDrawerActionId } from './types/DocumentDrawerActionId';
|
|
3
4
|
import { Document } from './deps';
|
|
4
5
|
import './style.scss';
|
|
5
6
|
export type DocumentDrawerProps = {
|
|
@@ -10,5 +11,9 @@ export type DocumentDrawerProps = {
|
|
|
10
11
|
handleClickDocument: (uid: string) => void;
|
|
11
12
|
useGrid: boolean;
|
|
12
13
|
categoriesHierarchy: Category[];
|
|
14
|
+
pageUid?: string;
|
|
15
|
+
pageOrder?: number;
|
|
16
|
+
onPageReload?: () => void;
|
|
17
|
+
hiddenActions?: DocumentDrawerActionId[];
|
|
13
18
|
};
|
|
14
|
-
export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChange, handleClickDocument, useGrid, categoriesHierarchy, }: DocumentDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChange, handleClickDocument, useGrid, categoriesHierarchy, pageUid, pageOrder, onPageReload, hiddenActions, }: DocumentDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -15,7 +15,7 @@ import Info from './Info';
|
|
|
15
15
|
import Boxes from './Pages/Boxes';
|
|
16
16
|
import Pages from './Pages/Pages';
|
|
17
17
|
import './style.scss';
|
|
18
|
-
export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChange, handleClickDocument, useGrid, categoriesHierarchy, }) {
|
|
18
|
+
export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChange, handleClickDocument, useGrid, categoriesHierarchy, pageUid, pageOrder, onPageReload, hiddenActions, }) {
|
|
19
19
|
const { t } = useTranslation('document');
|
|
20
20
|
const { getCorpus, hasParameter } = useCorpusUtils();
|
|
21
21
|
const [document, setDocument] = useState();
|
|
@@ -60,19 +60,19 @@ export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChan
|
|
|
60
60
|
} })), activeKey === 'metadata' && (_jsx(DocumentMetadata, { document: document, onDocumentChange: (updated) => {
|
|
61
61
|
handleChange(updated);
|
|
62
62
|
setDocument(updated);
|
|
63
|
-
} })), activeKey === 'lexicon' && _jsx(DocumentLexicon, { document: document }), activeKey === 'export' && _jsx(DocumentExport, { doc: document }), activeKey === 'actions' && (_jsx(Actions, { document: document, setOpenFile: setOpenFile, setFilter: setFilter, handleClickDocument: handleClickDocument, useGrid: useGrid })), activeKey === 'pages' && renderPages(), activeKey === 'gallery' && (_jsx(ImageGallery, { document: document, setDocument: setDocument, handleChange: handleChange })), activeKey === 'participants' && (_jsx(Participants, { document: document.uid, participants: document.participants || [], onChange: (r) => setDocument({ ...document, participants: r }), useChat: hasParameter(getCorpus(), 'useParticipantChat') })), activeKey === 'github' && (_jsx(Github, { document: document, setOpenFile: setOpenFile }))] })] }) }));
|
|
63
|
+
} })), activeKey === 'lexicon' && _jsx(DocumentLexicon, { document: document }), activeKey === 'export' && _jsx(DocumentExport, { doc: document }), activeKey === 'actions' && (_jsx(Actions, { document: document, setOpenFile: setOpenFile, setFilter: setFilter, handleClickDocument: handleClickDocument, useGrid: useGrid, pageUid: pageUid, pageOrder: pageOrder, onPageReload: onPageReload, hiddenActions: hiddenActions })), activeKey === 'pages' && renderPages(), activeKey === 'gallery' && (_jsx(ImageGallery, { document: document, setDocument: setDocument, handleChange: handleChange })), activeKey === 'participants' && (_jsx(Participants, { document: document.uid, participants: document.participants || [], onChange: (r) => setDocument({ ...document, participants: r }), useChat: hasParameter(getCorpus(), 'useParticipantChat') })), activeKey === 'github' && (_jsx(Github, { document: document, setOpenFile: setOpenFile }))] })] }) }));
|
|
64
64
|
}
|
|
65
65
|
const baseFileItems = [
|
|
66
|
-
{
|
|
67
|
-
eventKey: 'home',
|
|
68
|
-
icon: 'home',
|
|
69
|
-
title: 'menu.label.home',
|
|
70
|
-
},
|
|
71
66
|
{
|
|
72
67
|
eventKey: 'actions',
|
|
73
68
|
icon: 'manufacturing',
|
|
74
69
|
title: 'menu.label.actions',
|
|
75
70
|
},
|
|
71
|
+
{
|
|
72
|
+
eventKey: 'home',
|
|
73
|
+
icon: 'home',
|
|
74
|
+
title: 'menu.label.home',
|
|
75
|
+
},
|
|
76
76
|
{
|
|
77
77
|
eventKey: 'pages',
|
|
78
78
|
icon: 'article',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import InconsistencyResponse from './InconsistencyResponse';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
type Props = {
|
|
4
|
+
data: InconsistencyResponse;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
};
|
|
7
|
+
export default function Inconsistency({ data, onClose }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { AppModal } from '../deps';
|
|
5
|
+
import { inconsistencies, } from './InconsistencyResponse';
|
|
6
|
+
import './style.scss';
|
|
7
|
+
export default function Inconsistency({ data, onClose }) {
|
|
8
|
+
const { t } = useTranslation('inconsistency');
|
|
9
|
+
const [pages, setPages] = useState([]);
|
|
10
|
+
const getTotal = (key) => {
|
|
11
|
+
const arr = data[key];
|
|
12
|
+
return !arr ? (_jsx("span", { children: "0" })) : (_jsx("span", { className: "pointer", onClick: () => setPages(pages.length > 0 ? [] : arr.pages), children: arr.total }));
|
|
13
|
+
};
|
|
14
|
+
const openPage = (uid) => {
|
|
15
|
+
window.open(`${import.meta.env.VITE_APP_CATALOG_URL}/${uid}`);
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs(AppModal, { title: t('modal.inconsistency.title'), className: "modal-inconsistency", hideFooter: true, close: onClose, children: [_jsx("p", { children: t('modal.inconsistency.description') }), _jsxs("table", { className: "inconsistency-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: t('table.header.type') }), _jsx("th", { children: t('table.header.words') }), _jsx("th", { children: t('table.header.severity') }), _jsx("th", { children: t('table.header.action') })] }) }), _jsx("tbody", { children: inconsistencies.map((item, idx) => (_jsxs("tr", { children: [_jsx("td", { children: t(`type.label.${item.key}`) }), _jsx("td", { children: getTotal(item.key) }), _jsx("td", { children: t(`severity.label.${item.severity}`) }), _jsx("td", { children: t(`action.label.${item.auto}`) })] }, idx.valueOf()))) })] }), _jsx("div", { className: "inconsistency-warning", children: t('modal.inconsistency.warning') }), pages.length > 0 && (_jsx("div", { className: "links", children: pages.map((page) => (_jsxs("span", { onClick: () => openPage(page), children: [t('action.label.page'), page] }, page))) }))] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useCorpusUtils } from '../deps';
|
|
5
|
+
import { Icon } from 'tycho-storybook';
|
|
6
|
+
import Inconsistency from './Inconsistency';
|
|
7
|
+
import InconsistencyService from './InconsistencyService';
|
|
8
|
+
import './style.scss';
|
|
9
|
+
export default function InconsistencyActions({ document }) {
|
|
10
|
+
const { t } = useTranslation('inconsistency');
|
|
11
|
+
const { getCorpus, hasParameter } = useCorpusUtils();
|
|
12
|
+
const [openInconsistency, setOpenInconsistency] = useState(false);
|
|
13
|
+
const [loading, setLoading] = useState(true);
|
|
14
|
+
const [inconsistentData, setInconsistentData] = useState();
|
|
15
|
+
const hasInconsistencies = (data) => {
|
|
16
|
+
return Object.keys(data).some((d) => {
|
|
17
|
+
const arr = data[d];
|
|
18
|
+
const val = arr?.total;
|
|
19
|
+
return val !== 0;
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const checkInconsistency = () => {
|
|
23
|
+
setLoading(true);
|
|
24
|
+
if (hasParameter(getCorpus(), 'useEditionTiers')) {
|
|
25
|
+
InconsistencyService.verifyForDocument(document.uid)
|
|
26
|
+
.then((r) => {
|
|
27
|
+
if (hasInconsistencies(r.data)) {
|
|
28
|
+
setInconsistentData(r.data);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
setInconsistentData(undefined);
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
.finally(() => {
|
|
35
|
+
setLoading(false);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
setInconsistentData(undefined);
|
|
40
|
+
setLoading(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
checkInconsistency();
|
|
45
|
+
}, [document.uid]);
|
|
46
|
+
const actionOption = useMemo(() => {
|
|
47
|
+
if (loading) {
|
|
48
|
+
return {
|
|
49
|
+
iconName: 'progress_activity',
|
|
50
|
+
iconClassName: 'spin',
|
|
51
|
+
title: t('label.checking'),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (inconsistentData) {
|
|
55
|
+
return {
|
|
56
|
+
iconName: 'warning',
|
|
57
|
+
title: t('actions.label.inconsistency'),
|
|
58
|
+
description: t('actions.label.inconsistency.description'),
|
|
59
|
+
onClick: () => setOpenInconsistency(true),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
iconName: 'check_circle',
|
|
64
|
+
title: t('label.consistent'),
|
|
65
|
+
};
|
|
66
|
+
}, [loading, inconsistentData, t]);
|
|
67
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "action-line", onClick: actionOption.onClick, role: actionOption.onClick ? 'button' : undefined, children: [_jsx("div", { className: "action-button", children: _jsx(Icon, { name: actionOption.iconName, size: "medium", className: actionOption.iconClassName }) }), _jsxs("div", { className: "action-desc", children: [_jsx("span", { className: "title", children: actionOption.title }), actionOption.description && _jsx("span", { children: actionOption.description })] })] }), openInconsistency && inconsistentData && (_jsx(Inconsistency, { data: inconsistentData, onClose: () => setOpenInconsistency(false) }))] }));
|
|
68
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Struct } from '../../../configs/types/Struct';
|
|
2
|
+
export type InconsistencyInfo = {
|
|
3
|
+
key: keyof InconsistencyPageResponse;
|
|
4
|
+
severity: string;
|
|
5
|
+
auto: boolean;
|
|
6
|
+
link?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const inconsistencies: InconsistencyInfo[];
|
|
9
|
+
type InconsistencyResult = {
|
|
10
|
+
total: number;
|
|
11
|
+
pages: string[];
|
|
12
|
+
};
|
|
13
|
+
type InconsistencyResponse = {
|
|
14
|
+
attributes?: InconsistencyResult;
|
|
15
|
+
junction?: InconsistencyResult;
|
|
16
|
+
segmentation?: InconsistencyResult;
|
|
17
|
+
splitters?: InconsistencyResult;
|
|
18
|
+
editions?: InconsistencyResult;
|
|
19
|
+
};
|
|
20
|
+
export type InconsistencyPageResponse = {
|
|
21
|
+
attributes?: number;
|
|
22
|
+
junction?: Struct[];
|
|
23
|
+
segmentation?: Struct[];
|
|
24
|
+
splitters?: number;
|
|
25
|
+
editions?: number;
|
|
26
|
+
};
|
|
27
|
+
export default InconsistencyResponse;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const inconsistencies = [
|
|
2
|
+
{
|
|
3
|
+
key: 'editions',
|
|
4
|
+
severity: 'low',
|
|
5
|
+
auto: true,
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
key: 'attributes',
|
|
9
|
+
severity: 'low',
|
|
10
|
+
auto: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'junction',
|
|
14
|
+
severity: 'high',
|
|
15
|
+
auto: false,
|
|
16
|
+
link: true,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: 'segmentation',
|
|
20
|
+
severity: 'high',
|
|
21
|
+
auto: false,
|
|
22
|
+
link: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'splitters',
|
|
26
|
+
severity: 'medium',
|
|
27
|
+
auto: true,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import InconsistencyResponse from './InconsistencyResponse';
|
|
2
|
+
declare function verifyForDocument(uid: string): Promise<import("axios").AxiosResponse<InconsistencyResponse, any, {}>>;
|
|
3
|
+
declare const InconsistencyService: {
|
|
4
|
+
verifyForDocument: typeof verifyForDocument;
|
|
5
|
+
};
|
|
6
|
+
export default InconsistencyService;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import api from '../../../configs/api';
|
|
2
|
+
function verifyForDocument(uid) {
|
|
3
|
+
return api.get(`${import.meta.env.VITE_APP_FUNCTIONS_API}/inconsistency/document/${uid}`);
|
|
4
|
+
}
|
|
5
|
+
const InconsistencyService = {
|
|
6
|
+
verifyForDocument,
|
|
7
|
+
};
|
|
8
|
+
export default InconsistencyService;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@keyframes inconsistency-spin {
|
|
2
|
+
from {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
transform: rotate(360deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.modal-inconsistency {
|
|
11
|
+
.modal-body {
|
|
12
|
+
max-height: 60vh;
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
|
|
15
|
+
.inconsistency-table {
|
|
16
|
+
width: 100%;
|
|
17
|
+
border-collapse: collapse;
|
|
18
|
+
border: var(--border-default);
|
|
19
|
+
|
|
20
|
+
th,
|
|
21
|
+
td {
|
|
22
|
+
padding: var(--spacing-100) var(--spacing-150);
|
|
23
|
+
border: var(--border-default);
|
|
24
|
+
text-align: left;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
thead th {
|
|
28
|
+
@include label-medium-2;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.inconsistency-warning {
|
|
33
|
+
margin-top: var(--spacing-200);
|
|
34
|
+
padding: var(--spacing-150);
|
|
35
|
+
border: var(--border-default);
|
|
36
|
+
border-radius: var(--border-200);
|
|
37
|
+
background-color: var(--layer-hover-2);
|
|
38
|
+
color: var(--text-error);
|
|
39
|
+
@include body-small-1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.links {
|
|
43
|
+
> span {
|
|
44
|
+
display: block;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
padding: var(--spacing-50);
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background-color: var(--layer-hover-1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.spin {
|
|
57
|
+
animation: inconsistency-spin 1s linear infinite;
|
|
58
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import DocumentDrawer from './DocumentDrawer';
|
|
2
2
|
export default DocumentDrawer;
|
|
3
3
|
export type { DocumentDrawerProps } from './DocumentDrawer';
|
|
4
|
+
export type { DocumentDrawerActionId } from './types/DocumentDrawerActionId';
|
|
5
|
+
export { DOCUMENT_DRAWER_ACTION_IDS, isDocumentDrawerActionId, } from './types/DocumentDrawerActionId';
|
|
4
6
|
export type { default as CatalogSearchFilter } from './types/CatalogSearchFilter';
|
|
5
7
|
export { emptyCatalogSearchFilter, hasActiveCatalogFilter, } from './types/CatalogSearchFilter';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import DocumentDrawer from './DocumentDrawer';
|
|
2
2
|
export default DocumentDrawer;
|
|
3
|
+
export { DOCUMENT_DRAWER_ACTION_IDS, isDocumentDrawerActionId, } from './types/DocumentDrawerActionId';
|
|
3
4
|
export { emptyCatalogSearchFilter, hasActiveCatalogFilter, } from './types/CatalogSearchFilter';
|
|
@@ -18,6 +18,12 @@ export declare const ActionsTexts: {
|
|
|
18
18
|
'label.resume.description': string;
|
|
19
19
|
'label.syntactic.title': string;
|
|
20
20
|
'label.syntactic.description': string;
|
|
21
|
+
'label.documents.title': string;
|
|
22
|
+
'label.documents.description': string;
|
|
23
|
+
'label.transcription.title': string;
|
|
24
|
+
'label.transcription.description': string;
|
|
25
|
+
'modal.description.sentences.remove': string;
|
|
26
|
+
'error.page.required': string;
|
|
21
27
|
'label.edition.title': string;
|
|
22
28
|
'label.edition.description': string;
|
|
23
29
|
'modal.remove.title': string;
|
|
@@ -44,6 +50,12 @@ export declare const ActionsTexts: {
|
|
|
44
50
|
'label.resume.description': string;
|
|
45
51
|
'label.syntactic.title': string;
|
|
46
52
|
'label.syntactic.description': string;
|
|
53
|
+
'label.documents.title': string;
|
|
54
|
+
'label.documents.description': string;
|
|
55
|
+
'label.transcription.title': string;
|
|
56
|
+
'label.transcription.description': string;
|
|
57
|
+
'modal.description.sentences.remove': string;
|
|
58
|
+
'error.page.required': string;
|
|
47
59
|
'label.edition.title': string;
|
|
48
60
|
'label.edition.description': string;
|
|
49
61
|
'modal.title.design': string;
|
|
@@ -68,6 +80,12 @@ export declare const ActionsTexts: {
|
|
|
68
80
|
'label.resume.description': string;
|
|
69
81
|
'label.syntactic.title': string;
|
|
70
82
|
'label.syntactic.description': string;
|
|
83
|
+
'label.documents.title': string;
|
|
84
|
+
'label.documents.description': string;
|
|
85
|
+
'label.transcription.title': string;
|
|
86
|
+
'label.transcription.description': string;
|
|
87
|
+
'modal.description.sentences.remove': string;
|
|
88
|
+
'error.page.required': string;
|
|
71
89
|
'label.edition.title': string;
|
|
72
90
|
'label.edition.description': string;
|
|
73
91
|
'modal.remove.title': string;
|
|
@@ -18,6 +18,12 @@ export const ActionsTexts = {
|
|
|
18
18
|
'label.resume.description': 'Continue from the last reviewed sentence.',
|
|
19
19
|
'label.syntactic.title': 'Review Sentences',
|
|
20
20
|
'label.syntactic.description': 'Review and validate syntactic annotations for sentences.',
|
|
21
|
+
'label.documents.title': 'Back to documents',
|
|
22
|
+
'label.documents.description': 'Return to the list of documents',
|
|
23
|
+
'label.transcription.title': 'Go back to transcription',
|
|
24
|
+
'label.transcription.description': 'Return page {{pageNumber}} to transcription mode. This action applies only to the current page.',
|
|
25
|
+
'modal.description.sentences.remove': 'Are you sure you want to go back to transcription for this page? This will delete all sentences already edited?',
|
|
26
|
+
'error.page.required': 'A current page is required to reset transcription for this page.',
|
|
21
27
|
'label.edition.title': 'Resume editing the document',
|
|
22
28
|
'label.edition.description': 'Continue editing the document content.',
|
|
23
29
|
'modal.remove.title': 'Remove document',
|
|
@@ -44,6 +50,12 @@ export const ActionsTexts = {
|
|
|
44
50
|
'label.resume.description': 'Continue a partir da última sentença revisada.',
|
|
45
51
|
'label.syntactic.title': 'Revisar sentenças',
|
|
46
52
|
'label.syntactic.description': 'Revise e valide as anotações sintáticas das sentenças.',
|
|
53
|
+
'label.documents.title': 'Voltar aos Documentos',
|
|
54
|
+
'label.documents.description': 'Voltar à lista de documentos',
|
|
55
|
+
'label.transcription.title': 'Voltar para a transcrição',
|
|
56
|
+
'label.transcription.description': 'Voltar a página {{pageNumber}} para o modo de transcrição. Esta ação se aplica apenas à página atual.',
|
|
57
|
+
'modal.description.sentences.remove': 'Você tem certeza que deseja voltar para a transcrição para esta página? Isso vai excluir todas as sentenças já editadas?',
|
|
58
|
+
'error.page.required': 'É necessária uma página atual para redefinir a transcrição desta página.',
|
|
47
59
|
'label.edition.title': 'Continuar a edição do documento',
|
|
48
60
|
'label.edition.description': 'Continue editando o conteúdo do documento.',
|
|
49
61
|
'modal.title.design': 'Alterar ferramenta de edição',
|
|
@@ -68,6 +80,12 @@ export const ActionsTexts = {
|
|
|
68
80
|
'label.resume.description': "Continua dall'ultima frase revisionata.",
|
|
69
81
|
'label.syntactic.title': 'Revisiona frasi',
|
|
70
82
|
'label.syntactic.description': 'Revisiona e convalida le annotazioni sintattiche delle frasi.',
|
|
83
|
+
'label.documents.title': 'Torna ai documenti',
|
|
84
|
+
'label.documents.description': 'Ritorna all\'elenco dei documenti',
|
|
85
|
+
'label.transcription.title': 'Torna alla trascrizione',
|
|
86
|
+
'label.transcription.description': 'Ripristina la pagina {{pageNumber}} in modalità trascrizione. Questa azione si applica solo alla pagina corrente.',
|
|
87
|
+
'modal.description.sentences.remove': 'Sei sicuro di voler tornare alla trascrizione per questa pagina? Verranno eliminate tutte le frasi già modificate.',
|
|
88
|
+
'error.page.required': 'È necessaria una pagina corrente per reimpostare la trascrizione di questa pagina.',
|
|
71
89
|
'label.edition.title': 'Riprendi modifica del documento',
|
|
72
90
|
'label.edition.description': 'Continua a modificare il contenuto del documento.',
|
|
73
91
|
'modal.remove.title': 'Rimuovi documento',
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export declare const InconsistencyTexts: {
|
|
2
|
+
en: {
|
|
3
|
+
'modal.inconsistency.title': string;
|
|
4
|
+
'modal.inconsistency.description': string;
|
|
5
|
+
'modal.inconsistency.warning': string;
|
|
6
|
+
'type.label.attributes': string;
|
|
7
|
+
'type.label.junction': string;
|
|
8
|
+
'type.label.segmentation': string;
|
|
9
|
+
'type.label.splitters': string;
|
|
10
|
+
'type.label.editions': string;
|
|
11
|
+
'action.label.automatic': string;
|
|
12
|
+
'action.label.auto': string;
|
|
13
|
+
'action.label.manual': string;
|
|
14
|
+
'severity.label.high': string;
|
|
15
|
+
'severity.label.medium': string;
|
|
16
|
+
'severity.label.low': string;
|
|
17
|
+
'inconsistency.label.details': string;
|
|
18
|
+
'inconsistency.label.sentence': string;
|
|
19
|
+
'inconsistency.label.words': string;
|
|
20
|
+
'table.header.type': string;
|
|
21
|
+
'table.header.words': string;
|
|
22
|
+
'table.header.severity': string;
|
|
23
|
+
'table.header.action': string;
|
|
24
|
+
'actions.label.inconsistency': string;
|
|
25
|
+
'actions.label.inconsistency.description': string;
|
|
26
|
+
'label.checking': string;
|
|
27
|
+
'label.consistent': string;
|
|
28
|
+
'action.label.true': string;
|
|
29
|
+
'action.label.false': string;
|
|
30
|
+
'action.label.page': string;
|
|
31
|
+
'modal.button.automatic': string;
|
|
32
|
+
};
|
|
33
|
+
'pt-BR': {
|
|
34
|
+
'modal.inconsistency.title': string;
|
|
35
|
+
'modal.inconsistency.description': string;
|
|
36
|
+
'modal.inconsistency.warning': string;
|
|
37
|
+
'type.label.attributes': string;
|
|
38
|
+
'type.label.junction': string;
|
|
39
|
+
'type.label.segmentation': string;
|
|
40
|
+
'type.label.splitters': string;
|
|
41
|
+
'type.label.editions': string;
|
|
42
|
+
'action.label.automatic': string;
|
|
43
|
+
'action.label.auto': string;
|
|
44
|
+
'action.label.manual': string;
|
|
45
|
+
'severity.label.high': string;
|
|
46
|
+
'severity.label.medium': string;
|
|
47
|
+
'severity.label.low': string;
|
|
48
|
+
'inconsistency.label.details': string;
|
|
49
|
+
'inconsistency.label.sentence': string;
|
|
50
|
+
'inconsistency.label.words': string;
|
|
51
|
+
'table.header.type': string;
|
|
52
|
+
'table.header.words': string;
|
|
53
|
+
'table.header.severity': string;
|
|
54
|
+
'table.header.action': string;
|
|
55
|
+
'actions.label.inconsistency': string;
|
|
56
|
+
'actions.label.inconsistency.description': string;
|
|
57
|
+
'label.checking': string;
|
|
58
|
+
'label.consistent': string;
|
|
59
|
+
'action.label.true': string;
|
|
60
|
+
'action.label.false': string;
|
|
61
|
+
'action.label.page': string;
|
|
62
|
+
'modal.button.automatic': string;
|
|
63
|
+
};
|
|
64
|
+
it: {
|
|
65
|
+
'modal.inconsistency.title': string;
|
|
66
|
+
'modal.inconsistency.description': string;
|
|
67
|
+
'modal.inconsistency.warning': string;
|
|
68
|
+
'type.label.attributes': string;
|
|
69
|
+
'type.label.junction': string;
|
|
70
|
+
'type.label.segmentation': string;
|
|
71
|
+
'type.label.splitters': string;
|
|
72
|
+
'type.label.editions': string;
|
|
73
|
+
'action.label.automatic': string;
|
|
74
|
+
'action.label.auto': string;
|
|
75
|
+
'action.label.manual': string;
|
|
76
|
+
'severity.label.high': string;
|
|
77
|
+
'severity.label.medium': string;
|
|
78
|
+
'severity.label.low': string;
|
|
79
|
+
'inconsistency.label.details': string;
|
|
80
|
+
'inconsistency.label.sentence': string;
|
|
81
|
+
'inconsistency.label.words': string;
|
|
82
|
+
'table.header.type': string;
|
|
83
|
+
'table.header.words': string;
|
|
84
|
+
'table.header.severity': string;
|
|
85
|
+
'table.header.action': string;
|
|
86
|
+
'actions.label.inconsistency': string;
|
|
87
|
+
'actions.label.inconsistency.description': string;
|
|
88
|
+
'label.checking': string;
|
|
89
|
+
'label.consistent': string;
|
|
90
|
+
'action.label.true': string;
|
|
91
|
+
'action.label.false': string;
|
|
92
|
+
'action.label.page': string;
|
|
93
|
+
'modal.button.automatic': string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export const InconsistencyTexts = {
|
|
2
|
+
en: {
|
|
3
|
+
'modal.inconsistency.title': 'Inconsistency check',
|
|
4
|
+
'modal.inconsistency.description': 'Inconsistencies have been detected in this page, and it is highly recommended that you address them before continuing to work on it. Some inconsistencies may be automatically corrected. Sentences containing junctions and segmentations must be checked individually.',
|
|
5
|
+
'modal.inconsistency.warning': 'To fix the inconsistencies, you need to check the information available at each page in the editor.',
|
|
6
|
+
'type.label.attributes': 'Word attributes',
|
|
7
|
+
'type.label.junction': 'Junctions',
|
|
8
|
+
'type.label.segmentation': 'Segmentations',
|
|
9
|
+
'type.label.splitters': 'Word splitters',
|
|
10
|
+
'type.label.editions': 'Invalid editions',
|
|
11
|
+
'action.label.automatic': 'automatic',
|
|
12
|
+
'action.label.auto': 'automatic',
|
|
13
|
+
'action.label.manual': 'manual',
|
|
14
|
+
'severity.label.high': 'high',
|
|
15
|
+
'severity.label.medium': 'medium',
|
|
16
|
+
'severity.label.low': 'low',
|
|
17
|
+
'inconsistency.label.details': 'Inconsistency details',
|
|
18
|
+
'inconsistency.label.sentence': 'Sentence: ',
|
|
19
|
+
'inconsistency.label.words': 'Words: ',
|
|
20
|
+
'table.header.type': 'Type of inconsistency',
|
|
21
|
+
'table.header.words': 'Words',
|
|
22
|
+
'table.header.severity': 'Severity',
|
|
23
|
+
'table.header.action': 'Action',
|
|
24
|
+
'actions.label.inconsistency': 'Document is inconsistent',
|
|
25
|
+
'actions.label.inconsistency.description': 'Click here to check.',
|
|
26
|
+
'label.checking': 'Checking for inconsistencies',
|
|
27
|
+
'label.consistent': 'Your document has no inconsistencies',
|
|
28
|
+
'action.label.true': 'automatic',
|
|
29
|
+
'action.label.false': 'manual',
|
|
30
|
+
'action.label.page': 'Page: ',
|
|
31
|
+
'modal.button.automatic': 'Execute automatic fixes',
|
|
32
|
+
},
|
|
33
|
+
'pt-BR': {
|
|
34
|
+
'modal.inconsistency.title': 'Verificação de Inconsistência',
|
|
35
|
+
'modal.inconsistency.description': 'Foram detectadas inconsistências nesta página e é altamente recomendável que você as corrija antes de continuar trabalhando nela. Algumas inconsistências podem ser corrigidas automaticamente. Sentenças contendo junções e segmentações devem ser verificadas individualmente.',
|
|
36
|
+
'modal.inconsistency.warning': 'Para corrigir as inconsistências, você precisa verificar as informações disponíveis em cada página no editor.',
|
|
37
|
+
'type.label.attributes': 'Atributos da Palavra',
|
|
38
|
+
'type.label.junction': 'Junções',
|
|
39
|
+
'type.label.segmentation': 'Segmentações',
|
|
40
|
+
'type.label.splitters': 'Splitters',
|
|
41
|
+
'type.label.editions': 'Edições inválidas',
|
|
42
|
+
'action.label.automatic': 'automático',
|
|
43
|
+
'action.label.auto': 'automático',
|
|
44
|
+
'action.label.manual': 'manual',
|
|
45
|
+
'severity.label.high': 'alta',
|
|
46
|
+
'severity.label.medium': 'média',
|
|
47
|
+
'severity.label.low': 'baixa',
|
|
48
|
+
'inconsistency.label.details': 'Detalhes da Inconsistência',
|
|
49
|
+
'inconsistency.label.sentence': 'Sentença: ',
|
|
50
|
+
'inconsistency.label.words': 'Palavras: ',
|
|
51
|
+
'table.header.type': 'Tipo de Inconsistência',
|
|
52
|
+
'table.header.words': 'Palavras',
|
|
53
|
+
'table.header.severity': 'Gravidade',
|
|
54
|
+
'table.header.action': 'Ação',
|
|
55
|
+
'actions.label.inconsistency': 'Este documento possui inconsistências',
|
|
56
|
+
'actions.label.inconsistency.description': 'Clique aqui para verificar.',
|
|
57
|
+
'label.checking': 'Verificando por inconsistências',
|
|
58
|
+
'label.consistent': 'O documento não possui inconsistências',
|
|
59
|
+
'action.label.true': 'automático',
|
|
60
|
+
'action.label.false': 'manual',
|
|
61
|
+
'action.label.page': 'Página: ',
|
|
62
|
+
'modal.button.automatic': 'Executar correções automáticas',
|
|
63
|
+
},
|
|
64
|
+
it: {
|
|
65
|
+
'modal.inconsistency.title': 'Controllo incoerenze',
|
|
66
|
+
'modal.inconsistency.description': 'Sono state rilevate incoerenze in questo documento. Si consiglia di risolverle prima di continuare. Alcune incoerenze possono essere corrette automaticamente. Le frasi con giunzioni e segmentazioni devono essere verificate singolarmente.',
|
|
67
|
+
'modal.inconsistency.warning': 'Per correggere le incoerenze, verificare le informazioni disponibili in ogni pagina nell\'editor.',
|
|
68
|
+
'type.label.attributes': 'Attributi delle parole',
|
|
69
|
+
'type.label.junction': 'Giunzioni',
|
|
70
|
+
'type.label.segmentation': 'Segmentazioni',
|
|
71
|
+
'type.label.splitters': 'Splitter di parole',
|
|
72
|
+
'type.label.editions': 'Edizioni non valide',
|
|
73
|
+
'action.label.automatic': 'automatico',
|
|
74
|
+
'action.label.auto': 'automatico',
|
|
75
|
+
'action.label.manual': 'manuale',
|
|
76
|
+
'severity.label.high': 'alta',
|
|
77
|
+
'severity.label.medium': 'media',
|
|
78
|
+
'severity.label.low': 'bassa',
|
|
79
|
+
'inconsistency.label.details': 'Dettagli incoerenze',
|
|
80
|
+
'inconsistency.label.sentence': 'Frase: ',
|
|
81
|
+
'inconsistency.label.words': 'Parole: ',
|
|
82
|
+
'table.header.type': 'Tipo di incoerenza',
|
|
83
|
+
'table.header.words': 'Parole',
|
|
84
|
+
'table.header.severity': 'Gravità',
|
|
85
|
+
'table.header.action': 'Azione',
|
|
86
|
+
'actions.label.inconsistency': 'Il documento presenta incoerenze',
|
|
87
|
+
'actions.label.inconsistency.description': 'Clicca qui per verificare.',
|
|
88
|
+
'label.checking': 'Verifica incoerenze in corso',
|
|
89
|
+
'label.consistent': 'Il documento non presenta incoerenze',
|
|
90
|
+
'action.label.true': 'automatico',
|
|
91
|
+
'action.label.false': 'manuale',
|
|
92
|
+
'action.label.page': 'Pagina: ',
|
|
93
|
+
'modal.button.automatic': 'Esegui correzioni automatiche',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import api from '../../../configs/api';
|
|
1
|
+
import api, { parserApiBase } from '../../../configs/api';
|
|
2
2
|
function executeAutomaticParsing(uid, request) {
|
|
3
|
-
return api.post(`${
|
|
3
|
+
return api.post(`${parserApiBase}/auto/execute/${uid}`, request);
|
|
4
4
|
}
|
|
5
5
|
function checkParsingStatus(uid) {
|
|
6
|
-
return api.get(`${
|
|
6
|
+
return api.get(`${parserApiBase}/auto/status/${uid}`);
|
|
7
7
|
}
|
|
8
8
|
const AutomaticParserService = { executeAutomaticParsing, checkParsingStatus };
|
|
9
9
|
export default AutomaticParserService;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import api from '../../../configs/api';
|
|
1
|
+
import api, { platformApi } from '../../../configs/api';
|
|
2
2
|
function remove(box) {
|
|
3
|
-
return api.delete(`${
|
|
3
|
+
return api.delete(`${platformApi.editor}/box/${box.uid}`);
|
|
4
4
|
}
|
|
5
5
|
function create(uid, corpus) {
|
|
6
|
-
return api.post(`${
|
|
6
|
+
return api.post(`${platformApi.editor}/box/${uid}/${corpus.uid}`);
|
|
7
7
|
}
|
|
8
8
|
function page(document, index, size) {
|
|
9
9
|
const data = {
|
|
10
10
|
page: index,
|
|
11
11
|
size,
|
|
12
12
|
};
|
|
13
|
-
return api.post(`${
|
|
13
|
+
return api.post(`${platformApi.editor}/box/document/${document.uid}`, data);
|
|
14
14
|
}
|
|
15
15
|
const BoundingBoxService = {
|
|
16
16
|
page,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import Lexicon from '../types/Lexicon';
|
|
2
1
|
import LexiconResponse from '../types/LexiconResponse';
|
|
3
2
|
import { Document } from '../deps';
|
|
4
|
-
|
|
5
|
-
declare function available(): Promise<import("axios").AxiosResponse<Lexicon[], any, {}>>;
|
|
3
|
+
declare function list(document: Document): Promise<import("axios").AxiosResponse<LexiconResponse[], any, {}>>;
|
|
6
4
|
declare const LexiconService: {
|
|
7
5
|
list: typeof list;
|
|
8
|
-
available: typeof available;
|
|
9
6
|
};
|
|
10
7
|
export default LexiconService;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import api from '../../../configs/api';
|
|
2
|
-
|
|
2
|
+
function list(document) {
|
|
3
3
|
return api.get(`/lexicon/document/${document.uid}`);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return api.get(`${import.meta.env.VITE_APP_LEXICON_API}/available/admin`);
|
|
7
|
-
}
|
|
8
|
-
const LexiconService = { list, available };
|
|
5
|
+
const LexiconService = { list };
|
|
9
6
|
export default LexiconService;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import Metadata from '../types/Metadata';
|
|
2
|
-
import {
|
|
2
|
+
import { Document } from '../deps';
|
|
3
3
|
declare function list(document: Document): Promise<import("axios").AxiosResponse<Metadata[], any, {}>>;
|
|
4
4
|
declare function update(uid: string, request: Record<string, string>): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
5
|
-
declare function findBySymbol(corpus: Corpus, symbol: string): Promise<import("axios").AxiosResponse<Metadata, any, {}>>;
|
|
6
|
-
declare function findByCorpus(corpus: string): Promise<import("axios").AxiosResponse<Metadata[], any, {}>>;
|
|
7
5
|
declare function suggestValues(corpus: string, metadataUid: string, q: string): Promise<import("axios").AxiosResponse<string[], any, {}>>;
|
|
8
6
|
declare const MetadataService: {
|
|
9
7
|
list: typeof list;
|
|
10
8
|
update: typeof update;
|
|
11
|
-
findBySymbol: typeof findBySymbol;
|
|
12
|
-
findByCorpus: typeof findByCorpus;
|
|
13
9
|
suggestValues: typeof suggestValues;
|
|
14
10
|
};
|
|
15
11
|
export default MetadataService;
|
|
@@ -5,12 +5,6 @@ function list(document) {
|
|
|
5
5
|
function update(uid, request) {
|
|
6
6
|
return api.patch(`/metadata/${uid}`, request);
|
|
7
7
|
}
|
|
8
|
-
function findBySymbol(corpus, symbol) {
|
|
9
|
-
return api.get(`/metadata/symbol/${corpus.uid}/${symbol}`);
|
|
10
|
-
}
|
|
11
|
-
function findByCorpus(corpus) {
|
|
12
|
-
return api.get(`/metadata/corpus/${corpus}`);
|
|
13
|
-
}
|
|
14
8
|
function suggestValues(corpus, metadataUid, q) {
|
|
15
9
|
return api.get(`/metadata/values/${corpus}/${metadataUid}`, {
|
|
16
10
|
params: { q },
|
|
@@ -19,8 +13,6 @@ function suggestValues(corpus, metadataUid, q) {
|
|
|
19
13
|
const MetadataService = {
|
|
20
14
|
list,
|
|
21
15
|
update,
|
|
22
|
-
findBySymbol,
|
|
23
|
-
findByCorpus,
|
|
24
16
|
suggestValues,
|
|
25
17
|
};
|
|
26
18
|
export default MetadataService;
|
|
@@ -3,9 +3,11 @@ import { AppPage, Document } from '../deps';
|
|
|
3
3
|
declare function page(document: Document, index: number, size: number): Promise<import("axios").AxiosResponse<AppPage<Page>, any, {}>>;
|
|
4
4
|
declare function create(uid: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
5
5
|
declare function remove(thisPage: Page): Promise<import("axios").AxiosResponse<Document, any, {}>>;
|
|
6
|
+
declare function removeSentences(uid: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
6
7
|
declare const PageService: {
|
|
7
8
|
page: typeof page;
|
|
8
9
|
create: typeof create;
|
|
9
10
|
remove: typeof remove;
|
|
11
|
+
removeSentences: typeof removeSentences;
|
|
10
12
|
};
|
|
11
13
|
export default PageService;
|
|
@@ -12,5 +12,8 @@ function create(uid) {
|
|
|
12
12
|
function remove(thisPage) {
|
|
13
13
|
return api.delete(`/page/${thisPage.uid}`);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
function removeSentences(uid) {
|
|
16
|
+
return api.delete(`/page/sentences/${uid}`);
|
|
17
|
+
}
|
|
18
|
+
const PageService = { page, create, remove, removeSentences };
|
|
16
19
|
export default PageService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import api from '../../../configs/api';
|
|
1
|
+
import api, { platformApi } from '../../../configs/api';
|
|
2
2
|
function resume(uid) {
|
|
3
|
-
return api.get(`${
|
|
3
|
+
return api.get(`${platformApi.revision}/sentence/resume/${uid}`);
|
|
4
4
|
}
|
|
5
5
|
const SentenceService = { resume };
|
|
6
6
|
export default SentenceService;
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
display: flex;
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
border-bottom: var(--border-default);
|
|
23
|
-
min-height:
|
|
23
|
+
min-height: 96px;
|
|
24
24
|
|
|
25
25
|
.action-button {
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
align-items: center;
|
|
29
|
-
padding:
|
|
29
|
+
padding: 10px;
|
|
30
30
|
margin: auto 16px;
|
|
31
31
|
border: var(--border-default);
|
|
32
32
|
border-radius: var(--border-200);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DOCUMENT_DRAWER_ACTION_IDS: readonly ["documents", "edition", "syntactic", "resume", "transcription", "automatic", "sync", "remove", "inconsistency"];
|
|
2
|
+
export type DocumentDrawerActionId = (typeof DOCUMENT_DRAWER_ACTION_IDS)[number];
|
|
3
|
+
export declare function isDocumentDrawerActionId(value: string): value is DocumentDrawerActionId;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const DOCUMENT_DRAWER_ACTION_IDS = [
|
|
2
|
+
'documents',
|
|
3
|
+
'edition',
|
|
4
|
+
'syntactic',
|
|
5
|
+
'resume',
|
|
6
|
+
'transcription',
|
|
7
|
+
'automatic',
|
|
8
|
+
'sync',
|
|
9
|
+
'remove',
|
|
10
|
+
'inconsistency',
|
|
11
|
+
];
|
|
12
|
+
export function isDocumentDrawerActionId(value) {
|
|
13
|
+
return DOCUMENT_DRAWER_ACTION_IDS.includes(value);
|
|
14
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import api from '../../configs/api';
|
|
1
|
+
import api, { platformApi } from '../../configs/api';
|
|
2
2
|
function add(uid, request) {
|
|
3
|
-
return api.post(`${
|
|
3
|
+
return api.post(`${platformApi.catalog}/participant/${uid}`, request);
|
|
4
4
|
}
|
|
5
5
|
function update(field) {
|
|
6
|
-
return api.patch(`${
|
|
6
|
+
return api.patch(`${platformApi.catalog}/participant/update`, field);
|
|
7
7
|
}
|
|
8
8
|
function remove(document, code, transfer) {
|
|
9
9
|
const request = {
|
|
10
10
|
code,
|
|
11
11
|
transfer,
|
|
12
12
|
};
|
|
13
|
-
return api.delete(`${
|
|
13
|
+
return api.delete(`${platformApi.catalog}/participant/${document}`, {
|
|
14
|
+
data: request,
|
|
15
|
+
});
|
|
14
16
|
}
|
|
15
17
|
const ParticipantService = { add, update, remove };
|
|
16
18
|
export default ParticipantService;
|
package/dist/features/index.d.ts
CHANGED
|
@@ -24,5 +24,7 @@ export type { SentenceSplitTranslationsInput, SentenceSplitIconButtonProps, } fr
|
|
|
24
24
|
export { SentenceSplitTexts } from './SentenceSplit/localization/SentenceSplitTexts';
|
|
25
25
|
export { default as DocumentDrawer } from './DocumentDrawer';
|
|
26
26
|
export type { DocumentDrawerProps } from './DocumentDrawer';
|
|
27
|
+
export type { DocumentDrawerActionId } from './DocumentDrawer/types/DocumentDrawerActionId';
|
|
28
|
+
export { DOCUMENT_DRAWER_ACTION_IDS, isDocumentDrawerActionId, } from './DocumentDrawer/types/DocumentDrawerActionId';
|
|
27
29
|
export type { default as CatalogSearchFilter } from './DocumentDrawer/types/CatalogSearchFilter';
|
|
28
30
|
export { emptyCatalogSearchFilter, hasActiveCatalogFilter, } from './DocumentDrawer/types/CatalogSearchFilter';
|
package/dist/features/index.js
CHANGED
|
@@ -16,4 +16,5 @@ export { default as SentenceSplitService } from './SentenceSplit/SentenceSplitSe
|
|
|
16
16
|
export { emptySentenceSplitRequest, isSentenceSplitCommentAction, SENTENCE_SPLIT_COMMENT_ACTIONS, } from './SentenceSplit/types/SentenceSplitRequest';
|
|
17
17
|
export { SentenceSplitTexts } from './SentenceSplit/localization/SentenceSplitTexts';
|
|
18
18
|
export { default as DocumentDrawer } from './DocumentDrawer';
|
|
19
|
+
export { DOCUMENT_DRAWER_ACTION_IDS, isDocumentDrawerActionId, } from './DocumentDrawer/types/DocumentDrawerActionId';
|
|
19
20
|
export { emptyCatalogSearchFilter, hasActiveCatalogFilter, } from './DocumentDrawer/types/CatalogSearchFilter';
|
|
@@ -30,7 +30,7 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, use
|
|
|
30
30
|
if (uid) {
|
|
31
31
|
const selectedCorpus = r.data.find((c) => c.uid === uid);
|
|
32
32
|
if (!selectedCorpus) {
|
|
33
|
-
window.location.href =
|
|
33
|
+
window.location.href = import.meta.env.VITE_APP_UNAUTHORIZED_URL;
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
navigateCorpora && navigateCorpora(selectedCorpus.uid);
|