@manuscripts/style-guide 1.0.0 → 1.0.1
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/NOTICE
ADDED
|
@@ -44,16 +44,18 @@ const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, deta
|
|
|
44
44
|
const attachmentDesignationName = attachmentDesignation !== 'undefined'
|
|
45
45
|
? util_1.namesWithDesignationMap.get(attachmentDesignation)
|
|
46
46
|
: undefined;
|
|
47
|
-
const
|
|
47
|
+
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
48
|
+
const canBeReplaced = ((showReplaceAction == undefined || showReplaceAction) &&
|
|
48
49
|
(attachmentDesignationName == undefined ||
|
|
49
50
|
![
|
|
50
51
|
util_1.Designation.MainManuscript,
|
|
51
52
|
util_1.Designation.SubmissionFile,
|
|
52
53
|
util_1.Designation.SubmissionPdf,
|
|
53
|
-
].includes(attachmentDesignationName))
|
|
54
|
+
].includes(attachmentDesignationName))) ||
|
|
55
|
+
(attachmentDesignationName == util_1.Designation.MainManuscript &&
|
|
56
|
+
(can === null || can === void 0 ? void 0 : can.setMainManuscript));
|
|
54
57
|
const fileInputRef = (0, react_1.useRef)(null);
|
|
55
58
|
const [selectedFile, setSelectedFile] = (0, react_1.useState)();
|
|
56
|
-
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
57
59
|
const handleChange = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
60
|
if (event && event.target && event.target.files) {
|
|
59
61
|
const file = event.target.files[0];
|
|
@@ -18,16 +18,18 @@ export const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandle
|
|
|
18
18
|
const attachmentDesignationName = attachmentDesignation !== 'undefined'
|
|
19
19
|
? namesWithDesignationMap.get(attachmentDesignation)
|
|
20
20
|
: undefined;
|
|
21
|
-
const
|
|
21
|
+
const can = useContext(PermissionsContext);
|
|
22
|
+
const canBeReplaced = ((showReplaceAction == undefined || showReplaceAction) &&
|
|
22
23
|
(attachmentDesignationName == undefined ||
|
|
23
24
|
![
|
|
24
25
|
Designation.MainManuscript,
|
|
25
26
|
Designation.SubmissionFile,
|
|
26
27
|
Designation.SubmissionPdf,
|
|
27
|
-
].includes(attachmentDesignationName))
|
|
28
|
+
].includes(attachmentDesignationName))) ||
|
|
29
|
+
(attachmentDesignationName == Designation.MainManuscript &&
|
|
30
|
+
(can === null || can === void 0 ? void 0 : can.setMainManuscript));
|
|
28
31
|
const fileInputRef = useRef(null);
|
|
29
32
|
const [selectedFile, setSelectedFile] = useState();
|
|
30
|
-
const can = useContext(PermissionsContext);
|
|
31
33
|
const handleChange = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
34
|
if (event && event.target && event.target.files) {
|
|
33
35
|
const file = event.target.files[0];
|
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": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|