(includeCourseIDs)
| 914 | } |
| 915 | |
| 916 | prepaidType (includeCourseIDs) { |
| 917 | const courseProducts = this.activeProducts('course') |
| 918 | if (!courseProducts.length) { return undefined } |
| 919 | |
| 920 | if (_.any(courseProducts, p => (p.productOptions?.includedCourseIDs == null))) { return 'course' } |
| 921 | // Note: currently includeCourseIDs is a argument only used when displaying |
| 922 | // customized license's course names. |
| 923 | // Be careful to match the returned string EXACTLY to avoid comparison issues |
| 924 | |
| 925 | if (includeCourseIDs) { |
| 926 | const union = (res, prepaid) => _.union(res, prepaid.productOptions?.includedCourseIDs != null ? prepaid.productOptions?.includedCourseIDs : []) |
| 927 | const courses = _.reduce(courseProducts, union, []) |
| 928 | // return all courses names join with + as customized licenses's name |
| 929 | return (courses.map(id => utils.courseAcronyms[id])).join('+') |
| 930 | } |
| 931 | // NOTE: Default type is 'course' if no type is marked on the user's copy |
| 932 | return 'course' |
| 933 | } |
| 934 | |
| 935 | prepaidTypeDescription () { |
| 936 | const courseProducts = this.activeProducts('course') |
no test coverage detected