Skip to content

Commit

Permalink
Merge branch 'master' into hu/ent-8887
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 committed Aug 13, 2024
2 parents ab638fc + 4f4566e commit 57c2c85
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/course/course-header/CourseRunCards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import CourseRunCard from './CourseRunCard';
import DeprecatedCourseRunCard from './deprecated/CourseRunCard';
import { useUserSubsidyApplicableToCourse } from '../data';
import {
LEARNER_CREDIT_SUBSIDY_TYPE,
useCourseMetadata,
useEnterpriseCourseEnrollments,
useEnterpriseCustomerContainsContent,
useUserEntitlements,
LEARNER_CREDIT_SUBSIDY_TYPE,
} from '../../app/data';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/course/data/courseLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ const makeCourseLoader: Types.MakeRouteLoaderFunctionWithQueryClient = function
// redirect to the appropriate course route.
if (
courseMetadata.courseType
&& getCourseTypeConfig(courseMetadata)
&& !pathContainsCourseTypeSlug(requestUrl.pathname, courseMetadata.courseType)
&& getCourseTypeConfig(courseMetadata)
&& !pathContainsCourseTypeSlug(requestUrl.pathname, courseMetadata.courseType)
) {
const newUrl = getLinkToCourse(courseMetadata, enterpriseSlug);
throw redirect(newUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const getScreenReaderText = (str) => (
);

const BaseCourseCard = ({
hasEmailsEnabled: defaultHasEmailsEnabled,
hasEmailsEnabled,
title,
dropdownMenuItems: customDropdownMenuItem,
canUnenroll,
Expand All @@ -148,7 +148,6 @@ const BaseCourseCard = ({
const intl = useIntl();
const { LEARNER_SUPPORT_PACED_COURSE_MODE_URL } = getConfig();
const { data: enterpriseCustomer } = useEnterpriseCustomer();
const [hasEmailsEnabled, setHasEmailsEnabled] = useState(defaultHasEmailsEnabled);
const [emailSettingsModal, setEmailSettingsModal] = useState({
open: false,
options: {},
Expand Down Expand Up @@ -267,11 +266,8 @@ const BaseCourseCard = ({
}));
};

const handleEmailSettingsModalOnClose = (newValue) => {
const handleEmailSettingsModalOnClose = () => {
resetModals();
if (hasEmailsEnabled !== undefined) {
setHasEmailsEnabled(newValue);
}
};

const handleUnenrollModalOnClose = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ describe('<BaseCourseCard />', () => {
it('handles email settings modal close/cancel', async () => {
userEvent.click(screen.getByTestId('modal-footer-btn', { name: 'Close' }));
await waitFor(() => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
const dialogElement = screen.getByTestId('modal');
expect(dialogElement).not.toHaveClass('show');
});
});
});
Expand Down
5 changes: 4 additions & 1 deletion src/components/video/VideoPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import VideoJS from './VideoJS';

const hlsExtension = '.m3u8';
const defaultOptions = {
autoplay: false,
autoplay: true,
controls: true,
responsive: true,
fluid: true,
Expand All @@ -17,6 +17,8 @@ const VideoPlayer = ({ videoURL, onReady, customOptions }) => {
if (isMp4Video) {
return {
...defaultOptions,
// Disable autoplay if `showTranscripts` is enabled (video detail page); enable autoplay otherwise.
autoplay: !customOptions?.showTranscripts,
sources: [{ src: videoURL, type: 'video/mp4' }],
};
}
Expand All @@ -35,6 +37,7 @@ const VideoPlayer = ({ videoURL, onReady, customOptions }) => {
controls: true,
sources: [{ src: videoURL, type: 'application/x-mpegURL' }],
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [videoURL]);

return (
Expand Down

0 comments on commit 57c2c85

Please sign in to comment.