Skip to content

Commit 24d0eea

Browse files
committed
Merge branch 'redesign-2024' into redesign/page/teacher-features
2 parents 3a58614 + 8d9f338 commit 24d0eea

File tree

69 files changed

+1628
-496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1628
-496
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_API_VERSION=v3.18.1
1+
REACT_APP_API_VERSION=v3.18.3-SNAPSHOT

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaac-react-app",
3-
"version": "4.0.0-rc5-SNAPSHOT",
3+
"version": "4.0.0-rc6-SNAPSHOT",
44
"private": true,
55
"engines": {
66
"node": ">=18",
@@ -18,7 +18,7 @@
1818
"core-js": "^3.38.1",
1919
"dayjs": "^1.11.13",
2020
"he": "^1.2.0",
21-
"highlight.js": "^11.10.0",
21+
"highlight.js": "^11.11.1",
2222
"history": "^4.10.1",
2323
"html-to-text": "^9.0.5",
2424
"identity-obj-proxy": "3.0.0",
Lines changed: 40 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 40 additions & 0 deletions
Loading
Lines changed: 43 additions & 0 deletions
Loading
Lines changed: 43 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading

src/app/components/elements/CollapsibleList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Col, Row } from "reactstrap";
33
import { Spacer } from "./Spacer";
44
import { FilterCount } from "./svg/FilterCount";
55
import classNames from "classnames";
6+
import { isAda, isPhy } from "../../services";
67

78
export interface CollapsibleListProps {
89
title?: string;
@@ -37,7 +38,7 @@ export const CollapsibleList = (props: CollapsibleListProps) => {
3738

3839
return <Col className={props.className} data-targetHeight={(headRef.current?.offsetHeight ?? 0) + (expanded ? expandedHeight : 0)}>
3940
<div className="row collapsible-head" ref={headRef}>
40-
<button className={classNames("w-100 d-flex align-items-center p-3 bg-white text-start", {"ps-4": props.asSubList})} onClick={toggle}>
41+
<button className={classNames("w-100 d-flex align-items-center p-3 text-start", {"bg-white": isAda, "bg-transparent": isPhy, "ps-4": props.asSubList})} onClick={toggle}>
4142
{title && <span>{title}</span>}
4243
<Spacer/>
4344
{(props.numberSelected ?? 0) > 0

src/app/components/elements/LLMFreeTextQuestionFeedbackView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ export default function LLMFreeTextQuestionFeedbackView({validationResponse, has
6666
<ul className="no-bullet px-2 mb-4">
6767
<li>
6868
<StyledCheckbox
69-
id="disagree" label={<p>Disagree</p>} className='"mb-4'
69+
id="disagree" label={<p>Disagree</p>}
7070
checked={feedback.disagree} onChange={() => setFeedback({...noFeedback, disagree: !feedback.disagree})}
7171
/>
7272
</li>
7373
<li>
7474
<StyledCheckbox
75-
id="partlyAgree" label={<p>Partly agree</p>} className='"mb-4'
75+
id="partlyAgree" label={<p>Partly agree</p>}
7676
checked={feedback.partlyAgree} onChange={() => setFeedback({...noFeedback, partlyAgree: !feedback.partlyAgree})}
7777
/>
7878
</li>

src/app/components/elements/PageTitle.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface TitleIconProps {
7474
export interface PageTitleProps {
7575
currentPageTitle: string;
7676
subTitle?: string;
77+
description?: string;
7778
disallowLaTeX?: boolean;
7879
help?: ReactElement;
7980
className?: string;
@@ -82,7 +83,7 @@ export interface PageTitleProps {
8283
preview?: boolean;
8384
icon?: TitleIconProps;
8485
}
85-
export const PageTitle = ({currentPageTitle, subTitle, disallowLaTeX, help, className, audienceViews, modalId, preview, icon}: PageTitleProps) => {
86+
export const PageTitle = ({currentPageTitle, subTitle, description, disallowLaTeX, help, className, audienceViews, modalId, preview, icon}: PageTitleProps) => {
8687
const dispatch = useAppDispatch();
8788
const openModal = useAppSelector((state: AppState) => Boolean(state?.activeModals?.length));
8889
const headerRef = useRef<HTMLHeadingElement>(null);
@@ -119,13 +120,18 @@ export const PageTitle = ({currentPageTitle, subTitle, disallowLaTeX, help, clas
119120
}));
120121
}
121122

122-
return <h1 id="main-heading" tabIndex={-1} ref={headerRef} className={classNames("h-title h-secondary d-sm-flex", {"align-items-center py-4": isPhy}, className)}>
123-
{icon && (
124-
icon.type === "img" ? <img src={icon.icon} alt="" className="me-3"/>
125-
: icon.type === "hex" ? <PhyHexIcon icon={icon.icon} subject={icon.subject}/> : undefined)}
126-
<div className="me-auto" data-testid={"main-heading"}>
127-
{formatPageTitle(currentPageTitle, disallowLaTeX)}
128-
{subTitle && <span className="h-subtitle d-none d-sm-block">{subTitle}</span>}
123+
return <h1 id="main-heading" tabIndex={-1} ref={headerRef} className={classNames("h-title h-secondary d-sm-flex", {"align-items-center py-4 mb-0": isPhy}, className)}>
124+
<div className="me-auto">
125+
<div className="d-sm-flex align-items-center">
126+
{icon && (
127+
icon.type === "img" ? <img src={icon.icon} alt="" className="me-3"/>
128+
: icon.type === "hex" ? <PhyHexIcon icon={icon.icon} subject={icon.subject}/> : undefined)}
129+
<div className="me-auto" data-testid={"main-heading"}>
130+
{formatPageTitle(currentPageTitle, disallowLaTeX)}
131+
{subTitle && <span className="h-subtitle d-none d-sm-block">{subTitle}</span>}
132+
</div>
133+
</div>
134+
{description && <div className="h-description">{description}</div>}
129135
</div>
130136
<Helmet>
131137
<meta property="og:title" content={currentPageTitle} />

src/app/components/elements/TeacherDashboard.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { selectors, useAppSelector, useGetGroupsQuery, useGetMySetAssignmentsQue
33
import { skipToken } from '@reduxjs/toolkit/query';
44
import { Card, Col, Row } from 'reactstrap';
55
import { Link } from 'react-router-dom';
6-
import { isDefined, isLoggedIn, isTutorOrAbove, Subject, useDeviceSize } from '../../services';
7-
import { BookInfo, isaacBooks } from './modals/IsaacBooksModal';
6+
import { BookInfo, ISAAC_BOOKS, isDefined, isLoggedIn, isTutorOrAbove, Subject, useDeviceSize } from '../../services';
87
import { AssignmentDTO, RegisteredUserDTO } from '../../../IsaacApiTypes';
98
import { GroupSelector } from '../pages/Groups';
109
import { StyledDropdown } from './inputs/DropdownInput';
@@ -141,7 +140,7 @@ const BooksPanel = () => {
141140
</StyledDropdown>
142141
</div>
143142
<Row className="row-cols-3 row-cols-md-4 row-cols-lg-8 row-cols-xl-2 row-cols-xxl-3 flex-nowrap book-panel">
144-
{isaacBooks.filter(book => book.subject === subject || subject === "all")
143+
{ISAAC_BOOKS.filter(book => book.subject === subject || subject === "all")
145144
.map((book) =>
146145
<Col key={book.title} className="mb-2 me-1 p-0">
147146
<BookCard {...book}/>

src/app/components/elements/TitleAndBreadcrumb.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type TitleAndBreadcrumbProps = BreadcrumbTrailProps & PageTitleProps & {
5454
breadcrumbTitleOverride?: string;
5555
children?: ReactElement | boolean;
5656
};
57-
export const TitleAndBreadcrumb = ({modalId, children, breadcrumbTitleOverride, currentPageTitle, subTitle, disallowLaTeX, className, audienceViews, help, collectionType, intermediateCrumbs, preview, icon}: TitleAndBreadcrumbProps) => {
57+
export const TitleAndBreadcrumb = ({modalId, children, breadcrumbTitleOverride, currentPageTitle, subTitle, description, disallowLaTeX, className, audienceViews, help, collectionType, intermediateCrumbs, preview, icon}: TitleAndBreadcrumbProps) => {
5858
return <div className={classNames(className, {"title-breadcrumb-container": isPhy, "pt-4 pt-md-5": isAda})}>
5959
{isPhy && <div className="title-graphics"/>}
6060
<BreadcrumbTrail
@@ -64,7 +64,7 @@ export const TitleAndBreadcrumb = ({modalId, children, breadcrumbTitleOverride,
6464
/>
6565
{children}
6666
<PageTitle
67-
modalId={modalId} subTitle={subTitle}
67+
modalId={modalId} subTitle={subTitle} description={description}
6868
disallowLaTeX={disallowLaTeX} audienceViews={audienceViews}
6969
currentPageTitle={currentPageTitle} help={help}
7070
preview={preview} icon={icon}

src/app/components/elements/cards/EventCard.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import {Link} from "react-router-dom";
44
import {AugmentedEvent} from "../../../../IsaacAppTypes";
55
import {DateString} from "../DateString";
66
import {formatEventCardDate, siteSpecific} from "../../../services";
7-
import { Card, CardImg, CardBody, CardTitle, Badge, CardText } from "reactstrap";
7+
import { Card, CardImg, CardBody, CardTitle, Badge, CardText, CardProps } from "reactstrap";
88
import { Spacer } from "../Spacer";
9+
import classNames from "classnames";
910

10-
export const PhysicsEventCard = ({event}: {event: AugmentedEvent}) => {
11+
export const PhysicsEventCard = ({event, ...rest}: {event: AugmentedEvent} & CardProps) => {
1112
const {id, title, subtitle, eventThumbnail, location, date} = event;
1213

1314
const isVirtualEvent = event.tags?.includes("virtual");
1415
const isTeacherEvent = event.tags?.includes("teacher") && !event.tags?.includes("student");
1516
const isStudentEvent = event.tags?.includes("student") && !event.tags?.includes("teacher");
1617

17-
return <Card className="pod">
18+
return <Card {...rest} className={classNames("pod", rest.className)}>
1819
{eventThumbnail &&
1920
<a className={"pod-img event-pod-img"} href={`/events/${id}`}>
2021
<CardImg aria-hidden={true} top src={eventThumbnail.src} alt={"" /* Decorative image, should be hidden from screenreaders */} />

0 commit comments

Comments
 (0)