Skip to content
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

Sync opencraft-release/quince.1 with Upstream 20241125-1732494130 #51

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/courseware/course/sequence/Unit/hooks/useIFrameBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ const useIFrameBehavior = ({
if (type === messageTypes.resize) {
setIframeHeight(payload.height);

// We observe exit from the video xblock fullscreen mode
// and scroll to the previously saved scroll position
if (windowTopOffset !== null) {
window.scrollTo(0, Number(windowTopOffset));
}

if (!hasLoaded && iframeHeight === 0 && payload.height > 0) {
setHasLoaded(true);
if (onLoaded) {
onLoaded();
}
}
} else if (type === messageTypes.videoFullScreen) {
// We observe exit from the video xblock fullscreen mode
// and scroll to the previously saved scroll position
if (!payload.open && windowTopOffset !== null) {
window.scrollTo(0, Number(windowTopOffset));
}

// We listen for this message from LMS to know when we need to
// save or reset scroll position on toggle video xblock fullscreen mode
setWindowTopOffset(payload.open ? window.scrollY : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ describe('useIFrameBehavior hook', () => {
const resizeMessage = (height = 23) => ({
data: { type: messageTypes.resize, payload: { height } },
});
const videoFullScreenMessage = (open = false) => ({
data: { type: messageTypes.videoFullScreen, payload: { open } },
});
const testSetIFrameHeight = (height = 23) => {
const { cb } = useEventListener.mock.calls[0][1];
cb(resizeMessage(height));
Expand Down Expand Up @@ -209,7 +212,7 @@ describe('useIFrameBehavior hook', () => {
state.mockVals({ ...defaultStateVals, windowTopOffset });
hook = useIFrameBehavior(props);
const { cb } = useEventListener.mock.calls[0][1];
cb(resizeMessage());
cb(videoFullScreenMessage());
expect(window.scrollTo).toHaveBeenCalledWith(0, windowTopOffset);
});
it('does not scroll if towverticalp offset is not set', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.discussions-sidebar-frame {
@media (max-width: -1 + map-get($grid-breakpoints, "xl")) {
max-height: calc(100vh - 65px);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const DiscussionsSidebar = ({ intl }) => {
>
<iframe
src={`${discussionsUrl}?inContextSidebar`}
className="d-flex w-100 h-100 border-0"
className="d-flex w-100 h-100 border-0 discussions-sidebar-frame"
title={intl.formatMessage(messages.discussionsTitle)}
allow="clipboard-write"
loading="lazy"
Expand Down
5 changes: 2 additions & 3 deletions src/generic/upgrade-notification/UpgradeNotification.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
// An additional Font Awesome stylesheet is imported by Braze in
// stage/production but not devstack.
.upgrade-notification-ul.fa-ul {
padding-left: 1.25rem;
padding-top: 0.875rem;
padding-right: 1.25rem;
padding: 0.875rem 1.25rem 0;
margin: 0 0 1rem 2.5rem;
}

.upgrade-notification-text {
Expand Down
3 changes: 2 additions & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@

// Import component-specific sass files
@import "courseware/course/celebration/CelebrationModal.scss";
@import "courseware/course/sidebar/sidebars/discussions/Discussions.scss";
@import "courseware/course/sidebar/sidebars/notifications/NotificationIcon.scss";
@import "courseware/course/sequence/lock-paywall/LockPaywall.scss";
@import "shared/streak-celebration/StreakCelebrationModal.scss";
Expand All @@ -402,7 +403,7 @@
@import "generic/upgrade-notification/UpgradeNotification.scss";
@import "generic/upsell-bullets/UpsellBullets.scss";
@import "course-home/outline-tab/widgets/ProctoringInfoPanel.scss";
@import "src/course-home/outline-tab/widgets/FlagButton.scss";
@import "course-home/outline-tab/widgets/FlagButton.scss";
@import "course-home/progress-tab/course-completion/CompletionDonutChart.scss";
@import "course-home/progress-tab/grades/course-grade/GradeBar.scss";
@import "courseware/course/course-exit/CourseRecommendations";
Expand Down
Loading