mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Merge pull request #297 from learnhouse/fix/new-orgconfig-bugs
Fix new org config bugs
This commit is contained in:
commit
85709e9040
6 changed files with 12 additions and 15 deletions
|
|
@ -92,7 +92,7 @@ function PublishingState() {
|
||||||
|
|
||||||
async function updateAssignmentPublishState(assignmentUUID: string) {
|
async function updateAssignmentPublishState(assignmentUUID: string) {
|
||||||
const res = await updateAssignment({ published: !assignment?.assignment_object?.published }, assignmentUUID, access_token)
|
const res = await updateAssignment({ published: !assignment?.assignment_object?.published }, assignmentUUID, access_token)
|
||||||
const res2 = await updateActivity({ published: !assignment?.assignment_object?.published }, assignment?.activity_object?.activity_uuid, access_token)
|
const res2 = await updateActivity({ published: !assignment?.assignment_object?.published }, assignment?.activity_object?.activity_uuid, access_token)
|
||||||
if (res.success && res2) {
|
if (res.success && res2) {
|
||||||
mutate(`${getAPIUrl()}assignments/${assignmentUUID}`)
|
mutate(`${getAPIUrl()}assignments/${assignmentUUID}`)
|
||||||
toast.success('The assignment has been updated successfully')
|
toast.success('The assignment has been updated successfully')
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ function ActivityElement(props: ActivitiyElementProps) {
|
||||||
async function changePublicStatus() {
|
async function changePublicStatus() {
|
||||||
await updateActivity(
|
await updateActivity(
|
||||||
{
|
{
|
||||||
|
...props.activity,
|
||||||
published: !props.activity.published,
|
published: !props.activity.published,
|
||||||
},
|
},
|
||||||
props.activity.activity_uuid,
|
props.activity.activity_uuid,
|
||||||
|
|
@ -82,8 +83,8 @@ function ActivityElement(props: ActivitiyElementProps) {
|
||||||
) {
|
) {
|
||||||
setSelectedActivity(undefined)
|
setSelectedActivity(undefined)
|
||||||
let modifiedActivityCopy = {
|
let modifiedActivityCopy = {
|
||||||
|
...props.activity,
|
||||||
name: modifiedActivity.activityName,
|
name: modifiedActivity.activityName,
|
||||||
description: '',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateActivity(modifiedActivityCopy, activityUUID, access_token)
|
await updateActivity(modifiedActivityCopy, activityUUID, access_token)
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ function NewActivityModal({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
||||||
<Image quality={100} alt="Dynamic Page" src={DynamicPageActivityImage}></Image>
|
<Image unoptimized quality={100} alt="Dynamic Page" src={DynamicPageActivityImage}></Image>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
||||||
Dynamic Page
|
Dynamic Page
|
||||||
|
|
@ -42,7 +42,7 @@ function NewActivityModal({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
||||||
<Image quality={100} alt="Video Page" src={VideoPageActivityImage}></Image>
|
<Image unoptimized quality={100} alt="Video Page" src={VideoPageActivityImage}></Image>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
||||||
Video
|
Video
|
||||||
|
|
@ -54,7 +54,7 @@ function NewActivityModal({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
||||||
<Image quality={100} alt="Document PDF Page" src={DocumentPdfPageActivityImage}></Image>
|
<Image unoptimized quality={100} alt="Document PDF Page" src={DocumentPdfPageActivityImage}></Image>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
||||||
Document
|
Document
|
||||||
|
|
@ -66,7 +66,7 @@ function NewActivityModal({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
<div className="h-20 rounded-lg m-0.5 flex flex-col items-center justify-end text-center bg-white hover:cursor-pointer">
|
||||||
<Image quality={100} alt="Assignment Page" src={AssignmentActivityImage}></Image>
|
<Image unoptimized quality={100} alt="Assignment Page" src={AssignmentActivityImage}></Image>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
<div className="flex text-sm h-5 font-medium text-gray-500 items-center justify-center text-center">
|
||||||
Assignments
|
Assignments
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ const OnboardingScreen: React.FC<OnboardingScreenProps> = ({
|
||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
<div className='onboarding_screens flex-col px-4 py-4'>
|
<div className='onboarding_screens flex-col px-4 py-4'>
|
||||||
<div className='flex-grow rounded-xl'>
|
<div className='flex-grow rounded-xl'>
|
||||||
<Image className='mx-auto shadow-md shadow-gray-200 rounded-lg aspect-auto' alt='' priority quality={100} src={step.imageSrc} />
|
<Image unoptimized className='mx-auto shadow-md shadow-gray-200 rounded-lg aspect-auto' alt='' priority quality={100} src={step.imageSrc} />
|
||||||
</div>
|
</div>
|
||||||
<div className='grid grid-flow-col justify-stretch space-x-3 mt-4'>
|
<div className='grid grid-flow-col justify-stretch space-x-3 mt-4'>
|
||||||
{onboardingData.map((_, index) => (
|
{onboardingData.map((_, index) => (
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,8 @@ function Activity(props: any) {
|
||||||
) {
|
) {
|
||||||
setSelectedActivity(undefined)
|
setSelectedActivity(undefined)
|
||||||
let modifiedActivityCopy = {
|
let modifiedActivityCopy = {
|
||||||
|
...props.activity,
|
||||||
name: modifiedActivity.activityName,
|
name: modifiedActivity.activityName,
|
||||||
description: '',
|
|
||||||
type: props.activity.type,
|
|
||||||
content: props.activity.content,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateActivity(modifiedActivityCopy, activityId, session.data?.tokens?.access_token)
|
await updateActivity(modifiedActivityCopy, activityId, session.data?.tokens?.access_token)
|
||||||
|
|
@ -155,8 +153,7 @@ function Activity(props: any) {
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
getUriWithOrg(props.orgslug, '') +
|
getUriWithOrg(props.orgslug, '') +
|
||||||
`/course/${
|
`/course/${props.courseid
|
||||||
props.courseid
|
|
||||||
}/activity/${props.activity.uuid.replace(
|
}/activity/${props.activity.uuid.replace(
|
||||||
'activity_',
|
'activity_',
|
||||||
''
|
''
|
||||||
|
|
@ -172,8 +169,7 @@ function Activity(props: any) {
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
getUriWithOrg(props.orgslug, '') +
|
getUriWithOrg(props.orgslug, '') +
|
||||||
`/course/${
|
`/course/${props.courseid
|
||||||
props.courseid
|
|
||||||
}/activity/${props.activity.uuid.replace('activity_', '')}`
|
}/activity/${props.activity.uuid.replace('activity_', '')}`
|
||||||
}
|
}
|
||||||
className=" hover:cursor-pointer p-1 px-3 bg-gray-200 rounded-md"
|
className=" hover:cursor-pointer p-1 px-3 bg-gray-200 rounded-md"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ function TypeOfContentTitle(props: { title: string; type: string }) {
|
||||||
return (
|
return (
|
||||||
<div className="home_category_title flex my-5 items-center">
|
<div className="home_category_title flex my-5 items-center">
|
||||||
<div className="ml-2 rounded-full ring-1 ring-slate-900/5 shadow-inner p-2 my-auto mr-4">
|
<div className="ml-2 rounded-full ring-1 ring-slate-900/5 shadow-inner p-2 my-auto mr-4">
|
||||||
<Image className="" src={getLogo()} alt="Courses logo" />
|
<Image unoptimized className="" src={getLogo()} alt="Courses logo" />
|
||||||
</div>
|
</div>
|
||||||
<h1 className="font-bold text-2xl">{props.title}</h1>
|
<h1 className="font-bold text-2xl">{props.title}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue