mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
job in accompanying course: validation
This commit is contained in:
parent
216c035bac
commit
74e94637b9
@ -204,6 +204,7 @@ class AccompanyingPeriod implements
|
|||||||
* targetEntity=UserJob::class
|
* targetEntity=UserJob::class
|
||||||
* )
|
* )
|
||||||
* @Groups({"read", "write"})
|
* @Groups({"read", "write"})
|
||||||
|
* @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CONFIRMED})
|
||||||
*/
|
*/
|
||||||
private ?UserJob $job = null;
|
private ?UserJob $job = null;
|
||||||
|
|
||||||
|
@ -110,7 +110,11 @@ export default {
|
|||||||
scopes: {
|
scopes: {
|
||||||
msg: 'confirm.set_a_scope',
|
msg: 'confirm.set_a_scope',
|
||||||
anchor: '#section-70'
|
anchor: '#section-70'
|
||||||
}
|
},
|
||||||
|
job: {
|
||||||
|
msg: 'confirm.job_not_valid',
|
||||||
|
anchor: '#section-80'
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -124,6 +128,7 @@ export default {
|
|||||||
'isOriginValid',
|
'isOriginValid',
|
||||||
'isAdminLocationValid',
|
'isAdminLocationValid',
|
||||||
'isLocationValid',
|
'isLocationValid',
|
||||||
|
'isJobValid',
|
||||||
'validationKeys',
|
'validationKeys',
|
||||||
'isValidToBeConfirmed'
|
'isValidToBeConfirmed'
|
||||||
]),
|
]),
|
||||||
|
@ -67,13 +67,17 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="!isJobValid" class="alert alert-warning to-confirm">
|
||||||
|
{{ $t('job.not_valid') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import VueMultiselect from 'vue-multiselect';
|
import VueMultiselect from 'vue-multiselect';
|
||||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||||
import { mapState } from 'vuex';
|
import { mapState, mapGetters } from 'vuex';
|
||||||
import UserRenderBoxBadge from "ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge";
|
import UserRenderBoxBadge from "ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -101,11 +105,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
...mapGetters([
|
||||||
|
'isJobValid'
|
||||||
|
])
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getJobs();
|
this.getJobs();
|
||||||
console.log(this.users)
|
|
||||||
console.log(this.jobs)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateReferrer(value) {
|
updateReferrer(value) {
|
||||||
@ -130,7 +135,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateJob(value) {
|
updateJob(value) {
|
||||||
console.log(value)
|
|
||||||
this.$store.dispatch('updateJob', value)
|
this.$store.dispatch('updateJob', value)
|
||||||
.catch(({name, violations}) => {
|
.catch(({name, violations}) => {
|
||||||
if (name === 'ValidationException' || name === 'AccessException') {
|
if (name === 'ValidationException' || name === 'AccessException') {
|
||||||
|
@ -134,6 +134,7 @@ const appMessages = {
|
|||||||
location_not_valid: "indiquez au minimum une localisation temporaire du parcours",
|
location_not_valid: "indiquez au minimum une localisation temporaire du parcours",
|
||||||
origin_not_valid: "Indiquez une origine à la demande",
|
origin_not_valid: "Indiquez une origine à la demande",
|
||||||
adminLocation_not_valid: "Indiquez une localisation administrative à la demande",
|
adminLocation_not_valid: "Indiquez une localisation administrative à la demande",
|
||||||
|
job_not_valid: "Indiquez un métier du référent",
|
||||||
set_a_scope: "indiquez au moins un service",
|
set_a_scope: "indiquez au moins un service",
|
||||||
sure: "Êtes-vous sûr ?",
|
sure: "Êtes-vous sûr ?",
|
||||||
sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !",
|
sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !",
|
||||||
@ -142,7 +143,8 @@ const appMessages = {
|
|||||||
},
|
},
|
||||||
job: {
|
job: {
|
||||||
label: "Métier",
|
label: "Métier",
|
||||||
placeholder: "Choisir un métier"
|
placeholder: "Choisir un métier",
|
||||||
|
not_valid: "Sélectionnez un métier du référent"
|
||||||
},
|
},
|
||||||
// catch errors
|
// catch errors
|
||||||
'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
|
'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
|
||||||
|
@ -55,6 +55,9 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
|||||||
isLocationValid(state) {
|
isLocationValid(state) {
|
||||||
return state.accompanyingCourse.location !== null;
|
return state.accompanyingCourse.location !== null;
|
||||||
},
|
},
|
||||||
|
isJobValid(state) {
|
||||||
|
return state.accompanyingCourse.job !== null;
|
||||||
|
},
|
||||||
isScopeValid(state) {
|
isScopeValid(state) {
|
||||||
//console.log('is scope valid', state.accompanyingCourse.scopes.length > 0);
|
//console.log('is scope valid', state.accompanyingCourse.scopes.length > 0);
|
||||||
return state.accompanyingCourse.scopes.length > 0;
|
return state.accompanyingCourse.scopes.length > 0;
|
||||||
@ -63,6 +66,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
|||||||
let keys = [];
|
let keys = [];
|
||||||
if (!getters.isParticipationValid) { keys.push('participation'); }
|
if (!getters.isParticipationValid) { keys.push('participation'); }
|
||||||
if (!getters.isLocationValid) { keys.push('location'); }
|
if (!getters.isLocationValid) { keys.push('location'); }
|
||||||
|
if (!getters.isJobValid) { keys.push('job'); }
|
||||||
if (!getters.isSocialIssueValid) { keys.push('socialIssue'); }
|
if (!getters.isSocialIssueValid) { keys.push('socialIssue'); }
|
||||||
if (!getters.isOriginValid) { keys.push('origin'); }
|
if (!getters.isOriginValid) { keys.push('origin'); }
|
||||||
if (!getters.isAdminLocationValid) { keys.push('adminLocation'); }
|
if (!getters.isAdminLocationValid) { keys.push('adminLocation'); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user