@manuscripts/style-guide 1.1.7-LEAN-2324-2 → 1.1.7-LEAN-2192-v8
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 +1 -1
- package/dist/cjs/components/EditorHeader/ProceedView.js +5 -5
- package/dist/cjs/components/SaveStatus.js +0 -15
- package/dist/cjs/lib/capabilities.js +0 -1
- package/dist/es/components/EditorHeader/EditorHeader.js +1 -1
- package/dist/es/components/EditorHeader/ProceedView.js +5 -5
- package/dist/es/components/SaveStatus.js +0 -15
- package/dist/es/lib/capabilities.js +0 -1
- package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -1
- package/dist/types/components/EditorHeader/ProceedView.d.ts +1 -1
- package/dist/types/lib/capabilities.d.ts +0 -1
- package/package.json +1 -1
|
@@ -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.
|
|
98
|
+
submission.previousStep && (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: submission.previousStep.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, 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
|
+
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
105
|
react_1.default.createElement(Line, null)) })),
|
|
106
|
-
react_1.default.createElement(StepDetails, Object.assign({},
|
|
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,7 +19,6 @@ 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"));
|
|
23
22
|
const react_1 = __importDefault(require("react"));
|
|
24
23
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
24
|
const save_icon_offline_1 = __importDefault(require("./icons/save-icon-offline"));
|
|
@@ -41,11 +40,6 @@ const SaveStatus = ({ status }) => {
|
|
|
41
40
|
react_1.default.createElement(PopPop, null,
|
|
42
41
|
react_1.default.createElement(save_icon_saved_1.default, null)),
|
|
43
42
|
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")));
|
|
49
43
|
default:
|
|
50
44
|
return null;
|
|
51
45
|
}
|
|
@@ -67,15 +61,6 @@ const Text = styled_components_1.default.span `
|
|
|
67
61
|
font-size: 14px;
|
|
68
62
|
font-weight: 700;
|
|
69
63
|
`;
|
|
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
|
-
`;
|
|
79
64
|
const RotateContinuous = styled_components_1.default.div `
|
|
80
65
|
svg {
|
|
81
66
|
animation: saveRotation 2.7s ease-in-out infinite;
|
|
@@ -55,7 +55,6 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
55
55
|
formatArticle: !isViewer(),
|
|
56
56
|
editArticle: !isViewer(),
|
|
57
57
|
editMetadata: !(isViewer() || isAnnotator()),
|
|
58
|
-
editCitationsAndRefs: !(isViewer() || isAnnotator()),
|
|
59
58
|
shareProject: isOwner(),
|
|
60
59
|
};
|
|
61
60
|
};
|
|
@@ -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.
|
|
69
|
+
submission.previousStep && (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: submission.previousStep.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, 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
|
+
React.createElement(StepDetails, Object.assign({}, previousStepType, { icon: React.createElement(React.Fragment, null,
|
|
75
75
|
React.createElement(TaskStepDoneIcon, null),
|
|
76
76
|
React.createElement(Line, null)) })),
|
|
77
|
-
React.createElement(StepDetails, Object.assign({},
|
|
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,7 +13,6 @@
|
|
|
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';
|
|
17
16
|
import React from 'react';
|
|
18
17
|
import styled from 'styled-components';
|
|
19
18
|
import SaveIconOffline from './icons/save-icon-offline';
|
|
@@ -35,11 +34,6 @@ export const SaveStatus = ({ status }) => {
|
|
|
35
34
|
React.createElement(PopPop, null,
|
|
36
35
|
React.createElement(SaveIconSaved, null)),
|
|
37
36
|
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")));
|
|
43
37
|
default:
|
|
44
38
|
return null;
|
|
45
39
|
}
|
|
@@ -60,15 +54,6 @@ const Text = styled.span `
|
|
|
60
54
|
font-size: 14px;
|
|
61
55
|
font-weight: 700;
|
|
62
56
|
`;
|
|
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
|
-
`;
|
|
72
57
|
const RotateContinuous = styled.div `
|
|
73
58
|
svg {
|
|
74
59
|
animation: saveRotation 2.7s ease-in-out infinite;
|
|
@@ -49,7 +49,6 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
49
49
|
formatArticle: !isViewer(),
|
|
50
50
|
editArticle: !isViewer(),
|
|
51
51
|
editMetadata: !(isViewer() || isAnnotator()),
|
|
52
|
-
editCitationsAndRefs: !(isViewer() || isAnnotator()),
|
|
53
52
|
shareProject: isOwner(),
|
|
54
53
|
};
|
|
55
54
|
};
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
export type PartialSubmission = {
|
|
4
4
|
id: string;
|
|
5
5
|
currentStep: SubmissionStep;
|
|
6
|
-
|
|
6
|
+
previousStep?: SubmissionStep | null | undefined;
|
|
7
7
|
};
|
|
8
8
|
export type SubmissionStep = {
|
|
9
9
|
type: SubmissionStepType;
|
|
@@ -11,7 +11,7 @@ export declare const ProceedView: React.FC<{
|
|
|
11
11
|
noteValue: string;
|
|
12
12
|
currentStepTransition: SubmissionStepTransition[];
|
|
13
13
|
error: string | undefined;
|
|
14
|
-
|
|
14
|
+
previousStepType: SubmissionStepType;
|
|
15
15
|
currentStepType: SubmissionStepType;
|
|
16
16
|
confirmationDialog: boolean;
|
|
17
17
|
onCancelClick: () => 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.7-LEAN-
|
|
4
|
+
"version": "1.1.7-LEAN-2192-v8",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|