@manuscripts/article-editor 1.4.4 → 1.4.5-LEAN-2705-2
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/README.md +0 -3
- package/dist/cjs/src/EditorApp.js +0 -7
- package/dist/cjs/src/EditorApp.js.map +1 -1
- package/dist/cjs/src/components/projects/Inspector.js +2 -9
- package/dist/cjs/src/components/projects/Inspector.js.map +1 -1
- package/dist/cjs/src/components/projects/ManuscriptPageContainer.js +7 -1
- package/dist/cjs/src/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/cjs/src/config.js +0 -1
- package/dist/cjs/src/config.js.map +1 -1
- package/dist/cjs/src/hooks/use-handle-snapshot.js +5 -0
- package/dist/cjs/src/hooks/use-handle-snapshot.js.map +1 -1
- package/dist/es/src/EditorApp.js +0 -7
- package/dist/es/src/EditorApp.js.map +1 -1
- package/dist/es/src/components/projects/Inspector.js +2 -9
- package/dist/es/src/components/projects/Inspector.js.map +1 -1
- package/dist/es/src/components/projects/ManuscriptPageContainer.js +7 -1
- package/dist/es/src/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/es/src/config.js +0 -1
- package/dist/es/src/config.js.map +1 -1
- package/dist/es/src/hooks/use-handle-snapshot.js +5 -0
- package/dist/es/src/hooks/use-handle-snapshot.js.map +1 -1
- package/dist/types/src/config.d.ts +0 -1
- package/package.json +3 -4
- package/dist/cjs/src/components/requirements/RequirementContainer.js +0 -58
- package/dist/cjs/src/components/requirements/RequirementContainer.js.map +0 -1
- package/dist/cjs/src/components/requirements/RequirementsData.js +0 -129
- package/dist/cjs/src/components/requirements/RequirementsData.js.map +0 -1
- package/dist/cjs/src/components/requirements/RequirementsIcons.js +0 -34
- package/dist/cjs/src/components/requirements/RequirementsIcons.js.map +0 -1
- package/dist/cjs/src/components/requirements/RequirementsInspector.js +0 -150
- package/dist/cjs/src/components/requirements/RequirementsInspector.js.map +0 -1
- package/dist/cjs/src/components/requirements/RequirementsList.js +0 -84
- package/dist/cjs/src/components/requirements/RequirementsList.js.map +0 -1
- package/dist/cjs/src/components/requirements/SectionValidations.js +0 -47
- package/dist/cjs/src/components/requirements/SectionValidations.js.map +0 -1
- package/dist/cjs/src/hooks/use-requirements-validation.js +0 -87
- package/dist/cjs/src/hooks/use-requirements-validation.js.map +0 -1
- package/dist/cjs/stories/data/validationData.js +0 -44
- package/dist/cjs/stories/data/validationData.js.map +0 -1
- package/dist/es/src/components/requirements/RequirementContainer.js +0 -51
- package/dist/es/src/components/requirements/RequirementContainer.js.map +0 -1
- package/dist/es/src/components/requirements/RequirementsData.js +0 -99
- package/dist/es/src/components/requirements/RequirementsData.js.map +0 -1
- package/dist/es/src/components/requirements/RequirementsIcons.js +0 -24
- package/dist/es/src/components/requirements/RequirementsIcons.js.map +0 -1
- package/dist/es/src/components/requirements/RequirementsInspector.js +0 -118
- package/dist/es/src/components/requirements/RequirementsInspector.js.map +0 -1
- package/dist/es/src/components/requirements/RequirementsList.js +0 -54
- package/dist/es/src/components/requirements/RequirementsList.js.map +0 -1
- package/dist/es/src/components/requirements/SectionValidations.js +0 -40
- package/dist/es/src/components/requirements/SectionValidations.js.map +0 -1
- package/dist/es/src/hooks/use-requirements-validation.js +0 -83
- package/dist/es/src/hooks/use-requirements-validation.js.map +0 -1
- package/dist/es/stories/data/validationData.js +0 -41
- package/dist/es/stories/data/validationData.js.map +0 -1
- package/dist/types/src/components/requirements/RequirementContainer.d.ts +0 -19
- package/dist/types/src/components/requirements/RequirementsData.d.ts +0 -21
- package/dist/types/src/components/requirements/RequirementsIcons.d.ts +0 -16
- package/dist/types/src/components/requirements/RequirementsInspector.d.ts +0 -23
- package/dist/types/src/components/requirements/RequirementsList.d.ts +0 -16
- package/dist/types/src/components/requirements/SectionValidations.d.ts +0 -21
- package/dist/types/src/hooks/use-requirements-validation.d.ts +0 -22
- package/dist/types/stories/data/validationData.d.ts +0 -13
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RequirementsData = void 0;
|
|
30
|
-
/*!
|
|
31
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
32
|
-
*
|
|
33
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
34
|
-
*
|
|
35
|
-
* The Original Code is manuscripts-frontend.
|
|
36
|
-
*
|
|
37
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
38
|
-
*
|
|
39
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
40
|
-
*/
|
|
41
|
-
const json_schema_1 = require("@manuscripts/json-schema");
|
|
42
|
-
const requirements_1 = require("@manuscripts/requirements");
|
|
43
|
-
const lodash_es_1 = require("lodash-es");
|
|
44
|
-
const react_1 = __importStar(require("react"));
|
|
45
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
46
|
-
const getDiff = (modelMap, containedModelArray) => {
|
|
47
|
-
const result = new Array();
|
|
48
|
-
containedModelArray.forEach((value) => {
|
|
49
|
-
if (!modelMap.get(value._id)) {
|
|
50
|
-
// Determine added objects
|
|
51
|
-
result.push(value);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
// Determine updated objects
|
|
55
|
-
if (!(0, lodash_es_1.isEqual)(modelMap.get(value._id), value)) {
|
|
56
|
-
result.push(value);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
return result;
|
|
61
|
-
};
|
|
62
|
-
const RequirementsData = ({ node, modelMap, manuscriptID, bulkUpdate }) => {
|
|
63
|
-
const [isShown, setIsShown] = (0, react_1.useState)(false);
|
|
64
|
-
const fixItHandler = (0, react_1.useCallback)(async () => {
|
|
65
|
-
const manuscriptData = new Array();
|
|
66
|
-
modelMap.forEach((value) => {
|
|
67
|
-
manuscriptData.push({
|
|
68
|
-
...value,
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
const result = (0, requirements_1.runManuscriptFixes)(manuscriptData, manuscriptID, [node]);
|
|
72
|
-
const changedItems = getDiff(modelMap, result);
|
|
73
|
-
await bulkUpdate(changedItems);
|
|
74
|
-
}, [modelMap, bulkUpdate, manuscriptID, node]);
|
|
75
|
-
const ignoreItHandler = (0, react_1.useCallback)(async () => {
|
|
76
|
-
modelMap.forEach((model) => {
|
|
77
|
-
if (model.objectType === json_schema_1.ObjectTypes.RequirementsValidation) {
|
|
78
|
-
const validationModel = model;
|
|
79
|
-
validationModel.results.forEach((value) => {
|
|
80
|
-
if (value._id === node._id) {
|
|
81
|
-
value.ignored = true;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
modelMap.set(validationModel._id, validationModel);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}, [modelMap, node]);
|
|
88
|
-
return (react_1.default.createElement(InspectorContainer, null,
|
|
89
|
-
react_1.default.createElement(MessageContainer, { onMouseEnter: () => setIsShown(true), onMouseLeave: () => setIsShown(false) },
|
|
90
|
-
react_1.default.createElement(Message, null,
|
|
91
|
-
" ",
|
|
92
|
-
node.message,
|
|
93
|
-
" "),
|
|
94
|
-
isShown && !node.passed && node.fixable && (react_1.default.createElement(ButtonsList, null,
|
|
95
|
-
react_1.default.createElement(Button, { onClick: fixItHandler }, " Fix it"),
|
|
96
|
-
!node.ignored && (react_1.default.createElement(Button, { onClick: ignoreItHandler }, " Ignore")))))));
|
|
97
|
-
};
|
|
98
|
-
exports.RequirementsData = RequirementsData;
|
|
99
|
-
const InspectorContainer = styled_components_1.default.div `
|
|
100
|
-
display: flex;
|
|
101
|
-
height: 52px;
|
|
102
|
-
`;
|
|
103
|
-
const MessageContainer = styled_components_1.default.div `
|
|
104
|
-
font-family: Lato;
|
|
105
|
-
font-size: 14px;
|
|
106
|
-
color: #353535;
|
|
107
|
-
padding: 4px 0 0 58px;
|
|
108
|
-
`;
|
|
109
|
-
const Message = styled_components_1.default.div `
|
|
110
|
-
display: inline;
|
|
111
|
-
cursor: default;
|
|
112
|
-
`;
|
|
113
|
-
const Button = styled_components_1.default.button `
|
|
114
|
-
font-family: Lato;
|
|
115
|
-
font-size: 14px;
|
|
116
|
-
text-decoration-line: underline;
|
|
117
|
-
color: #0d79d0;
|
|
118
|
-
padding: 0 0 0 9px;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
background: #fff;
|
|
121
|
-
border: none;
|
|
122
|
-
outline: none;
|
|
123
|
-
`;
|
|
124
|
-
const ButtonsList = styled_components_1.default.div `
|
|
125
|
-
float: right;
|
|
126
|
-
padding: 22px 0 0 0;
|
|
127
|
-
cursor: pointer;
|
|
128
|
-
`;
|
|
129
|
-
//# sourceMappingURL=RequirementsData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequirementsData.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsData.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAIiC;AACjC,4DAGkC;AAElC,yCAAmC;AACnC,+CAAoD;AACpD,0EAAsC;AAEtC,MAAM,OAAO,GAAG,CACd,QAA4B,EAC5B,mBAA0C,EACnB,EAAE;IACzB,MAAM,MAAM,GAA0B,IAAI,KAAK,EAAkB,CAAA;IAEjE,mBAAmB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YAC5B,0BAA0B;YAC1B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SACnB;aAAM;YACL,4BAA4B;YAC5B,IAAI,CAAC,IAAA,mBAAO,EAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE;gBAC5C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACnB;SACF;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAEM,MAAM,gBAAgB,GAKxB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AAC,CAAA;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAA;IAEpB,OAAO,CACL,8BAAC,kBAAkB;QACjB,8BAAC,gBAAgB,IACf,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;YAErC,8BAAC,OAAO;;gBAAG,IAAI,CAAC,OAAO;oBAAY;YAElC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,IAAI,CAC1C,8BAAC,WAAW;gBACV,8BAAC,MAAM,IAAC,OAAO,EAAE,YAAY,cAAkB;gBAC9C,CAAC,IAAI,CAAC,OAAO,IAAI,CAChB,8BAAC,MAAM,IAAC,OAAO,EAAE,eAAe,cAAkB,CACnD,CACW,CACf,CACgB,CACA,CACtB,CAAA;AACH,CAAC,CAAA;AA5DY,QAAA,gBAAgB,oBA4D5B;AAED,MAAM,kBAAkB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;CAGpC,CAAA;AACD,MAAM,gBAAgB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;CAKlC,CAAA;AACD,MAAM,OAAO,GAAG,2BAAM,CAAC,GAAG,CAAA;;;CAGzB,CAAA;AACD,MAAM,MAAM,GAAG,2BAAM,CAAC,MAAM,CAAA;;;;;;;;;;CAU3B,CAAA;AACD,MAAM,WAAW,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAI7B,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ValidationPassedIcon = exports.ValidationDangerIcon = exports.ArrowUpIcon = exports.ArrowDownIcon = void 0;
|
|
7
|
-
/*!
|
|
8
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
-
*
|
|
10
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
-
*
|
|
12
|
-
* The Original Code is manuscripts-frontend.
|
|
13
|
-
*
|
|
14
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
-
*
|
|
16
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
-
*/
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const ArrowDownIcon = () => (react_1.default.createElement("svg", { width: "19", height: "19", viewBox: "0 0 19 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
20
|
-
react_1.default.createElement("path", { d: "M18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52944 18.5 0.5 14.4706 0.5 9.5C0.5 4.52944 4.52944 0.5 9.5 0.5C14.4706 0.5 18.5 4.52944 18.5 9.5Z", stroke: "#E2E2E2" }),
|
|
21
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.3437 8.231C12.7604 7.88994 13.3921 7.93134 13.7545 8.32348C14.117 8.71562 14.073 9.31 13.6562 9.65106L9.56451 13L5.35969 9.70134C4.93548 9.36855 4.87828 8.77516 5.23193 8.37598C5.58557 7.97679 6.21615 7.92296 6.64035 8.25575L9.53703 10.5282L12.3437 8.231Z", fill: "#6E6E6E" })));
|
|
22
|
-
exports.ArrowDownIcon = ArrowDownIcon;
|
|
23
|
-
const ArrowUpIcon = () => (react_1.default.createElement("svg", { width: "19", height: "19", viewBox: "0 0 19 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
24
|
-
react_1.default.createElement("path", { d: "M18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52944 18.5 0.5 14.4706 0.5 9.5C0.5 4.52944 4.52944 0.5 9.5 0.5C14.4706 0.5 18.5 4.52944 18.5 9.5Z", stroke: "#E2E2E2" }),
|
|
25
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.65627 11.769C6.23955 12.1101 5.60792 12.0687 5.24548 11.6765C4.88304 11.2844 4.92704 10.69 5.34375 10.3489L9.43549 7L13.6403 10.2987C14.0645 10.6315 14.1217 11.2248 13.7681 11.624C13.4144 12.0232 12.7839 12.077 12.3596 11.7443L9.46297 9.47182L6.65627 11.769Z", fill: "#6E6E6E" })));
|
|
26
|
-
exports.ArrowUpIcon = ArrowUpIcon;
|
|
27
|
-
const ValidationDangerIcon = () => (react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15C4.134 15 1 11.866 1 8C1 4.134 4.13333 1 8 1ZM8 0C12.418 0 16 3.582 16 8C16 12.418 12.418 16 8 16C3.582 16 0 12.418 0 8C0 3.582 3.58133 0 8 0ZM8 10.8C7.82319 10.8 7.65362 10.8702 7.5286 10.9953C7.40357 11.1203 7.33333 11.2899 7.33333 11.4667C7.33333 11.6435 7.40357 11.813 7.5286 11.9381C7.65362 12.0631 7.82319 12.1333 8 12.1333C8.17681 12.1333 8.34638 12.0631 8.47141 11.9381C8.59643 11.813 8.66667 11.6435 8.66667 11.4667C8.66667 11.2899 8.59643 11.1203 8.47141 10.9953C8.34638 10.8702 8.17681 10.8 8 10.8ZM8.01333 4C7.8542 4 7.70159 4.06321 7.58907 4.17574C7.47655 4.28826 7.41333 4.44087 7.41333 4.6V9.4C7.41333 9.55913 7.47655 9.71174 7.58907 9.82426C7.70159 9.93679 7.8542 10 8.01333 10C8.17246 10 8.32508 9.93679 8.4376 9.82426C8.55012 9.71174 8.61333 9.55913 8.61333 9.4V4.6C8.61333 4.44087 8.55012 4.28826 8.4376 4.17574C8.32508 4.06321 8.17246 4 8.01333 4Z", fill: "#F35143" })));
|
|
29
|
-
exports.ValidationDangerIcon = ValidationDangerIcon;
|
|
30
|
-
const ValidationPassedIcon = () => (react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
31
|
-
react_1.default.createElement("path", { d: "M7.99984 0C3.58852 0 0 3.5888 0 8C0 12.4112 3.58852 16 7.99984 16C12.4112 16 16 12.4112 16 8C16 3.5888 12.4112 0 7.99984 0ZM7.99984 14.9508C4.1672 14.9508 1.0492 11.8326 1.0492 8C1.0492 4.16732 4.16716 1.04924 7.99984 1.04924C11.8325 1.04924 14.9507 4.16736 14.9507 8C14.9507 11.8326 11.8325 14.9508 7.99984 14.9508Z", fill: "#36B260" }),
|
|
32
|
-
react_1.default.createElement("path", { d: "M10.8962 5.38104L6.771 9.50608L5.10344 7.83888C4.89852 7.6342 4.56656 7.63408 4.36164 7.839C4.15664 8.044 4.15664 8.376 4.36164 8.58092L6.40016 10.6191C6.5026 10.7214 6.6368 10.7726 6.771 10.7726C6.9052 10.7726 7.03976 10.7214 7.14216 10.619L7.14324 10.6176L11.638 6.12284C11.843 5.91804 11.843 5.5858 11.638 5.381C11.4331 5.17608 11.1009 5.17608 10.8962 5.38104Z", fill: "#36B260" })));
|
|
33
|
-
exports.ValidationPassedIcon = ValidationPassedIcon;
|
|
34
|
-
//# sourceMappingURL=RequirementsIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequirementsIcons.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsIcons.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,kDAAyB;AAElB,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CACjC,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,CAAC,EAAC,kJAAkJ,EACpJ,MAAM,EAAC,SAAS,GAChB;IACF,wCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,qQAAqQ,EACvQ,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AAnBY,QAAA,aAAa,iBAmBzB;AACM,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CAC/B,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,CAAC,EAAC,kJAAkJ,EACpJ,MAAM,EAAC,SAAS,GAChB;IACF,wCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,uQAAuQ,EACzQ,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AAnBY,QAAA,WAAW,eAmBvB;AACM,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CACxC,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,y5BAAy5B,EAC35B,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AAfY,QAAA,oBAAoB,wBAehC;AACM,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CACxC,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,CAAC,EAAC,8TAA8T,EAChU,IAAI,EAAC,SAAS,GACd;IACF,wCACE,CAAC,EAAC,6WAA6W,EAC/W,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AAjBY,QAAA,oBAAoB,wBAiBhC"}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.RequirementsInspectorView = exports.RequirementsInspector = exports.buildQualityCheck = void 0;
|
|
41
|
-
const requirements_1 = require("@manuscripts/requirements");
|
|
42
|
-
const transform_1 = require("@manuscripts/transform");
|
|
43
|
-
const blob_to_buffer_1 = __importDefault(require("blob-to-buffer"));
|
|
44
|
-
const react_1 = __importStar(require("react"));
|
|
45
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
46
|
-
const store_1 = require("../../store");
|
|
47
|
-
const Placeholders_1 = require("../Placeholders");
|
|
48
|
-
const RequirementsList_1 = require("./RequirementsList");
|
|
49
|
-
const buildQualityCheck = async (modelMap, prototypeId, manuscriptID, template, sectionCategories, validationOptions) => {
|
|
50
|
-
if (typeof prototypeId === 'undefined') {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
const getData = async (id) => {
|
|
54
|
-
if (modelMap.has(id)) {
|
|
55
|
-
const model = modelMap.get(id);
|
|
56
|
-
if ((0, transform_1.isFigure)(model)) {
|
|
57
|
-
const modelSrc = model.src;
|
|
58
|
-
const blobData = await fetch(modelSrc).then((res) => res.blob());
|
|
59
|
-
const blobFile = new File([blobData], id, {
|
|
60
|
-
type: blobData.type,
|
|
61
|
-
});
|
|
62
|
-
return fileToBuffer(blobFile);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return undefined;
|
|
66
|
-
};
|
|
67
|
-
const fileToBuffer = (file) => new Promise((resolve, reject) => {
|
|
68
|
-
(0, blob_to_buffer_1.default)(file, (err, buffer) => {
|
|
69
|
-
if (err) {
|
|
70
|
-
reject(err);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
resolve(buffer);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
const validateManuscript = (0, requirements_1.createTemplateValidator)(template, sectionCategories);
|
|
78
|
-
// TODO: remove `as AnyValidationResult[]`
|
|
79
|
-
const results = (await validateManuscript(Array.from(modelMap.values()), manuscriptID, getData, validationOptions));
|
|
80
|
-
return results;
|
|
81
|
-
};
|
|
82
|
-
exports.buildQualityCheck = buildQualityCheck;
|
|
83
|
-
const RequirementsInspector = () => {
|
|
84
|
-
const [{ modelMap, manuscript, manuscriptID, sectionCategories, template }] = (0, store_1.useStore)((store) => ({
|
|
85
|
-
modelMap: store.modelMap,
|
|
86
|
-
manuscript: store.manuscript,
|
|
87
|
-
manuscriptID: store.manuscriptID,
|
|
88
|
-
sectionCategories: store.sectionCategories,
|
|
89
|
-
template: store.template,
|
|
90
|
-
}));
|
|
91
|
-
const prototypeId = manuscript.prototype;
|
|
92
|
-
const [result, setResult] = (0, react_1.useState)([]);
|
|
93
|
-
const [error, setError] = (0, react_1.useState)();
|
|
94
|
-
const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
|
|
95
|
-
(0, react_1.useEffect)(() => {
|
|
96
|
-
setIsBuilding(true);
|
|
97
|
-
(0, exports.buildQualityCheck)(modelMap, prototypeId, manuscriptID, template, sectionCategories)
|
|
98
|
-
.then(setResult)
|
|
99
|
-
.finally(() => {
|
|
100
|
-
setIsBuilding(false);
|
|
101
|
-
})
|
|
102
|
-
.catch(setError);
|
|
103
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
|
-
}, [prototypeId, manuscriptID, JSON.stringify([...modelMap.values()])]);
|
|
105
|
-
return (react_1.default.createElement(exports.RequirementsInspectorView, { prototypeId: prototypeId, result: result, error: error, isBuilding: isBuilding }));
|
|
106
|
-
};
|
|
107
|
-
exports.RequirementsInspector = RequirementsInspector;
|
|
108
|
-
const RequirementsInspectorView = ({ error, result, isBuilding }) => {
|
|
109
|
-
const [prototypeId, dispatch] = (0, store_1.useStore)((store) => store.manuscript?.prototype);
|
|
110
|
-
(0, react_1.useEffect)(() => {
|
|
111
|
-
if (error) {
|
|
112
|
-
dispatch({ requirementError: 'QR_SERVICE_UNAVAILABLE' });
|
|
113
|
-
}
|
|
114
|
-
if (!prototypeId) {
|
|
115
|
-
dispatch({ requirementError: 'QR_PROFILE_NOT_FOUND' });
|
|
116
|
-
}
|
|
117
|
-
dispatch({ requirementError: '' });
|
|
118
|
-
}, [error, prototypeId, dispatch]);
|
|
119
|
-
(0, react_1.useEffect)(() => {
|
|
120
|
-
if (!prototypeId) {
|
|
121
|
-
dispatch({ requirementError: 'QR_PROFILE_NOT_FOUND' });
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
dispatch({ requirementError: '' });
|
|
125
|
-
}
|
|
126
|
-
}, [prototypeId, dispatch]);
|
|
127
|
-
if (isBuilding) {
|
|
128
|
-
return react_1.default.createElement(Placeholders_1.DataLoadingPlaceholder, null);
|
|
129
|
-
}
|
|
130
|
-
if (error) {
|
|
131
|
-
return react_1.default.createElement(ErrorMessage, null,
|
|
132
|
-
" ",
|
|
133
|
-
error?.message);
|
|
134
|
-
}
|
|
135
|
-
if (!prototypeId) {
|
|
136
|
-
return (react_1.default.createElement(AlertMessage, null, "You need to select a template to display the quality report check"));
|
|
137
|
-
}
|
|
138
|
-
if (!result) {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
return react_1.default.createElement(RequirementsList_1.RequirementsList, { validationResult: result });
|
|
142
|
-
};
|
|
143
|
-
exports.RequirementsInspectorView = RequirementsInspectorView;
|
|
144
|
-
const AlertMessage = styled_components_1.default.div `
|
|
145
|
-
margin: 13px 0 9px 17px;
|
|
146
|
-
`;
|
|
147
|
-
const ErrorMessage = styled_components_1.default.div `
|
|
148
|
-
margin: 13px 0 9px 17px;
|
|
149
|
-
`;
|
|
150
|
-
//# sourceMappingURL=RequirementsInspector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequirementsInspector.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsInspector.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOH,4DAIkC;AAClC,sDAAiE;AACjE,oEAAqC;AACrC,+CAAkD;AAClD,0EAAsC;AAGtC,uCAAsC;AACtC,kDAAwD;AACxD,yDAAqD;AAE9C,MAAM,iBAAiB,GAAG,KAAK,EACpC,QAA4B,EAC5B,WAA+B,EAC/B,YAAoB,EACpB,QAAwC,EACxC,iBAAoC,EACpC,iBAAqC,EACL,EAAE;IAClC,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE;QACtC,OAAO,EAAE,CAAA;KACV;IAED,MAAM,OAAO,GAAG,KAAK,EAAE,EAAU,EAA+B,EAAE;QAChE,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YACpB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAU,CAAA;YACvC,IAAI,IAAA,oBAAQ,EAAC,KAAK,CAAC,EAAE;gBACnB,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAa,CAAA;gBACpC,MAAM,QAAQ,GAA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MAAM,YAAY,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAE9B,CAAA;AACD,MAAM,YAAY,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAE9B,CAAA"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.RequirementsList = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
|
-
const store_1 = require("../../store");
|
|
44
|
-
const RequirementContainer_1 = require("./RequirementContainer");
|
|
45
|
-
const RequirementsData_1 = require("./RequirementsData");
|
|
46
|
-
const SectionValidations_1 = require("./SectionValidations");
|
|
47
|
-
const RequirementsList = ({ validationResult }) => {
|
|
48
|
-
const [{ modelMap, manuscriptID, bulkUpdate }] = (0, store_1.useStore)((store) => ({
|
|
49
|
-
modelMap: store.modelMap,
|
|
50
|
-
manuscriptID: store.manuscriptID,
|
|
51
|
-
bulkUpdate: store.bulkUpdate,
|
|
52
|
-
}));
|
|
53
|
-
const sortedData = (0, react_1.useMemo)(() => [...validationResult].sort((a, b) => a.passed === b.passed ? 0 : a ? -1 : 1), [validationResult]);
|
|
54
|
-
const ignoredValidations = sortedData.filter((node) => node.ignored);
|
|
55
|
-
const validationsList = sortedData.filter((node) => !node.ignored);
|
|
56
|
-
const manuscriptValidation = validationsList.filter((node) => node.type && node.type.startsWith('manuscript-'));
|
|
57
|
-
const bibliographyValidation = validationsList.filter((node) => node.type && node.type.startsWith('bibliography-'));
|
|
58
|
-
const figureValidation = validationsList.filter((node) => node.type && node.type.startsWith('figure-'));
|
|
59
|
-
const requiredSectionValidation = validationsList.filter((node) => node.type === 'required-section');
|
|
60
|
-
const sectionOrderValidation = validationsList.filter((node) => node.type === 'section-order');
|
|
61
|
-
const sectionValidation = validationsList.filter((node) => node.type && node.type.startsWith('section-'));
|
|
62
|
-
return (react_1.default.createElement(RequirementList, null,
|
|
63
|
-
manuscriptValidation.length !== 0 && (react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: manuscriptValidation, title: 'Manuscript' },
|
|
64
|
-
react_1.default.createElement(Requirement, null, manuscriptValidation.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
|
|
65
|
-
react_1.default.createElement(SectionValidations_1.SectionValidations, { sortedData: sectionValidation, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate }),
|
|
66
|
-
requiredSectionValidation.length !== 0 && (react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: requiredSectionValidation, title: 'Required Section' },
|
|
67
|
-
react_1.default.createElement(Requirement, null, requiredSectionValidation.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
|
|
68
|
-
bibliographyValidation.length !== 0 && (react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: bibliographyValidation, title: 'Bibliography' },
|
|
69
|
-
react_1.default.createElement(Requirement, null, bibliographyValidation.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
|
|
70
|
-
figureValidation.length !== 0 && (react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: figureValidation, title: 'Figure' },
|
|
71
|
-
react_1.default.createElement(Requirement, null, figureValidation.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
|
|
72
|
-
sectionOrderValidation.length !== 0 && (react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: sectionOrderValidation, title: 'Section Order' },
|
|
73
|
-
react_1.default.createElement(Requirement, null, sectionOrderValidation.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
|
|
74
|
-
ignoredValidations.length !== 0 && (react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: ignoredValidations, title: 'Ignored' },
|
|
75
|
-
react_1.default.createElement(Requirement, null, ignoredValidations.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate }))))))));
|
|
76
|
-
};
|
|
77
|
-
exports.RequirementsList = RequirementsList;
|
|
78
|
-
const RequirementList = styled_components_1.default.div `
|
|
79
|
-
display: block;
|
|
80
|
-
`;
|
|
81
|
-
const Requirement = styled_components_1.default.div `
|
|
82
|
-
padding: 15px 0 0 0;
|
|
83
|
-
`;
|
|
84
|
-
//# sourceMappingURL=RequirementsList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequirementsList.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsList.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,+CAAsC;AACtC,0EAAsC;AAEtC,uCAAsC;AACtC,iEAA6D;AAC7D,yDAAqD;AACrD,6DAAyD;AAElD,MAAM,gBAAgB,GAExB,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC5B,MAAM,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU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/B,OAAO,CAAC,OAAO,IAAI,CACjB,8BAAC,mCAAgB,IACf,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,GACtB,CACH,CACJ,CACW,CACO,CACxB;QACA,kBAAkB,CAAC,MAAM,KAAK,CAAC,IAAI,CAClC,8BAAC,2CAAoB,IAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS;YAChE,8BAAC,WAAW,QACT,kBAAkB,CAAC,GAAG,CACrB,CAAC,OAA4B,EAAE,EAAE,CAC/B,OAAO,CAAC,OAAO,IAAI,CACjB,8BAAC,mCAAgB,IACf,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,GACtB,CACH,CACJ,CACW,CACO,CACxB,CACe,CACnB,CAAA;AACH,CAAC,CAAA;AA5KY,QAAA,gBAAgB,oBA4K5B;AACD,MAAM,eAAe,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAEjC,CAAA;AACD,MAAM,WAAW,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAE7B,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SectionValidations = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const store_1 = require("../../store");
|
|
10
|
-
const RequirementContainer_1 = require("./RequirementContainer");
|
|
11
|
-
const RequirementsData_1 = require("./RequirementsData");
|
|
12
|
-
const SectionValidations = ({ sortedData, modelMap, manuscriptID, bulkUpdate }) => {
|
|
13
|
-
const [sectionCategories] = (0, store_1.useStore)((store) => store.sectionCategories);
|
|
14
|
-
const isSectionValidation = (node) => {
|
|
15
|
-
if (node.type &&
|
|
16
|
-
node.type.startsWith('section-') &&
|
|
17
|
-
!node.type.startsWith('section-order')) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
};
|
|
22
|
-
let sectionValidation = sortedData.filter((node) => isSectionValidation(node) && node.message !== undefined);
|
|
23
|
-
const sectionsData = [];
|
|
24
|
-
while (sectionValidation.length > 0) {
|
|
25
|
-
const category = isSectionValidation(sectionValidation[0]) &&
|
|
26
|
-
sectionValidation[0].data.sectionCategory;
|
|
27
|
-
const sectionValidationId = sectionValidation[0]._id;
|
|
28
|
-
const sections = sectionValidation.filter((node) => isSectionValidation(node) && node.data.sectionCategory === category);
|
|
29
|
-
sectionValidation = sectionValidation.filter((x) => sections.indexOf(x) === -1);
|
|
30
|
-
const categoryData = sectionCategories.map((section) => {
|
|
31
|
-
if (section._id === category) {
|
|
32
|
-
return section.name;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
sectionsData.push(react_1.default.createElement(RequirementContainer_1.RequirementContainer, { result: sections, key: sectionValidationId, title: categoryData },
|
|
36
|
-
react_1.default.createElement(Requirement, null, sections.map((section) => section.message && (react_1.default.createElement(RequirementsData_1.RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate }))))));
|
|
37
|
-
if (sectionValidation.length <= 0) {
|
|
38
|
-
return react_1.default.createElement(react_1.default.Fragment, null, sectionsData);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
};
|
|
43
|
-
exports.SectionValidations = SectionValidations;
|
|
44
|
-
const Requirement = styled_components_1.default.div `
|
|
45
|
-
padding: 15px 0 0 0;
|
|
46
|
-
`;
|
|
47
|
-
//# sourceMappingURL=SectionValidations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionValidations.js","sourceRoot":"","sources":["../../../../../src/components/requirements/SectionValidations.tsx"],"names":[],"mappings":";;;;;;AAqBA,kDAAyB;AACzB,0EAAsC;AAEtC,uCAAsC;AACtC,iEAA6D;AAC7D,yDAAqD;AAE9C,MAAM,kBAAkB,GAK1B,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1D,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;IAExE,MAAM,mBAAmB,GAAG,CAC1B,IAAyB,EAKM,EAAE;QACjC,IACE,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YAChC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EACtC;YACA,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;IAED,IAAI,iBAAiB,GAAG,UAAU,CAAC,MAAM,CACvC,CAAC,IAAyB,EAAE,EAAE,CAC5B,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,CAC1D,CAAA;IAED,MAAM,YAAY,GAAG,EAAE,CAAA;IACvB,OAAO,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;QACnC,MAAM,QAAQ,GACZ,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YACzC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAA;QAC3C,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;QACpD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CACvC,CAAC,IAAyB,EAAE,EAAE,CAC5B,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,KAAK,QAAQ,CACtE,CAAA;QACD,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAC1C,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAClC,CAAA;QACD,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAwB,EAAE,EAAE;YACtE,IAAI,OAAO,CAAC,GAAG,KAAK,QAAQ,EAAE;gBAC5B,OAAO,OAAO,CAAC,IAAI,CAAA;aACpB;QACH,CAAC,CAAC,CAAA;QACF,YAAY,CAAC,IAAI,CACf,8BAAC,2CAAoB,IACnB,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,YAAY;YAEnB,8BAAC,WAAW,QACT,QAAQ,CAAC,GAAG,CACX,CAAC,OAA4B,EAAE,EAAE,CAC/B,OAAO,CAAC,OAAO,IAAI,CACjB,8BAAC,mCAAgB,IACf,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,GACtB,CACH,CACJ,CACW,CACO,CACxB,CAAA;QACD,IAAI,iBAAiB,CAAC,MAAM,IAAI,CAAC,EAAE;YACjC,OAAO,8DAAG,YAAY,CAAI,CAAA;SAC3B;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AA3EY,QAAA,kBAAkB,sBA2E9B;AACD,MAAM,WAAW,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAE7B,CAAA"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.useRequirementsValidation = void 0;
|
|
15
|
-
const react_1 = require("react");
|
|
16
|
-
const RequirementsInspector_1 = require("../components/requirements/RequirementsInspector");
|
|
17
|
-
const store_1 = require("../store");
|
|
18
|
-
const use_idle_prop_effect_1 = require("./use-idle-prop-effect");
|
|
19
|
-
const useRequirementsValidation = ({ state }) => {
|
|
20
|
-
const [{ manuscript, modelMap, template, sectionCategories }] = (0, store_1.useStore)((store) => ({
|
|
21
|
-
manuscript: store.manuscript,
|
|
22
|
-
modelMap: store.modelMap,
|
|
23
|
-
sectionCategories: store.sectionCategories,
|
|
24
|
-
template: store.template,
|
|
25
|
-
}));
|
|
26
|
-
const [error, setError] = (0, react_1.useState)();
|
|
27
|
-
const [result, setResult] = (0, react_1.useState)([]);
|
|
28
|
-
const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
|
|
29
|
-
const prototypeID = manuscript.prototype;
|
|
30
|
-
// TODO: re-enable once the quality report (RequirementsValidation) is saved
|
|
31
|
-
// useEffect(() => {
|
|
32
|
-
// if (isPullComplete) {
|
|
33
|
-
// const subscription = collection
|
|
34
|
-
// .find({
|
|
35
|
-
// manuscriptID: manuscript._id,
|
|
36
|
-
// objectType: ObjectTypes.RequirementsValidation,
|
|
37
|
-
// })
|
|
38
|
-
// .$.subscribe((docs) => {
|
|
39
|
-
// setLoaded(true)
|
|
40
|
-
// if (!docs || !docs.length) {
|
|
41
|
-
// return
|
|
42
|
-
// }
|
|
43
|
-
// const doc = docs[0].toJSON() as RequirementsValidation
|
|
44
|
-
// setDoc(doc)
|
|
45
|
-
// })
|
|
46
|
-
// return () => {
|
|
47
|
-
// subscription.unsubscribe()
|
|
48
|
-
// }
|
|
49
|
-
// }
|
|
50
|
-
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
|
-
// }, [project._id, isPullComplete, manuscript._id])
|
|
52
|
-
(0, use_idle_prop_effect_1.useIdlePropEffect)(() => {
|
|
53
|
-
setIsBuilding(true);
|
|
54
|
-
(0, RequirementsInspector_1.buildQualityCheck)(modelMap, prototypeID, manuscript._id, template, sectionCategories, {
|
|
55
|
-
validateImageFiles: false,
|
|
56
|
-
})
|
|
57
|
-
.then(setResult)
|
|
58
|
-
// Saving the report failed, we need to update the `RequirementsValidation` schema in order to fix the issue.
|
|
59
|
-
// TODO: re-enable once we decide to save the quality report (RequirementsValidation).
|
|
60
|
-
// .then((results) => {
|
|
61
|
-
// // make sure not to create multiple documents
|
|
62
|
-
// if (!loaded) {
|
|
63
|
-
// return
|
|
64
|
-
// }
|
|
65
|
-
// const nextDoc = doc
|
|
66
|
-
// ? {
|
|
67
|
-
// ...doc,
|
|
68
|
-
// results,
|
|
69
|
-
// }
|
|
70
|
-
// : buildValidation(results as RequirementsValidationData[])
|
|
71
|
-
// setError(null)
|
|
72
|
-
// return collection.save(nextDoc, {
|
|
73
|
-
// containerID: project._id,
|
|
74
|
-
// manuscriptID: manuscript._id,
|
|
75
|
-
// })
|
|
76
|
-
// })
|
|
77
|
-
.finally(() => {
|
|
78
|
-
setIsBuilding(false);
|
|
79
|
-
})
|
|
80
|
-
.catch((err) => {
|
|
81
|
-
setError(err);
|
|
82
|
-
});
|
|
83
|
-
}, [state], 1000);
|
|
84
|
-
return { result, error, isBuilding };
|
|
85
|
-
};
|
|
86
|
-
exports.useRequirementsValidation = useRequirementsValidation;
|
|
87
|
-
//# sourceMappingURL=use-requirements-validation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-requirements-validation.js","sourceRoot":"","sources":["../../../../src/hooks/use-requirements-validation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,iCAAgC;AAEhC,4FAAoF;AACpF,oCAAmC;AACnC,iEAA0D;AAMnD,MAAM,yBAAyB,GAAG,CAAC,EAAE,KAAK,EAAQ,EAAE,EAAE;IAC3D,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,GAAG,IAAA,gBAAQ,EACtE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACV,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CACH,CAAA;IAED,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAgB,CAAA;IAClD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAwB,EAAE,CAAC,CAAA;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAA;IAC5D,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAA;IAExC,4EAA4E;IAE5E,oBAAoB;IACpB,0BAA0B;IAC1B,sCAAsC;IACtC,gBAAgB;IAChB,wCAAwC;IACxC,0DAA0D;IAC1D,WAAW;IACX,iCAAiC;IACjC,0BAA0B;IAC1B,uCAAuC;IACvC,mBAAmB;IACnB,YAAY;IAEZ,iEAAiE;IACjE,sBAAsB;IACtB,WAAW;IACX,qBAAqB;IACrB,mCAAmC;IACnC,QAAQ;IACR,MAAM;IACN,4DAA4D;IAC5D,oDAAoD;IAEpD,IAAA,wCAAiB,EACf,GAAG,EAAE;QACH,aAAa,CAAC,IAAI,CAAC,CAAA;QACnB,IAAA,yCAAiB,EACf,QAAQ,EACR,WAAW,EACX,UAAU,CAAC,GAAG,EACd,QAAQ,EACR,iBAAiB,EACjB;YACE,kBAAkB,EAAE,KAAK;SAC1B,CACF;aACE,IAAI,CAAC,SAAS,CAAC;YAChB,6GAA6G;YAC7G,sFAAsF;YAEtF,uBAAuB;YACvB,kDAAkD;YAClD,mBAAmB;YACnB,aAAa;YACb,MAAM;YAEN,wBAAwB;YACxB,UAAU;YACV,kBAAkB;YAClB,mBAAmB;YACnB,UAAU;YACV,iEAAiE;YAEjE,mBAAmB;YACnB,sCAAsC;YACtC,gCAAgC;YAChC,oCAAoC;YACpC,OAAO;YACP,KAAK;aACJ,OAAO,CAAC,GAAG,EAAE;YACZ,aAAa,CAAC,KAAK,CAAC,CAAA;QACtB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,QAAQ,CAAC,GAAG,CAAC,CAAA;QACf,CAAC,CAAC,CAAA;IACN,CAAC,EACD,CAAC,KAAK,CAAC,EACP,IAAI,CACL,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;AACtC,CAAC,CAAA;AAxFY,QAAA,yBAAyB,6BAwFrC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.validationData = void 0;
|
|
15
|
-
exports.validationData = [
|
|
16
|
-
{
|
|
17
|
-
type: 'section-order',
|
|
18
|
-
severity: 0,
|
|
19
|
-
passed: true,
|
|
20
|
-
data: {
|
|
21
|
-
order: [],
|
|
22
|
-
},
|
|
23
|
-
fixable: true,
|
|
24
|
-
objectType: 'MPSectionOrderValidationResult',
|
|
25
|
-
_id: 'MPSectionOrderValidationResult:FCD54873-BAD0-488E-96C8-D1ECA23DD1F4',
|
|
26
|
-
message: 'Sections must be listed in the following order Abstract',
|
|
27
|
-
ignored: false,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: 'section-body-has-content',
|
|
31
|
-
passed: false,
|
|
32
|
-
severity: 0,
|
|
33
|
-
data: {
|
|
34
|
-
id: 'MPSection:6383A9BC-CB0E-4B0E-BB3A-31E0B5143256',
|
|
35
|
-
sectionCategory: 'MPSectionCategory:abstract',
|
|
36
|
-
},
|
|
37
|
-
fixable: true,
|
|
38
|
-
objectType: 'MPSectionBodyValidationResult',
|
|
39
|
-
_id: 'MPSectionBodyValidationResult:2C772412-BA8C-46A4-B0D6-DFDC8BCB793A',
|
|
40
|
-
message: 'Abstract section must contains content',
|
|
41
|
-
ignored: false,
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
//# sourceMappingURL=validationData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validationData.js","sourceRoot":"","sources":["../../../../stories/data/validationData.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIU,QAAA,cAAc,GAA0B;IACnD;QACE,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE;YACJ,KAAK,EAAE,EAAE;SACV;QACD,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,gCAAgC;QAC5C,GAAG,EAAE,qEAAqE;QAC1E,OAAO,EAAE,yDAAyD;QAClE,OAAO,EAAE,KAAK;KACf;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE;YACJ,EAAE,EAAE,gDAAgD;YACpD,eAAe,EAAE,4BAA4B;SAC9C;QACD,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,+BAA+B;QAC3C,GAAG,EAAE,oEAAoE;QACzE,OAAO,EAAE,wCAAwC;QACjD,OAAO,EAAE,KAAK;KACf;CACF,CAAA"}
|