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.13.22 #1288

Merged
merged 8 commits into from
Jul 18, 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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.12.4"
cache: "poetry"
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
NODE_ENV: test

- name: Upload frontend build
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: frontend-build
path: frontends/mit-open/build
Expand All @@ -158,7 +158,7 @@ jobs:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand All @@ -181,7 +181,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down Expand Up @@ -298,7 +298,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: playwright-report
path: e2e_testing/playwright-report
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
ref: release

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
ref: release-candidate

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
Expand Down
10 changes: 10 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release Notes
=============

Version 0.13.22
---------------

- Optimize queries for learning resource APIs
- Fix bug with background image obscuring search controls (#1286)
- Draggable list card styles (#1282)
- Update actions/setup-node digest to 1e60f62 (#1267)
- Update actions/upload-artifact digest to 0b2256b (#1269)
- Update actions/setup-python digest to 39cd149 (#1268)

Version 0.13.21 (Released July 17, 2024)
---------------

Expand Down
6 changes: 4 additions & 2 deletions channels/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Models for channels"""

from functools import cached_property

from django.contrib.auth.models import Group
from django.core.validators import RegexValidator
from django.db import models
Expand Down Expand Up @@ -30,7 +32,7 @@ class ChannelQuerySet(TimestampedModelQuerySet):
def annotate_channel_url(self):
"""Annotate the channel for serialization"""
return self.annotate(
_channel_url=Concat(
channel_url=Concat(
models.Value(frontend_absolute_url("/c/")),
"channel_type",
models.Value("/"),
Expand Down Expand Up @@ -110,7 +112,7 @@ def __str__(self):
"""Str representation of channel"""
return self.title

@property
@cached_property
def channel_url(self) -> str:
"""Return the channel url"""
return getattr(
Expand Down
4 changes: 2 additions & 2 deletions frontends/api/src/generated/v1/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4268,10 +4268,10 @@ export type PrivacyLevelEnum =
export interface Program {
/**
*
* @type {Array<CourseResource>}
* @type {number}
* @memberof Program
*/
courses: Array<CourseResource> | null
course_count: number
}
/**
* Serializer for Program Certificates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const program: PartialFactory<ProgramResource> = (overrides = {}) => {
platform: learningResourcePlatform(),
certification: faker.datatype.boolean(),
program: {
courses: repeat(course, { min: 0, max: 5 }),
course_count: faker.number.int({ min: 0, max: 8 }),
},
},
overrides,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from "react"
import { faker } from "@faker-js/faker/locale/en"
import { SortableList, SortableItem } from "ol-components"
import LearningResourceCard from "@/page-components/LearningResourceCard/LearningResourceCard"
import {
SortableList,
SortableItem,
LearningResourceListCard,
LearningResourceListCardCondensed,
} from "ol-components"
import { factories, urls, makeRequest } from "api/test-utils"
import {
screen,
Expand All @@ -27,10 +31,17 @@ jest.mock("ol-components", () => {
...actual,
SortableList: jest.fn(actual.SortableList),
SortableItem: jest.fn(actual.SortableItem),
LearningResourceListCard: jest.fn(actual.LearningResourceListCard),
LearningResourceListCardCondensed: jest.fn(
actual.LearningResourceListCardCondensed,
),
}
})

const spyLearningResourceCardOld = jest.mocked(LearningResourceCard)
const spyLearningResourceListCard = jest.mocked(LearningResourceListCard)
const spyLearningResourceListCardCondensed = jest.mocked(
LearningResourceListCardCondensed,
)

const spySortableList = jest.mocked(SortableList)
const spySortableItem = jest.mocked(SortableItem)
Expand Down Expand Up @@ -114,21 +125,39 @@ describe("ItemsListing", () => {
)

test.each([
{ listType: ListType.LearningPath, sortable: false, cardProps: {} },
{
listType: ListType.LearningPath,
sortable: false,
condensed: false,
cardProps: {},
},
{
listType: ListType.LearningPath,
sortable: true,
cardProps: { sortable: true },
condensed: false,
cardProps: { draggable: true },
},
{
listType: ListType.UserList,
sortable: false,
condensed: false,
cardProps: {},
},
{ listType: ListType.UserList, sortable: false, cardProps: {} },
{
listType: ListType.UserList,
sortable: true,
cardProps: { sortable: true },
condensed: false,
cardProps: { draggable: true },
},
{
listType: ListType.LearningPath,
sortable: true,
condensed: true,
cardProps: { draggable: true },
},
])(
"Shows a list of $listType LearningResourceCards with sortable=$sortable",
({ listType, sortable, cardProps }) => {
"Shows a list of $listType LearningResourceCards with sortable=$sortable and condensed=$condensed",
({ listType, sortable, condensed, cardProps }) => {
const emptyMessage = faker.lorem.sentence()
const paginatedRelationships = getPaginatedRelationships(
listType,
Expand All @@ -142,6 +171,7 @@ describe("ItemsListing", () => {
emptyMessage={emptyMessage}
items={items}
sortable={sortable}
condensed={condensed}
/>,
{ user: {} },
)
Expand All @@ -153,7 +183,14 @@ describe("ItemsListing", () => {

if (sortable) {
items.forEach(({ resource }) => {
expectProps(spyLearningResourceCardOld, { resource, ...cardProps })
if (condensed) {
expectProps(spyLearningResourceListCardCondensed, {
resource,
...cardProps,
})
} else {
expectProps(spyLearningResourceListCard, { resource, ...cardProps })
}
})
}
},
Expand Down
Loading
Loading