@manuscripts/style-guide 0.30.16 → 0.30.20

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.
Files changed (124) hide show
  1. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditor.js +3 -3
  2. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +7 -6
  3. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +3 -3
  4. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +10 -40
  5. package/dist/cjs/components/AffiliationsEditor/styles.js +2 -1
  6. package/dist/cjs/components/AffiliationsList.js +3 -2
  7. package/dist/cjs/components/AlertMessage.js +9 -9
  8. package/dist/cjs/components/AuthorForm/AuthorForm.js +2 -1
  9. package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +6 -6
  10. package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +1 -1
  11. package/dist/cjs/components/AuthorForm/index.js +0 -1
  12. package/dist/cjs/components/AuthorName.js +2 -2
  13. package/dist/cjs/components/AuthorsContainer.js +4 -3
  14. package/dist/cjs/components/AuthorsDND/AuthorsDND.js +39 -17
  15. package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +6 -25
  16. package/dist/cjs/components/AuthorsDND/index.js +5 -10
  17. package/dist/cjs/components/AuthorsList/Author.js +3 -2
  18. package/dist/cjs/components/AuthorsList/AuthorsList.js +3 -2
  19. package/dist/cjs/components/Avatar.js +5 -4
  20. package/dist/cjs/components/Button.js +15 -15
  21. package/dist/cjs/components/ColorField/ColorField.js +2 -1
  22. package/dist/cjs/components/ColorField/ColorSelector.js +8 -7
  23. package/dist/cjs/components/Comments/CommentActions.js +9 -12
  24. package/dist/cjs/components/Comments/CommentBody.js +5 -5
  25. package/dist/cjs/components/Comments/CommentTarget.js +1 -1
  26. package/dist/cjs/components/Comments/CommentUser.js +3 -2
  27. package/dist/cjs/components/Comments/CommentWrapper.js +18 -16
  28. package/dist/cjs/components/Comments/ResolveButton.js +3 -2
  29. package/dist/cjs/components/Dialog.js +2 -2
  30. package/dist/cjs/components/FileManager/ConfirmationPopUp.js +2 -1
  31. package/dist/cjs/components/FileManager/DragItemArea.js +2 -1
  32. package/dist/cjs/components/FileManager/FileManager.js +11 -16
  33. package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +5 -4
  34. package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -4
  35. package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +5 -4
  36. package/dist/cjs/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +8 -7
  37. package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +3 -2
  38. package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +11 -3
  39. package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +3 -2
  40. package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +2 -1
  41. package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +5 -4
  42. package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +2 -1
  43. package/dist/cjs/components/FileManager/FileSectionState.js +5 -3
  44. package/dist/cjs/components/FileManager/FilesSection.js +4 -3
  45. package/dist/cjs/components/FileManager/SelectDesignationActions.js +11 -11
  46. package/dist/cjs/components/FileManager/SelectDialogDesignation.js +3 -2
  47. package/dist/cjs/components/FileManager/UploadFileArea.js +11 -10
  48. package/dist/cjs/components/FileManager/util.js +15 -8
  49. package/dist/cjs/components/Form.js +1 -1
  50. package/dist/cjs/components/Inspector.js +7 -7
  51. package/dist/cjs/components/InspectorSection.js +5 -4
  52. package/dist/cjs/components/ManuscriptNoteList.js +17 -17
  53. package/dist/cjs/components/PdfPreview.js +13 -13
  54. package/dist/cjs/components/RadioButton.js +2 -1
  55. package/dist/cjs/components/RelativeDate.js +3 -2
  56. package/dist/cjs/components/SaveStatus.js +2 -1
  57. package/dist/cjs/components/SimpleModal.js +3 -2
  58. package/dist/cjs/components/StyledModal.js +3 -2
  59. package/dist/cjs/components/SubmissionInspector/BaseInformation.js +51 -24
  60. package/dist/cjs/components/SubmissionInspector/Button.js +2 -2
  61. package/dist/cjs/components/SubmissionInspector/Progress.js +6 -5
  62. package/dist/cjs/components/SubmissionInspector/Text.js +2 -2
  63. package/dist/cjs/components/TextField.js +3 -2
  64. package/dist/cjs/components/TextFieldContainer.js +2 -1
  65. package/dist/cjs/components/TextFieldError.js +2 -1
  66. package/dist/cjs/components/TextFieldGroupContainer.js +2 -1
  67. package/dist/cjs/components/Tip.js +7 -6
  68. package/dist/cjs/components/icons/back-arrow.js +2 -1
  69. package/dist/cjs/hooks/use-dropdown.js +6 -5
  70. package/dist/cjs/lib/authors.js +24 -15
  71. package/dist/cjs/lib/capabilities.js +13 -8
  72. package/dist/cjs/lib/comments.js +9 -5
  73. package/dist/cjs/lib/lw-errors-decoder.js +50 -0
  74. package/dist/cjs/lib/name.js +2 -1
  75. package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +6 -36
  76. package/dist/es/components/AuthorForm/ContributorRolesSelect.js +1 -2
  77. package/dist/es/components/AuthorForm/index.js +0 -1
  78. package/dist/es/components/AuthorsDND/AuthorsDND.js +20 -16
  79. package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +2 -2
  80. package/dist/es/components/AuthorsDND/index.js +1 -1
  81. package/dist/es/components/Comments/CommentActions.js +1 -5
  82. package/dist/es/components/Comments/CommentWrapper.js +10 -9
  83. package/dist/es/components/FileManager/FileManager.js +2 -8
  84. package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
  85. package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +8 -1
  86. package/dist/es/components/FileManager/FileSectionState.js +1 -1
  87. package/dist/es/components/FileManager/SelectDesignationActions.js +7 -8
  88. package/dist/es/components/PdfPreview.js +4 -4
  89. package/dist/es/components/SubmissionInspector/BaseInformation.js +33 -7
  90. package/dist/es/components/TextFieldContainer.js +1 -1
  91. package/dist/es/components/TextFieldGroupContainer.js +1 -1
  92. package/dist/es/lib/lw-errors-decoder.js +50 -0
  93. package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +4 -7
  94. package/dist/types/components/AffiliationsEditor/styles.d.ts +2 -2
  95. package/dist/types/components/AlertMessage.d.ts +1 -1
  96. package/dist/types/components/AuthorForm/index.d.ts +0 -1
  97. package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +2 -2
  98. package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +15 -5
  99. package/dist/types/components/AuthorsDND/index.d.ts +1 -1
  100. package/dist/types/components/Button.d.ts +9 -9
  101. package/dist/types/components/FileManager/util.d.ts +0 -1
  102. package/dist/types/components/Form.d.ts +1 -1
  103. package/dist/types/components/InspectorSection.d.ts +1 -1
  104. package/dist/types/components/PdfPreview.d.ts +1 -1
  105. package/dist/types/components/SimpleModal.d.ts +1 -1
  106. package/dist/types/components/SubmissionInspector/Button.d.ts +1 -1
  107. package/dist/types/components/icons/add-author.d.ts +0 -1
  108. package/dist/types/components/icons/add-icon-active.d.ts +0 -1
  109. package/dist/types/components/icons/add-icon-inverted.d.ts +0 -1
  110. package/dist/types/components/icons/back-arrow.d.ts +0 -1
  111. package/dist/types/components/icons/bookmark.d.ts +0 -1
  112. package/dist/types/components/icons/google.d.ts +0 -1
  113. package/dist/types/components/icons/orcid.d.ts +0 -1
  114. package/dist/types/components/icons/project-notification.d.ts +0 -1
  115. package/dist/types/components/icons/project.d.ts +0 -1
  116. package/dist/types/components/icons/projects-list.d.ts +0 -1
  117. package/dist/types/components/icons/search.d.ts +0 -1
  118. package/dist/types/components/icons/tick-mark.d.ts +0 -1
  119. package/dist/types/components/icons/user.d.ts +0 -1
  120. package/dist/types/lib/comments.d.ts +2 -2
  121. package/package.json +5 -5
  122. package/dist/cjs/components/AuthorForm/AffiliationsSelect.js +0 -55
  123. package/dist/es/components/AuthorForm/AffiliationsSelect.js +0 -49
  124. 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
- exports.getLWCapabilities = (project, profile, lwRole, actions) => {
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.getAllPermitted = () => {
58
- const capabilities = exports.getLWCapabilities();
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
- const CapabilitiesContext = react_1.default.createContext(exports.getLWCapabilities());
66
+ exports.getAllPermitted = getAllPermitted;
67
+ const CapabilitiesContext = react_1.default.createContext((0, exports.getLWCapabilities)());
66
68
  CapabilitiesContext.displayName = 'CapabilitiesContext';
67
- exports.usePermissions = () => {
69
+ const usePermissions = () => {
68
70
  return react_1.default.useContext(CapabilitiesContext);
69
71
  };
70
- exports.useCalcPermission = ({ project, profile, lwRole, permittedActions, }) => {
71
- return exports.getLWCapabilities(project, profile, lwRole, permittedActions);
72
+ exports.usePermissions = usePermissions;
73
+ const useCalcPermission = ({ project, profile, lwRole, permittedActions, }) => {
74
+ return (0, exports.getLWCapabilities)(project, profile, lwRole, permittedActions);
72
75
  };
73
- exports.CapabilitiesProvider = (props) => {
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;
@@ -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
- exports.isSavedComment = (comment) => {
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
- exports.buildCommentTree = (doc, comments, newComment) => {
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.buildNoteTree = (comments) => {
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.buildName = (name) => [name.given, name.family].filter((item) => item).join(' ');
102
+ exports.buildNoteTree = buildNoteTree;
103
+ const buildName = (name) => [name.given, name.family].filter((item) => item).join(' ');
104
+ exports.buildName = buildName;
@@ -211,6 +211,26 @@ const errorsExplanations = {
211
211
  description: 'The input package is of invalid format. Please contact the source where the submitted article comes from.',
212
212
  type: 'Workflow',
213
213
  },
214
+ CI_IMAGES_EXTRACTED: {
215
+ title: 'Images extracted',
216
+ description: 'There are images extracted from the Word document file. Please check the quality of these images.',
217
+ type: 'Workflow',
218
+ },
219
+ CP_IMAGES_INCOMPLETE: {
220
+ title: 'Missing images',
221
+ description: 'Some images of the article are either missing, incomplete or corrupted.',
222
+ type: 'Workflow',
223
+ },
224
+ CP_IMAGES_UNSUPPORTED_FORMAT: {
225
+ title: 'Images of unsupported format',
226
+ description: 'There are images in the document of unsupported format.',
227
+ type: 'Workflow',
228
+ },
229
+ CP_FIGURES_MULTIPLE_IMAGES: {
230
+ title: 'Figures with multiple images',
231
+ description: 'There are figures in the docment containing multiple images.',
232
+ type: 'Workflow',
233
+ },
214
234
  FC_FAIL_QA_CHECKLIST: {
215
235
  title: 'Quality report checks outstanding',
216
236
  description: 'The Quality report still contains outstanding critical checks that have to be resolved in order to proceed.',
@@ -221,6 +241,36 @@ const errorsExplanations = {
221
241
  description: 'The package does not contain any main manuscript file.',
222
242
  type: 'Workflow',
223
243
  },
244
+ CI_ADDITIONAL_WORD_FILES: {
245
+ title: 'Multiple word files',
246
+ description: 'The package contains multiple word files. Please have the content of the package adjusted.',
247
+ type: 'Workflow',
248
+ },
249
+ CI_XML_AMENDMENT_FAILED: {
250
+ title: 'External file references error',
251
+ description: 'The XML document could not be amended with the external file references.',
252
+ type: 'Workflow',
253
+ },
254
+ CI_IMAGES_NOT_MATCHED: {
255
+ title: 'Images not found',
256
+ description: 'The package does not contain all the images refenenced in the document. Please have the content of the package adjusted.',
257
+ type: 'Workflow',
258
+ },
259
+ CI_METADATA_MISSING: {
260
+ title: 'Metadata missing',
261
+ description: 'Not all the required metadata could be foundin the content of the package. Please have the content of the package adjusted.',
262
+ type: 'Workflow',
263
+ },
264
+ CI_INVALID_DTD: {
265
+ title: 'Invalid DTD',
266
+ description: 'The DTD file is invalid. Please have the content of the package adjusted.',
267
+ type: 'Workflow',
268
+ },
269
+ CI_INVALID_FORMAT: {
270
+ title: 'Invalid Word file',
271
+ description: 'The format or version of the Word file is not correct or supported. Please have the content of the package adjusted.',
272
+ type: 'Workflow',
273
+ },
224
274
  CI_UNSUPPORTED_FORMAT: {
225
275
  title: 'Unsupported file format',
226
276
  description: 'The package contains a main document file that is not of the word document formats (DOCX/DOC) supported.',
@@ -16,10 +16,11 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.initials = void 0;
19
- exports.initials = (name) => name.given
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 AddAuthor from '@manuscripts/assets/react/AddAuthor';
17
- import React, { useState } from 'react';
16
+ import React, { useContext, useState } from 'react';
18
17
  import CreatableSelect from 'react-select/creatable';
19
- import styled, { withTheme } from 'styled-components';
18
+ import { ThemeContext } from 'styled-components';
20
19
  import { defaultAuthorFormComponents, } from '../AuthorForm/AuthorFormComponents';
21
20
  import { AffiliationsEditorItem } from './AffiliationsEditorItem';
22
- const Container = styled.div `
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, theme, components, styleOverrides, }) => {
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 withTheme(AffiliationsEditorView);
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
- const items = value;
69
- setFieldValue(items.map((item) => item._id));
68
+ setFieldValue(value.map((item) => item._id));
70
69
  } }));
71
70
  };
@@ -14,4 +14,3 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export * from './AuthorForm';
17
- export * from './AffiliationsSelect';
@@ -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
- export const AuthorsDND = ({ authors, selectAuthor, selectedAuthor, handleDrop, getSidebarItemDecorator, components, }) => (React.createElement(SidebarList, null, authors.map((author, index) => {
24
- const user = {
25
- _id: author.userID,
26
- };
27
- const authorItem = {
28
- _id: author._id,
29
- priority: author.priority || null,
30
- index,
31
- };
32
- const decorator = getSidebarItemDecorator
33
- ? getSidebarItemDecorator(author._id)
34
- : null;
35
- 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 }));
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, { withTheme } from 'styled-components';
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 withTheme(DraggableAuthorItem);
192
+ export default DraggableAuthorItem;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export * from './AuthorsDND';
16
+ export { default as AuthorsDND } from './AuthorsDND';
@@ -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) : false;
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(() => { var _a; return (_a = threadRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
35
- block: 'nearest',
36
- inline: 'nearest',
37
- }); }, 100);
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, } = useDragLayer((monitor) => ({
19
+ const { itemType, isDragging, item, initialOffset, currentOffset } = useDragLayer((monitor) => ({
20
20
  item: monitor.getItem(),
21
21
  itemType: monitor.getItemType(),
22
22
  initialOffset: monitor.getInitialSourceClientOffset(),
@@ -13,8 +13,15 @@ export const FileSectionItem = ({ submissionId, externalFile, title, showAttachm
13
13
  const fileExtension = externalFile.filename.substring(externalFile.filename.lastIndexOf('.') + 1);
14
14
  const designation = namesWithDesignationMap.get(externalFile.designation);
15
15
  const isMainManuscript = designation === Designation.MainManuscript;
16
+ const isSelected = externalFile._id == window.location.hash.substr(1);
16
17
  return (React.createElement(Item, { ref: dragRef, className: className, style: style },
17
- React.createElement(ItemContainer, { onClick: () => (window.location.hash = isEditor ? `#${externalFile._id}` : '#') },
18
+ React.createElement(ItemContainer, { onClick: () => {
19
+ window.location.hash =
20
+ isEditor && !isSelected ? `#${externalFile._id}` : '#';
21
+ if (isSelected) {
22
+ window.location.hash = `#${externalFile._id}`;
23
+ }
24
+ } },
18
25
  React.createElement(FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.filename }),
19
26
  React.createElement(FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, showDesignationActions: showDesignationActions, submissionAttachmentName: externalFile.filename, title: title, designation: designation, description: externalFile.description, handleChangeDesignation: handleChangeDesignation, submissionId: submissionId, dispatch: dispatch })),
20
27
  onClose && (React.createElement(IconCloseButton, { onClick: (e) => {
@@ -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.CLOSE_FILE_UPLOADED_ALERT,
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 = (value) => {
16
- if (value) {
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/es5/web/pdf_viewer.css';
2
- import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist/es5/build/pdf';
3
- import * as pdfjsWorker from 'pdfjs-dist/es5/build/pdf.worker.entry';
4
- import { EventBus, PDFViewer } from 'pdfjs-dist/es5/web/pdf_viewer';
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 styled from 'styled-components';
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(DateButton, { ref: ref, criticality: submission.currentStep.criticality, disabled: userRole !== 'pe' },
70
- format(submission.currentStep.dueDate, 'd MMM, EEEE'),
71
- submission.currentStep.criticality ===
72
- SubmissionCriticality.DUE_TODAY && React.createElement(AttentionOrange, null),
73
- submission.currentStep.criticality === SubmissionCriticality.OVERDUE && (React.createElement(AttentionRed, null))));
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)))))));
@@ -209,6 +209,26 @@ const errorsExplanations = {
209
209
  description: 'The input package is of invalid format. Please contact the source where the submitted article comes from.',
210
210
  type: 'Workflow',
211
211
  },
212
+ CI_IMAGES_EXTRACTED: {
213
+ title: 'Images extracted',
214
+ description: 'There are images extracted from the Word document file. Please check the quality of these images.',
215
+ type: 'Workflow',
216
+ },
217
+ CP_IMAGES_INCOMPLETE: {
218
+ title: 'Missing images',
219
+ description: 'Some images of the article are either missing, incomplete or corrupted.',
220
+ type: 'Workflow',
221
+ },
222
+ CP_IMAGES_UNSUPPORTED_FORMAT: {
223
+ title: 'Images of unsupported format',
224
+ description: 'There are images in the document of unsupported format.',
225
+ type: 'Workflow',
226
+ },
227
+ CP_FIGURES_MULTIPLE_IMAGES: {
228
+ title: 'Figures with multiple images',
229
+ description: 'There are figures in the docment containing multiple images.',
230
+ type: 'Workflow',
231
+ },
212
232
  FC_FAIL_QA_CHECKLIST: {
213
233
  title: 'Quality report checks outstanding',
214
234
  description: 'The Quality report still contains outstanding critical checks that have to be resolved in order to proceed.',
@@ -219,6 +239,36 @@ const errorsExplanations = {
219
239
  description: 'The package does not contain any main manuscript file.',
220
240
  type: 'Workflow',
221
241
  },
242
+ CI_ADDITIONAL_WORD_FILES: {
243
+ title: 'Multiple word files',
244
+ description: 'The package contains multiple word files. Please have the content of the package adjusted.',
245
+ type: 'Workflow',
246
+ },
247
+ CI_XML_AMENDMENT_FAILED: {
248
+ title: 'External file references error',
249
+ description: 'The XML document could not be amended with the external file references.',
250
+ type: 'Workflow',
251
+ },
252
+ CI_IMAGES_NOT_MATCHED: {
253
+ title: 'Images not found',
254
+ description: 'The package does not contain all the images refenenced in the document. Please have the content of the package adjusted.',
255
+ type: 'Workflow',
256
+ },
257
+ CI_METADATA_MISSING: {
258
+ title: 'Metadata missing',
259
+ description: 'Not all the required metadata could be foundin the content of the package. Please have the content of the package adjusted.',
260
+ type: 'Workflow',
261
+ },
262
+ CI_INVALID_DTD: {
263
+ title: 'Invalid DTD',
264
+ description: 'The DTD file is invalid. Please have the content of the package adjusted.',
265
+ type: 'Workflow',
266
+ },
267
+ CI_INVALID_FORMAT: {
268
+ title: 'Invalid Word file',
269
+ description: 'The format or version of the Word file is not correct or supported. Please have the content of the package adjusted.',
270
+ type: 'Workflow',
271
+ },
222
272
  CI_UNSUPPORTED_FORMAT: {
223
273
  title: 'Unsupported file format',
224
274
  description: 'The package contains a main document file that is not of the word document formats (DOCX/DOC) supported.',