-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 1.2 - tussensprint (kostenbaten en genestheid)
Release 1.2 - tussensprint (kostenbaten en genestheid)
- Loading branch information
Showing
71 changed files
with
12,188 additions
and
818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ on: | |
branches: | ||
- main | ||
- production | ||
- acceptance | ||
workflow_dispatch: | ||
|
||
permissions: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
frontend/components/Blocks/ChallengeFeedbackModal/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { StaticImage } from "@/components/ImageSelector/types"; | ||
|
||
export type FeedbackModal = { | ||
id: string; | ||
type: string; | ||
value: { | ||
modaltitle: string; | ||
modaltext: string; | ||
modaltheme: string; | ||
imageSelector: { | ||
id: string; | ||
title: string; | ||
img: StaticImage; | ||
}; | ||
conditions: [ | ||
{ | ||
id: string; | ||
type: string; | ||
value: { | ||
parameter: string; | ||
operator: string; | ||
value: string; | ||
}; | ||
} | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 3 additions & 10 deletions
13
frontend/components/Blocks/HeaderFullImageBlock/HeaderFullImageBlock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
frontend/components/Blocks/HolarchyFeedbackImage/HolarchyFeedbackImage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { StaticImage } from "@/components/ImageSelector/types"; | ||
import { Content } from "@/components/Blocks/SectionBlock/types"; | ||
|
||
export type HolarchyFeedbackImageProps = { | ||
id: string; | ||
type: string; | ||
value: { | ||
imageSelector: { | ||
id: string; | ||
title: string; | ||
img: StaticImage; | ||
}; | ||
conditions: [ | ||
{ | ||
id: string; | ||
type: string; | ||
value: { | ||
parameter: string; | ||
operator: string; | ||
value: string; | ||
}; | ||
} | ||
]; | ||
}; | ||
}; | ||
|
||
type Props = { | ||
content: Array<Content>; | ||
holarchyfeedbackimages: Array<HolarchyFeedbackImageProps>; | ||
}; | ||
|
||
export default function HolarchyFeedbackImage({ content, holarchyfeedbackimages }: Props) { | ||
const [selectedImage, setSelectedImage] = useState({}); | ||
|
||
useEffect(() => { | ||
setSelectedImage({}); | ||
|
||
setSelectedImage( | ||
//loop through al configured images | ||
holarchyfeedbackimages.filter(feedbackimage => { | ||
if (feedbackimage.value.conditions.length > 0 && content.length) { | ||
//loop through all conditions within image... | ||
for (const conditionItem of feedbackimage.value.conditions) { | ||
//inputvalue is the vaule of the assessed validator | ||
const inputvalue = content?.find( | ||
content => content.value.id == parseFloat(conditionItem.value.parameter) | ||
)?.currentValue; | ||
|
||
const conditionValue = parseFloat(conditionItem.value.value); | ||
|
||
if (inputvalue == null || inputvalue == undefined) { | ||
return false; | ||
} else if (conditionItem.value.operator == "bigger" && inputvalue <= conditionValue) { | ||
return false; | ||
} else if ( | ||
conditionItem.value.operator == "biggerequal" && | ||
inputvalue < conditionValue | ||
) { | ||
return false; | ||
} else if ( | ||
conditionItem.value.operator == "equal" && | ||
inputvalue != conditionItem.value.value | ||
) { | ||
return false; | ||
} else if ( | ||
conditionItem.value.operator == "notequal" && | ||
inputvalue == conditionItem.value.value | ||
) { | ||
return false; | ||
} else if (conditionItem.value.operator == "lower" && inputvalue >= conditionValue) { | ||
return false; | ||
} else if ( | ||
conditionItem.value.operator == "lowerequal" && | ||
inputvalue > conditionValue | ||
) { | ||
return false; | ||
} else { | ||
} | ||
} | ||
return true; | ||
} | ||
})[0] | ||
); | ||
}, [content, holarchyfeedbackimages]); | ||
|
||
return ( | ||
<React.Fragment> | ||
{selectedImage && selectedImage.value ? ( | ||
<img | ||
src={selectedImage?.value.imageSelector?.img?.src} | ||
alt={selectedImage?.value.imageSelector?.img?.alt} | ||
className="image z-10 absolute translate-x-[-50%] translate-y-[-50%] top-1/2 left-1/2 h-[300%] object-contain max-w-none" | ||
/> | ||
) : ( | ||
<img | ||
src={holarchyfeedbackimages[0]?.value.imageSelector?.img?.src} | ||
alt={holarchyfeedbackimages[0].value.imageSelector?.img?.alt} | ||
className="image z-10 absolute translate-x-[-50%] translate-y-[-50%] top-1/2 left-1/2 h-[300%] object-contain max-w-none" | ||
/> | ||
)} | ||
</React.Fragment> | ||
); | ||
} |
Oops, something went wrong.