@manuscripts/style-guide 0.30.15 → 0.30.16
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/FileManager/FileManager.js +20 -4
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +3 -5
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +1 -1
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +5 -1
- package/dist/cjs/components/FileManager/FileSectionState.js +8 -1
- package/dist/cjs/lib/lw-errors-decoder.js +1 -1
- package/dist/es/components/FileManager/FileManager.js +20 -4
- package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +3 -5
- package/dist/es/components/FileManager/FileSectionItem/FileSectionUploadItem.js +1 -1
- package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +6 -2
- package/dist/es/components/FileManager/FileSectionState.js +8 -1
- package/dist/es/lib/lw-errors-decoder.js +1 -1
- package/dist/types/components/FileManager/FileSectionItem/FileSectionItem.d.ts +1 -2
- package/dist/types/components/FileManager/FileSectionItem/FileSectionUploadItem.d.ts +1 -1
- package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +3 -1
- package/dist/types/components/FileManager/FileSectionState.d.ts +2 -0
- package/package.json +1 -1
|
@@ -47,9 +47,19 @@ const util_1 = require("./util");
|
|
|
47
47
|
exports.PermissionsContext = react_1.createContext(null);
|
|
48
48
|
exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, handleUpload, handleDownload, handleReplace, handleChangeDesignation, }) => {
|
|
49
49
|
const [state, dispatch] = react_1.useReducer(FileSectionState_1.reducer, FileSectionState_1.getInitialState());
|
|
50
|
-
const handleReplaceFile = react_1.useCallback((submissionId, name, file, typeId) => {
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const handleReplaceFile = react_1.useCallback((submissionId, name, file, typeId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
dispatch(FileSectionState_1.actions.HANDLE_UPLOAD_ACTION());
|
|
52
|
+
dispatch(FileSectionState_1.actions.SELECT_DESIGNATION(util_1.namesWithDesignationMap.get(typeId) || util_1.Designation.Document));
|
|
53
|
+
const res = yield handleReplace(submissionId, name, file, typeId);
|
|
54
|
+
if (res) {
|
|
55
|
+
dispatch(FileSectionState_1.actions.SHOW_FILE_UPLOADED_ALERT());
|
|
56
|
+
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
60
|
+
}
|
|
61
|
+
return res;
|
|
62
|
+
}), [handleReplace]);
|
|
53
63
|
const handleUploadFile = react_1.useCallback((submissionId, file, designation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
64
|
try {
|
|
55
65
|
dispatch(FileSectionState_1.actions.HANDLE_UPLOAD_ACTION());
|
|
@@ -57,7 +67,13 @@ exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, ha
|
|
|
57
67
|
dispatch(FileSectionState_1.actions.SELECT_DESIGNATION(util_1.Designation.Supplementary));
|
|
58
68
|
}
|
|
59
69
|
const res = yield handleUpload(submissionId, file, designation);
|
|
60
|
-
|
|
70
|
+
if (res) {
|
|
71
|
+
dispatch(FileSectionState_1.actions.SHOW_FILE_UPLOADED_ALERT());
|
|
72
|
+
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
76
|
+
}
|
|
61
77
|
return res;
|
|
62
78
|
}
|
|
63
79
|
catch (e) {
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ItemContainer = exports.Item = exports.ActionsIcon = exports.FileSectionItem = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
9
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
9
|
const use_dropdown_1 = require("../../../hooks/use-dropdown");
|
|
11
10
|
const Dropdown_1 = require("../../Dropdown");
|
|
@@ -21,7 +20,7 @@ exports.FileSectionItem = ({ submissionId, externalFile, title, showAttachmentNa
|
|
|
21
20
|
const designation = util_1.namesWithDesignationMap.get(externalFile.designation);
|
|
22
21
|
const isMainManuscript = designation === util_1.Designation.MainManuscript;
|
|
23
22
|
return (react_1.default.createElement(exports.Item, { ref: dragRef, className: className, style: style },
|
|
24
|
-
react_1.default.createElement(exports.ItemContainer, {
|
|
23
|
+
react_1.default.createElement(exports.ItemContainer, { onClick: () => (window.location.hash = isEditor ? `#${externalFile._id}` : '#') },
|
|
25
24
|
react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.filename }),
|
|
26
25
|
react_1.default.createElement(FileInfo_1.FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, showDesignationActions: showDesignationActions, submissionAttachmentName: externalFile.filename, title: title, designation: designation, description: externalFile.description, handleChangeDesignation: handleChangeDesignation, submissionId: submissionId, dispatch: dispatch })),
|
|
27
26
|
onClose && (react_1.default.createElement(IconCloseButton, { onClick: (e) => {
|
|
@@ -32,7 +31,7 @@ exports.FileSectionItem = ({ submissionId, externalFile, title, showAttachmentNa
|
|
|
32
31
|
handleDownload && handleReplace && submissionId && (react_1.default.createElement(Dropdown_1.DropdownContainer, { ref: wrapperRef },
|
|
33
32
|
react_1.default.createElement(exports.ActionsIcon, { onClick: toggleOpen, type: "button", "aria-label": "Download or Replace", "aria-pressed": isOpen },
|
|
34
33
|
react_1.default.createElement(dots_icon_1.default, null)),
|
|
35
|
-
isOpen && (react_1.default.createElement(ItemActions_1.ItemActions, { replaceAttachmentHandler: handleReplace, downloadAttachmentHandler: handleDownload, submissionId: submissionId, fileName: externalFile.filename, designation: externalFile.designation, publicUrl: externalFile.publicUrl, hideActionList: toggleOpen }))))));
|
|
34
|
+
isOpen && (react_1.default.createElement(ItemActions_1.ItemActions, { replaceAttachmentHandler: handleReplace, downloadAttachmentHandler: handleDownload, submissionId: submissionId, fileName: externalFile.filename, designation: externalFile.designation, publicUrl: externalFile.publicUrl, hideActionList: toggleOpen, dispatch: dispatch }))))));
|
|
36
35
|
};
|
|
37
36
|
const IconCloseButton = styled_components_1.default.button `
|
|
38
37
|
border: none;
|
|
@@ -82,10 +81,9 @@ exports.Item = styled_components_1.default.div `
|
|
|
82
81
|
margin-right: 8px;
|
|
83
82
|
}
|
|
84
83
|
`;
|
|
85
|
-
exports.ItemContainer = styled_components_1.default
|
|
84
|
+
exports.ItemContainer = styled_components_1.default.div `
|
|
86
85
|
display: flex;
|
|
87
86
|
min-width: calc(100% - 8px);
|
|
88
87
|
padding-right: 4px;
|
|
89
88
|
box-sizing: border-box;
|
|
90
|
-
text-decoration: none;
|
|
91
89
|
`;
|
|
@@ -14,7 +14,7 @@ exports.FileSectionUploadItem = ({ fileName, isLoading, submissionId, dragRef, c
|
|
|
14
14
|
const fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
|
|
15
15
|
fileName = fileName.substring(0, fileName.lastIndexOf('.'));
|
|
16
16
|
return (react_1.default.createElement(FileSectionItem_1.Item, { ref: dragRef, className: className, style: style },
|
|
17
|
-
react_1.default.createElement(exports.UploadItemContainer,
|
|
17
|
+
react_1.default.createElement(exports.UploadItemContainer, null,
|
|
18
18
|
react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { withDot: false }),
|
|
19
19
|
react_1.default.createElement(FileInfo_1.FileInfoContainer, null,
|
|
20
20
|
react_1.default.createElement(FileInfo_1.FileNameContainer, null,
|
|
@@ -23,8 +23,9 @@ exports.ItemActions = void 0;
|
|
|
23
23
|
const react_1 = __importStar(require("react"));
|
|
24
24
|
const Dropdown_1 = require("../../Dropdown");
|
|
25
25
|
const FileManager_1 = require("../FileManager");
|
|
26
|
+
const FileSectionState_1 = require("../FileSectionState");
|
|
26
27
|
const ItemsAction_1 = require("../ItemsAction");
|
|
27
|
-
exports.ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, submissionId, fileName, designation, publicUrl, hideActionList, }) => {
|
|
28
|
+
exports.ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, submissionId, fileName, designation, publicUrl, hideActionList, dispatch, }) => {
|
|
28
29
|
const attachmentDesignation = designation == undefined ? 'undefined' : designation;
|
|
29
30
|
const fileInputRef = react_1.useRef(null);
|
|
30
31
|
const [selectedFile, setSelectedFile] = react_1.useState();
|
|
@@ -33,6 +34,9 @@ exports.ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, su
|
|
|
33
34
|
if (event && event.target && event.target.files) {
|
|
34
35
|
const file = event.target.files[0];
|
|
35
36
|
setSelectedFile(file);
|
|
37
|
+
if (dispatch) {
|
|
38
|
+
dispatch(FileSectionState_1.actions.UPLOAD_FILE(file));
|
|
39
|
+
}
|
|
36
40
|
replaceAttachmentHandler(submissionId, fileName, file, attachmentDesignation);
|
|
37
41
|
hideActionList();
|
|
38
42
|
}
|
|
@@ -20,6 +20,7 @@ var ActionTypes;
|
|
|
20
20
|
ActionTypes["HANDLE_UPLOAD_ACTION"] = "handleUpload";
|
|
21
21
|
ActionTypes["HANDLE_FINISH_UPLOAD"] = "handleFinishUpload";
|
|
22
22
|
ActionTypes["HANDLE_SUCCESS_MESSAGE"] = "handleSuccessMessage";
|
|
23
|
+
ActionTypes["SHOW_FILE_UPLOADED_ALERT"] = "showFileUploadedAlert";
|
|
23
24
|
ActionTypes["CLOSE_FILE_UPLOADED_ALERT"] = "closeFileUploadedAlert";
|
|
24
25
|
})(ActionTypes || (ActionTypes = {}));
|
|
25
26
|
exports.reducer = (state, action) => {
|
|
@@ -44,7 +45,10 @@ exports.reducer = (state, action) => {
|
|
|
44
45
|
return Object.assign(Object.assign({}, state), { isOpenSelectDesignationPopup: false });
|
|
45
46
|
}
|
|
46
47
|
case ActionTypes.HANDLE_FINISH_UPLOAD: {
|
|
47
|
-
return Object.assign(Object.assign({}, state), { isUploadFile: false,
|
|
48
|
+
return Object.assign(Object.assign({}, state), { isUploadFile: false, uploadedFile: undefined, selectDesignation: undefined });
|
|
49
|
+
}
|
|
50
|
+
case ActionTypes.SHOW_FILE_UPLOADED_ALERT: {
|
|
51
|
+
return Object.assign(Object.assign({}, state), { isFileUploaded: true });
|
|
48
52
|
}
|
|
49
53
|
case ActionTypes.HANDLE_SUCCESS_MESSAGE: {
|
|
50
54
|
return Object.assign(Object.assign({}, state), { isShowSuccessMessage: true });
|
|
@@ -80,6 +84,9 @@ exports.actions = {
|
|
|
80
84
|
HANDLE_FINISH_UPLOAD: () => ({
|
|
81
85
|
type: ActionTypes.HANDLE_FINISH_UPLOAD,
|
|
82
86
|
}),
|
|
87
|
+
SHOW_FILE_UPLOADED_ALERT: () => ({
|
|
88
|
+
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
89
|
+
}),
|
|
83
90
|
CLOSE_FILE_UPLOADED_ALERT: () => ({
|
|
84
91
|
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
85
92
|
}),
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
const errorsExplanations = {
|
|
19
19
|
ANY_ERR_AUTHORIZATION: {
|
|
20
20
|
title: 'Authorization issue',
|
|
21
|
-
description: "It seems you don't have access to this
|
|
21
|
+
description: "It seems you don't have access to this resource. If you think you should have access, please contact the support team.",
|
|
22
22
|
type: 'System',
|
|
23
23
|
},
|
|
24
24
|
PREVIEW_HTML_GENERATION_FAILED: {
|
|
@@ -22,9 +22,19 @@ import { Designation, designationWithFileSectionsMap, FileSectionType, generateE
|
|
|
22
22
|
export const PermissionsContext = createContext(null);
|
|
23
23
|
export const FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, handleUpload, handleDownload, handleReplace, handleChangeDesignation, }) => {
|
|
24
24
|
const [state, dispatch] = useReducer(reducer, getInitialState());
|
|
25
|
-
const handleReplaceFile = useCallback((submissionId, name, file, typeId) => {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const handleReplaceFile = useCallback((submissionId, name, file, typeId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
dispatch(actions.HANDLE_UPLOAD_ACTION());
|
|
27
|
+
dispatch(actions.SELECT_DESIGNATION(namesWithDesignationMap.get(typeId) || Designation.Document));
|
|
28
|
+
const res = yield handleReplace(submissionId, name, file, typeId);
|
|
29
|
+
if (res) {
|
|
30
|
+
dispatch(actions.SHOW_FILE_UPLOADED_ALERT());
|
|
31
|
+
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
35
|
+
}
|
|
36
|
+
return res;
|
|
37
|
+
}), [handleReplace]);
|
|
28
38
|
const handleUploadFile = useCallback((submissionId, file, designation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
39
|
try {
|
|
30
40
|
dispatch(actions.HANDLE_UPLOAD_ACTION());
|
|
@@ -32,7 +42,13 @@ export const FileManager = ({ submissionId, externalFiles, enableDragAndDrop, ca
|
|
|
32
42
|
dispatch(actions.SELECT_DESIGNATION(Designation.Supplementary));
|
|
33
43
|
}
|
|
34
44
|
const res = yield handleUpload(submissionId, file, designation);
|
|
35
|
-
|
|
45
|
+
if (res) {
|
|
46
|
+
dispatch(actions.SHOW_FILE_UPLOADED_ALERT());
|
|
47
|
+
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
51
|
+
}
|
|
36
52
|
return res;
|
|
37
53
|
}
|
|
38
54
|
catch (e) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Link } from 'react-router-dom';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import { useDropdown } from '../../../hooks/use-dropdown';
|
|
5
4
|
import { DropdownContainer } from '../../Dropdown';
|
|
@@ -15,7 +14,7 @@ export const FileSectionItem = ({ submissionId, externalFile, title, showAttachm
|
|
|
15
14
|
const designation = namesWithDesignationMap.get(externalFile.designation);
|
|
16
15
|
const isMainManuscript = designation === Designation.MainManuscript;
|
|
17
16
|
return (React.createElement(Item, { ref: dragRef, className: className, style: style },
|
|
18
|
-
React.createElement(ItemContainer, {
|
|
17
|
+
React.createElement(ItemContainer, { onClick: () => (window.location.hash = isEditor ? `#${externalFile._id}` : '#') },
|
|
19
18
|
React.createElement(FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.filename }),
|
|
20
19
|
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 })),
|
|
21
20
|
onClose && (React.createElement(IconCloseButton, { onClick: (e) => {
|
|
@@ -26,7 +25,7 @@ export const FileSectionItem = ({ submissionId, externalFile, title, showAttachm
|
|
|
26
25
|
handleDownload && handleReplace && submissionId && (React.createElement(DropdownContainer, { ref: wrapperRef },
|
|
27
26
|
React.createElement(ActionsIcon, { onClick: toggleOpen, type: "button", "aria-label": "Download or Replace", "aria-pressed": isOpen },
|
|
28
27
|
React.createElement(DotsIcon, null)),
|
|
29
|
-
isOpen && (React.createElement(ItemActions, { replaceAttachmentHandler: handleReplace, downloadAttachmentHandler: handleDownload, submissionId: submissionId, fileName: externalFile.filename, designation: externalFile.designation, publicUrl: externalFile.publicUrl, hideActionList: toggleOpen }))))));
|
|
28
|
+
isOpen && (React.createElement(ItemActions, { replaceAttachmentHandler: handleReplace, downloadAttachmentHandler: handleDownload, submissionId: submissionId, fileName: externalFile.filename, designation: externalFile.designation, publicUrl: externalFile.publicUrl, hideActionList: toggleOpen, dispatch: dispatch }))))));
|
|
30
29
|
};
|
|
31
30
|
const IconCloseButton = styled.button `
|
|
32
31
|
border: none;
|
|
@@ -76,10 +75,9 @@ export const Item = styled.div `
|
|
|
76
75
|
margin-right: 8px;
|
|
77
76
|
}
|
|
78
77
|
`;
|
|
79
|
-
export const ItemContainer = styled
|
|
78
|
+
export const ItemContainer = styled.div `
|
|
80
79
|
display: flex;
|
|
81
80
|
min-width: calc(100% - 8px);
|
|
82
81
|
padding-right: 4px;
|
|
83
82
|
box-sizing: border-box;
|
|
84
|
-
text-decoration: none;
|
|
85
83
|
`;
|
|
@@ -8,7 +8,7 @@ export const FileSectionUploadItem = ({ fileName, isLoading, submissionId, dragR
|
|
|
8
8
|
const fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
|
|
9
9
|
fileName = fileName.substring(0, fileName.lastIndexOf('.'));
|
|
10
10
|
return (React.createElement(Item, { ref: dragRef, className: className, style: style },
|
|
11
|
-
React.createElement(UploadItemContainer,
|
|
11
|
+
React.createElement(UploadItemContainer, null,
|
|
12
12
|
React.createElement(FileTypeIcon, { withDot: false }),
|
|
13
13
|
React.createElement(FileInfoContainer, null,
|
|
14
14
|
React.createElement(FileNameContainer, null,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React, { useContext, useRef, useState } from 'react';
|
|
1
|
+
import React, { useContext, useRef, useState, } from 'react';
|
|
2
2
|
import { DropdownList } from '../../Dropdown';
|
|
3
3
|
import { PermissionsContext } from '../FileManager';
|
|
4
|
+
import { actions } from '../FileSectionState';
|
|
4
5
|
import { ActionsItem } from '../ItemsAction';
|
|
5
|
-
export const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, submissionId, fileName, designation, publicUrl, hideActionList, }) => {
|
|
6
|
+
export const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, submissionId, fileName, designation, publicUrl, hideActionList, dispatch, }) => {
|
|
6
7
|
const attachmentDesignation = designation == undefined ? 'undefined' : designation;
|
|
7
8
|
const fileInputRef = useRef(null);
|
|
8
9
|
const [selectedFile, setSelectedFile] = useState();
|
|
@@ -11,6 +12,9 @@ export const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandle
|
|
|
11
12
|
if (event && event.target && event.target.files) {
|
|
12
13
|
const file = event.target.files[0];
|
|
13
14
|
setSelectedFile(file);
|
|
15
|
+
if (dispatch) {
|
|
16
|
+
dispatch(actions.UPLOAD_FILE(file));
|
|
17
|
+
}
|
|
14
18
|
replaceAttachmentHandler(submissionId, fileName, file, attachmentDesignation);
|
|
15
19
|
hideActionList();
|
|
16
20
|
}
|
|
@@ -17,6 +17,7 @@ var ActionTypes;
|
|
|
17
17
|
ActionTypes["HANDLE_UPLOAD_ACTION"] = "handleUpload";
|
|
18
18
|
ActionTypes["HANDLE_FINISH_UPLOAD"] = "handleFinishUpload";
|
|
19
19
|
ActionTypes["HANDLE_SUCCESS_MESSAGE"] = "handleSuccessMessage";
|
|
20
|
+
ActionTypes["SHOW_FILE_UPLOADED_ALERT"] = "showFileUploadedAlert";
|
|
20
21
|
ActionTypes["CLOSE_FILE_UPLOADED_ALERT"] = "closeFileUploadedAlert";
|
|
21
22
|
})(ActionTypes || (ActionTypes = {}));
|
|
22
23
|
export const reducer = (state, action) => {
|
|
@@ -41,7 +42,10 @@ export const reducer = (state, action) => {
|
|
|
41
42
|
return Object.assign(Object.assign({}, state), { isOpenSelectDesignationPopup: false });
|
|
42
43
|
}
|
|
43
44
|
case ActionTypes.HANDLE_FINISH_UPLOAD: {
|
|
44
|
-
return Object.assign(Object.assign({}, state), { isUploadFile: false,
|
|
45
|
+
return Object.assign(Object.assign({}, state), { isUploadFile: false, uploadedFile: undefined, selectDesignation: undefined });
|
|
46
|
+
}
|
|
47
|
+
case ActionTypes.SHOW_FILE_UPLOADED_ALERT: {
|
|
48
|
+
return Object.assign(Object.assign({}, state), { isFileUploaded: true });
|
|
45
49
|
}
|
|
46
50
|
case ActionTypes.HANDLE_SUCCESS_MESSAGE: {
|
|
47
51
|
return Object.assign(Object.assign({}, state), { isShowSuccessMessage: true });
|
|
@@ -77,6 +81,9 @@ export const actions = {
|
|
|
77
81
|
HANDLE_FINISH_UPLOAD: () => ({
|
|
78
82
|
type: ActionTypes.HANDLE_FINISH_UPLOAD,
|
|
79
83
|
}),
|
|
84
|
+
SHOW_FILE_UPLOADED_ALERT: () => ({
|
|
85
|
+
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
86
|
+
}),
|
|
80
87
|
CLOSE_FILE_UPLOADED_ALERT: () => ({
|
|
81
88
|
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
82
89
|
}),
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
const errorsExplanations = {
|
|
17
17
|
ANY_ERR_AUTHORIZATION: {
|
|
18
18
|
title: 'Authorization issue',
|
|
19
|
-
description: "It seems you don't have access to this
|
|
19
|
+
description: "It seems you don't have access to this resource. If you think you should have access, please contact the support team.",
|
|
20
20
|
type: 'System',
|
|
21
21
|
},
|
|
22
22
|
PREVIEW_HTML_GENERATION_FAILED: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ExternalFile } from '@manuscripts/manuscripts-json-schema';
|
|
2
2
|
import React, { CSSProperties, Dispatch } from 'react';
|
|
3
3
|
import { DragElementWrapper, DragSourceOptions } from 'react-dnd';
|
|
4
|
-
import { Link } from 'react-router-dom';
|
|
5
4
|
import { Action } from '../FileSectionState';
|
|
6
5
|
export interface FileSectionItemProps {
|
|
7
6
|
submissionId?: string;
|
|
@@ -23,4 +22,4 @@ export interface FileSectionItemProps {
|
|
|
23
22
|
export declare const FileSectionItem: React.FC<FileSectionItemProps>;
|
|
24
23
|
export declare const ActionsIcon: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
25
24
|
export declare const Item: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
26
|
-
export declare const ItemContainer: import("styled-components").StyledComponent<
|
|
25
|
+
export declare const ItemContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -9,5 +9,5 @@ export interface FileSectionItemProps {
|
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
}
|
|
11
11
|
export declare const FileSectionUploadItem: React.FC<FileSectionItemProps>;
|
|
12
|
-
export declare const UploadItemContainer: import("styled-components").StyledComponent<
|
|
12
|
+
export declare const UploadItemContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
13
|
export declare const ProgressBar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Dispatch } from 'react';
|
|
2
|
+
import { Action } from '../FileSectionState';
|
|
2
3
|
export declare const ItemActions: React.FC<{
|
|
3
4
|
downloadAttachmentHandler: (url: string) => void;
|
|
4
5
|
replaceAttachmentHandler: (submissionId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
@@ -7,4 +8,5 @@ export declare const ItemActions: React.FC<{
|
|
|
7
8
|
designation?: string | undefined;
|
|
8
9
|
publicUrl: string | undefined;
|
|
9
10
|
hideActionList: () => void;
|
|
11
|
+
dispatch?: Dispatch<Action>;
|
|
10
12
|
}>;
|
|
@@ -22,6 +22,7 @@ declare enum ActionTypes {
|
|
|
22
22
|
HANDLE_UPLOAD_ACTION = "handleUpload",
|
|
23
23
|
HANDLE_FINISH_UPLOAD = "handleFinishUpload",
|
|
24
24
|
HANDLE_SUCCESS_MESSAGE = "handleSuccessMessage",
|
|
25
|
+
SHOW_FILE_UPLOADED_ALERT = "showFileUploadedAlert",
|
|
25
26
|
CLOSE_FILE_UPLOADED_ALERT = "closeFileUploadedAlert"
|
|
26
27
|
}
|
|
27
28
|
export declare const reducer: (state: State, action: Action) => State;
|
|
@@ -36,6 +37,7 @@ export declare const actions: {
|
|
|
36
37
|
SELECT_DESIGNATION: (designation: Designation) => Action;
|
|
37
38
|
MOVE_FILE: (submissionId: string, typeId: string, name: string, successMoveMessage: string) => Action;
|
|
38
39
|
HANDLE_FINISH_UPLOAD: () => Action;
|
|
40
|
+
SHOW_FILE_UPLOADED_ALERT: () => Action;
|
|
39
41
|
CLOSE_FILE_UPLOADED_ALERT: () => Action;
|
|
40
42
|
HANDLE_SUCCESS_MESSAGE: () => Action;
|
|
41
43
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "0.30.
|
|
4
|
+
"version": "0.30.16",
|
|
5
5
|
"repository": "gitlab:mpapp-public/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|