Skip to content

Commit

Permalink
Merge branch 'main' into feat/LBAC-1646-anonymization-candidatures
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlr authored Nov 6, 2023
2 parents 45af9b5 + a1ba974 commit 9520513
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,10 @@ exports[`generateOpenApiSchema > should generate proper schema 1`] = `
},
"job_start_date": {
"description": "Date de début de l'alternance",
"type": "string",
"type": [
"string",
"null",
],
},
"job_status": {
"description": "Statut de l'offre",
Expand Down Expand Up @@ -5297,7 +5300,10 @@ L'email est envoyé depuis l'adresse générique \\"Ne pas répondre\\" de La bo
},
"job_start_date": {
"description": "Date de début de l'alternance",
"type": "string",
"type": [
"string",
"null",
],
},
"job_type": {
"description": "Type de contrat",
Expand Down
11 changes: 6 additions & 5 deletions shared/models/job.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ const ZJobFields = z
.enum([allJobLevel[0], ...allJobLevel.slice(1)])
.nullish()
.describe("Niveau de formation visé en fin de stage"),
job_start_date: z.coerce
.date()
.describe("Date de début de l'alternance")
.refine((date) => dayjs(date).isSameOrAfter(dayjs().utc()), { message: "job_start_date must be greater or equal to today's date" }),
job_start_date: z.coerce.date().describe("Date de début de l'alternance"),
job_description: z.string().nullish().describe("Description de l'offre d'alternance"),
job_employer_description: z.string().nullish().describe("Description de l'employer proposant l'offre d'alternance"),
rome_code: z.array(z.string()).describe("Liste des romes liés au métier"),
Expand Down Expand Up @@ -84,14 +81,18 @@ export const ZJobWrite = ZJobFields.pick({
rome_label: true,
job_type: true,
job_level_label: true,
job_start_date: true,
is_disabled_elligible: true,
job_count: true,
job_duration: true,
job_rythm: true,
job_description: true,
delegations: true,
})
.extend({
job_start_date: ZJobFields.shape.job_start_date.refine((date) => dayjs(date).isSameOrAfter(dayjs().utc().startOf("days")), {
message: "job_start_date must be greater or equal to today's date",
}),
})
.strict()
.openapi("JobWrite")

Expand Down
4 changes: 2 additions & 2 deletions ui/components/espace_pro/AjouterVoeux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const AjouterVoeuxForm = (props) => {
</Flex>
</FormErrorMessage>
</FormControl>
{(user && user.type !== AUTHTYPE.ENTREPRISE) || type !== AUTHTYPE.ENTREPRISE ? (
{Boolean((user && user.type !== AUTHTYPE.ENTREPRISE) || (type && type !== AUTHTYPE.ENTREPRISE)) && (
<FormControl mt={6}>
<FormLabel>Rythme de l'alternance (formation / entreprise)</FormLabel>
<FormHelperText pb={2}>Facultatif</FormHelperText>
Expand All @@ -330,7 +330,7 @@ const AjouterVoeuxForm = (props) => {
</Select>
{errors.job_rythm && touched.job_rythm && <FormErrorMessage>{errors.job_rythm as string}</FormErrorMessage>}
</FormControl>
) : null}
)}
<Divider mt={5} />
{(values.job_description || organisation?.includes("akto")) && (
<FormControl mt={6}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import { Layout } from "../../../../../../components/espace_pro"
import CreationOffre from "../../../../../../components/espace_pro/CreationOffre"
import { authProvider, withAuth } from "../../../../../../components/espace_pro/withAuth"

function EntrepriseCreationOffre() {
return <CreationOffre />
}

function EntrepriseCreationOffrePage() {
return (
<Layout footer={false}>
<EntrepriseCreationOffre />
<CreationOffre />
</Layout>
)
}
Expand Down

0 comments on commit 9520513

Please sign in to comment.