tycho-components 0.25.8 → 0.25.10
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/features/DocumentDrawer/Inconsistency/Inconsistency.d.ts +2 -2
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.js +7 -7
- package/dist/features/DocumentDrawer/Inconsistency/style.scss +14 -8
- package/dist/features/DocumentDrawer/services/PageService.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from
|
|
3
|
-
import { useTranslation } from
|
|
4
|
-
import { AppModal } from
|
|
5
|
-
import { inconsistencies, } from
|
|
6
|
-
import
|
|
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
7
|
export default function Inconsistency({ data, onClose }) {
|
|
8
|
-
const { t } = useTranslation(
|
|
8
|
+
const { t } = useTranslation("inconsistency");
|
|
9
9
|
const [pages, setPages] = useState([]);
|
|
10
10
|
const getTotal = (key) => {
|
|
11
11
|
const arr = data[key];
|
|
@@ -14,5 +14,5 @@ export default function Inconsistency({ data, onClose }) {
|
|
|
14
14
|
const openPage = (uid) => {
|
|
15
15
|
window.open(`${import.meta.env.VITE_APP_CATALOG_URL}/${uid}`);
|
|
16
16
|
};
|
|
17
|
-
return (_jsxs(AppModal, { title: t(
|
|
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
18
|
}
|
|
@@ -8,24 +8,30 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.modal-inconsistency {
|
|
11
|
-
.
|
|
11
|
+
.body {
|
|
12
12
|
max-height: 60vh;
|
|
13
13
|
overflow-y: auto;
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.description {
|
|
16
|
+
margin-bottom: 16px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.table {
|
|
16
20
|
width: 100%;
|
|
17
21
|
border-collapse: collapse;
|
|
18
|
-
border: var(--border-default);
|
|
19
22
|
|
|
20
23
|
th,
|
|
21
24
|
td {
|
|
22
|
-
padding:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
padding: 8px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
th:not(:first-child),
|
|
29
|
+
td:not(:first-child) {
|
|
30
|
+
text-align: center;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
thead
|
|
28
|
-
@include
|
|
33
|
+
> thead {
|
|
34
|
+
@include body-medium-2;
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
|
|
@@ -7,10 +7,10 @@ function page(document, index, size) {
|
|
|
7
7
|
return api.post(`${platformApi.catalog}/page/document/${document.uid}`, data);
|
|
8
8
|
}
|
|
9
9
|
function create(uid) {
|
|
10
|
-
return api.post(`${platformApi.
|
|
10
|
+
return api.post(`${platformApi.catalog}/page/${uid}`);
|
|
11
11
|
}
|
|
12
12
|
function remove(thisPage) {
|
|
13
|
-
return api.delete(`${platformApi.
|
|
13
|
+
return api.delete(`${platformApi.catalog}/page/${thisPage.uid}`);
|
|
14
14
|
}
|
|
15
15
|
function removeSentences(uid) {
|
|
16
16
|
return api.delete(`${platformApi.editor}/page/sentences/${uid}`);
|