Skip to content

Commit 989bc32

Browse files
authored
org contract welcome message display (#2677)
* update mitxonline api package * add display of welcome message * fix existing tests broken by API package update and add some new ones * fix more type checking issues * simplify null contract check and fix spacing issue when the contract welcome message is null or missing
1 parent 7807fe5 commit 989bc32

File tree

8 files changed

+329
-123
lines changed

8 files changed

+329
-123
lines changed

frontends/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"ol-test-utilities": "0.0.0"
2929
},
3030
"dependencies": {
31-
"@mitodl/mitxonline-api-axios": "^2025.10.21",
31+
"@mitodl/mitxonline-api-axios": "^2025.11.5",
3232
"@tanstack/react-query": "^5.66.0",
3333
"axios": "^1.12.2",
3434
"tiny-invariant": "^1.3.3"

frontends/api/src/mitxonline/test-utils/factories/contracts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const contract = (overrides: Partial<ContractPage> = {}): ContractPage => ({
1313
organization: faker.number.int(),
1414
slug: faker.lorem.slug(),
1515
membership_type: faker.helpers.arrayElement(["managed", "unmanaged"]),
16+
welcome_message: faker.lorem.sentence(),
17+
welcome_message_extra: `<p>${faker.lorem.paragraph()}</p>`,
1618
...overrides,
1719
})
1820

frontends/api/src/mitxonline/test-utils/factories/user.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { UniqueEnforcer } from "enforce-unique"
1111
const enforcerId = new UniqueEnforcer()
1212

1313
const legalAddress = (): LegalAddress => ({
14-
first_name: faker.person.firstName(),
15-
last_name: faker.person.lastName(),
1614
country: faker.location.countryCode(),
1715
state: faker.datatype.boolean() ? faker.location.state() : null,
1816
})

frontends/main/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@emotion/cache": "^11.13.1",
1515
"@emotion/styled": "^11.11.0",
1616
"@mitodl/course-search-utils": "^3.5.0",
17-
"@mitodl/mitxonline-api-axios": "^2025.10.21",
17+
"@mitodl/mitxonline-api-axios": "^2025.11.5",
1818
"@mitodl/smoot-design": "^6.17.1",
1919
"@next/bundle-analyzer": "^14.2.15",
2020
"@react-pdf/renderer": "^4.3.0",

frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/test-utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ const setupProgramsAndCourses = () => {
159159
results: [programCollection],
160160
})
161161
setMockResponse.get(
162-
urls.programs.programsList({ id: programA.id, org_id: orgX.id }),
162+
urls.programs.programsList({ id: [programA.id], org_id: orgX.id }),
163163
{ results: [programA] },
164164
)
165165
setMockResponse.get(
166-
urls.programs.programsList({ id: programB.id, org_id: orgX.id }),
166+
urls.programs.programsList({ id: [programB.id], org_id: orgX.id }),
167167
{ results: [programB] },
168168
)
169169
setMockResponse.get(
@@ -310,6 +310,8 @@ const createTestContracts = (
310310
organization: orgId,
311311
slug: faker.lorem.slug(),
312312
membership_type: faker.helpers.arrayElement(["managed", "unmanaged"]),
313+
welcome_message: faker.lorem.sentence(),
314+
welcome_message_extra: faker.lorem.sentence(),
313315
}))
314316
}
315317

0 commit comments

Comments
 (0)