-
Notifications
You must be signed in to change notification settings - Fork 3
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
Course specific research form #1167
Conversation
@@ -0,0 +1,28 @@ | |||
/* eslint-disable i18next/no-literal-string */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the block (and the file) to ResearchConsentCheckbox
|
||
const CheckBoxConfiguration: BlockConfiguration<CheckBoxAttributes> = { | ||
title: "CheckBox", | ||
description: "Checkbox block", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also write here that this is only for the editor that is used for the teacher-editable research question.
services/cms/src/blocks/index.tsx
Outdated
@@ -78,3 +80,8 @@ export const blockTypeMapForTopLevelPages = [ | |||
["moocfi/hero-section", HeroSection], | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
] as Array<[string, BlockConfiguration<Record<string, any>>]> | |||
|
|||
export const blockTypeMapForResearchConsentForm = [["moocfi/checkbox", CheckBox]] as Array< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moocfi/research-consent-checkbox
services/cms/src/blocks/index.tsx
Outdated
@@ -53,6 +54,7 @@ export const blockTypeMapForPages = [ | |||
["moocfi/tablebox", TableBox], | |||
["moocfi/iframe", Iframe], | |||
["moocfi/map", Map], | |||
["moocfi/checkbox", CheckBox], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate const for the research consent form editor
) -> ControllerResult<web::Json<ResearchForm>> { | ||
let mut conn = pool.acquire().await?; | ||
|
||
let token = authorize(&mut conn, Act::Edit, Some(user.id), Res::Exam(*course_id)).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Res::Global...
) -> ControllerResult<web::Json<ResearchForm>> { | ||
let mut conn = pool.acquire().await?; | ||
|
||
let token = authorize(&mut conn, Act::View, Some(user.id), Res::Course(*course_id)).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit
) -> ControllerResult<web::Json<ResearchForm>> { | ||
let mut conn = pool.acquire().await?; | ||
|
||
let token = authorize(&mut conn, Act::View, Some(user.id), Res::Course(*course_id)).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authorize_access_to_course_material
?.map((obj) => obj.course_id) | ||
.filter((course_id: string, index, currentVal) => currentVal.indexOf(course_id) === index) | ||
setAllCourseIds(uniqueCourseIds ?? []) | ||
}, [getAllResearchFormAnswers.data]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onSuccess
@@ -225,6 +225,14 @@ const ManageCourse: React.FC<React.PropsWithChildren<Props>> = ({ course, refetc | |||
{t("link-export-course-instances")} | |||
</a> | |||
</li> | |||
<li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap this into a separate <OnlyRenderIfPermissions>
thing
d98f3ff
to
af46e25
Compare
</ul> | ||
</> | ||
</OnlyRenderIfPermissions> | ||
<OnlyRenderIfPermissions action={{ type: "edit" }} resource={{ type: "global_permissions" }}> | ||
<a href={`/cms/courses/${course.id}/research-form-edit`} aria-label={"Edit research form"}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translate
<OnlyRenderIfPermissions action={{ type: "edit" }} resource={{ type: "global_permissions" }}> | ||
<a href={`/cms/courses/${course.id}/research-form-edit`} aria-label={"Edit research form"}> | ||
<Button variant="secondary" size="medium"> | ||
{"Create or edit research form"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translate
...ots__/research-form.spec.ts/research-consent-form-shows-in-user-setting-page-mobile-tall.png
Outdated
Show resolved
Hide resolved
…earch-form # Conflicts: # services/headless-lms/models/sqlx-data.json
37183ab
to
b92fdf2
Compare
No description provided.