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

Release 0.82.3 #2045

Merged
merged 14 commits into from
Jan 3, 2024
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 @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9.6"
python-version: "3.9.18"

- name: Install dependencies
run: poetry install --no-interaction
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.9.6 as base
FROM python:3.9.18 as base
LABEL maintainer "ODL DevOps <[email protected]>"

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

Version 0.82.3
--------------

- Check to make sure the end date and upgrade deadline haven't passed before grabbing your audit enrollment (#2044)
- fix(deps): update dependency posthog to v3.1.0 (#2032)
- Program enrollment: choose courses (#2028)
- fix(deps): update dependency boto3 to v1.34.5 (#1803)
- Update dependency enzyme-adapter-react-16 to v1.15.7 (#1806)
- Update dependency chai to v4.3.10 (#1804)
- Update dependency celery to v5.3.6 (#2029)
- Update dependency @sentry/browser to v6.19.7 (#1802)
- Update dependency @craco/craco to v6.4.5 (#1801)
- chore: Bump Python patch release and generate Poetry lock (#2041)
- Update dependency dayjs to v1.11.10 (#1805)
- Update dependency postcss to v8.4.31 [SECURITY] (#1943)

Version 0.82.2 (Released December 14, 2023)
--------------

Expand Down
2 changes: 1 addition & 1 deletion cms/templates/product_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h1>{{ page.title }}</h1>
</section>{% endif %}

{% if page.is_program_page %}
<section class="program-courses-container" id="program-courses">
<section class="program-courses-container about-richtext-container" id="program-courses">
{% if page.product.required_courses %}
<h2>{{ page.product.required_title }}</h2>

Expand Down
8 changes: 4 additions & 4 deletions frontend/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@json-editor/json-editor": "2.8.0",
"@material/layout-grid": "0.41.0",
"@material/top-app-bar": "1.1.1",
"@sentry/browser": "6.19.3",
"@sentry/browser": "6.19.7",
"@trust/webcrypto": "0.9.2",
"@types/react": "18.0.3",
"autoprefixer": "9.8.8",
Expand All @@ -34,13 +34,13 @@
"babel-plugin-istanbul": "5.2.0",
"bootstrap": "5.2.3",
"casual-browserify": "1.5.19-2",
"chai": "4.3.6",
"chai": "4.3.10",
"chai-as-promised": "7.1.1",
"codecov": "3.8.3",
"css-loader": "3.6.0",
"decimal.js-light": "2.5.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"enzyme-adapter-react-16": "1.15.7",
"eslint": "6.8.0",
"eslint-config-google": "0.9.1",
"eslint-config-mitodl": "0.0.7",
Expand Down Expand Up @@ -70,7 +70,7 @@
"nyc": "15.1.0",
"object.entries": "1.1.5",
"popper.js": "1.16.1",
"postcss": "8.4.12",
"postcss": "8.4.31",
"postcss-loader": "6.2.1",
"posthog-js": "^1.75.4",
"prettier-eslint": "9.0.2",
Expand Down
7 changes: 6 additions & 1 deletion frontend/public/src/components/CourseProductDetailEnroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,18 @@ export class CourseProductDetailEnroll extends React.Component<
// Find an existing enrollment - the default should be the audit enrollment
// already have, so you can just upgrade in place. If you don't, you get the
// current run (which should be the first available one).
// This was changed to also make sure the run you're enrolled in is upgradeable.
const { enrollments } = this.props

if (enrollments) {
const firstAuditEnrollment = enrollments.find(
(enrollment: RunEnrollment) =>
enrollment.run.course.id === run.course.id &&
enrollment.enrollment_mode === "audit"
enrollment.enrollment_mode === "audit" &&
enrollment.run.enrollment_end !== null &&
enrollment.run.enrollment_end > moment.now() &&
(enrollment.run.upgrade_deadline === null ||
enrollment.run.upgrade_deadline > moment.now())
)

if (firstAuditEnrollment) {
Expand Down
119 changes: 79 additions & 40 deletions frontend/public/src/components/CourseProductDetailEnroll_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,46 +325,6 @@ describe("CourseProductDetailEnroll", () => {
"$9.00"
)
})
it(`shows dialog to upgrade user enrollment with flexible percent-off discount and handles ${returnedStatusCode} response`, async () => {
courseRun["products"] = [
{
id: 1,
price: 10,
product_flexible_price: {
amount: 10,
discount_type: DISCOUNT_TYPE_PERCENT_OFF
}
}
]
isWithinEnrollmentPeriodStub.returns(true)
const { inner } = await renderPage()

sinon.assert.calledWith(
helper.handleRequestStub,
"/api/course_runs/?relevant_to=",
"GET"
)
sinon.assert.calledWith(helper.handleRequestStub, "/api/users/me", "GET")

const enrollBtn = inner.find(".enroll-now").at(0)
assert.isTrue(enrollBtn.exists())
await enrollBtn.prop("onClick")()

const modal = inner.find(".upgrade-enrollment-modal")
const upgradeForm = modal.find("form").at(0)
assert.isTrue(upgradeForm.exists())

assert.equal(upgradeForm.find("input[type='hidden']").prop("value"), "1")

assert.equal(
inner
.find("#certificate-price-info")
.at(0)
.text()
.at(1),
"9"
)
})
it(`shows dialog to upgrade user enrollment with flexible fixed-price discount and handles ${returnedStatusCode} response`, async () => {
courseRun["products"] = [
{
Expand Down Expand Up @@ -527,6 +487,85 @@ describe("CourseProductDetailEnroll", () => {
}
})
})
it("renders the upsell dialog with the correct date if the user has an enrollment in the past that is not upgradeable", async () => {
const pastCourseRun = makeCourseRunDetail()
pastCourseRun["start_date"] = moment().add(-1, "Y")
pastCourseRun["end_date"] = moment().add(-11, "M")
pastCourseRun["enrollment_start"] = pastCourseRun["start_date"]
pastCourseRun["enrollment_end"] = pastCourseRun["end_date"]
pastCourseRun["upgrade_deadline"] = moment().add(-11, "M")
pastCourseRun["is_upgradable"] = true

const currentCourseRun = makeCourseRunDetail()
currentCourseRun["start_date"] = moment().add(1, "M")
currentCourseRun["end_date"] = moment().add(1, "Y")
currentCourseRun["enrollment_start"] = moment().add(-1, "M")
currentCourseRun["enrollment_end"] = currentCourseRun["end_date"]
currentCourseRun["upgrade_deadline"] = moment().add(11, "M")
currentCourseRun["is_upgradable"] = true

const pastCourseRunEnrollment = makeCourseRunEnrollment()
pastCourseRunEnrollment.run = pastCourseRun
pastCourseRunEnrollment.enrollment_mode = "audit"

pastCourseRun["products"] = currentCourseRun["products"] = [
{
id: 1,
price: 10,
is_upgradable: true,
product_flexible_price: {
amount: 10,
discount_type: DISCOUNT_TYPE_PERCENT_OFF
}
}
]

const course = {
...makeCourseDetailWithRuns(),
courseruns: [pastCourseRun, currentCourseRun]
}

const entities = {
courseRuns: [currentCourseRun],
courses: [course],
enrollments: [pastCourseRunEnrollment],
currentUser: currentUser
}

isWithinEnrollmentPeriodStub.returns(true)
const { inner } = await renderPage({
entities: entities
})

sinon.assert.calledWith(
helper.handleRequestStub,
"/api/course_runs/?relevant_to=",
"GET"
)
sinon.assert.calledWith(helper.handleRequestStub, "/api/users/me", "GET")
sinon.assert.calledWith(
helper.handleRequestStub,
"/api/enrollments/",
"GET"
)

const enrollBtn = inner.find(".enroll-now").at(0)
assert.isTrue(enrollBtn.exists())

await enrollBtn.prop("onClick")()

const modal = inner.find(".upgrade-enrollment-modal")
const upgradeForm = modal.find("form").at(0)
assert.isTrue(upgradeForm.exists())

const certPricing = modal.find(".certificate-pricing").at(0)
assert.isTrue(certPricing.exists())
assert.isTrue(
certPricing
.text()
.includes(currentCourseRun["upgrade_deadline"].format("MMMM D, YYYY"))
)
})
;[
[true, false],
[false, false],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class ProgramProductDetailEnroll extends React.Component<
key={`selectable-courserun-${run.id}`}
value={run.courseware_id}
>
{run.courseware_id} - {run.title}
{run.title} - {run.courseware_id}
</option>
))}
</select>
Expand Down
2 changes: 1 addition & 1 deletion frontend/staff-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@ant-design/icons": "^5.0.0",
"@craco/craco": "6.4.3",
"@craco/craco": "6.4.5",
"@pankod/refine-antd": "3.22.1",
"@pankod/refine-core": "3.22.1",
"@pankod/refine-react-router-v6": "3.22.1",
Expand Down
2 changes: 1 addition & 1 deletion main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from main.celery_utils import OffsettingSchedule
from main.sentry import init_sentry

VERSION = "0.82.2"
VERSION = "0.82.3"

log = logging.getLogger()

Expand Down
Loading
Loading