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 20240325-1711326059 #12

Merged
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
6 changes: 3 additions & 3 deletions src/course-home/dates-tab/timeline/badgelist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ function getBadgeListAndColor(date, intl, item, items) {
message: messages.today,
shownForDay: isToday,
bg: 'bg-warning-300',
className: 'text-black',
className: 'text-dark',
},
{
message: messages.completed,
shownForDay: assignments.length && assignments.every(isComplete),
shownForItem: x => isLearnerAssignment(x) && isComplete(x),
bg: 'bg-light-500',
className: 'text-black',
className: 'text-dark',
},
{
message: messages.pastDue,
shownForDay: assignments.length && assignments.every(isPastDue),
shownForItem: x => isLearnerAssignment(x) && isPastDue(x),
bg: 'bg-dark-200',
className: 'text-white',
className: 'text-dark',
},
{
message: messages.dueNext,
Expand Down
3 changes: 2 additions & 1 deletion src/course-home/outline-tab/LmsHtmlFragment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const LmsHtmlFragment = ({
title,
...rest
}) => {
const direction = document.documentElement?.getAttribute('dir') || 'ltr';
const wholePage = `
<html>
<html dir="${direction}">
<head>
<base href="${getConfig().LMS_BASE_URL}" target="_parent">
<link rel="stylesheet" href="/static/${getConfig().LEGACY_THEME_NAME ? `${getConfig().LEGACY_THEME_NAME}/` : ''}css/bootstrap/lms-main.css">
Expand Down
4 changes: 2 additions & 2 deletions src/course-home/progress-tab/ProgressTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ProgressTab = () => {
} = useSelector(state => state.courseHome);

const {
gradesFeatureIsFullyLocked,
gradesFeatureIsFullyLocked, disableProgressGraph,
} = useModel('progress', courseId);

const applyLockedOverlay = gradesFeatureIsFullyLocked ? 'locked-overlay' : '';
Expand All @@ -38,7 +38,7 @@ const ProgressTab = () => {
<div className="row w-100 m-0">
{/* Main body */}
<div className="col-12 col-md-8 p-0">
<CourseCompletion />
{!disableProgressGraph && <CourseCompletion />}
{!wideScreen && <CertificateStatus />}
<CourseGrade />
<div className={`grades my-4 p-4 rounded raised-card ${applyLockedOverlay}`} aria-hidden={gradesFeatureIsFullyLocked}>
Expand Down
40 changes: 21 additions & 19 deletions src/courseware/course/sequence/Sequence.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,28 @@ const Sequence = ({
const gated = sequence && sequence.gatedContent !== undefined && sequence.gatedContent.gated;

const defaultContent = (
<div className="sequence-container d-inline-flex flex-row">
<div className="sequence-container d-inline-flex flex-row w-100">
<div className={classNames('sequence w-100', { 'position-relative': shouldDisplayNotificationTriggerInSequence })}>
<SequenceNavigation
sequenceId={sequenceId}
unitId={unitId}
className="mb-4"
nextHandler={() => {
logEvent('edx.ui.lms.sequence.next_selected', 'top');
handleNext();
}}
onNavigate={(destinationUnitId) => {
logEvent('edx.ui.lms.sequence.tab_selected', 'top', destinationUnitId);
handleNavigate(destinationUnitId);
}}
previousHandler={() => {
logEvent('edx.ui.lms.sequence.previous_selected', 'top');
handlePrevious();
}}
/>
{shouldDisplayNotificationTriggerInSequence && <SidebarTriggers />}
<div className="sequence-navigation-container">
<SequenceNavigation
sequenceId={sequenceId}
unitId={unitId}
className="mb-4"
nextHandler={() => {
logEvent('edx.ui.lms.sequence.next_selected', 'top');
handleNext();
}}
onNavigate={(destinationUnitId) => {
logEvent('edx.ui.lms.sequence.tab_selected', 'top', destinationUnitId);
handleNavigate(destinationUnitId);
}}
previousHandler={() => {
logEvent('edx.ui.lms.sequence.previous_selected', 'top');
handlePrevious();
}}
/>
{shouldDisplayNotificationTriggerInSequence && <SidebarTriggers />}
</div>

<div className="unit-container flex-grow-1">
<SequenceContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ const SequenceNavigation = ({
};

return sequenceStatus === LOADED && (
<nav id="courseware-sequenceNavigation" className={classNames('sequence-navigation', className)} style={{ width: shouldDisplayNotificationTriggerInSequence ? '90%' : null }}>
<nav id="courseware-sequenceNavigation" className={classNames('sequence-navigation', className, { 'mr-2': shouldDisplayNotificationTriggerInSequence })}>
{renderPreviousButton()}
{renderUnitButtons()}
{renderNextButton()}

</nav>
);
};
Expand Down
6 changes: 5 additions & 1 deletion src/courseware/course/sidebar/SidebarTriggers.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import classNames from 'classnames';
import React, { useContext } from 'react';
import { breakpoints, useWindowSize } from '@edx/paragon';
import SidebarContext from './SidebarContext';
import { SIDEBAR_ORDER, SIDEBARS } from './sidebars';

Expand All @@ -8,14 +9,17 @@ const SidebarTriggers = () => {
toggleSidebar,
currentSidebar,
} = useContext(SidebarContext);

const isMobileView = useWindowSize().width < breakpoints.small.minWidth;

return (
<div className="d-flex ml-auto">
{SIDEBAR_ORDER.map((sidebarId) => {
const { Trigger } = SIDEBARS[sidebarId];
const isActive = sidebarId === currentSidebar;
return (
<div
className={classNames('mt-3', { 'border-primary-700': isActive })}
className={classNames({ 'mt-3': !isMobileView, 'border-primary-700': isActive })}
style={{ borderBottom: isActive ? '2px solid' : null }}
key={sidebarId}
>
Expand Down
2 changes: 1 addition & 1 deletion src/courseware/course/sidebar/common/TriggerBase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const SidebarTriggerBase = ({
children,
}) => (
<button
className="border border-light-400 bg-transparent align-items-center align-content-center d-flex"
className="border border-light-400 bg-transparent align-items-center align-content-center d-flex notification-btn"
type="button"
onClick={onClick}
aria-label={ariaLabel}
Expand Down
1 change: 1 addition & 0 deletions src/generic/tabs/useIndexOfLastVisibleChild.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const invisibleStyle = {
left: 0,
pointerEvents: 'none',
visibility: 'hidden',
maxWidth: '100%',
};

/**
Expand Down
20 changes: 18 additions & 2 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
flex-direction: column;
flex-grow: 1;
margin-bottom: 4rem;
width: 100%;
margin-right: auto;
margin-left: auto;
}
Expand All @@ -96,8 +95,24 @@
}
}

.sequence-navigation-container {
display: flex;
align-items: flex-start;
}

.notification-btn {
@media (max-width: -1 + map-get($grid-breakpoints, "sm")) {
height: 3rem;
}
}

.sequence-navigation {
display: flex;
flex-grow: 1;

@media (max-width: -1 + map-get($grid-breakpoints, "sm")) {
max-width: 100%;
}

@media (min-width: map-get($grid-breakpoints, "sm")) {
margin: -1px -1px 0;
Expand Down Expand Up @@ -165,9 +180,10 @@
}

.sequence-navigation-tabs {
overflow: auto;
.btn {
flex-basis: 100%;
min-width: 2rem;
min-width: 3rem;
}
}

Expand Down
Loading