-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from edx/aj/fix-certificate-checklist
fix(coursechecklist): fix certificate check if cert url is empty
- Loading branch information
Showing
9 changed files
with
115 additions
and
24 deletions.
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
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
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 |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import { filters } from './courseChecklistData'; | ||
|
||
const getFilteredChecklist = (checklist, isSelfPaced) => { | ||
let healthChecks; | ||
const getFilteredChecklist = ( | ||
checklist, isSelfPaced, hasCertificatesEnabled, hasHighlightsEnabled) => { | ||
let filteredCheckList; | ||
|
||
if (isSelfPaced) { | ||
healthChecks = | ||
filteredCheckList = | ||
checklist.filter(data => data.pacingTypeFilter === filters.ALL || | ||
data.pacingTypeFilter === filters.SELF_PACED); | ||
} else { | ||
healthChecks = | ||
filteredCheckList = | ||
checklist.filter(data => data.pacingTypeFilter === filters.ALL || | ||
data.pacingTypeFilter === filters.INSTRUCTOR_PACED); | ||
} | ||
|
||
return healthChecks; | ||
filteredCheckList = filteredCheckList.filter(data => data.id !== 'certificate' || | ||
hasCertificatesEnabled); | ||
|
||
filteredCheckList = filteredCheckList.filter(data => data.id !== 'weeklyHighlights' || | ||
hasHighlightsEnabled); | ||
|
||
return filteredCheckList; | ||
}; | ||
|
||
export default getFilteredChecklist; |
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