Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: "3.12.3"
python-version: "3.12.4"
cache: "poetry"

- name: Validate lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
- name: Purge Fastly cache
uses: jcoene/fastly-purge-action@master
with:
api_key: "${{ secrets.FASTLY_API_KEY_PRODUCTION }}"
service_id: "${{ secrets.FASTLY_SERVICE_ID_PRODUCTION }}"
api_key: "${{ secrets.FASTLY_API_KEY_PROD }}"
service_id: "${{ secrets.FASTLY_SERVICE_ID_PROD }}"

# runs ONLY on a failure of the CI workflow
on-failure:
Expand Down
610 changes: 305 additions & 305 deletions .yarn/releases/yarn-4.2.2.cjs → .yarn/releases/yarn-4.3.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.3.0.cjs

# https://github.com/vitejs/vite-plugin-react-swc/issues/74#issuecomment-1520484130
# https://github.com/swc-project/swc/issues/5616#issuecomment-1265639797
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.3
FROM python:3.12.4
LABEL maintainer "ODL DevOps <mitx-devops@mit.edu>"

# Add package files, install updated node and pip
Expand Down
17 changes: 17 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Release Notes
=============

Version 0.13.7
--------------

- Redoing the marketing image selector (#1113)
- Update Python to v3.12.4 (#1035)
- Update the conditional for the marketing image test to drop out if we haven't seen a marketing image at all yet (#1112)
- Update Yarn to v4.3.0 (#1095)
- Homepage Stories & Events layout fixes (#1103)
- Add marketing images to homepage testimonial, fix some styling issues (#1077)
- Contentfile archive comparison fix (#1078)
- Sort run prices on save; make learning resource prices equal "next run" prices (#1085)
- units page fixes (#1083)
- Rename test appropriately and increase the timeout (#1105)
- Fixed typo in the fastly api key secret name. (#1106)
- breadcrumbs component (#1089)
- Update dependency eslint-config-mitodl to v2 (#1037)

Version 0.13.6 (Released June 17, 2024)
--------------

Expand Down
42 changes: 21 additions & 21 deletions frontends/api/src/generated/v1/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,11 +603,11 @@ export interface CourseResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof CourseResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down Expand Up @@ -1233,11 +1233,11 @@ export interface LearningPathResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof LearningPathResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down Expand Up @@ -3710,11 +3710,11 @@ export interface PodcastEpisodeResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof PodcastEpisodeResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down Expand Up @@ -3995,11 +3995,11 @@ export interface PodcastResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof PodcastResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down Expand Up @@ -4518,11 +4518,11 @@ export interface ProgramResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof ProgramResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down Expand Up @@ -5210,11 +5210,11 @@ export interface VideoPlaylistResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof VideoPlaylistResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down Expand Up @@ -5489,11 +5489,11 @@ export interface VideoResource {
*/
certification_type: CourseResourceCertificationType
/**
* Returns the prices for the learning resource
* @type {Array<number>}
*
* @type {Array<string>}
* @memberof VideoResource
*/
prices: Array<number>
prices: Array<string>
/**
*
* @type {Array<LearningResourceRun>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const _learningResourceShared = (): Partial<
image: learningResourceImage(),
offered_by: maybe(learningResourceOfferor) ?? null,
platform: maybe(learningResourcePlatform) ?? null,
prices: [0.0],
prices: ["0.00"],
readable_id: faker.lorem.slug(),
course_feature: repeat(faker.lorem.word),
runs: [],
Expand Down
3 changes: 2 additions & 1 deletion frontends/api/src/test-utils/factories/testimonials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Attestation } from "../../generated/v0"

const testimonial: Factory<Attestation> = (overrides = {}) => ({
id: faker.number.int(),
title: faker.lorem.sentence(),
title: "Testable Title",
quote: faker.lorem.paragraph(),
attestant_name: faker.person.fullName(),
avatar: faker.image.url({ width: 500, height: 500 }),
Expand All @@ -16,6 +16,7 @@ const testimonial: Factory<Attestation> = (overrides = {}) => ({
updated_on: faker.date.past().toISOString(),
publish_date: null,
channels: [],
offerors: ["see"],
...overrides,
})

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
<ResourceTypeTabs.Context
resourceType={requestParams.resource_type?.[0]}
>
<DesktopFiltersColumn variant="sidebar-2">
<DesktopFiltersColumn
variant="sidebar-2"
data-testid="facets-container"
>
<FacetsTitleContainer>
<FilterTitle>
<Typography variant="subtitle1">Filter</Typography>
Expand All @@ -586,7 +589,6 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
</Button>
) : null}
</FacetsTitleContainer>

{filterContents}
</DesktopFiltersColumn>
<StyledMainColumn variant="main-2">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import React from "react"

import { styled, theme } from "ol-components"
import type { Attestation } from "api/v0"

type AttestantBlockVariant = "start" | "end"
type AttestantBlockColor = "light" | "dark"

type AttestantBlockChildProps = {
variant?: AttestantBlockVariant
color?: AttestantBlockColor
}

type AttestantBlockProps = AttestantBlockChildProps & {
attestation: Attestation
}

const AttestantBlockContainer = styled.div<AttestantBlockChildProps>(
(props) => {
const flexDir = props.variant === "end" ? "row-reverse" : "row"

return [
{
width: "100%",
display: "flex",
flexDirection: flexDir,
[theme.breakpoints.down("md")]: {
marginTop: "24px",
},
},
]
},
)

const AttestantAvatar = styled.div<AttestantBlockChildProps>((props) => {
return [
{
marginRight: props.variant === "end" ? "0px" : "12px",
marginLeft: props.variant === "end" ? "14px" : "0px",
[theme.breakpoints.down("md")]: {
marginRight: "0",
marginLeft: "0",
},
img: {
objectFit: "cover",
borderRadius: "50%",
background: theme.custom.colors.white,
width: "40px",
height: "40px",
boxShadow:
"0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 2px 4px 0px rgba(37, 38, 43, 0.10)",
[theme.breakpoints.down("md")]: {
display: "none",
},
},
},
]
})

const AttestantNameBlock = styled.div<AttestantBlockChildProps>((props) => {
return [
{
flexGrow: "1",
width: "auto",
textAlign: props.variant === "end" ? "end" : "start",
color:
props.color === "light"
? theme.custom.colors.lightGray2
: theme.custom.colors.silverGray,
},
]
})

const AttestantName = styled.div<AttestantBlockChildProps>((props) => {
return [
{
...theme.typography.subtitle1,
whiteSpace: "nowrap",
color:
props.color === "light"
? theme.custom.colors.white
: theme.custom.colors.darkGray2,
lineHeight: "125%",
},
]
})

const AttestantBlock: React.FC<AttestantBlockProps> = ({
attestation,
variant = "start",
color = "light",
}) => {
return (
<AttestantBlockContainer variant={variant} color={color}>
<AttestantAvatar variant={variant} color={color}>
<img src={attestation.avatar_medium} />
</AttestantAvatar>
<AttestantNameBlock variant={variant} color={color}>
<AttestantName variant={variant} color={color}>
{attestation?.attestant_name}
</AttestantName>
{attestation.title}
</AttestantNameBlock>
</AttestantBlockContainer>
)
}

export default AttestantBlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from "react"
import { setMockResponse, urls } from "api/test-utils"
import { renderWithProviders, screen, waitFor } from "@/test-utils"

import { testimonials as factory } from "api/test-utils/factories"
import TestimonialDisplay from "./TestimonialDisplay"

const setupAPIs = () => {
setMockResponse.get(urls.userMe.get(), {})
}

describe("TestimonialDisplay", () => {
test("Display the carousel if there's more than one testimonial", async () => {
setupAPIs()

const attestations = factory.testimonials({ count: 3 })

setMockResponse.get(
expect.stringContaining(urls.testimonials.list({})),
attestations,
)

renderWithProviders(<TestimonialDisplay offerors={["see"]} />)

await waitFor(() => {
screen.getAllByText(/testable/i)
})
})

test("Display single testimonial if there's only one testimonial", async () => {
setupAPIs()

const attestations = factory.testimonials({ count: 1 })

setMockResponse.get(
expect.stringContaining(urls.testimonials.list({})),
attestations,
)

renderWithProviders(<TestimonialDisplay offerors={["see"]} />)

await waitFor(() => {
expect(screen.getAllByText(/testable/i).length).toBe(1)
})
})

test("Display nothing if there's no testimonials", async () => {
setupAPIs()

const attestations = {}

setMockResponse.get(
expect.stringContaining(urls.testimonials.list({})),
attestations,
)

renderWithProviders(<TestimonialDisplay offerors={["see"]} />)

await waitFor(() => {
expect(screen.queryAllByText(/testable/i).length).toBe(0)
})
})
})
Loading