@manuscripts/style-guide 1.3.5-LEAN-2705-2 → 1.3.5-LEAN-2705-3
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.
|
@@ -99,28 +99,33 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialog
|
|
|
99
99
|
isProofer,
|
|
100
100
|
]);
|
|
101
101
|
const prevDialogMsgs = (0, react_1.useRef)();
|
|
102
|
+
const prevDialogueState = (0, react_1.useRef)();
|
|
102
103
|
(0, react_1.useEffect)(() => {
|
|
103
104
|
prevDialogMsgs.current = dialogMessages;
|
|
105
|
+
prevDialogueState.current = dialogData.state;
|
|
104
106
|
});
|
|
105
107
|
const messages = dialogData.state === __1.DialogState.CLOSED && prevDialogMsgs.current
|
|
106
108
|
? prevDialogMsgs.current
|
|
107
109
|
: dialogMessages;
|
|
110
|
+
const finalState = dialogData.state === __1.DialogState.CLOSED && prevDialogueState.current
|
|
111
|
+
? prevDialogueState.current
|
|
112
|
+
: dialogData.state;
|
|
108
113
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
109
114
|
(currentStepTransition && (currentStepTransition === null || currentStepTransition === void 0 ? void 0 : currentStepTransition.length) > 1 && (react_1.default.createElement(DropdownWrapper, { button: 'Complete task', disabled: disable, primary: true },
|
|
110
115
|
react_1.default.createElement(TaskDropdown, null, currentStepTransition &&
|
|
111
116
|
currentStepTransition.map((transition, index) => (react_1.default.createElement(Task, { key: 'task_' + transition.type.id, className: transition.status.id === 'success' ? 'happyPath' : '', value: index, onClick: onTransitionClick },
|
|
112
117
|
react_1.default.createElement("strong", null, transition.type.label),
|
|
113
118
|
transition.type.description))))))) || (react_1.default.createElement(EditorHeader_1.PrimaryButtonSmall, { value: 0, onClick: onTransitionClick, disabled: disable }, "Complete task")),
|
|
114
|
-
|
|
119
|
+
finalState === __1.DialogState.LOADING && (react_1.default.createElement(__1.LoadingOverlay, null,
|
|
115
120
|
react_1.default.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026"))),
|
|
116
|
-
react_1.default.createElement(__1.Dialog, { isOpen:
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
react_1.default.createElement(__1.Dialog, { isOpen: finalState !== __1.DialogState.CLOSED &&
|
|
122
|
+
finalState !== __1.DialogState.LOADING, category: __1.Category.confirmation, header: messages.header, message: messages.message, actions: messages.actions },
|
|
123
|
+
finalState === __1.DialogState.SUCCESS && (react_1.default.createElement(Grid, null,
|
|
119
124
|
previousStepType && (react_1.default.createElement(StepDetails, Object.assign({}, previousStepType, { icon: react_1.default.createElement(react_1.default.Fragment, null,
|
|
120
125
|
react_1.default.createElement(__1.TaskStepDoneIcon, null),
|
|
121
126
|
react_1.default.createElement(Line, null)) }))),
|
|
122
127
|
react_1.default.createElement(StepDetails, Object.assign({}, currentStepType)))),
|
|
123
|
-
|
|
128
|
+
finalState === __1.DialogState.ERROR && (react_1.default.createElement(AlertMessage_1.AlertMessage, { type: AlertMessage_1.AlertMessageType.error, hideCloseButton: true }, dialogData.error)))));
|
|
124
129
|
};
|
|
125
130
|
exports.ProceedView = ProceedView;
|
|
126
131
|
const TaskDropdown = styled_components_1.default.div `
|
|
@@ -70,28 +70,33 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
70
70
|
isProofer,
|
|
71
71
|
]);
|
|
72
72
|
const prevDialogMsgs = useRef();
|
|
73
|
+
const prevDialogueState = useRef();
|
|
73
74
|
useEffect(() => {
|
|
74
75
|
prevDialogMsgs.current = dialogMessages;
|
|
76
|
+
prevDialogueState.current = dialogData.state;
|
|
75
77
|
});
|
|
76
78
|
const messages = dialogData.state === DialogState.CLOSED && prevDialogMsgs.current
|
|
77
79
|
? prevDialogMsgs.current
|
|
78
80
|
: dialogMessages;
|
|
81
|
+
const finalState = dialogData.state === DialogState.CLOSED && prevDialogueState.current
|
|
82
|
+
? prevDialogueState.current
|
|
83
|
+
: dialogData.state;
|
|
79
84
|
return (React.createElement(React.Fragment, null,
|
|
80
85
|
(currentStepTransition && (currentStepTransition === null || currentStepTransition === void 0 ? void 0 : currentStepTransition.length) > 1 && (React.createElement(DropdownWrapper, { button: 'Complete task', disabled: disable, primary: true },
|
|
81
86
|
React.createElement(TaskDropdown, null, currentStepTransition &&
|
|
82
87
|
currentStepTransition.map((transition, index) => (React.createElement(Task, { key: 'task_' + transition.type.id, className: transition.status.id === 'success' ? 'happyPath' : '', value: index, onClick: onTransitionClick },
|
|
83
88
|
React.createElement("strong", null, transition.type.label),
|
|
84
89
|
transition.type.description))))))) || (React.createElement(PrimaryButtonSmall, { value: 0, onClick: onTransitionClick, disabled: disable }, "Complete task")),
|
|
85
|
-
|
|
90
|
+
finalState === DialogState.LOADING && (React.createElement(LoadingOverlay, null,
|
|
86
91
|
React.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026"))),
|
|
87
|
-
React.createElement(Dialog, { isOpen:
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
React.createElement(Dialog, { isOpen: finalState !== DialogState.CLOSED &&
|
|
93
|
+
finalState !== DialogState.LOADING, category: Category.confirmation, header: messages.header, message: messages.message, actions: messages.actions },
|
|
94
|
+
finalState === DialogState.SUCCESS && (React.createElement(Grid, null,
|
|
90
95
|
previousStepType && (React.createElement(StepDetails, Object.assign({}, previousStepType, { icon: React.createElement(React.Fragment, null,
|
|
91
96
|
React.createElement(TaskStepDoneIcon, null),
|
|
92
97
|
React.createElement(Line, null)) }))),
|
|
93
98
|
React.createElement(StepDetails, Object.assign({}, currentStepType)))),
|
|
94
|
-
|
|
99
|
+
finalState === DialogState.ERROR && (React.createElement(AlertMessage, { type: AlertMessageType.error, hideCloseButton: true }, dialogData.error)))));
|
|
95
100
|
};
|
|
96
101
|
const TaskDropdown = styled.div `
|
|
97
102
|
display: flex;
|
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.3.5-LEAN-2705-
|
|
4
|
+
"version": "1.3.5-LEAN-2705-3",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|