@manuscripts/style-guide 1.2.2-LEAN-2705 → 1.2.2-LEAN-2810-0
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/FileSectionItem/FileInfo.js +6 -2
- package/dist/cjs/lib/capabilities.js +0 -1
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +6 -2
- package/dist/es/lib/capabilities.js +0 -1
- package/dist/types/lib/capabilities.d.ts +0 -1
- package/package.json +2 -2
|
@@ -32,9 +32,12 @@ const react_1 = __importStar(require("react"));
|
|
|
32
32
|
const react_tooltip_1 = __importDefault(require("react-tooltip"));
|
|
33
33
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
34
34
|
const FileManager_1 = require("../FileManager");
|
|
35
|
+
const TooltipDiv_1 = require("../TooltipDiv");
|
|
35
36
|
const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, fileCreatedDate, }) => {
|
|
36
37
|
const fileName = fileAttachmentName.substring(0, fileAttachmentName.lastIndexOf('.'));
|
|
37
38
|
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
39
|
+
fileCreatedDate = new Date();
|
|
40
|
+
console.log(fileCreatedDate);
|
|
38
41
|
return (react_1.default.createElement(exports.FileInfoContainer, null,
|
|
39
42
|
react_1.default.createElement(exports.FileNameTitleContainer, null,
|
|
40
43
|
react_1.default.createElement(exports.FileTitle, null,
|
|
@@ -47,7 +50,9 @@ const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension
|
|
|
47
50
|
fileExtension))),
|
|
48
51
|
fileCreatedDate && (react_1.default.createElement(exports.FileDateContainer, { "data-tip": "tooltip-content" },
|
|
49
52
|
react_1.default.createElement(exports.FileDate, null, (0, date_fns_1.format)(new Date(fileCreatedDate), 'M/d/yy, HH:mm')),
|
|
50
|
-
react_1.default.createElement(
|
|
53
|
+
react_1.default.createElement(TooltipDiv_1.TooltipDiv, null,
|
|
54
|
+
react_1.default.createElement(react_tooltip_1.default, { place: "bottom", offset: { top: 0 }, effect: "solid", className: "tooltip" },
|
|
55
|
+
react_1.default.createElement("div", null, "File uploaded"))))))));
|
|
51
56
|
};
|
|
52
57
|
exports.FileInfo = FileInfo;
|
|
53
58
|
exports.FileDateContainer = styled_components_1.default.div `
|
|
@@ -55,7 +60,6 @@ exports.FileDateContainer = styled_components_1.default.div `
|
|
|
55
60
|
overflow: hidden;
|
|
56
61
|
width: 100%;
|
|
57
62
|
display: none;
|
|
58
|
-
display: flex;
|
|
59
63
|
justify-content: flex-end;
|
|
60
64
|
`;
|
|
61
65
|
exports.FileInfoContainer = styled_components_1.default.div `
|
|
@@ -59,7 +59,6 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
59
59
|
editMetadata: !(isViewer() || isAnnotator() || isProofer()),
|
|
60
60
|
editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
|
|
61
61
|
shareProject: isOwner(),
|
|
62
|
-
applySaveChanges: !(isAnnotator() || isProofer()),
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
64
|
exports.getCapabilities = getCapabilities;
|
|
@@ -3,9 +3,12 @@ import React, { useContext } from 'react';
|
|
|
3
3
|
import ReactTooltip from 'react-tooltip';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { PermissionsContext } from '../FileManager';
|
|
6
|
+
import { TooltipDiv } from '../TooltipDiv';
|
|
6
7
|
export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, fileCreatedDate, }) => {
|
|
7
8
|
const fileName = fileAttachmentName.substring(0, fileAttachmentName.lastIndexOf('.'));
|
|
8
9
|
const can = useContext(PermissionsContext);
|
|
10
|
+
fileCreatedDate = new Date();
|
|
11
|
+
console.log(fileCreatedDate);
|
|
9
12
|
return (React.createElement(FileInfoContainer, null,
|
|
10
13
|
React.createElement(FileNameTitleContainer, null,
|
|
11
14
|
React.createElement(FileTitle, null,
|
|
@@ -18,14 +21,15 @@ export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileEx
|
|
|
18
21
|
fileExtension))),
|
|
19
22
|
fileCreatedDate && (React.createElement(FileDateContainer, { "data-tip": "tooltip-content" },
|
|
20
23
|
React.createElement(FileDate, null, format(new Date(fileCreatedDate), 'M/d/yy, HH:mm')),
|
|
21
|
-
React.createElement(
|
|
24
|
+
React.createElement(TooltipDiv, null,
|
|
25
|
+
React.createElement(ReactTooltip, { place: "bottom", offset: { top: 0 }, effect: "solid", className: "tooltip" },
|
|
26
|
+
React.createElement("div", null, "File uploaded"))))))));
|
|
22
27
|
};
|
|
23
28
|
export const FileDateContainer = styled.div `
|
|
24
29
|
line-height: 20px;
|
|
25
30
|
overflow: hidden;
|
|
26
31
|
width: 100%;
|
|
27
32
|
display: none;
|
|
28
|
-
display: flex;
|
|
29
33
|
justify-content: flex-end;
|
|
30
34
|
`;
|
|
31
35
|
export const FileInfoContainer = styled.div `
|
|
@@ -53,7 +53,6 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
53
53
|
editMetadata: !(isViewer() || isAnnotator() || isProofer()),
|
|
54
54
|
editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
|
|
55
55
|
shareProject: isOwner(),
|
|
56
|
-
applySaveChanges: !(isAnnotator() || isProofer()),
|
|
57
56
|
};
|
|
58
57
|
};
|
|
59
58
|
export const getAllPermitted = () => {
|
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.2.2-LEAN-
|
|
4
|
+
"version": "1.2.2-LEAN-2810-0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -141,4 +141,4 @@
|
|
|
141
141
|
"resolutions": {
|
|
142
142
|
"@types/react": "^17.0.2"
|
|
143
143
|
}
|
|
144
|
-
}
|
|
144
|
+
}
|