Skip to content
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

Njwe 2406/scott training results page #3169

Merged
merged 26 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 24 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
13 changes: 2 additions & 11 deletions src/app/career-pathways/[industry]/Content/InDemandDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ import { InfoBox } from "@components/modules/InfoBox";
import { LabelBox } from "@components/modules/LabelBox";
import { SeeMoreList } from "@components/modules/SeeMoreList";
import { Tag } from "@components/modules/Tag";
import {
ArrowSquareOut,
Briefcase,
GraduationCap,
Hourglass,
MapPinLine,
} from "@phosphor-icons/react";
import { calendarLength } from "@utils/calendarLength";
import { toUsCurrency } from "@utils/toUsCurrency";
import {
InDemandItemProps,
OccupationDetail,
Expand All @@ -38,7 +29,7 @@ export const InDemandDetails = (props: {

const getJobNumbers = async () => {
const jobNumbers = await fetch(
`${process.env.REACT_APP_API_URL}/api/jobcount/${props.content.title}`,
`${process.env.REACT_APP_API_URL}/api/jobcount/${props.content.title}`
);

const jobNumbersArray = await jobNumbers.json();
Expand Down Expand Up @@ -70,7 +61,7 @@ export const InDemandDetails = (props: {

const uniqueTrainings = sortedCourses?.filter(
(training, index, self) =>
index === self.findIndex((t) => t.name === training.name),
index === self.findIndex((t) => t.name === training.name)
);

setSortedTraining(uniqueTrainings);
Expand Down
4 changes: 0 additions & 4 deletions src/app/career-pathways/[industry]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ async function getData() {
query: CAREER_PATHWAYS_PAGE_QUERY,
});

if (process.env.REACT_APP_FEATURE_CAREER_PATHWAYS === "false" || !page) {
return notFound();
}

return {
page,
};
Expand Down
8 changes: 4 additions & 4 deletions src/app/support-resources/[slug]/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ export const Filter = ({
page.items[0].title === "Career Support"
? "purple"
: page.items[0].title === "Tuition Assistance"
? "green"
: "navy";
? "green"
: "navy";

useEffect(() => {
if (selectedTags.length > 0) {
const filtered = listingItems.resources.items.filter(
(resource: ResourceCardProps) => {
const resourceTags = resource.tagsCollection.items.map(
(tag) => tag.title,
(tag) => tag.title
);
return selectedTags.some((tag) => resourceTags.includes(tag.title));
},
}
);
setFilteredResources(filtered);
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/app/training/[code]/SocDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const SocDrawer = ({
Standard Occupational Classification (SOC) codes
</Heading>
<p>
"The 2018 Standard Occupational Classification (SOC) system is a federal
statistical standard used by federal agencies to classify workers into
occupational categories for the purpose of collecting, calculating, or
disseminating data." <sup>1.</sup>
&quot;The 2018 Standard Occupational Classification (SOC) system is a
federal statistical standard used by federal agencies to classify
workers into occupational categories for the purpose of collecting,
calculating, or disseminating data.&quot; <sup>1.</sup>
</p>
<p>
You can find a list of SOC codes{" "}
Expand Down
33 changes: 16 additions & 17 deletions src/app/training/search/components/CompareTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import { X } from "@phosphor-icons/react";
import { calendarLength } from "@utils/calendarLength";
import { toUsCurrency } from "@utils/toUsCurrency";
import { ResultProps } from "@utils/types";
import { useState } from "react";
import { useContext, useState } from "react";
import { ResultsContext } from "./Results";

export const CompareTable = () => {
let { compare, setCompare } = useContext(ResultsContext);

export const CompareTable = ({
items,
setCompare,
}: {
items: ResultProps[];
setCompare: (items: ResultProps[]) => void;
}) => {
const [expanded, setExpanded] = useState<boolean>(false);
const remainingBoxes = 3 - items.length;
const remainingBoxes = 3 - compare.length;

const remainingBoxesArray = Array.from(Array(remainingBoxes).keys());

Expand All @@ -28,7 +25,7 @@ export const CompareTable = ({
<thead>
<tr>
<td></td>
{items.map((item) => (
{compare.map((item) => (
<td key={item.id}>
<div>
<p>{item.name}</p>
Expand All @@ -53,7 +50,7 @@ export const CompareTable = ({
<tbody>
<tr>
<td>Cost</td>
{items.map((item) => (
{compare.map((item) => (
<td key={item.id}>
{item.totalCost ? toUsCurrency(item.totalCost) : "--"}
</td>
Expand All @@ -64,7 +61,7 @@ export const CompareTable = ({
</tr>
<tr>
<td>Employment Rate %</td>
{items.map((item) => (
{compare.map((item) => (
<td key={item.id}>
{" "}
{item.percentEmployed
Expand All @@ -78,7 +75,7 @@ export const CompareTable = ({
</tr>
<tr>
<td>Time to Complete</td>
{items.map((item) => (
{compare.map((item) => (
<td key={item.id}>
{item.calendarLength
? calendarLength(item.calendarLength)
Expand All @@ -91,7 +88,7 @@ export const CompareTable = ({
</tr>
<tr>
<td></td>
{items.map((item) => (
{compare.map((item) => (
<td key={item.id}>
<Button type="link" link={`/training/${item.id}`}>
See Details
Expand All @@ -107,7 +104,7 @@ export const CompareTable = ({
</div>
) : (
<div className="boxes">
{items.map((item) => (
{compare.map((item) => (
<div className="box" key={item.id}>
<p>{item.name}</p>
<p>{item.providerName}</p>
Expand All @@ -116,12 +113,14 @@ export const CompareTable = ({
onClick={() => {
// find the div with id of item.id and uncheck the checkbox
const checkbox: HTMLInputElement = document.getElementById(
`checkbox_${item.id}`,
`checkbox_${item.id}`
) as HTMLInputElement;
checkbox.checked = false;

setCompare(
items.filter((compareItem) => compareItem.id !== item.id),
compare.filter(
(compareItem) => compareItem.id !== item.id
)
);
}}
>
Expand Down
Loading