@manuscripts/style-guide 1.1.9 → 1.1.11-LEAN-2615
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/EditorHeader/EditorHeader.js +2 -2
- package/dist/cjs/components/EditorHeader/ProceedView.js +6 -6
- package/dist/cjs/components/SaveStatus.js +15 -0
- package/dist/cjs/lib/capabilities.js +1 -0
- package/dist/es/components/EditorHeader/EditorHeader.js +2 -2
- package/dist/es/components/EditorHeader/ProceedView.js +6 -6
- package/dist/es/components/SaveStatus.js +15 -0
- package/dist/es/lib/capabilities.js +1 -0
- package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -0
- package/dist/types/components/EditorHeader/ProceedView.d.ts +2 -1
- package/dist/types/lib/capabilities.d.ts +1 -0
- package/package.json +2 -2
|
@@ -49,7 +49,7 @@ const MapUserRole = {
|
|
|
49
49
|
Viewer: { label: 'Reading...', icon: __1.ReadingIcon },
|
|
50
50
|
};
|
|
51
51
|
const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userRole, canCompleteTask, submitProceed, goBack, status, isAnnotator, message, exceptionDialog: ExceptionDialog, disabelProceedNote, }) => {
|
|
52
|
-
var _a, _b, _c;
|
|
52
|
+
var _a, _b, _c, _d;
|
|
53
53
|
const [confirmationDialog, toggleConfirmationDialog] = (0, react_1.useState)(false);
|
|
54
54
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
55
55
|
const [noteValue, setNoteValue] = (0, react_1.useState)('');
|
|
@@ -95,7 +95,7 @@ const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userR
|
|
|
95
95
|
react_1.default.createElement("span", null, "Dashboard"))),
|
|
96
96
|
handleSnapshot &&
|
|
97
97
|
typeof hasPendingSuggestions == 'boolean' &&
|
|
98
|
-
submission.nextStep && (react_1.default.createElement(ProceedView_1.ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, loading: loading, showComplete: showComplete, noteValue: noteValue, currentStepTransition: currentStepTransition, error: error,
|
|
98
|
+
submission.nextStep && (react_1.default.createElement(ProceedView_1.ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, loading: loading, showComplete: showComplete, noteValue: noteValue, currentStepTransition: currentStepTransition, error: error, currentStepType: submission.currentStep.type, previousStepType: (_d = submission.previousStep) === null || _d === void 0 ? void 0 : _d.type, nextStepType: submission.nextStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
|
|
99
99
|
status && (react_1.default.createElement(ChildWrapper, null,
|
|
100
100
|
react_1.default.createElement(__1.SaveStatus, { status: status }))),
|
|
101
101
|
react_1.default.createElement(Spacer, null),
|
|
@@ -46,7 +46,7 @@ const StepDetails = ({ icon, label, description, role }) => (react_1.default.cre
|
|
|
46
46
|
react_1.default.createElement(__1.SecondarySmallText, null,
|
|
47
47
|
"Actor: ",
|
|
48
48
|
role.label))));
|
|
49
|
-
const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog,
|
|
49
|
+
const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog, previousStepType, currentStepType, nextStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
|
|
50
50
|
const dialogMessages = (0, react_1.useMemo)(() => hasPendingSuggestions && !isAnnotator
|
|
51
51
|
? {
|
|
52
52
|
header: 'The task can not be transitioned to the next step',
|
|
@@ -62,7 +62,7 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loadin
|
|
|
62
62
|
: showComplete
|
|
63
63
|
? {
|
|
64
64
|
header: 'Content reassigned successfully',
|
|
65
|
-
message: `to the ${
|
|
65
|
+
message: `to the ${currentStepType.label}`,
|
|
66
66
|
actions: {
|
|
67
67
|
primary: {
|
|
68
68
|
action: onCancelClick,
|
|
@@ -87,7 +87,7 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loadin
|
|
|
87
87
|
showComplete,
|
|
88
88
|
continueDialogAction,
|
|
89
89
|
onCancelClick,
|
|
90
|
-
|
|
90
|
+
currentStepType,
|
|
91
91
|
hasPendingSuggestions,
|
|
92
92
|
isAnnotator,
|
|
93
93
|
]);
|
|
@@ -100,10 +100,10 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loadin
|
|
|
100
100
|
(loading && (react_1.default.createElement(__1.LoadingOverlay, null,
|
|
101
101
|
react_1.default.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026")))) || (react_1.default.createElement(__1.Dialog, { isOpen: confirmationDialog && !loading, category: __1.Category.confirmation, header: dialogMessages.header, message: dialogMessages.message, actions: dialogMessages.actions },
|
|
102
102
|
(showComplete && (react_1.default.createElement(Grid, null,
|
|
103
|
-
react_1.default.createElement(StepDetails, Object.assign({},
|
|
103
|
+
previousStepType && (react_1.default.createElement(StepDetails, Object.assign({}, previousStepType, { icon: react_1.default.createElement(react_1.default.Fragment, null,
|
|
104
104
|
react_1.default.createElement(__1.TaskStepDoneIcon, null),
|
|
105
|
-
react_1.default.createElement(Line, null)) })),
|
|
106
|
-
react_1.default.createElement(StepDetails, Object.assign({},
|
|
105
|
+
react_1.default.createElement(Line, null)) }))),
|
|
106
|
+
react_1.default.createElement(StepDetails, Object.assign({}, currentStepType))))) ||
|
|
107
107
|
((!hasPendingSuggestions || isAnnotator) && onNoteChange && (react_1.default.createElement(TextAreaWrapper, null,
|
|
108
108
|
react_1.default.createElement(EditorHeader_1.MediumTextArea, { value: noteValue, onChange: onNoteChange, rows: 5, placeholder: 'Add any additional comment here...' })))),
|
|
109
109
|
error && (react_1.default.createElement(AlertMessage_1.AlertMessage, { type: AlertMessage_1.AlertMessageType.error, hideCloseButton: true }, error))))));
|
|
@@ -19,6 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.SaveStatus = void 0;
|
|
22
|
+
const AttentionRed_1 = __importDefault(require("@manuscripts/assets/react/AttentionRed"));
|
|
22
23
|
const react_1 = __importDefault(require("react"));
|
|
23
24
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
25
|
const save_icon_offline_1 = __importDefault(require("./icons/save-icon-offline"));
|
|
@@ -40,6 +41,11 @@ const SaveStatus = ({ status }) => {
|
|
|
40
41
|
react_1.default.createElement(PopPop, null,
|
|
41
42
|
react_1.default.createElement(save_icon_saved_1.default, null)),
|
|
42
43
|
react_1.default.createElement(Text, null, "Saved")));
|
|
44
|
+
case 'failed':
|
|
45
|
+
return (react_1.default.createElement(FailedContainer, null,
|
|
46
|
+
react_1.default.createElement(PopPop, null,
|
|
47
|
+
react_1.default.createElement(AttentionRed_1.default, { width: 20, height: 20 })),
|
|
48
|
+
react_1.default.createElement(FailedText, null, "Failed To Save")));
|
|
43
49
|
default:
|
|
44
50
|
return null;
|
|
45
51
|
}
|
|
@@ -61,6 +67,15 @@ const Text = styled_components_1.default.span `
|
|
|
61
67
|
font-size: 14px;
|
|
62
68
|
font-weight: 700;
|
|
63
69
|
`;
|
|
70
|
+
const FailedContainer = (0, styled_components_1.default)(Container) `
|
|
71
|
+
path {
|
|
72
|
+
stroke: ${(props) => props.theme.colors.text.error};
|
|
73
|
+
stroke-width: 0;
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
const FailedText = (0, styled_components_1.default)(Text) `
|
|
77
|
+
color: ${(props) => props.theme.colors.text.error};
|
|
78
|
+
`;
|
|
64
79
|
const RotateContinuous = styled_components_1.default.div `
|
|
65
80
|
svg {
|
|
66
81
|
animation: saveRotation 2.7s ease-in-out infinite;
|
|
@@ -56,6 +56,7 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
56
56
|
formatArticle: !isViewer(),
|
|
57
57
|
editArticle: !isViewer(),
|
|
58
58
|
editMetadata: !(isViewer() || isAnnotator()),
|
|
59
|
+
editCitationsAndRefs: !(isViewer() || isAnnotator()),
|
|
59
60
|
shareProject: isOwner(),
|
|
60
61
|
};
|
|
61
62
|
};
|
|
@@ -20,7 +20,7 @@ const MapUserRole = {
|
|
|
20
20
|
Viewer: { label: 'Reading...', icon: ReadingIcon },
|
|
21
21
|
};
|
|
22
22
|
export const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userRole, canCompleteTask, submitProceed, goBack, status, isAnnotator, message, exceptionDialog: ExceptionDialog, disabelProceedNote, }) => {
|
|
23
|
-
var _a, _b, _c;
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
24
|
const [confirmationDialog, toggleConfirmationDialog] = useState(false);
|
|
25
25
|
const [loading, setLoading] = useState(false);
|
|
26
26
|
const [noteValue, setNoteValue] = useState('');
|
|
@@ -66,7 +66,7 @@ export const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions
|
|
|
66
66
|
React.createElement("span", null, "Dashboard"))),
|
|
67
67
|
handleSnapshot &&
|
|
68
68
|
typeof hasPendingSuggestions == 'boolean' &&
|
|
69
|
-
submission.nextStep && (React.createElement(ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, loading: loading, showComplete: showComplete, noteValue: noteValue, currentStepTransition: currentStepTransition, error: error,
|
|
69
|
+
submission.nextStep && (React.createElement(ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, loading: loading, showComplete: showComplete, noteValue: noteValue, currentStepTransition: currentStepTransition, error: error, currentStepType: submission.currentStep.type, previousStepType: (_d = submission.previousStep) === null || _d === void 0 ? void 0 : _d.type, nextStepType: submission.nextStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
|
|
70
70
|
status && (React.createElement(ChildWrapper, null,
|
|
71
71
|
React.createElement(SaveStatus, { status: status }))),
|
|
72
72
|
React.createElement(Spacer, null),
|
|
@@ -17,7 +17,7 @@ const StepDetails = ({ icon, label, description, role }) => (React.createElement
|
|
|
17
17
|
React.createElement(SecondarySmallText, null,
|
|
18
18
|
"Actor: ",
|
|
19
19
|
role.label))));
|
|
20
|
-
export const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog,
|
|
20
|
+
export const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog, previousStepType, currentStepType, nextStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
|
|
21
21
|
const dialogMessages = useMemo(() => hasPendingSuggestions && !isAnnotator
|
|
22
22
|
? {
|
|
23
23
|
header: 'The task can not be transitioned to the next step',
|
|
@@ -33,7 +33,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
33
33
|
: showComplete
|
|
34
34
|
? {
|
|
35
35
|
header: 'Content reassigned successfully',
|
|
36
|
-
message: `to the ${
|
|
36
|
+
message: `to the ${currentStepType.label}`,
|
|
37
37
|
actions: {
|
|
38
38
|
primary: {
|
|
39
39
|
action: onCancelClick,
|
|
@@ -58,7 +58,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
58
58
|
showComplete,
|
|
59
59
|
continueDialogAction,
|
|
60
60
|
onCancelClick,
|
|
61
|
-
|
|
61
|
+
currentStepType,
|
|
62
62
|
hasPendingSuggestions,
|
|
63
63
|
isAnnotator,
|
|
64
64
|
]);
|
|
@@ -71,10 +71,10 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
71
71
|
(loading && (React.createElement(LoadingOverlay, null,
|
|
72
72
|
React.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026")))) || (React.createElement(Dialog, { isOpen: confirmationDialog && !loading, category: Category.confirmation, header: dialogMessages.header, message: dialogMessages.message, actions: dialogMessages.actions },
|
|
73
73
|
(showComplete && (React.createElement(Grid, null,
|
|
74
|
-
React.createElement(StepDetails, Object.assign({},
|
|
74
|
+
previousStepType && (React.createElement(StepDetails, Object.assign({}, previousStepType, { icon: React.createElement(React.Fragment, null,
|
|
75
75
|
React.createElement(TaskStepDoneIcon, null),
|
|
76
|
-
React.createElement(Line, null)) })),
|
|
77
|
-
React.createElement(StepDetails, Object.assign({},
|
|
76
|
+
React.createElement(Line, null)) }))),
|
|
77
|
+
React.createElement(StepDetails, Object.assign({}, currentStepType))))) ||
|
|
78
78
|
((!hasPendingSuggestions || isAnnotator) && onNoteChange && (React.createElement(TextAreaWrapper, null,
|
|
79
79
|
React.createElement(MediumTextArea, { value: noteValue, onChange: onNoteChange, rows: 5, placeholder: 'Add any additional comment here...' })))),
|
|
80
80
|
error && (React.createElement(AlertMessage, { type: AlertMessageType.error, hideCloseButton: true }, error))))));
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import AttentionRed from '@manuscripts/assets/react/AttentionRed';
|
|
16
17
|
import React from 'react';
|
|
17
18
|
import styled from 'styled-components';
|
|
18
19
|
import SaveIconOffline from './icons/save-icon-offline';
|
|
@@ -34,6 +35,11 @@ export const SaveStatus = ({ status }) => {
|
|
|
34
35
|
React.createElement(PopPop, null,
|
|
35
36
|
React.createElement(SaveIconSaved, null)),
|
|
36
37
|
React.createElement(Text, null, "Saved")));
|
|
38
|
+
case 'failed':
|
|
39
|
+
return (React.createElement(FailedContainer, null,
|
|
40
|
+
React.createElement(PopPop, null,
|
|
41
|
+
React.createElement(AttentionRed, { width: 20, height: 20 })),
|
|
42
|
+
React.createElement(FailedText, null, "Failed To Save")));
|
|
37
43
|
default:
|
|
38
44
|
return null;
|
|
39
45
|
}
|
|
@@ -54,6 +60,15 @@ const Text = styled.span `
|
|
|
54
60
|
font-size: 14px;
|
|
55
61
|
font-weight: 700;
|
|
56
62
|
`;
|
|
63
|
+
const FailedContainer = styled(Container) `
|
|
64
|
+
path {
|
|
65
|
+
stroke: ${(props) => props.theme.colors.text.error};
|
|
66
|
+
stroke-width: 0;
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const FailedText = styled(Text) `
|
|
70
|
+
color: ${(props) => props.theme.colors.text.error};
|
|
71
|
+
`;
|
|
57
72
|
const RotateContinuous = styled.div `
|
|
58
73
|
svg {
|
|
59
74
|
animation: saveRotation 2.7s ease-in-out infinite;
|
|
@@ -50,6 +50,7 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
50
50
|
formatArticle: !isViewer(),
|
|
51
51
|
editArticle: !isViewer(),
|
|
52
52
|
editMetadata: !(isViewer() || isAnnotator()),
|
|
53
|
+
editCitationsAndRefs: !(isViewer() || isAnnotator()),
|
|
53
54
|
shareProject: isOwner(),
|
|
54
55
|
};
|
|
55
56
|
};
|
|
@@ -11,8 +11,9 @@ export declare const ProceedView: React.FC<{
|
|
|
11
11
|
noteValue: string;
|
|
12
12
|
currentStepTransition: SubmissionStepTransition[];
|
|
13
13
|
error: string | undefined;
|
|
14
|
-
|
|
14
|
+
previousStepType: SubmissionStepType | undefined;
|
|
15
15
|
currentStepType: SubmissionStepType;
|
|
16
|
+
nextStepType: SubmissionStepType;
|
|
16
17
|
confirmationDialog: boolean;
|
|
17
18
|
onCancelClick: () => void;
|
|
18
19
|
continueDialogAction: () => Promise<void>;
|
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.1.
|
|
4
|
+
"version": "1.1.11-LEAN-2615",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@formatjs/intl-relativetimeformat": "^4.5.9",
|
|
37
37
|
"@formatjs/intl-utils": "^2.2.0",
|
|
38
38
|
"@manuscripts/assets": "^0.6.2",
|
|
39
|
-
"@manuscripts/transform": "^1.3.0",
|
|
39
|
+
"@manuscripts/transform": "^1.3.0-LEAN-2615",
|
|
40
40
|
"@manuscripts/json-schema": "^2.0.2",
|
|
41
41
|
"@manuscripts/title-editor": "^1.1.0",
|
|
42
42
|
"@manuscripts/comment-editor": "^1.0.1",
|