-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: rely on new error_reason
field to determine failed learner_state
reason
#1079
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
673943c
chore: remove console.logs
adamstankiewicz 0e526c4
chore: update tests to account for multiple actions
adamstankiewicz 5138adb
chore: remove newline
adamstankiewicz 04c759c
fix: rely on error_reason returned on assignment record
adamstankiewicz 13dd8cc
chore: update tests
adamstankiewicz dad9642
chore: use email_error instead of bad_email
adamstankiewicz 5909068
chore: remove copy
adamstankiewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,19 @@ import FailedBadEmail from './assignments-status-chips/FailedBadEmail'; | |
import FailedSystem from './assignments-status-chips/FailedSystem'; | ||
|
||
const AssignmentStatusTableCell = ({ row }) => { | ||
const { original: { learnerEmail, learnerState } } = row; | ||
const { original } = row; | ||
const { | ||
learnerEmail, | ||
learnerState, | ||
errorReason, | ||
} = original; | ||
|
||
// Learner state is not available for this assignment, so don't display anything. | ||
if (!learnerState) { | ||
return null; | ||
} | ||
|
||
// Display the appropriate status chip based on the learner state. | ||
if (learnerState === 'notifying') { | ||
return ( | ||
<NotifyingLearner learnerEmail={learnerEmail} /> | ||
|
@@ -29,12 +35,8 @@ const AssignmentStatusTableCell = ({ row }) => { | |
} | ||
|
||
if (learnerState === 'failed') { | ||
// Determine the failure reason based on the actions. | ||
const { actions } = row.original; | ||
const mostRecentAction = actions[0]; // API returns actions in reverse chronological order. | ||
const isBadEmailError = mostRecentAction.actionType === 'notified' && !!mostRecentAction.errorReason; | ||
|
||
if (isBadEmailError) { | ||
// Determine which failure chip to display based on the error reason. | ||
if (errorReason === 'email_error') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [inform] Added via openedx/enterprise-access#314 |
||
return ( | ||
<FailedBadEmail learnerEmail={learnerEmail} /> | ||
); | ||
|
@@ -52,6 +54,7 @@ AssignmentStatusTableCell.propTypes = { | |
original: PropTypes.shape({ | ||
learnerEmail: PropTypes.string, | ||
learnerState: PropTypes.string.isRequired, | ||
errorReason: PropTypes.string, | ||
actions: PropTypes.arrayOf(PropTypes.shape({ | ||
actionType: PropTypes.string.isRequired, | ||
errorReason: PropTypes.string, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,6 @@ export const NextStepsForAssignedLearners = ({ course }) => ( | |
is calculated based on the course enrollment deadline or {ASSIGNMENT_ENROLLMENT_DEADLINE} days | ||
past the date of assignment, whichever is sooner. | ||
</li> | ||
<li> | ||
Learners will receive automated reminder emails every 10-15 days until the enrollment | ||
deadline is reached. | ||
</li> | ||
Comment on lines
-23
to
-26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</ul> | ||
</div> | ||
</Collapsible> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[context] These erroneous
console.log
statements slipped through in the previous PR that merged while debugging one of the review comments. Removing theconsole.log
statements in this PR.