Skip to content

Feat/qualifier pages #668

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

Merged
merged 15 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions frontend/src/components/Buttons/_Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ $theme-values: (
),
),
"primary-dark": (
"background-color": $color-blue,
"color": $color-white,
"background-color": $color-white,
"color": $color-blue-dark,
"focus": (
"background-color": $color-blue-focused,
"background-color": $color-blue-dark-focused,
),
"hover": (
"background-color": $color-white,
"background-color": $color-blue-dark-hover,
"box-shadow": 0 4px 4px rgb(0 0 0 / 20%),
"color": $color-charcoal,
"color": $color-white,
),
"active": (
"background-color": $color-blue-focused,
"background-color": $color-blue-dark-focused,
),
),
);
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/context/QualifiersContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ type QualifiersType = {
COPs: {
[copName: string]: string[];
};
selectedCOP?: string;
skills_matrix?: { [skill: string]: string };
// availabilityTimeSlots: string[];
};

Expand Down Expand Up @@ -53,6 +55,7 @@ export const QualifiersProvider: React.FC<{ children: ReactNode }> = ({
const [qualifiers, setQualifiers] = useState<QualifiersType>(initialState);

const updateQualifiers = (newQualifiers: QualifiersType) => {
console.log("Updated Qualifiers:", newQualifiers); // Log the updated qualifiers TO DELETE
setQualifiers(newQualifiers);
};

Expand Down
60 changes: 60 additions & 0 deletions frontend/src/pages/QualifierPage/components/ProgressIndicator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from "react";

interface ProgressIndicatorProps {
currentPart: number;
totalParts: number;
title: string;
progressPercentage: number; // New prop
}

export const ProgressIndicator: React.FC<ProgressIndicatorProps> = ({
currentPart,
totalParts,
title,
progressPercentage,
}) => {
// Ensure progressPercentage is clamped between 0 and 100
const validProgressPercentage = Math.min(
Math.max(progressPercentage, 0),
100,
);
const strokeDashoffset = 62.8 - (62.8 * validProgressPercentage) / 100;

return (
<div className="flex items-center gap-2">
<svg
className="text-blue-dark"
width="40"
height="40"
viewBox="0 0 36 36"
xmlns="http://www.w3.org/2000/svg"
>
<circle
cx="18"
cy="18"
r="10"
fill="none"
stroke="#e6e6e6"
strokeWidth="4"
/>
<circle
cx="18"
cy="18"
r="10"
fill="none"
stroke="currentColor"
strokeWidth="4"
strokeDasharray="62.8, 62.8"
strokeDashoffset={strokeDashoffset}
transform="rotate(-90 18 18)"
/>
</svg>
<div className="flex flex-col">
<span className="font-bold text-charcoal">
Part {currentPart} of {totalParts}
</span>
<span className="text-charcoal">{title}</span>
</div>
</div>
);
};
6 changes: 4 additions & 2 deletions frontend/src/pages/QualifierPage/components/QualifierNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ function QualifierNav({ className, children }: QualifierNavProps) {
return (
<div
className={clsx(
"border-px sticky bottom-0 box-content flex h-20 w-4/5 flex-wrap items-center rounded-lg border-[#D8D8D8] bg-[#FDFDFD] px-6 opacity-80 shadow-[0_8px_25px_#00000014] hover:opacity-100",
"sticky bottom-0 box-content flex h-16 w-full flex-wrap items-center rounded-lg border border-[#E0E0E0] bg-[#FDFDFD] opacity-80 shadow-[0_8px_25px_#00000014] hover:opacity-100",
className,
)}
>
{children}
<div className="flex w-full items-center justify-between px-6">
{children}
</div>
</div>
);
}
Expand Down
92 changes: 70 additions & 22 deletions frontend/src/pages/QualifierPage/components/RadioButtonForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,36 @@ import React from "react";
// Internal Imports
import Typography from "tw-components/Typography";

function RadioButtonForm() {
interface RadioButtonFormProps {
onSkillSelect: (skill: string, level: string) => void;
selectedSkillsLevel: Record<string, string>;
}

const skills = [
{
name: "User Research Methods",
description: "Interviews, surveys, and usability testing",
},
{
name: "User Personas & Journey Mapping",
description:
"Developing representative user profiles and mapping user journeys",
},
{
name: "Information Architecture",
description:
"E.g., creating site maps, navigation flows, or using card sorting",
},
{
name: "Wireframing & Sketching",
description: "low-fidelity layouts to visualize structure and flow",
},
];

function RadioButtonForm({
onSkillSelect,
selectedSkillsLevel,
}: RadioButtonFormProps) {
return (
<table className="w-full table-fixed border-collapse text-charcoal">
<thead>
Expand All @@ -29,22 +58,15 @@ function RadioButtonForm() {
</tr>
</thead>
<tbody>
<SkillRow
skillName="User Research Methods"
description="Interviews, surveys, and usability testing"
/>
<SkillRow
skillName="User Personas & Journey Mapping"
description="Developing representative user profiles and mapping user journeys"
/>
<SkillRow
skillName="Information Architecture"
description="E.g., creating site maps, navigation flows, or using card sorting"
/>
<SkillRow
skillName="Wireframing & Sketching"
description="low-fidelity layouts to visualize structure and flow"
/>
{skills.map((skill) => (
<SkillRow
key={skill.name}
skillName={skill.name}
description={skill.description}
onSkillSelect={onSkillSelect}
selectedLevel={selectedSkillsLevel[skill.name]}
/>
))}
</tbody>
</table>
);
Expand All @@ -53,9 +75,16 @@ function RadioButtonForm() {
interface SkillRowProps {
skillName: string;
description: string;
onSkillSelect: (skill: string, level: string) => void;
selectedLevel?: string;
}

function SkillRow({ skillName, description }: SkillRowProps) {
function SkillRow({
skillName,
description,
onSkillSelect,
selectedLevel,
}: SkillRowProps) {
return (
<tr className="border-b-2 border-grey last:border-0">
<td className="pb-7 pt-6">
Expand All @@ -65,13 +94,28 @@ function SkillRow({ skillName, description }: SkillRowProps) {
</Typography.Paragraph3>
</td>
<td>
<RadioButton name={skillName} value="0-2yrs" />
<RadioButton
name={skillName}
value="0-2yrs"
checked={selectedLevel === "0-2yrs"}
onChange={() => onSkillSelect(skillName, "0-2yrs")}
/>
</td>
<td>
<RadioButton name={skillName} value="2-4yrs" />
<RadioButton
name={skillName}
value="2-4yrs"
checked={selectedLevel === "2-4yrs"}
onChange={() => onSkillSelect(skillName, "2-4yrs")}
/>
</td>
<td>
<RadioButton name={skillName} value="4+yrs" />
<RadioButton
name={skillName}
value="4+yrs"
checked={selectedLevel === "4+yrs"}
onChange={() => onSkillSelect(skillName, "4+yrs")}
/>
</td>
</tr>
);
Expand All @@ -80,14 +124,18 @@ function SkillRow({ skillName, description }: SkillRowProps) {
interface RadioButtonProps {
value: string;
name: string;
checked?: boolean;
onChange: () => void;
}

function RadioButton({ value, name }: RadioButtonProps) {
function RadioButton({ value, name, checked, onChange }: RadioButtonProps) {
return (
<input
type="radio"
name={name}
value={value}
checked={checked}
onChange={onChange}
className="size-8 border-2 border-grey-dark checked:bg-blue-dark"
/>
);
Expand Down
Loading