Skip to content

Commit

Permalink
Merge pull request #7374 from GCTC-NTGC/7168-application-skills-valid…
Browse files Browse the repository at this point in the history
…ation

[Bug] Application skills page validation
  • Loading branch information
vd1992 authored Jul 26, 2023
2 parents cb086f6 + a759cda commit 54bb6c7
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Separator,
ThrowNotFound,
} from "@gc-digital-talent/ui";
import { notEmpty } from "@gc-digital-talent/helpers";
import { toast } from "@gc-digital-talent/toast";
import { Input } from "@gc-digital-talent/forms";
import { useFeatureFlags } from "@gc-digital-talent/env";
Expand All @@ -30,6 +29,7 @@ import {
} from "~/api/generated";
import { AnyExperience } from "~/types/experience";

import { isIncomplete } from "~/validators/profile/skillRequirements";
import SkillTree from "./components/SkillTree";
import { ApplicationPageProps } from "../ApplicationApi";
import SkillDescriptionAccordion from "./components/SkillDescriptionAccordion";
Expand Down Expand Up @@ -112,17 +112,10 @@ export const ApplicationSkills = ({
const nextStep =
followingPageUrl ?? paths.applicationQuestionsIntro(application.id);

const skillsMissingExperiences = categorizedEssentialSkills[
SkillCategory.Technical
]
?.filter((essentialSkill) => {
return !application.user.experiences?.some((experience) => {
return experience?.skills?.some(
(skill) => skill.id === essentialSkill.id,
);
});
})
.filter(notEmpty);
const isSkillsExperiencesIncomplete = isIncomplete(
application.user,
application.pool,
);

const methods = useForm<FormValues>();
const {
Expand Down Expand Up @@ -332,7 +325,7 @@ export const ApplicationSkills = ({
onClick={() => {
setValue(
"skillsMissingExperiences",
skillsMissingExperiences?.length || 0,
isSkillsExperiencesIncomplete ? 1 : 0,
);
}}
>
Expand Down

0 comments on commit 54bb6c7

Please sign in to comment.