@manuscripts/style-guide 0.30.17 → 0.30.21
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/cjs/components/AffiliationsEditor/AffiliationsEditor.js +3 -3
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +7 -6
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +3 -3
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +10 -40
- package/dist/cjs/components/AffiliationsEditor/styles.js +2 -1
- package/dist/cjs/components/AffiliationsList.js +3 -2
- package/dist/cjs/components/AlertMessage.js +9 -9
- package/dist/cjs/components/AuthorForm/AuthorForm.js +2 -1
- package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +6 -6
- package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +1 -1
- package/dist/cjs/components/AuthorForm/index.js +0 -1
- package/dist/cjs/components/AuthorName.js +2 -2
- package/dist/cjs/components/AuthorsContainer.js +4 -3
- package/dist/cjs/components/AuthorsDND/AuthorsDND.js +39 -17
- package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +6 -25
- package/dist/cjs/components/AuthorsDND/index.js +5 -10
- package/dist/cjs/components/AuthorsList/Author.js +3 -2
- package/dist/cjs/components/AuthorsList/AuthorsList.js +3 -2
- package/dist/cjs/components/Avatar.js +5 -4
- package/dist/cjs/components/Button.js +15 -15
- package/dist/cjs/components/ColorField/ColorField.js +2 -1
- package/dist/cjs/components/ColorField/ColorSelector.js +8 -7
- package/dist/cjs/components/Comments/CommentActions.js +9 -12
- package/dist/cjs/components/Comments/CommentBody.js +5 -5
- package/dist/cjs/components/Comments/CommentTarget.js +1 -1
- package/dist/cjs/components/Comments/CommentUser.js +3 -2
- package/dist/cjs/components/Comments/CommentWrapper.js +18 -16
- package/dist/cjs/components/Comments/ResolveButton.js +3 -2
- package/dist/cjs/components/Dialog.js +2 -2
- package/dist/cjs/components/FileManager/ConfirmationPopUp.js +2 -1
- package/dist/cjs/components/FileManager/DragItemArea.js +2 -1
- package/dist/cjs/components/FileManager/FileManager.js +11 -16
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +8 -7
- package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionState.js +5 -3
- package/dist/cjs/components/FileManager/FilesSection.js +4 -3
- package/dist/cjs/components/FileManager/SelectDesignationActions.js +11 -11
- package/dist/cjs/components/FileManager/SelectDialogDesignation.js +3 -2
- package/dist/cjs/components/FileManager/UploadFileArea.js +11 -10
- package/dist/cjs/components/FileManager/util.js +15 -8
- package/dist/cjs/components/Form.js +1 -1
- package/dist/cjs/components/Inspector.js +7 -7
- package/dist/cjs/components/InspectorSection.js +5 -4
- package/dist/cjs/components/ManuscriptNoteList.js +17 -17
- package/dist/cjs/components/PdfPreview.js +13 -13
- package/dist/cjs/components/RadioButton.js +2 -1
- package/dist/cjs/components/RelativeDate.js +3 -2
- package/dist/cjs/components/SaveStatus.js +2 -1
- package/dist/cjs/components/SimpleModal.js +3 -2
- package/dist/cjs/components/StyledModal.js +3 -2
- package/dist/cjs/components/SubmissionInspector/BaseInformation.js +51 -24
- package/dist/cjs/components/SubmissionInspector/Button.js +2 -2
- package/dist/cjs/components/SubmissionInspector/Progress.js +6 -5
- package/dist/cjs/components/SubmissionInspector/Text.js +2 -2
- package/dist/cjs/components/TextField.js +3 -2
- package/dist/cjs/components/TextFieldContainer.js +2 -1
- package/dist/cjs/components/TextFieldError.js +2 -1
- package/dist/cjs/components/TextFieldGroupContainer.js +2 -1
- package/dist/cjs/components/Tip.js +7 -6
- package/dist/cjs/components/icons/back-arrow.js +2 -1
- package/dist/cjs/hooks/use-dropdown.js +6 -5
- package/dist/cjs/lib/authors.js +24 -15
- package/dist/cjs/lib/capabilities.js +13 -8
- package/dist/cjs/lib/comments.js +9 -5
- package/dist/cjs/lib/lw-errors-decoder.js +55 -0
- package/dist/cjs/lib/name.js +2 -1
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +6 -36
- package/dist/es/components/AuthorForm/ContributorRolesSelect.js +1 -2
- package/dist/es/components/AuthorForm/index.js +0 -1
- package/dist/es/components/AuthorsDND/AuthorsDND.js +20 -16
- package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +2 -2
- package/dist/es/components/AuthorsDND/index.js +1 -1
- package/dist/es/components/Comments/CommentActions.js +1 -5
- package/dist/es/components/Comments/CommentWrapper.js +10 -9
- package/dist/es/components/FileManager/FileManager.js +2 -8
- package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
- package/dist/es/components/FileManager/FileSectionState.js +1 -1
- package/dist/es/components/FileManager/SelectDesignationActions.js +7 -8
- package/dist/es/components/PdfPreview.js +4 -4
- package/dist/es/components/SubmissionInspector/BaseInformation.js +33 -7
- package/dist/es/components/TextFieldContainer.js +1 -1
- package/dist/es/components/TextFieldGroupContainer.js +1 -1
- package/dist/es/lib/lw-errors-decoder.js +55 -0
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +4 -7
- package/dist/types/components/AffiliationsEditor/styles.d.ts +2 -2
- package/dist/types/components/AlertMessage.d.ts +1 -1
- package/dist/types/components/AuthorForm/index.d.ts +0 -1
- package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +2 -2
- package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +15 -5
- package/dist/types/components/AuthorsDND/index.d.ts +1 -1
- package/dist/types/components/Button.d.ts +9 -9
- package/dist/types/components/FileManager/util.d.ts +0 -1
- package/dist/types/components/Form.d.ts +1 -1
- package/dist/types/components/InspectorSection.d.ts +1 -1
- package/dist/types/components/PdfPreview.d.ts +1 -1
- package/dist/types/components/SimpleModal.d.ts +1 -1
- package/dist/types/components/SubmissionInspector/Button.d.ts +1 -1
- package/dist/types/components/icons/add-author.d.ts +0 -1
- package/dist/types/components/icons/add-icon-active.d.ts +0 -1
- package/dist/types/components/icons/add-icon-inverted.d.ts +0 -1
- package/dist/types/components/icons/back-arrow.d.ts +0 -1
- package/dist/types/components/icons/bookmark.d.ts +0 -1
- package/dist/types/components/icons/google.d.ts +0 -1
- package/dist/types/components/icons/orcid.d.ts +0 -1
- package/dist/types/components/icons/project-notification.d.ts +0 -1
- package/dist/types/components/icons/project.d.ts +0 -1
- package/dist/types/components/icons/projects-list.d.ts +0 -1
- package/dist/types/components/icons/search.d.ts +0 -1
- package/dist/types/components/icons/tick-mark.d.ts +0 -1
- package/dist/types/components/icons/user.d.ts +0 -1
- package/dist/types/lib/comments.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cjs/components/AuthorForm/AffiliationsSelect.js +0 -55
- package/dist/es/components/AuthorForm/AffiliationsSelect.js +0 -49
- package/dist/types/components/AuthorForm/AffiliationsSelect.d.ts +0 -29
|
@@ -13,7 +13,7 @@ var A;
|
|
|
13
13
|
A["addNote"] = "add-note";
|
|
14
14
|
A["setMainManuscript"] = "set-main-manuscript";
|
|
15
15
|
})(A || (A = {}));
|
|
16
|
-
|
|
16
|
+
const getLWCapabilities = (project, profile, lwRole, actions) => {
|
|
17
17
|
const isEditor = () => { var _a; return !!(profile && ((_a = project === null || project === void 0 ? void 0 : project.editors) === null || _a === void 0 ? void 0 : _a.includes(profile.userID))); };
|
|
18
18
|
const isOwner = () => { var _a; return !!(profile && ((_a = project === null || project === void 0 ? void 0 : project.owners) === null || _a === void 0 ? void 0 : _a.includes(profile.userID))); };
|
|
19
19
|
const isWriter = () => { var _a; return !!(profile && ((_a = project === null || project === void 0 ? void 0 : project.writers) === null || _a === void 0 ? void 0 : _a.includes(profile.userID))); };
|
|
@@ -54,23 +54,28 @@ exports.getLWCapabilities = (project, profile, lwRole, actions) => {
|
|
|
54
54
|
accessEditor: true,
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
exports.
|
|
58
|
-
|
|
57
|
+
exports.getLWCapabilities = getLWCapabilities;
|
|
58
|
+
const getAllPermitted = () => {
|
|
59
|
+
const capabilities = (0, exports.getLWCapabilities)();
|
|
59
60
|
const allAllowed = Object.keys(capabilities).reduce((caps, item) => {
|
|
60
61
|
caps[item] = true;
|
|
61
62
|
return caps;
|
|
62
63
|
}, {});
|
|
63
64
|
return allAllowed;
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
+
exports.getAllPermitted = getAllPermitted;
|
|
67
|
+
const CapabilitiesContext = react_1.default.createContext((0, exports.getLWCapabilities)());
|
|
66
68
|
CapabilitiesContext.displayName = 'CapabilitiesContext';
|
|
67
|
-
|
|
69
|
+
const usePermissions = () => {
|
|
68
70
|
return react_1.default.useContext(CapabilitiesContext);
|
|
69
71
|
};
|
|
70
|
-
exports.
|
|
71
|
-
|
|
72
|
+
exports.usePermissions = usePermissions;
|
|
73
|
+
const useCalcPermission = ({ project, profile, lwRole, permittedActions, }) => {
|
|
74
|
+
return (0, exports.getLWCapabilities)(project, profile, lwRole, permittedActions);
|
|
72
75
|
};
|
|
73
|
-
exports.
|
|
76
|
+
exports.useCalcPermission = useCalcPermission;
|
|
77
|
+
const CapabilitiesProvider = (props) => {
|
|
74
78
|
const { can } = props;
|
|
75
79
|
return (react_1.default.createElement(CapabilitiesContext.Provider, { value: can }, props === null || props === void 0 ? void 0 : props.children));
|
|
76
80
|
};
|
|
81
|
+
exports.CapabilitiesProvider = CapabilitiesProvider;
|
package/dist/cjs/lib/comments.js
CHANGED
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.buildName = exports.buildNoteTree = exports.buildCommentTree = exports.isSavedComment = void 0;
|
|
19
|
-
|
|
19
|
+
const isSavedComment = (comment) => {
|
|
20
20
|
return !!comment.createdAt;
|
|
21
21
|
};
|
|
22
|
+
exports.isSavedComment = isSavedComment;
|
|
22
23
|
const oldestFirst = (a, b) => Number(a.createdAt) - Number(b.createdAt);
|
|
23
24
|
const buildCommentsMap = (comments) => {
|
|
24
25
|
const map = new Map();
|
|
@@ -84,17 +85,20 @@ const buildNotesTreeMap = (targetsMap) => {
|
|
|
84
85
|
}
|
|
85
86
|
return map;
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
+
const buildCommentTree = (doc, comments, newComment) => {
|
|
88
89
|
if (newComment) {
|
|
89
|
-
return exports.buildCommentTree(doc, [...comments, newComment]);
|
|
90
|
+
return (0, exports.buildCommentTree)(doc, [...comments, newComment]);
|
|
90
91
|
}
|
|
91
92
|
const commentsMap = buildCommentsMap(comments);
|
|
92
93
|
const targetsMap = buildTargetsMap(commentsMap);
|
|
93
94
|
return buildCommentsTreeMap(doc, targetsMap);
|
|
94
95
|
};
|
|
95
|
-
exports.
|
|
96
|
+
exports.buildCommentTree = buildCommentTree;
|
|
97
|
+
const buildNoteTree = (comments) => {
|
|
96
98
|
const commentsMap = buildCommentsMap(comments);
|
|
97
99
|
const targetsMap = buildTargetsMap(commentsMap);
|
|
98
100
|
return buildNotesTreeMap(targetsMap);
|
|
99
101
|
};
|
|
100
|
-
exports.
|
|
102
|
+
exports.buildNoteTree = buildNoteTree;
|
|
103
|
+
const buildName = (name) => [name.given, name.family].filter((item) => item).join(' ');
|
|
104
|
+
exports.buildName = buildName;
|
|
@@ -71,6 +71,11 @@ const errorsExplanations = {
|
|
|
71
71
|
description: 'The quality report could not be loaded.',
|
|
72
72
|
type: 'System',
|
|
73
73
|
},
|
|
74
|
+
TSK_FAILED: {
|
|
75
|
+
title: 'Internal error',
|
|
76
|
+
description: 'An internal error occured while the system was processing the submission.',
|
|
77
|
+
type: 'System',
|
|
78
|
+
},
|
|
74
79
|
TSK_MYTASKS_NOT_LOADED: {
|
|
75
80
|
title: 'Task list cannot be loaded',
|
|
76
81
|
description: 'There was an internal error while loading the list of your tasks.',
|
|
@@ -211,6 +216,26 @@ const errorsExplanations = {
|
|
|
211
216
|
description: 'The input package is of invalid format. Please contact the source where the submitted article comes from.',
|
|
212
217
|
type: 'Workflow',
|
|
213
218
|
},
|
|
219
|
+
CI_IMAGES_EXTRACTED: {
|
|
220
|
+
title: 'Images extracted',
|
|
221
|
+
description: 'There are images extracted from the Word document file. Please check the quality of these images.',
|
|
222
|
+
type: 'Workflow',
|
|
223
|
+
},
|
|
224
|
+
CP_IMAGES_INCOMPLETE: {
|
|
225
|
+
title: 'Missing images',
|
|
226
|
+
description: 'Some images of the article are either missing, incomplete or corrupted.',
|
|
227
|
+
type: 'Workflow',
|
|
228
|
+
},
|
|
229
|
+
CP_IMAGES_UNSUPPORTED_FORMAT: {
|
|
230
|
+
title: 'Images of unsupported format',
|
|
231
|
+
description: 'There are images in the document of unsupported format.',
|
|
232
|
+
type: 'Workflow',
|
|
233
|
+
},
|
|
234
|
+
CP_FIGURES_MULTIPLE_IMAGES: {
|
|
235
|
+
title: 'Figures with multiple images',
|
|
236
|
+
description: 'There are figures in the docment containing multiple images.',
|
|
237
|
+
type: 'Workflow',
|
|
238
|
+
},
|
|
214
239
|
FC_FAIL_QA_CHECKLIST: {
|
|
215
240
|
title: 'Quality report checks outstanding',
|
|
216
241
|
description: 'The Quality report still contains outstanding critical checks that have to be resolved in order to proceed.',
|
|
@@ -221,6 +246,36 @@ const errorsExplanations = {
|
|
|
221
246
|
description: 'The package does not contain any main manuscript file.',
|
|
222
247
|
type: 'Workflow',
|
|
223
248
|
},
|
|
249
|
+
CI_ADDITIONAL_WORD_FILES: {
|
|
250
|
+
title: 'Multiple word files',
|
|
251
|
+
description: 'The package contains multiple word files. Please have the content of the package adjusted.',
|
|
252
|
+
type: 'Workflow',
|
|
253
|
+
},
|
|
254
|
+
CI_XML_AMENDMENT_FAILED: {
|
|
255
|
+
title: 'External file references error',
|
|
256
|
+
description: 'The XML document could not be amended with the external file references.',
|
|
257
|
+
type: 'Workflow',
|
|
258
|
+
},
|
|
259
|
+
CI_IMAGES_NOT_MATCHED: {
|
|
260
|
+
title: 'Images not found',
|
|
261
|
+
description: 'The package does not contain all the images refenenced in the document. Please have the content of the package adjusted.',
|
|
262
|
+
type: 'Workflow',
|
|
263
|
+
},
|
|
264
|
+
CI_METADATA_MISSING: {
|
|
265
|
+
title: 'Metadata missing',
|
|
266
|
+
description: 'Not all the required metadata could be foundin the content of the package. Please have the content of the package adjusted.',
|
|
267
|
+
type: 'Workflow',
|
|
268
|
+
},
|
|
269
|
+
CI_INVALID_DTD: {
|
|
270
|
+
title: 'Invalid DTD',
|
|
271
|
+
description: 'The DTD file is invalid. Please have the content of the package adjusted.',
|
|
272
|
+
type: 'Workflow',
|
|
273
|
+
},
|
|
274
|
+
CI_INVALID_FORMAT: {
|
|
275
|
+
title: 'Invalid Word file',
|
|
276
|
+
description: 'The format or version of the Word file is not correct or supported. Please have the content of the package adjusted.',
|
|
277
|
+
type: 'Workflow',
|
|
278
|
+
},
|
|
224
279
|
CI_UNSUPPORTED_FORMAT: {
|
|
225
280
|
title: 'Unsupported file format',
|
|
226
281
|
description: 'The package contains a main document file that is not of the word document formats (DOCX/DOC) supported.',
|
package/dist/cjs/lib/name.js
CHANGED
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.initials = void 0;
|
|
19
|
-
|
|
19
|
+
const initials = (name) => name.given
|
|
20
20
|
? name.given
|
|
21
21
|
.trim()
|
|
22
22
|
.split(' ')
|
|
23
23
|
.map((part) => part.substr(0, 1).toUpperCase() + '.')
|
|
24
24
|
.join('')
|
|
25
25
|
: '';
|
|
26
|
+
exports.initials = initials;
|
|
@@ -13,52 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
17
|
-
import React, { useState } from 'react';
|
|
16
|
+
import React, { useContext, useState } from 'react';
|
|
18
17
|
import CreatableSelect from 'react-select/creatable';
|
|
19
|
-
import
|
|
18
|
+
import { ThemeContext } from 'styled-components';
|
|
20
19
|
import { defaultAuthorFormComponents, } from '../AuthorForm/AuthorFormComponents';
|
|
21
20
|
import { AffiliationsEditorItem } from './AffiliationsEditorItem';
|
|
22
|
-
|
|
23
|
-
margin: 0 1.89rem 1rem;
|
|
24
|
-
`;
|
|
25
|
-
const Field = styled.div `
|
|
26
|
-
margin: 1rem 0;
|
|
27
|
-
`;
|
|
28
|
-
const List = styled.div `
|
|
29
|
-
margin-bottom: 0.5rem;
|
|
30
|
-
`;
|
|
31
|
-
const AddAffiliationContainer = styled.div `
|
|
32
|
-
padding-right: 0.71rem;
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
justify-content: space-around;
|
|
36
|
-
|
|
37
|
-
svg {
|
|
38
|
-
width: 1.5rem;
|
|
39
|
-
height: 1.5rem;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
circle,
|
|
43
|
-
use {
|
|
44
|
-
fill: ${(props) => props.theme.colors.brand.default};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
path {
|
|
48
|
-
mask: none;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
const AddAffiliationIndicator = () => (React.createElement(AddAffiliationContainer, null,
|
|
52
|
-
React.createElement(AddAuthor, null)));
|
|
21
|
+
import { AddAffiliationIndicator, Container, Field, List } from './styles';
|
|
53
22
|
const reactSelectComponents = {
|
|
54
23
|
IndicatorsContainer: AddAffiliationIndicator,
|
|
55
24
|
};
|
|
56
|
-
const AffiliationsEditorView = ({ options, selected, updateAffiliation, removeAuthorAffiliation, handleChoose, handleInputChange, inputValue,
|
|
25
|
+
const AffiliationsEditorView = ({ options, selected, updateAffiliation, removeAuthorAffiliation, handleChoose, handleInputChange, inputValue, components, styleOverrides, }) => {
|
|
57
26
|
const { Legend } = Object.assign(Object.assign({}, defaultAuthorFormComponents), components);
|
|
58
27
|
const [currentSection, setCurrentSection] = useState('');
|
|
59
28
|
const requestOpen = (id) => {
|
|
60
29
|
setCurrentSection(id === currentSection ? '' : id);
|
|
61
30
|
};
|
|
31
|
+
const theme = useContext(ThemeContext);
|
|
62
32
|
return (React.createElement(Container, null,
|
|
63
33
|
React.createElement(Legend, null, "Affiliations"),
|
|
64
34
|
React.createElement(Field, null,
|
|
@@ -79,4 +49,4 @@ const AffiliationsEditorView = ({ options, selected, updateAffiliation, removeAu
|
|
|
79
49
|
provided.zIndex })),
|
|
80
50
|
} }))));
|
|
81
51
|
};
|
|
82
|
-
export default
|
|
52
|
+
export default AffiliationsEditorView;
|
|
@@ -65,7 +65,6 @@ export const ContributorRolesSelect = ({ contributorRoles, createContributorRole
|
|
|
65
65
|
setSaving(false);
|
|
66
66
|
setFieldValue([...value, contribution._id]);
|
|
67
67
|
}), getOptionValue: (option) => option._id, getOptionLabel: (option) => option.name, onChange: (value) => {
|
|
68
|
-
|
|
69
|
-
setFieldValue(items.map((item) => item._id));
|
|
68
|
+
setFieldValue(value.map((item) => item._id));
|
|
70
69
|
} }));
|
|
71
70
|
};
|
|
@@ -13,24 +13,28 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
16
|
+
import React, { useContext } from 'react';
|
|
17
|
+
import styled, { ThemeContext } from 'styled-components';
|
|
18
18
|
import DraggableAuthorItem from './DraggableAuthorItem';
|
|
19
19
|
const SidebarList = styled.div `
|
|
20
20
|
flex: 1;
|
|
21
21
|
overflow-y: visible;
|
|
22
22
|
`;
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
const AuthorsDND = ({ authors, selectAuthor, selectedAuthor, handleDrop, getSidebarItemDecorator, components, }) => {
|
|
24
|
+
const theme = useContext(ThemeContext);
|
|
25
|
+
return (React.createElement(SidebarList, null, authors.map((author, index) => {
|
|
26
|
+
const user = {
|
|
27
|
+
_id: author.userID,
|
|
28
|
+
};
|
|
29
|
+
const authorItem = {
|
|
30
|
+
_id: author._id,
|
|
31
|
+
priority: author.priority || null,
|
|
32
|
+
index,
|
|
33
|
+
};
|
|
34
|
+
const decorator = getSidebarItemDecorator
|
|
35
|
+
? getSidebarItemDecorator(author._id)
|
|
36
|
+
: null;
|
|
37
|
+
return (React.createElement(DraggableAuthorItem, { key: author._id, authorItem: authorItem, onDrop: handleDrop, author: author, authors: authors, user: user, selectedAuthor: selectedAuthor, selectAuthor: selectAuthor, sidebarItemDecorator: decorator, components: components, theme: theme }));
|
|
38
|
+
})));
|
|
39
|
+
};
|
|
40
|
+
export default AuthorsDND;
|
|
@@ -19,7 +19,7 @@ import VerticalEllipsis from '@manuscripts/assets/react/VerticalEllipsis';
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import { DragSource, DropTarget, } from 'react-dnd';
|
|
21
21
|
import { findDOMNode } from 'react-dom';
|
|
22
|
-
import styled
|
|
22
|
+
import styled from 'styled-components';
|
|
23
23
|
import { isJointFirstAuthor } from '../../lib/authors';
|
|
24
24
|
import { Avatar } from '../Avatar';
|
|
25
25
|
import { defaultAuthorItemComponents, } from './AuthorItemComponents';
|
|
@@ -189,4 +189,4 @@ const dragType = 'authorItem';
|
|
|
189
189
|
const dragSource = DragSource(dragType, dragSourceSpec, dragSourceCollector);
|
|
190
190
|
const dropTarget = DropTarget(dragType, dropTargetSpec, dropTargetCollector);
|
|
191
191
|
const DraggableAuthorItem = dragSource(dropTarget(AuthorComponent));
|
|
192
|
-
export default
|
|
192
|
+
export default DraggableAuthorItem;
|
|
@@ -25,11 +25,7 @@ export const CommentActions = ({ id, target, can, isResolved, handleSetResolved,
|
|
|
25
25
|
const handleRequestEdit = useCallback(() => {
|
|
26
26
|
setIsEditing(true);
|
|
27
27
|
}, [setIsEditing]);
|
|
28
|
-
const handleRequestDelete = useCallback(() => deleteComment(id, target), [
|
|
29
|
-
deleteComment,
|
|
30
|
-
id,
|
|
31
|
-
target,
|
|
32
|
-
]);
|
|
28
|
+
const handleRequestDelete = useCallback(() => deleteComment(id, target), [deleteComment, id, target]);
|
|
33
29
|
const canResolve = useMemo(() => {
|
|
34
30
|
if (!isProdNote) {
|
|
35
31
|
return ((isOwnComment && (can === null || can === void 0 ? void 0 : can.resolveOwnComment)) || (can === null || can === void 0 ? void 0 : can.resolveOthersComment));
|
|
@@ -22,7 +22,8 @@ import { CommentUser } from './CommentUser';
|
|
|
22
22
|
const isOwn = (comment, userId) => {
|
|
23
23
|
var _a;
|
|
24
24
|
return comment.contributions
|
|
25
|
-
? (_a = comment.contributions) === null || _a === void 0 ? void 0 : _a.some((c) => c.profileID === userId)
|
|
25
|
+
? (_a = comment.contributions) === null || _a === void 0 ? void 0 : _a.some((c) => c.profileID === userId)
|
|
26
|
+
: false;
|
|
26
27
|
};
|
|
27
28
|
export const CommentWrapper = ({ createKeyword, comment, can, currentUserId, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, handleSetResolved, isProdNote, isSelected, handleRequestSelect, scrollIntoHighlight, children, }) => {
|
|
28
29
|
const [isEditing, setIsEditing] = useState();
|
|
@@ -31,10 +32,13 @@ export const CommentWrapper = ({ createKeyword, comment, can, currentUserId, get
|
|
|
31
32
|
if (isNew) {
|
|
32
33
|
setIsEditing(true);
|
|
33
34
|
if (threadRef.current) {
|
|
34
|
-
setTimeout(() => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = threadRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
38
|
+
block: 'nearest',
|
|
39
|
+
inline: 'nearest',
|
|
40
|
+
});
|
|
41
|
+
}, 100);
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
}, [isNew]);
|
|
@@ -48,10 +52,7 @@ export const CommentWrapper = ({ createKeyword, comment, can, currentUserId, get
|
|
|
48
52
|
handleRequestSelect && handleRequestSelect();
|
|
49
53
|
}
|
|
50
54
|
}, [handleRequestSelect]);
|
|
51
|
-
const isOwnComment = useMemo(() => isOwn(comment, currentUserId), [
|
|
52
|
-
comment,
|
|
53
|
-
currentUserId,
|
|
54
|
-
]);
|
|
55
|
+
const isOwnComment = useMemo(() => isOwn(comment, currentUserId), [comment, currentUserId]);
|
|
55
56
|
return (React.createElement(Note, { ref: threadRef, isSelected: isSelected },
|
|
56
57
|
React.createElement(NoteHeader, null,
|
|
57
58
|
React.createElement(NoteTitle, { type: "button", onMouseDown: onTitleMouseDown, onKeyDown: onTitleKeyDown }, comment.contributions && (React.createElement(CommentUser, { contributions: comment.contributions, getCollaboratorById: getCollaborator, displayName: comment.displayName, createdAt: isSavedComment(comment) ? comment.createdAt * 1000 : undefined }))),
|
|
@@ -28,11 +28,8 @@ export const FileManager = ({ submissionId, externalFiles, enableDragAndDrop, ca
|
|
|
28
28
|
const res = yield handleReplace(submissionId, name, file, typeId);
|
|
29
29
|
if (res) {
|
|
30
30
|
dispatch(actions.SHOW_FILE_UPLOADED_ALERT());
|
|
31
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
35
31
|
}
|
|
32
|
+
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
36
33
|
return res;
|
|
37
34
|
}), [handleReplace]);
|
|
38
35
|
const handleUploadFile = useCallback((submissionId, file, designation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -44,11 +41,8 @@ export const FileManager = ({ submissionId, externalFiles, enableDragAndDrop, ca
|
|
|
44
41
|
const res = yield handleUpload(submissionId, file, designation);
|
|
45
42
|
if (res) {
|
|
46
43
|
dispatch(actions.SHOW_FILE_UPLOADED_ALERT());
|
|
47
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
51
44
|
}
|
|
45
|
+
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
52
46
|
return res;
|
|
53
47
|
}
|
|
54
48
|
catch (e) {
|
|
@@ -16,7 +16,7 @@ function getItemStyles(initialOffset, currentOffset) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export const DragLayer = () => {
|
|
19
|
-
const { itemType, isDragging, item, initialOffset, currentOffset
|
|
19
|
+
const { itemType, isDragging, item, initialOffset, currentOffset } = useDragLayer((monitor) => ({
|
|
20
20
|
item: monitor.getItem(),
|
|
21
21
|
itemType: monitor.getItemType(),
|
|
22
22
|
initialOffset: monitor.getInitialSourceClientOffset(),
|
|
@@ -82,7 +82,7 @@ export const actions = {
|
|
|
82
82
|
type: ActionTypes.HANDLE_FINISH_UPLOAD,
|
|
83
83
|
}),
|
|
84
84
|
SHOW_FILE_UPLOADED_ALERT: () => ({
|
|
85
|
-
type: ActionTypes.
|
|
85
|
+
type: ActionTypes.SHOW_FILE_UPLOADED_ALERT,
|
|
86
86
|
}),
|
|
87
87
|
CLOSE_FILE_UPLOADED_ALERT: () => ({
|
|
88
88
|
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
@@ -5,16 +5,15 @@ import BottomArrowIcon from '../icons/BottomArrowIcon';
|
|
|
5
5
|
import { PermissionsContext } from './FileManager';
|
|
6
6
|
import { actions } from './FileSectionState';
|
|
7
7
|
import { getUploadFileDesignationList, } from './util';
|
|
8
|
+
const DropdownIndicator = () => (React.createElement(SelectDesignationContainer, null,
|
|
9
|
+
React.createElement(BottomArrowIcon, null)));
|
|
10
|
+
const reactSelectComponents = {
|
|
11
|
+
IndicatorsContainer: DropdownIndicator,
|
|
12
|
+
};
|
|
8
13
|
export const SelectDesignationActions = ({ fileExtension, fileSection, dispatch }) => {
|
|
9
|
-
const DropdownIndicator = () => (React.createElement(SelectDesignationContainer, null,
|
|
10
|
-
React.createElement(BottomArrowIcon, null)));
|
|
11
|
-
const reactSelectComponents = {
|
|
12
|
-
IndicatorsContainer: DropdownIndicator,
|
|
13
|
-
};
|
|
14
14
|
const can = useContext(PermissionsContext);
|
|
15
|
-
const handleInputChange = (
|
|
16
|
-
if (
|
|
17
|
-
const selectedDesignation = value;
|
|
15
|
+
const handleInputChange = (selectedDesignation) => {
|
|
16
|
+
if (selectedDesignation) {
|
|
18
17
|
if (selectedDesignation && 'value' in selectedDesignation) {
|
|
19
18
|
dispatch(actions.SELECT_DESIGNATION(selectedDesignation.value));
|
|
20
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import 'pdfjs-dist/
|
|
2
|
-
import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist/
|
|
3
|
-
import * as pdfjsWorker from 'pdfjs-dist/
|
|
4
|
-
import { EventBus, PDFViewer } from 'pdfjs-dist/
|
|
1
|
+
import 'pdfjs-dist/web/pdf_viewer.css';
|
|
2
|
+
import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist/build/pdf';
|
|
3
|
+
import * as pdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry';
|
|
4
|
+
import { EventBus, PDFViewer } from 'pdfjs-dist/web/pdf_viewer';
|
|
5
5
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
GlobalWorkerOptions.workerSrc = pdfjsWorker;
|
|
@@ -19,7 +19,8 @@ import AttentionRed from '@manuscripts/assets/react/AttentionRed';
|
|
|
19
19
|
import { add, format, intervalToDuration } from 'date-fns';
|
|
20
20
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
21
21
|
import DatePicker from 'react-modern-calendar-datepicker';
|
|
22
|
-
import
|
|
22
|
+
import ReactTooltip from 'react-tooltip';
|
|
23
|
+
import styled, { css } from 'styled-components';
|
|
23
24
|
import { IconTextButton } from '../Button';
|
|
24
25
|
import { Category, Dialog, MessageContainer } from '../Dialog';
|
|
25
26
|
import { SubmissionCriticality } from './types';
|
|
@@ -66,11 +67,15 @@ const CalenderDatePicker = ({ submission, handleDateChange, Button }) => {
|
|
|
66
67
|
} })));
|
|
67
68
|
};
|
|
68
69
|
export const BaseInformation = ({ submission, handleDateChange, userRole }) => {
|
|
69
|
-
const Button = ({ ref }) => (React.createElement(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
const Button = ({ ref }) => (React.createElement(Container, null,
|
|
71
|
+
React.createElement("div", { "data-tip": true, "data-for": submission.id },
|
|
72
|
+
React.createElement(DateButton, { ref: ref, criticality: submission.currentStep.criticality, disabled: userRole !== 'pe' },
|
|
73
|
+
format(submission.currentStep.dueDate, 'd MMM, EEEE'),
|
|
74
|
+
submission.currentStep.criticality ===
|
|
75
|
+
SubmissionCriticality.DUE_TODAY && React.createElement(AttentionOrange, null),
|
|
76
|
+
submission.currentStep.criticality ===
|
|
77
|
+
SubmissionCriticality.OVERDUE && React.createElement(AttentionRed, null))),
|
|
78
|
+
React.createElement(ReactTooltip, { id: submission.id, place: "bottom", effect: "solid", offset: { top: 10 }, className: "tooltip", disable: userRole == 'pe' }, "No permissions to reschedule")));
|
|
74
79
|
return (React.createElement(Grid, null,
|
|
75
80
|
React.createElement(DateLabel, null, "Due date"),
|
|
76
81
|
React.createElement(Value, null,
|
|
@@ -107,6 +112,12 @@ const potentialDueDate = (stepDueDate, dueDate, submissionDueDate) => {
|
|
|
107
112
|
});
|
|
108
113
|
return add(submissionDueDate, duration);
|
|
109
114
|
};
|
|
115
|
+
const Container = styled.div `
|
|
116
|
+
.tooltip {
|
|
117
|
+
border-radius: 6px;
|
|
118
|
+
padding: ${(props) => props.theme.grid.unit * 2}px;
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
110
121
|
const Grid = styled.div `
|
|
111
122
|
display: grid;
|
|
112
123
|
grid-template-columns: 30% auto;
|
|
@@ -129,6 +140,10 @@ const Label = styled.div `
|
|
|
129
140
|
const DateLabel = styled(Label) `
|
|
130
141
|
color: ${(props) => props.theme.colors.text.primary};
|
|
131
142
|
`;
|
|
143
|
+
const disabledStyle = css `
|
|
144
|
+
background-color: ${(props) => props.theme.colors.background.secondary} !important;
|
|
145
|
+
color: ${(props) => props.theme.colors.text.secondary} !important;
|
|
146
|
+
`;
|
|
132
147
|
const DateButton = styled(IconTextButton) `
|
|
133
148
|
border: 1px solid ${(props) => props.theme.colors.border.secondary}!important;
|
|
134
149
|
box-sizing: border-box;
|
|
@@ -141,9 +156,20 @@ const DateButton = styled(IconTextButton) `
|
|
|
141
156
|
width: 100%;
|
|
142
157
|
height: ${(props) => props.theme.grid.unit * 7.5}px;
|
|
143
158
|
justify-content: space-between;
|
|
144
|
-
background: transparent !important;
|
|
145
159
|
padding: 0 ${(props) => props.theme.grid.unit * 2}px 0
|
|
146
160
|
${(props) => props.theme.grid.unit * 4}px;
|
|
161
|
+
|
|
162
|
+
${(props) => props.disabled && disabledStyle}
|
|
163
|
+
|
|
164
|
+
&:focus {
|
|
165
|
+
border-color: ${(props) => props.theme.colors.border.field.hover}!important;
|
|
166
|
+
background-color: ${(props) => props.theme.colors.background.fifth};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:hover {
|
|
170
|
+
background-color: ${(props) => props.theme.colors.background.fifth};
|
|
171
|
+
}
|
|
172
|
+
|
|
147
173
|
svg {
|
|
148
174
|
margin-right: 0;
|
|
149
175
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import { TextFieldLabel } from './TextField';
|
|
18
18
|
import { TextFieldError, TextFieldErrorItem } from './TextFieldError';
|
|
19
|
-
export const TextFieldContainer = ({ label, error, children
|
|
19
|
+
export const TextFieldContainer = ({ label, error, children }) => {
|
|
20
20
|
const childrenWithErrorProp = React.Children.map(children, (child) => React.cloneElement(child, { error }));
|
|
21
21
|
return (React.createElement(React.Fragment, null,
|
|
22
22
|
label ? (React.createElement(TextFieldLabel, null,
|
|
@@ -17,7 +17,7 @@ import React from 'react';
|
|
|
17
17
|
import { TextFieldGroup } from './TextField';
|
|
18
18
|
import { TextFieldError, TextFieldErrorItem } from './TextFieldError';
|
|
19
19
|
const hasErrors = (errors) => Object.values(errors).some((error) => !!error);
|
|
20
|
-
export const TextFieldGroupContainer = ({ children, errors
|
|
20
|
+
export const TextFieldGroupContainer = ({ children, errors }) => {
|
|
21
21
|
return (React.createElement(TextFieldGroup, null,
|
|
22
22
|
children,
|
|
23
23
|
errors && hasErrors(errors) && (React.createElement(TextFieldError, null, Object.entries(errors).map(([key, error]) => error && (React.createElement(TextFieldErrorItem, { id: `${key}-text-field-error`, key: key }, error)))))));
|
|
@@ -69,6 +69,11 @@ const errorsExplanations = {
|
|
|
69
69
|
description: 'The quality report could not be loaded.',
|
|
70
70
|
type: 'System',
|
|
71
71
|
},
|
|
72
|
+
TSK_FAILED: {
|
|
73
|
+
title: 'Internal error',
|
|
74
|
+
description: 'An internal error occured while the system was processing the submission.',
|
|
75
|
+
type: 'System',
|
|
76
|
+
},
|
|
72
77
|
TSK_MYTASKS_NOT_LOADED: {
|
|
73
78
|
title: 'Task list cannot be loaded',
|
|
74
79
|
description: 'There was an internal error while loading the list of your tasks.',
|
|
@@ -209,6 +214,26 @@ const errorsExplanations = {
|
|
|
209
214
|
description: 'The input package is of invalid format. Please contact the source where the submitted article comes from.',
|
|
210
215
|
type: 'Workflow',
|
|
211
216
|
},
|
|
217
|
+
CI_IMAGES_EXTRACTED: {
|
|
218
|
+
title: 'Images extracted',
|
|
219
|
+
description: 'There are images extracted from the Word document file. Please check the quality of these images.',
|
|
220
|
+
type: 'Workflow',
|
|
221
|
+
},
|
|
222
|
+
CP_IMAGES_INCOMPLETE: {
|
|
223
|
+
title: 'Missing images',
|
|
224
|
+
description: 'Some images of the article are either missing, incomplete or corrupted.',
|
|
225
|
+
type: 'Workflow',
|
|
226
|
+
},
|
|
227
|
+
CP_IMAGES_UNSUPPORTED_FORMAT: {
|
|
228
|
+
title: 'Images of unsupported format',
|
|
229
|
+
description: 'There are images in the document of unsupported format.',
|
|
230
|
+
type: 'Workflow',
|
|
231
|
+
},
|
|
232
|
+
CP_FIGURES_MULTIPLE_IMAGES: {
|
|
233
|
+
title: 'Figures with multiple images',
|
|
234
|
+
description: 'There are figures in the docment containing multiple images.',
|
|
235
|
+
type: 'Workflow',
|
|
236
|
+
},
|
|
212
237
|
FC_FAIL_QA_CHECKLIST: {
|
|
213
238
|
title: 'Quality report checks outstanding',
|
|
214
239
|
description: 'The Quality report still contains outstanding critical checks that have to be resolved in order to proceed.',
|
|
@@ -219,6 +244,36 @@ const errorsExplanations = {
|
|
|
219
244
|
description: 'The package does not contain any main manuscript file.',
|
|
220
245
|
type: 'Workflow',
|
|
221
246
|
},
|
|
247
|
+
CI_ADDITIONAL_WORD_FILES: {
|
|
248
|
+
title: 'Multiple word files',
|
|
249
|
+
description: 'The package contains multiple word files. Please have the content of the package adjusted.',
|
|
250
|
+
type: 'Workflow',
|
|
251
|
+
},
|
|
252
|
+
CI_XML_AMENDMENT_FAILED: {
|
|
253
|
+
title: 'External file references error',
|
|
254
|
+
description: 'The XML document could not be amended with the external file references.',
|
|
255
|
+
type: 'Workflow',
|
|
256
|
+
},
|
|
257
|
+
CI_IMAGES_NOT_MATCHED: {
|
|
258
|
+
title: 'Images not found',
|
|
259
|
+
description: 'The package does not contain all the images refenenced in the document. Please have the content of the package adjusted.',
|
|
260
|
+
type: 'Workflow',
|
|
261
|
+
},
|
|
262
|
+
CI_METADATA_MISSING: {
|
|
263
|
+
title: 'Metadata missing',
|
|
264
|
+
description: 'Not all the required metadata could be foundin the content of the package. Please have the content of the package adjusted.',
|
|
265
|
+
type: 'Workflow',
|
|
266
|
+
},
|
|
267
|
+
CI_INVALID_DTD: {
|
|
268
|
+
title: 'Invalid DTD',
|
|
269
|
+
description: 'The DTD file is invalid. Please have the content of the package adjusted.',
|
|
270
|
+
type: 'Workflow',
|
|
271
|
+
},
|
|
272
|
+
CI_INVALID_FORMAT: {
|
|
273
|
+
title: 'Invalid Word file',
|
|
274
|
+
description: 'The format or version of the Word file is not correct or supported. Please have the content of the package adjusted.',
|
|
275
|
+
type: 'Workflow',
|
|
276
|
+
},
|
|
222
277
|
CI_UNSUPPORTED_FORMAT: {
|
|
223
278
|
title: 'Unsupported file format',
|
|
224
279
|
description: 'The package contains a main document file that is not of the word document formats (DOCX/DOC) supported.',
|