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

Added grouping via subject categories for english subject #3048

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dd48bac
feat: added grouping via subject categories for english
orangemug Dec 2, 2024
18da0db
refactor: add a blank line before subject category headings and make …
assadk88 Dec 11, 2024
ad932de
test: update snapshot tests
assadk88 Dec 12, 2024
ca97756
feat: for primary english add newly organised thread unit listing
assadk88 Dec 12, 2024
ae0cb68
test: update snapshots to previous state
assadk88 Dec 12, 2024
e516171
test: added missing tests for new subjectcategory grouped threads/units
orangemug Dec 16, 2024
96db8e0
chore: extracted out groupUnitsBySubjectCategory(...)
orangemug Dec 16, 2024
6d5609c
Merge remote-tracking branch 'origin/main' into feat/CUR-829-english-…
orangemug Dec 16, 2024
5a80a62
test: fix tests for non-grouped english units in docx
orangemug Dec 16, 2024
21b87dd
test: more groupUnitsBySubjectCategory tests
orangemug Dec 16, 2024
bbc6bf8
feat: added group_by_subjectcategory to getUnitFeatures(...)
orangemug Dec 16, 2024
e1b994d
chore: update docx snapshot
orangemug Dec 16, 2024
d2cfb77
chore: reorganise some unit tests
orangemug Dec 16, 2024
14adb50
Merge remote-tracking branch 'origin/main' into feat/CUR-829-english-…
orangemug Dec 18, 2024
871cde9
fix: enable group_by_subjectcategory for english secondary
orangemug Dec 18, 2024
455b770
Merge branch 'main' into feat/CUR-829-english-category-grouping
orangemug Jan 6, 2025
cbaf219
fix: added group_by_subjectcategory to english secondary and fixed th…
orangemug Jan 6, 2025
66c886a
Merge remote-tracking branch 'origin/main' into feat/CUR-829-english-…
orangemug Jan 6, 2025
8a0bc06
Merge remote-tracking branch 'origin/feat/CUR-829-english-category-gr…
orangemug Jan 6, 2025
f7572d2
Merge branch 'main' into feat/CUR-829-english-category-grouping
orangemug Jan 6, 2025
6795bb3
Merge branch 'main' into feat/CUR-829-english-category-grouping
orangemug Jan 6, 2025
4f59be9
Merge branch 'main' into feat/CUR-829-english-category-grouping
orangemug Jan 6, 2025
e77d61c
Merge remote-tracking branch 'origin/main' into feat/CUR-829-english-…
orangemug Jan 8, 2025
bdf405b
Merge remote-tracking branch 'origin/feat/CUR-829-english-category-gr…
orangemug Jan 8, 2025
21e663f
fix: adjust logic for subject categories
assadk88 Jan 8, 2025
d27da6d
Merge branch 'feat/CUR-829-english-category-grouping' into feat/CUR-1…
orangemug Jan 8, 2025
3e34fe4
Merge pull request #3096 from oaknational/feat/CUR-1156-fix-subj-cate…
orangemug Jan 8, 2025
ca4403d
fix: added logic for non-subjectcategory grouped threads to curric do…
orangemug Jan 8, 2025
e4b412c
fix: unit ordering in subjectcategory grouped unit threads (curric docx)
orangemug Jan 9, 2025
bc0fa28
chore: ["10", "11"] to "ks4"
orangemug Jan 9, 2025
769a754
fix: more ordering fixes for threads in curric docx
orangemug Jan 9, 2025
9b6de6e
test: added missing keystage_slug to tests
orangemug Jan 9, 2025
6d3db4c
test: fixed failing curric docx thread tests
orangemug Jan 9, 2025
a8ed332
fix: added back in thread check
orangemug Jan 9, 2025
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
17 changes: 17 additions & 0 deletions scripts/dev/curriculum/_commands/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ const fixtures = {
});
return output;
},
"curriculumunits-english-primary": async () => {
const output = await sdk.curriculumUnits({
where: {
_and: [
{
_or: [
{ subject_slug: { _eq: "english" } },
{ subject_parent_slug: { _eq: "english" } },
],
},
{ phase_slug: { _eq: "primary" } },
{ state: { _eq: "published" } },
],
},
});
return output;
},
"curriculumunits-science-secondary": async () => {
const output = await sdk.curriculumUnits({
where: {
Expand Down
83 changes: 83 additions & 0 deletions src/pages-helpers/curriculum/docx/builder/10_threadsDetail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,87 @@ describe("10_threadsDetail", () => {

expect(await zipToSnapshotObject(zip.getJsZip())).toMatchSnapshot();
});

it("subjectcategory grouped", async () => {
const zip = await generateEmptyDocx();
await generate(zip, {
data: {
subjectTitle: "English",
units: [
{
subject_slug: "english",
phase_slug: "primary",
year: "7",
title: "Test A",
threads: [{ title: "thread-one", order: 0, slug: "one" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "7",
title: "Test B",
threads: [{ title: "thread-two", order: 0, slug: "two" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "8",
title: "Test A",
threads: [{ title: "thread-one", order: 0, slug: "one" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "8",
title: "Test B",
threads: [{ title: "thread-two", order: 0, slug: "two" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "9",
title: "Test A",
threads: [{ title: "thread-one", order: 0, slug: "one" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "9",
title: "Test B",
threads: [{ title: "thread-two", order: 0, slug: "two" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "10",
title: "Test A",
threads: [{ title: "thread-one", order: 0, slug: "one" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "10",
title: "Test B",
threads: [{ title: "thread-two", order: 0, slug: "two" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "11",
title: "Test A",
threads: [{ title: "thread-one", order: 0, slug: "one" }],
},
{
subject_slug: "english",
phase_slug: "primary",
year: "11",
title: "Test B",
threads: [{ title: "thread-two", order: 0, slug: "two" }],
},
],
} as CombinedCurriculumData,
});

expect(await zipToSnapshotObject(zip.getJsZip())).toMatchSnapshot();
});
});
Loading
Loading