-
Notifications
You must be signed in to change notification settings - Fork 239
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
feat: add course end dashboard plugin slots #1658
base: master
Are you sure you want to change the base?
Conversation
b200607
to
8a62a38
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1658 +/- ##
==========================================
+ Coverage 90.09% 90.11% +0.02%
==========================================
Files 338 340 +2
Lines 5784 5796 +12
Branches 1370 1371 +1
==========================================
+ Hits 5211 5223 +12
Misses 557 557
Partials 16 16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
const CourseExitViewCoursesPluginSlot = ({ href }) => ( | ||
<PluginSlot id="course_exit_view_courses_slot"> | ||
<ViewCoursesLink content={{ href }} /> | ||
</PluginSlot> | ||
); |
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.
const CourseExitViewCoursesPluginSlot = ({ href }) => ( | |
<PluginSlot id="course_exit_view_courses_slot"> | |
<ViewCoursesLink content={{ href }} /> | |
</PluginSlot> | |
); | |
const CourseExitViewCoursesPluginSlot = () => { | |
const href = `${getConfig().LMS_BASE_URL}/dashboard`; | |
return ( | |
<PluginSlot id="course_exit_view_courses_slot"> | |
<ViewCoursesLink content={{ href }} /> | |
</PluginSlot> | |
); | |
}; |
{intl.formatMessage(messages.viewCoursesButton)} | ||
</Button> | ||
</div> | ||
<CourseExitViewCoursesPluginSlot href={`${getConfig().LMS_BASE_URL}/dashboard`} /> |
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.
<CourseExitViewCoursesPluginSlot href={`${getConfig().LMS_BASE_URL}/dashboard`} /> | |
<CourseExitViewCoursesPluginSlot /> |
See comment on plugin file
const { courseId } = useSelector(state => state.courseware); | ||
const { org } = useModel('courseHomeMeta', courseId); | ||
const { administrator } = getAuthenticatedUser(); | ||
|
||
const dashboardLink = ( | ||
<Hyperlink | ||
style={{ textDecoration: 'underline' }} | ||
destination={`${getConfig().LMS_BASE_URL}/dashboard`} | ||
destination={content?.dashboardFootnoteUrl || `${getConfig().LMS_BASE_URL}/dashboard`} |
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.
Is this conditional necessary? In the default version, you always pass in a url so it should always be defined.
|
||
CourseExitViewCoursesPluginSlot.propTypes = {}; | ||
|
||
export default CourseExitViewCoursesPluginSlot; |
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.
This doesn't need to block this PR if you didn't know, but: whenever creating new files in this repo or any MFE repo, please:
- Use TypeScript
.tsx
instead of.jsx
- Use TypeScript types instead of
propTypes
- propTypes have been deprecated for 8 years!
You also don't need to use default exports anymore, but you can if you want to.
Add plugin slots to allow control of course end dashboard links