tycho-components 0.28.11 → 0.29.0
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.d.ts +2 -2
- package/dist/configs/Localization.js +21 -39
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.js +1 -0
- package/dist/configs/types/Document.d.ts +3 -3
- package/dist/configs/types/Document.js +4 -4
- package/dist/features/index.d.ts +15 -32
- package/dist/features/index.js +11 -21
- package/package.json +1 -1
- package/dist/features/DocumentDrawer/Actions/Actions.d.ts +0 -17
- package/dist/features/DocumentDrawer/Actions/Actions.js +0 -121
- package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.d.ts +0 -7
- package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.js +0 -23
- package/dist/features/DocumentDrawer/Actions/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Actions/index.js +0 -2
- package/dist/features/DocumentDrawer/Actions/style.scss +0 -0
- package/dist/features/DocumentDrawer/AutomaticParser/AutomaticParser.d.ts +0 -8
- package/dist/features/DocumentDrawer/AutomaticParser/AutomaticParser.js +0 -96
- package/dist/features/DocumentDrawer/AutomaticParser/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/AutomaticParser/index.js +0 -2
- package/dist/features/DocumentDrawer/AutomaticParser/style.scss +0 -10
- package/dist/features/DocumentDrawer/DocumentDrawer.d.ts +0 -19
- package/dist/features/DocumentDrawer/DocumentDrawer.js +0 -102
- package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.d.ts +0 -35
- package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.js +0 -207
- package/dist/features/DocumentDrawer/DocumentEdit/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentEdit/index.js +0 -1
- package/dist/features/DocumentDrawer/DocumentExport/DocumentExport.d.ts +0 -7
- package/dist/features/DocumentDrawer/DocumentExport/DocumentExport.js +0 -83
- package/dist/features/DocumentDrawer/DocumentExport/ExportInvalidSentences.d.ts +0 -7
- package/dist/features/DocumentDrawer/DocumentExport/ExportInvalidSentences.js +0 -12
- package/dist/features/DocumentDrawer/DocumentExport/ExportTxtTierModal.d.ts +0 -8
- package/dist/features/DocumentDrawer/DocumentExport/ExportTxtTierModal.js +0 -14
- package/dist/features/DocumentDrawer/DocumentExport/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentExport/index.js +0 -2
- package/dist/features/DocumentDrawer/DocumentExport/style.scss +0 -49
- package/dist/features/DocumentDrawer/DocumentLexicon/DocumentLexicon.d.ts +0 -7
- package/dist/features/DocumentDrawer/DocumentLexicon/DocumentLexicon.js +0 -22
- package/dist/features/DocumentDrawer/DocumentLexicon/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentLexicon/index.js +0 -2
- package/dist/features/DocumentDrawer/DocumentLexicon/style.scss +0 -38
- package/dist/features/DocumentDrawer/DocumentRemove/DocumentRemove.d.ts +0 -12
- package/dist/features/DocumentDrawer/DocumentRemove/DocumentRemove.js +0 -28
- package/dist/features/DocumentDrawer/DocumentRemove/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentRemove/index.js +0 -2
- package/dist/features/DocumentDrawer/DocumentRemove/style.scss +0 -0
- package/dist/features/DocumentDrawer/Github/Github.d.ts +0 -8
- package/dist/features/DocumentDrawer/Github/Github.js +0 -11
- package/dist/features/DocumentDrawer/Github/GithubCommit.d.ts +0 -8
- package/dist/features/DocumentDrawer/Github/GithubCommit.js +0 -86
- package/dist/features/DocumentDrawer/Github/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Github/index.js +0 -2
- package/dist/features/DocumentDrawer/Github/style.scss +0 -31
- package/dist/features/DocumentDrawer/ImageGallery/GalleryImage.d.ts +0 -8
- package/dist/features/DocumentDrawer/ImageGallery/GalleryImage.js +0 -5
- package/dist/features/DocumentDrawer/ImageGallery/GalleryRemoval.d.ts +0 -9
- package/dist/features/DocumentDrawer/ImageGallery/GalleryRemoval.js +0 -14
- package/dist/features/DocumentDrawer/ImageGallery/ImageGallery.d.ts +0 -9
- package/dist/features/DocumentDrawer/ImageGallery/ImageGallery.js +0 -45
- package/dist/features/DocumentDrawer/ImageGallery/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/ImageGallery/index.js +0 -2
- package/dist/features/DocumentDrawer/ImageGallery/style.scss +0 -41
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.d.ts +0 -8
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.js +0 -18
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.d.ts +0 -7
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.js +0 -77
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.d.ts +0 -31
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.js +0 -39
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.d.ts +0 -6
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.js +0 -8
- package/dist/features/DocumentDrawer/Inconsistency/style.scss +0 -64
- package/dist/features/DocumentDrawer/Info/Info.d.ts +0 -10
- package/dist/features/DocumentDrawer/Info/Info.js +0 -16
- package/dist/features/DocumentDrawer/Info/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Info/index.js +0 -2
- package/dist/features/DocumentDrawer/Info/style.scss +0 -24
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/DocumentMetadata.d.ts +0 -8
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/DocumentMetadata.js +0 -60
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/index.js +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/style.scss +0 -7
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/DocumentMetadataEdit.d.ts +0 -11
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/DocumentMetadataEdit.js +0 -195
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/index.js +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/style.scss +0 -58
- package/dist/features/DocumentDrawer/PageStatusComponent/PageStatusComponent.d.ts +0 -9
- package/dist/features/DocumentDrawer/PageStatusComponent/PageStatusComponent.js +0 -30
- package/dist/features/DocumentDrawer/PageStatusComponent/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/PageStatusComponent/index.js +0 -2
- package/dist/features/DocumentDrawer/PageStatusComponent/style.scss +0 -19
- package/dist/features/DocumentDrawer/Pages/BoxRemoval.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/BoxRemoval.js +0 -14
- package/dist/features/DocumentDrawer/Pages/Boxes.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/Boxes.js +0 -65
- package/dist/features/DocumentDrawer/Pages/PageRemoval.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/PageRemoval.js +0 -15
- package/dist/features/DocumentDrawer/Pages/Pages.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/Pages.js +0 -67
- package/dist/features/DocumentDrawer/Pages/style.scss +0 -48
- package/dist/features/DocumentDrawer/deps.d.ts +0 -28
- package/dist/features/DocumentDrawer/deps.js +0 -20
- package/dist/features/DocumentDrawer/functions/FileUtils.d.ts +0 -4
- package/dist/features/DocumentDrawer/functions/FileUtils.js +0 -8
- package/dist/features/DocumentDrawer/functions/MetadataUtils.d.ts +0 -41
- package/dist/features/DocumentDrawer/functions/MetadataUtils.js +0 -192
- package/dist/features/DocumentDrawer/index.d.ts +0 -7
- package/dist/features/DocumentDrawer/index.js +0 -4
- package/dist/features/DocumentDrawer/localization/ActionsTexts.d.ts +0 -119
- package/dist/features/DocumentDrawer/localization/ActionsTexts.js +0 -119
- package/dist/features/DocumentDrawer/localization/DocumentTexts.d.ts +0 -137
- package/dist/features/DocumentDrawer/localization/DocumentTexts.js +0 -137
- package/dist/features/DocumentDrawer/localization/ExportTexts.d.ts +0 -74
- package/dist/features/DocumentDrawer/localization/ExportTexts.js +0 -74
- package/dist/features/DocumentDrawer/localization/GithubTexts.d.ts +0 -35
- package/dist/features/DocumentDrawer/localization/GithubTexts.js +0 -35
- package/dist/features/DocumentDrawer/localization/InconsistencyTexts.d.ts +0 -101
- package/dist/features/DocumentDrawer/localization/InconsistencyTexts.js +0 -101
- package/dist/features/DocumentDrawer/localization/PageTexts.d.ts +0 -45
- package/dist/features/DocumentDrawer/localization/PageTexts.js +0 -45
- package/dist/features/DocumentDrawer/localization/ParserTexts.d.ts +0 -30
- package/dist/features/DocumentDrawer/localization/ParserTexts.js +0 -30
- package/dist/features/DocumentDrawer/services/AutomaticParserService.d.ts +0 -8
- package/dist/features/DocumentDrawer/services/AutomaticParserService.js +0 -9
- package/dist/features/DocumentDrawer/services/BoundingBoxService.d.ts +0 -11
- package/dist/features/DocumentDrawer/services/BoundingBoxService.js +0 -20
- package/dist/features/DocumentDrawer/services/DocumentService.d.ts +0 -13
- package/dist/features/DocumentDrawer/services/DocumentService.js +0 -20
- package/dist/features/DocumentDrawer/services/ExportService.d.ts +0 -11
- package/dist/features/DocumentDrawer/services/ExportService.js +0 -22
- package/dist/features/DocumentDrawer/services/GithubService.d.ts +0 -8
- package/dist/features/DocumentDrawer/services/GithubService.js +0 -12
- package/dist/features/DocumentDrawer/services/ImageService.d.ts +0 -8
- package/dist/features/DocumentDrawer/services/ImageService.js +0 -12
- package/dist/features/DocumentDrawer/services/LexiconService.d.ts +0 -7
- package/dist/features/DocumentDrawer/services/LexiconService.js +0 -6
- package/dist/features/DocumentDrawer/services/MetadataService.d.ts +0 -11
- package/dist/features/DocumentDrawer/services/MetadataService.js +0 -18
- package/dist/features/DocumentDrawer/services/PageService.d.ts +0 -13
- package/dist/features/DocumentDrawer/services/PageService.js +0 -19
- package/dist/features/DocumentDrawer/services/SentenceService.d.ts +0 -6
- package/dist/features/DocumentDrawer/services/SentenceService.js +0 -6
- package/dist/features/DocumentDrawer/style.scss +0 -192
- package/dist/features/DocumentDrawer/types/BoundingBox.d.ts +0 -8
- package/dist/features/DocumentDrawer/types/BoundingBox.js +0 -1
- package/dist/features/DocumentDrawer/types/CatalogSearchFilter.d.ts +0 -15
- package/dist/features/DocumentDrawer/types/CatalogSearchFilter.js +0 -16
- package/dist/features/DocumentDrawer/types/Category.d.ts +0 -16
- package/dist/features/DocumentDrawer/types/Category.js +0 -5
- package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.d.ts +0 -3
- package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.js +0 -14
- package/dist/features/DocumentDrawer/types/DocumentStatus.d.ts +0 -7
- package/dist/features/DocumentDrawer/types/DocumentStatus.js +0 -6
- package/dist/features/DocumentDrawer/types/DocumentUpdateRequest.d.ts +0 -13
- package/dist/features/DocumentDrawer/types/DocumentUpdateRequest.js +0 -1
- package/dist/features/DocumentDrawer/types/Export.d.ts +0 -30
- package/dist/features/DocumentDrawer/types/Export.js +0 -46
- package/dist/features/DocumentDrawer/types/Lexicon.d.ts +0 -6
- package/dist/features/DocumentDrawer/types/Lexicon.js +0 -1
- package/dist/features/DocumentDrawer/types/LexiconResponse.d.ts +0 -6
- package/dist/features/DocumentDrawer/types/LexiconResponse.js +0 -1
- package/dist/features/DocumentDrawer/types/Metadata.d.ts +0 -22
- package/dist/features/DocumentDrawer/types/Metadata.js +0 -8
- package/dist/features/DocumentDrawer/types/Page.d.ts +0 -10
- package/dist/features/DocumentDrawer/types/Page.js +0 -1
- package/dist/features/DocumentDrawer/types/PageStatus.d.ts +0 -9
- package/dist/features/DocumentDrawer/types/PageStatus.js +0 -8
- package/dist/features/DocumentDrawer/types/Parser.d.ts +0 -18
- package/dist/features/DocumentDrawer/types/Parser.js +0 -21
- package/dist/features/DocumentDrawer/types/Query.d.ts +0 -6
- package/dist/features/DocumentDrawer/types/Query.js +0 -1
- package/dist/features/DocumentDrawer/types/Sentence.d.ts +0 -4
- package/dist/features/DocumentDrawer/types/Sentence.js +0 -1
- package/dist/features/Participants/ParticipantCreate/ParticipantCreate.d.ts +0 -8
- package/dist/features/Participants/ParticipantCreate/ParticipantCreate.js +0 -44
- package/dist/features/Participants/ParticipantCreate/index.d.ts +0 -2
- package/dist/features/Participants/ParticipantCreate/index.js +0 -2
- package/dist/features/Participants/ParticipantRemove/ParticipantRemove.d.ts +0 -11
- package/dist/features/Participants/ParticipantRemove/ParticipantRemove.js +0 -39
- package/dist/features/Participants/ParticipantRemove/index.d.ts +0 -2
- package/dist/features/Participants/ParticipantRemove/index.js +0 -2
- package/dist/features/Participants/ParticipantRemove/style.scss +0 -15
- package/dist/features/Participants/ParticipantService.d.ts +0 -10
- package/dist/features/Participants/ParticipantService.js +0 -19
- package/dist/features/Participants/Participants.d.ts +0 -10
- package/dist/features/Participants/Participants.js +0 -134
- package/dist/features/Participants/index.d.ts +0 -2
- package/dist/features/Participants/index.js +0 -2
- package/dist/features/Participants/style.scss +0 -51
- package/dist/features/SentenceSplit/SentenceSplit.d.ts +0 -33
- package/dist/features/SentenceSplit/SentenceSplit.js +0 -191
- package/dist/features/SentenceSplit/SentenceSplitAudio/SentenceSplitAudioStep.d.ts +0 -9
- package/dist/features/SentenceSplit/SentenceSplitAudio/SentenceSplitAudioStep.js +0 -38
- package/dist/features/SentenceSplit/SentenceSplitAudio/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitAudio/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitAudio/style.scss +0 -29
- package/dist/features/SentenceSplit/SentenceSplitChoose/SentenceSplitChoose.d.ts +0 -10
- package/dist/features/SentenceSplit/SentenceSplitChoose/SentenceSplitChoose.js +0 -23
- package/dist/features/SentenceSplit/SentenceSplitChoose/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitChoose/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitChoose/style.scss +0 -25
- package/dist/features/SentenceSplit/SentenceSplitCommentUtils.d.ts +0 -21
- package/dist/features/SentenceSplit/SentenceSplitCommentUtils.js +0 -77
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentBlock.d.ts +0 -7
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentBlock.js +0 -6
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitComments.d.ts +0 -8
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitComments.js +0 -37
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsStep.d.ts +0 -11
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsStep.js +0 -72
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsWords.d.ts +0 -9
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsWords.js +0 -15
- package/dist/features/SentenceSplit/SentenceSplitComments/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitComments/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitComments/style.scss +0 -126
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreview.d.ts +0 -10
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreview.js +0 -10
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreviewStep.d.ts +0 -11
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreviewStep.js +0 -24
- package/dist/features/SentenceSplit/SentenceSplitPreview/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitPreview/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitPreview/style.scss +0 -24
- package/dist/features/SentenceSplit/SentenceSplitService.d.ts +0 -13
- package/dist/features/SentenceSplit/SentenceSplitService.js +0 -13
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.d.ts +0 -12
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.js +0 -15
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.d.ts +0 -10
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.js +0 -8
- package/dist/features/SentenceSplit/SentenceSplitTranslations/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitTranslations/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitTranslations/style.scss +0 -23
- package/dist/features/SentenceSplit/SentenceSplitUtils.d.ts +0 -6
- package/dist/features/SentenceSplit/SentenceSplitUtils.js +0 -17
- package/dist/features/SentenceSplit/index.d.ts +0 -2
- package/dist/features/SentenceSplit/index.js +0 -2
- package/dist/features/SentenceSplit/localization/SentenceSplitTexts.d.ts +0 -107
- package/dist/features/SentenceSplit/localization/SentenceSplitTexts.js +0 -107
- package/dist/features/SentenceSplit/style.scss +0 -173
- package/dist/features/SentenceSplit/types/Language.d.ts +0 -6
- package/dist/features/SentenceSplit/types/Language.js +0 -1
- package/dist/features/SentenceSplit/types/SentenceSplitRequest.d.ts +0 -20
- package/dist/features/SentenceSplit/types/SentenceSplitRequest.js +0 -16
- /package/dist/{features/Participants → configs}/types/Participant.d.ts +0 -0
- /package/dist/{features/Participants → configs}/types/Participant.js +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { emptyCatalogSearchFilter, } from '../types/CatalogSearchFilter';
|
|
3
|
-
import DocumentService from '../services/DocumentService';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { AppModalConfirm, DateUtils, useMessageUtils } from '../deps';
|
|
6
|
-
import './style.scss';
|
|
7
|
-
export default function DocumentRemove({ document, onClose, useGrid, setFilter, setOpenFile, }) {
|
|
8
|
-
const { t } = useTranslation('actions');
|
|
9
|
-
const { dispatchLoading, isLoading } = useMessageUtils();
|
|
10
|
-
const handleRemove = () => {
|
|
11
|
-
if (isLoading())
|
|
12
|
-
return;
|
|
13
|
-
dispatchLoading(true);
|
|
14
|
-
DocumentService.remove(document.uid)
|
|
15
|
-
.then((r) => {
|
|
16
|
-
setOpenFile(false);
|
|
17
|
-
onClose();
|
|
18
|
-
setFilter({
|
|
19
|
-
...emptyCatalogSearchFilter(useGrid),
|
|
20
|
-
seed: DateUtils.millis(),
|
|
21
|
-
});
|
|
22
|
-
})
|
|
23
|
-
.finally(() => {
|
|
24
|
-
dispatchLoading(false);
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
return (_jsx(AppModalConfirm, { title: t('modal.remove.title'), subtitle: t('message:generic.remove.message'), onClose: onClose, onConfirm: handleRemove }));
|
|
28
|
-
}
|
|
File without changes
|
|
@@ -1,11 +0,0 @@
|
|
|
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 { Icon } from 'tycho-storybook';
|
|
5
|
-
import GithubCommit from './GithubCommit';
|
|
6
|
-
import './style.scss';
|
|
7
|
-
export default function Github({ document, setOpenFile }) {
|
|
8
|
-
const { t } = useTranslation('github');
|
|
9
|
-
const [openCommit, setOpenCommit] = useState(false);
|
|
10
|
-
return (_jsxs("div", { className: "github-actions-container", children: [_jsx("div", { className: "header", children: _jsx("div", { className: "title", children: t('label.title') }) }), _jsx("div", { className: "body", children: _jsxs("div", { className: "action-line", onClick: () => setOpenCommit(true), children: [_jsx("div", { className: "action-button", children: _jsx(Icon, { name: "commit", size: "medium" }) }), _jsxs("div", { className: "action-desc", children: [_jsx("span", { className: "title", children: t('label.commit.title') }), _jsx("span", { children: t('label.commit.description') })] })] }, "commit") }), openCommit && (_jsx(GithubCommit, { document: document, onClose: () => setOpenCommit(false) }))] }));
|
|
11
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import ExportService from '../services/ExportService';
|
|
3
|
-
import GithubService from '../services/GithubService';
|
|
4
|
-
import { useEffect, useState } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { AppModal, useCorpusUtils, useMessageUtils } from '../deps';
|
|
7
|
-
import './style.scss';
|
|
8
|
-
const timingCheck = 5000;
|
|
9
|
-
export default function GithubCommit({ document, onClose }) {
|
|
10
|
-
const { t } = useTranslation('github');
|
|
11
|
-
const { dispatchLoading, dispatchError, dispatchMessage, isLoading } = useMessageUtils();
|
|
12
|
-
const { getCorpus, hasCorpus } = useCorpusUtils();
|
|
13
|
-
const [exportId, setExportId] = useState('');
|
|
14
|
-
const [openPush, setOpenPush] = useState(false);
|
|
15
|
-
let intervalCheck = null;
|
|
16
|
-
const handleExport = () => {
|
|
17
|
-
if (isLoading())
|
|
18
|
-
return;
|
|
19
|
-
dispatchLoading(true);
|
|
20
|
-
ExportService.executeForGithub(document.uid, document.githubFormat)
|
|
21
|
-
.then((r) => {
|
|
22
|
-
setExportId(r.data);
|
|
23
|
-
})
|
|
24
|
-
.catch((err) => {
|
|
25
|
-
console.log(err);
|
|
26
|
-
dispatchError({ err, t });
|
|
27
|
-
dispatchLoading(false);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
const handleCommit = () => {
|
|
31
|
-
if (isLoading() || !hasCorpus())
|
|
32
|
-
return;
|
|
33
|
-
GithubService.commit(getCorpus())
|
|
34
|
-
.then(() => {
|
|
35
|
-
setOpenPush(true);
|
|
36
|
-
})
|
|
37
|
-
.catch((err) => {
|
|
38
|
-
dispatchError({ err, t });
|
|
39
|
-
dispatchLoading(false);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const handlePush = () => {
|
|
43
|
-
if (isLoading() || !hasCorpus())
|
|
44
|
-
return;
|
|
45
|
-
dispatchLoading(true);
|
|
46
|
-
GithubService.push(getCorpus())
|
|
47
|
-
.then(() => {
|
|
48
|
-
dispatchMessage({ key: 'push.success', t });
|
|
49
|
-
onClose();
|
|
50
|
-
setOpenPush(false);
|
|
51
|
-
})
|
|
52
|
-
.catch((err) => {
|
|
53
|
-
dispatchError({ err, t });
|
|
54
|
-
})
|
|
55
|
-
.finally(() => {
|
|
56
|
-
dispatchLoading(false);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const check = () => {
|
|
60
|
-
ExportService.check(exportId)
|
|
61
|
-
.then((r) => {
|
|
62
|
-
if (!r.data)
|
|
63
|
-
return;
|
|
64
|
-
clearInterval(intervalCheck);
|
|
65
|
-
if (r.data.status === 'SUCCESS') {
|
|
66
|
-
handleCommit();
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
dispatchError({ err: r.data.error, t });
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
.catch(() => {
|
|
73
|
-
dispatchError({ err: 'export.process.error', t });
|
|
74
|
-
clearInterval(intervalCheck);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (!exportId)
|
|
79
|
-
return;
|
|
80
|
-
intervalCheck = setInterval(check, timingCheck);
|
|
81
|
-
}, [exportId]);
|
|
82
|
-
return (_jsx(_Fragment, { children: !openPush ? (_jsx(AppModal, { title: t('modal.commit.title'), className: "modal-github", close: onClose, confirm: handleExport, children: _jsxs("div", { className: "body", children: [_jsx("p", { children: t('modal.commit.description') }), _jsxs("div", { className: "line", children: [_jsx("b", { children: t('modal.label.github.file') }), _jsx("span", { children: document.github })] }), _jsxs("div", { className: "line", children: [_jsx("b", { children: t('modal.label.github.format') }), _jsx("span", { children: document.githubFormat })] })] }) })) : (_jsx(AppModal, { title: t('modal.push.title'), className: "modal-github", close: () => {
|
|
83
|
-
setOpenPush(false);
|
|
84
|
-
onClose();
|
|
85
|
-
}, confirm: handlePush, children: _jsx("div", { className: "body", children: _jsx("p", { children: t('modal.push.description') }) }) })) }));
|
|
86
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.github-actions-container {
|
|
2
|
-
.body {
|
|
3
|
-
height: 90vh;
|
|
4
|
-
overflow-y: auto;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.modal-github {
|
|
9
|
-
width: 50vw;
|
|
10
|
-
max-width: 50vw;
|
|
11
|
-
|
|
12
|
-
.modal-body {
|
|
13
|
-
padding: 0px;
|
|
14
|
-
|
|
15
|
-
> .body {
|
|
16
|
-
padding: 16px;
|
|
17
|
-
|
|
18
|
-
> p {
|
|
19
|
-
text-align: center;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
> .line {
|
|
23
|
-
margin-bottom: 4px;
|
|
24
|
-
|
|
25
|
-
> b {
|
|
26
|
-
margin-right: 4px;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Document } from '../deps';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
type Props = {
|
|
4
|
-
document: Document;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
onRemove: () => void;
|
|
7
|
-
};
|
|
8
|
-
export default function GalleryRemoval({ document, onClose, onRemove }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import ImageService from '../services/ImageService';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { AppModalConfirm } from '../deps';
|
|
5
|
-
import './style.scss';
|
|
6
|
-
export default function GalleryRemoval({ document, onClose, onRemove }) {
|
|
7
|
-
const { t } = useTranslation('document');
|
|
8
|
-
const handleRemove = () => {
|
|
9
|
-
ImageService.removeDocument(document.uid).then(() => {
|
|
10
|
-
onRemove();
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
return (_jsx(AppModalConfirm, { title: t('message:generic.remove.title'), subtitle: t('message:generic.remove.message'), onClose: onClose, onConfirm: handleRemove }));
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Document } from '../deps';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
type Props = {
|
|
4
|
-
document: Document;
|
|
5
|
-
setDocument: (d: Document) => void;
|
|
6
|
-
handleChange: (document: Document) => void;
|
|
7
|
-
};
|
|
8
|
-
export default function ImageGallery({ document, setDocument, handleChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import ImageService from '../services/ImageService';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { AppCard, AppDropzone, AppPicture, AppPlaceholder, useCorpusUtils, useMessageUtils, } from '../deps';
|
|
6
|
-
import { Button, IconButton } from 'tycho-storybook';
|
|
7
|
-
import GalleryRemoval from './GalleryRemoval';
|
|
8
|
-
import './style.scss';
|
|
9
|
-
export default function ImageGallery({ document, setDocument, handleChange, }) {
|
|
10
|
-
const { t } = useTranslation('document');
|
|
11
|
-
const { dispatchMessage } = useMessageUtils();
|
|
12
|
-
const { getCorpus, hasCorpus } = useCorpusUtils();
|
|
13
|
-
const [images, setImages] = useState([]);
|
|
14
|
-
const [removal, setRemoval] = useState();
|
|
15
|
-
const [openUpload, setOpenUpload] = useState(false);
|
|
16
|
-
const handleSuccess = (response) => {
|
|
17
|
-
const image = {
|
|
18
|
-
...response,
|
|
19
|
-
type: 'COVER',
|
|
20
|
-
};
|
|
21
|
-
ImageService.updateDocument(document.uid, image).then(() => {
|
|
22
|
-
dispatchMessage({ key: 'update.success', t });
|
|
23
|
-
setDocument({ ...document, picture: response.url });
|
|
24
|
-
setImages((prevState) => [...prevState, image]);
|
|
25
|
-
updateImageAtList(response.url);
|
|
26
|
-
setOpenUpload(false);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const updateImageAtList = (value) => {
|
|
30
|
-
handleChange({ ...document, picture: value });
|
|
31
|
-
};
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (document.picture)
|
|
34
|
-
setImages([{ url: document.picture, type: 'COVER' }]);
|
|
35
|
-
}, [document]);
|
|
36
|
-
return (_jsxs("div", { className: "images-container", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('images.label.title') }), !document.picture && (_jsx(Button, { size: "small", onClick: () => setOpenUpload(true), text: t('images.tooltip.add'), icon: "add", mode: "outlined" }))] }), _jsxs("div", { className: "body", children: [images.map((image, idx) => (_jsx(AppCard, { footer: _jsxs(_Fragment, { children: [_jsx("span", { children: t('images.label.card') }), _jsx(IconButton, { onClick: () => setRemoval(image), title: t('images.tooltip.remove'), name: "delete", mode: "ghost", size: "small" })] }), children: _jsx(AppPicture, { src: image.url }) }, idx.valueOf()))), images.length === 0 && (_jsx(AppPlaceholder, { text: t('placeholder.empty.images') }))] }), openUpload && hasCorpus() && (_jsx(AppDropzone, { folder: `/${getCorpus().uploadDir}/documents`, onSuccess: handleSuccess, onClose: () => setOpenUpload(false), accept: {
|
|
37
|
-
'image/jpeg': [],
|
|
38
|
-
'image/png': [],
|
|
39
|
-
} })), removal && (_jsx(GalleryRemoval, { document: document, onClose: () => setRemoval(undefined), onRemove: () => {
|
|
40
|
-
setDocument({ ...document, picture: '' });
|
|
41
|
-
setImages(images.filter((i) => i.type !== removal.type));
|
|
42
|
-
setRemoval(undefined);
|
|
43
|
-
updateImageAtList('');
|
|
44
|
-
} }))] }));
|
|
45
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
.images-container {
|
|
2
|
-
height: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
|
|
6
|
-
> .body {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-wrap: wrap;
|
|
9
|
-
max-height: 90vh;
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
padding: 16px;
|
|
12
|
-
gap: 16px;
|
|
13
|
-
|
|
14
|
-
> .ds-placeholder {
|
|
15
|
-
margin: 0 auto;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
> .ds-app-card {
|
|
19
|
-
flex: 0 0 calc(50% - 16px);
|
|
20
|
-
|
|
21
|
-
> .body {
|
|
22
|
-
position: relative;
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
align-items: center;
|
|
26
|
-
height: 20vh;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
|
|
29
|
-
img {
|
|
30
|
-
max-height: 20vh;
|
|
31
|
-
max-width: 230px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
> .footer {
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,18 +0,0 @@
|
|
|
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("div", { className: "description", children: t("modal.inconsistency.description") }), _jsxs("table", { className: "table table-striped", 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
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
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 [loadFailed, setLoadFailed] = useState(false);
|
|
15
|
-
const [inconsistentData, setInconsistentData] = useState();
|
|
16
|
-
const hasInconsistencies = (data) => {
|
|
17
|
-
return Object.keys(data).some((d) => {
|
|
18
|
-
const arr = data[d];
|
|
19
|
-
const val = arr?.total;
|
|
20
|
-
return val !== 0;
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
const checkInconsistency = () => {
|
|
24
|
-
setLoading(true);
|
|
25
|
-
setLoadFailed(false);
|
|
26
|
-
if (hasParameter(getCorpus(), 'useEditionTiers')) {
|
|
27
|
-
InconsistencyService.verifyForDocument(document.uid)
|
|
28
|
-
.then((r) => {
|
|
29
|
-
if (hasInconsistencies(r.data)) {
|
|
30
|
-
setInconsistentData(r.data);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
setInconsistentData(undefined);
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
.catch(() => {
|
|
37
|
-
setLoadFailed(true);
|
|
38
|
-
setInconsistentData(undefined);
|
|
39
|
-
})
|
|
40
|
-
.finally(() => {
|
|
41
|
-
setLoading(false);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
setInconsistentData(undefined);
|
|
46
|
-
setLoading(false);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
checkInconsistency();
|
|
51
|
-
}, [document.uid]);
|
|
52
|
-
const actionOption = useMemo(() => {
|
|
53
|
-
if (loading) {
|
|
54
|
-
return {
|
|
55
|
-
iconName: 'progress_activity',
|
|
56
|
-
iconClassName: 'spin',
|
|
57
|
-
title: t('label.checking'),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
if (inconsistentData) {
|
|
61
|
-
return {
|
|
62
|
-
iconName: 'warning',
|
|
63
|
-
title: t('actions.label.inconsistency'),
|
|
64
|
-
description: t('actions.label.inconsistency.description'),
|
|
65
|
-
onClick: () => setOpenInconsistency(true),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
iconName: 'check_circle',
|
|
70
|
-
title: t('label.consistent'),
|
|
71
|
-
};
|
|
72
|
-
}, [loading, inconsistentData, t]);
|
|
73
|
-
if (loadFailed) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
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) }))] }));
|
|
77
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
legacySegmented?: InconsistencyResult;
|
|
18
|
-
duplicateEditions?: InconsistencyResult;
|
|
19
|
-
splitters?: InconsistencyResult;
|
|
20
|
-
editions?: InconsistencyResult;
|
|
21
|
-
};
|
|
22
|
-
export type InconsistencyPageResponse = {
|
|
23
|
-
attributes?: number;
|
|
24
|
-
junction?: Struct[];
|
|
25
|
-
segmentation?: Struct[];
|
|
26
|
-
legacySegmented?: number;
|
|
27
|
-
duplicateEditions?: number;
|
|
28
|
-
splitters?: number;
|
|
29
|
-
editions?: number;
|
|
30
|
-
};
|
|
31
|
-
export default InconsistencyResponse;
|
|
@@ -1,39 +0,0 @@
|
|
|
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: 'legacySegmented',
|
|
26
|
-
severity: 'medium',
|
|
27
|
-
auto: true,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: 'duplicateEditions',
|
|
31
|
-
severity: 'medium',
|
|
32
|
-
auto: true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: 'splitters',
|
|
36
|
-
severity: 'medium',
|
|
37
|
-
auto: true,
|
|
38
|
-
},
|
|
39
|
-
];
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
@keyframes inconsistency-spin {
|
|
2
|
-
from {
|
|
3
|
-
transform: rotate(0deg);
|
|
4
|
-
}
|
|
5
|
-
to {
|
|
6
|
-
transform: rotate(360deg);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.modal-inconsistency {
|
|
11
|
-
.body {
|
|
12
|
-
max-height: 60vh;
|
|
13
|
-
overflow-y: auto;
|
|
14
|
-
|
|
15
|
-
.description {
|
|
16
|
-
margin-bottom: 16px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.table {
|
|
20
|
-
width: 100%;
|
|
21
|
-
border-collapse: collapse;
|
|
22
|
-
|
|
23
|
-
th,
|
|
24
|
-
td {
|
|
25
|
-
padding: 8px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
th:not(:first-child),
|
|
29
|
-
td:not(:first-child) {
|
|
30
|
-
text-align: center;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
> thead {
|
|
34
|
-
@include body-medium-2;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.inconsistency-warning {
|
|
39
|
-
margin-top: var(--spacing-200);
|
|
40
|
-
padding: var(--spacing-150);
|
|
41
|
-
border: var(--border-default);
|
|
42
|
-
border-radius: var(--border-200);
|
|
43
|
-
background-color: var(--layer-hover-2);
|
|
44
|
-
color: var(--text-error);
|
|
45
|
-
@include body-small-1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.links {
|
|
49
|
-
> span {
|
|
50
|
-
display: block;
|
|
51
|
-
cursor: pointer;
|
|
52
|
-
padding: var(--spacing-50);
|
|
53
|
-
|
|
54
|
-
&:hover {
|
|
55
|
-
background-color: var(--layer-hover-1);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.spin {
|
|
63
|
-
animation: inconsistency-spin 1s linear infinite;
|
|
64
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Category from '../types/Category';
|
|
2
|
-
import { Document } from '../deps';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
type Props = {
|
|
5
|
-
document: Document;
|
|
6
|
-
categoriesHierarchy: Category[];
|
|
7
|
-
handleChange: (document: Document) => void;
|
|
8
|
-
};
|
|
9
|
-
export default function Info({ document, categoriesHierarchy, handleChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import DocumentEdit, { getDocumentFields } from '../DocumentEdit/DocumentEdit';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { AppCopyText, AppFormInfo } from '../deps';
|
|
6
|
-
import { Button } from 'tycho-storybook';
|
|
7
|
-
import './style.scss';
|
|
8
|
-
export default function Info({ document, categoriesHierarchy, handleChange, }) {
|
|
9
|
-
const { t } = useTranslation(['document', 'actions']);
|
|
10
|
-
const [editOpen, setEditOpen] = useState(false);
|
|
11
|
-
const categoryName = categoriesHierarchy.find((category) => category.uid === document.category)
|
|
12
|
-
?.name ?? document.category;
|
|
13
|
-
const documentInfoData = { ...document, category: categoryName };
|
|
14
|
-
return (_jsxs("div", { className: "info-container", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('document.label.title') }), _jsx(Button, { size: "small", onClick: () => setEditOpen(true), text: t('document.button.edit'), icon: "edit", mode: "outlined" })] }), _jsx("div", { className: "body", children: _jsx(AppFormInfo, { fields: getDocumentFields(categoriesHierarchy, t).filter((field) => field.attr !== 'category' ||
|
|
15
|
-
(categoriesHierarchy?.length ?? 0) > 0), data: documentInfoData }) }), _jsx("div", { className: "footer", children: _jsx(AppCopyText, { content: document.uid }) }), editOpen && (_jsx(DocumentEdit, { document: document, categoriesHierarchy: categoriesHierarchy, onClose: () => setEditOpen(false), onSave: handleChange }))] }));
|
|
16
|
-
}
|