Skip to content

Commit

Permalink
Include hide_download in data.json (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbertrand authored Sep 4, 2024
1 parent 1f47ed8 commit 10b2017
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion course-v2/layouts/index.coursedata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"instructors": [
{{- range $index, $instructor := $instructors -}}
{{- if $index -}}
,
,
{{- end -}}
{
"first_name": {{- $instructor.first_name | jsonify -}},
Expand All @@ -34,6 +34,7 @@
"term": {{- $courseData.term | jsonify -}},
"year": {{- $courseData.year | jsonify -}},
"level": {{- $courseData.level | jsonify -}},
"hide_download": {{- $courseData.hide_download | jsonify -}},
"image_src": {{- $courseImageUrl | jsonify -}},
"course_image_metadata": {{- $courseImageMetadata.Params | jsonify -}}
}
Expand Down
3 changes: 2 additions & 1 deletion test-sites/__fixtures__/courses/ocw-ci-test-course/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"Graduate",
"Undergraduate"
],
"hide_download": false,
"image_src": "/courses/ocw-ci-test-course/example_jpg.jpg",
"course_image_metadata": {
"body": "",
Expand Down Expand Up @@ -88,4 +89,4 @@
"youtube_id": ""
}
}
}
}
1 change: 1 addition & 0 deletions www/assets/js/LearningResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export interface CourseJSON {
term: string
year: string
level: Level[] | null
hide_download: boolean
image_src: string
course_image_metadata: CourseImageMetadata
}
Expand Down
1 change: 1 addition & 0 deletions www/assets/js/factories/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export const makeCourseJSON = (): CourseJSON => ({
department_numbers: [casual.word, casual.word],
learning_resource_types: [casual.word, casual.word],
year: String(casual.year),
hide_download: casual.boolean,
course_image_metadata: {
file: casual.string,
image_metadata: {
Expand Down

0 comments on commit 10b2017

Please sign in to comment.