@manuscripts/style-guide 1.1.9 → 1.1.10

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.
@@ -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, nextStepType: submission.nextStep.type, currentStepType: submission.currentStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
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, nextStepType, currentStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
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 ${nextStepType.label}`,
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
- nextStepType,
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({}, currentStepType, { icon: react_1.default.createElement(react_1.default.Fragment, null,
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({}, nextStepType))))) ||
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))))));
@@ -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, nextStepType: submission.nextStep.type, currentStepType: submission.currentStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
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, nextStepType, currentStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
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 ${nextStepType.label}`,
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
- nextStepType,
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({}, currentStepType, { icon: React.createElement(React.Fragment, null,
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({}, nextStepType))))) ||
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))))));
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  export type PartialSubmission = {
4
4
  id: string;
5
5
  currentStep: SubmissionStep;
6
+ previousStep?: SubmissionStep | null | undefined;
6
7
  nextStep?: SubmissionStep | null | undefined;
7
8
  };
8
9
  export type SubmissionStep = {
@@ -11,8 +11,9 @@ export declare const ProceedView: React.FC<{
11
11
  noteValue: string;
12
12
  currentStepTransition: SubmissionStepTransition[];
13
13
  error: string | undefined;
14
- nextStepType: SubmissionStepType;
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.9",
4
+ "version": "1.1.10",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",