| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62 | 2×
2×
2×
2×
2×
2×
2×
2×
2×
52×
52×
52×
52×
52×
52×
52×
52×
52×
52×
52×
| var AsyncButton, BS, CardBody, React, StepPanel, TaskStepStore, TaskStore, _, ref;
React = require('react');
BS = require('react-bootstrap');
_ = require('underscore');
StepPanel = require('../../helpers/policies').StepPanel;
ref = require('openstax-react-components'), AsyncButton = ref.AsyncButton, CardBody = ref.CardBody;
TaskStore = require('../../flux/task').TaskStore;
TaskStepStore = require('../../flux/task-step').TaskStepStore;
module.exports = {
renderContinueButton: function() {
var cannotContinue, waitingText;
Iif (typeof this.hideContinueButton === "function" ? this.hideContinueButton() : void 0) {
return null;
}
waitingText = (function() {
switch (false) {
case !TaskStepStore.isLoading(this.props.id):
return "Loading…";
case !TaskStepStore.isSaving(this.props.id):
return "Saving…";
default:
return null;
}
}).call(this);
cannotContinue = !StepPanel.canContinue(this.props.id) || !(typeof this.isContinueEnabled === "function" ? this.isContinueEnabled() : void 0);
return React.createElement(AsyncButton, {
"bsStyle": 'primary',
"className": 'continue',
"key": 'step-continue',
"onClick": this.onContinue,
"disabled": cannotContinue,
"isWaiting": !!waitingText,
"waitingText": waitingText,
"isFailed": TaskStepStore.isFailed(this.props.id)
}, (typeof this.continueButtonText === "function" ? this.continueButtonText() : void 0) || 'Continue');
},
render: function() {
var courseId, footer, id, pinned, ref1, review, taskId;
ref1 = this.props, pinned = ref1.pinned, courseId = ref1.courseId, id = ref1.id, taskId = ref1.taskId, review = ref1.review;
footer = this.renderFooter({
stepId: id,
taskId: taskId,
courseId: courseId,
review: review
});
return React.createElement(CardBody, {
"className": 'task-step',
"footer": footer,
"pinned": pinned
}, this.renderBody(), typeof this.renderGroup === "function" ? this.renderGroup() : void 0);
}
};
|