feat: link quizzes to job positions and filter candidate dashboard accordingly
This commit is contained in:
@@ -10,7 +10,8 @@ import InputError from '@/Components/InputError.vue';
|
||||
|
||||
const props = defineProps({
|
||||
jobPositions: Array,
|
||||
tenants: Array
|
||||
tenants: Array,
|
||||
quizzes: Array
|
||||
});
|
||||
|
||||
const showingModal = ref(false);
|
||||
@@ -22,6 +23,7 @@ const form = useForm({
|
||||
requirements: [],
|
||||
ai_prompt: '',
|
||||
tenant_id: '',
|
||||
quiz_ids: [],
|
||||
});
|
||||
|
||||
const openModal = (position = null) => {
|
||||
@@ -32,6 +34,7 @@ const openModal = (position = null) => {
|
||||
form.requirements = position.requirements || [];
|
||||
form.ai_prompt = position.ai_prompt || '';
|
||||
form.tenant_id = position.tenant_id || '';
|
||||
form.quiz_ids = position.quizzes ? position.quizzes.map(q => q.id) : [];
|
||||
} else {
|
||||
form.reset();
|
||||
}
|
||||
@@ -203,6 +206,32 @@ const removeRequirement = (index) => {
|
||||
<InputError :message="form.errors.ai_prompt" />
|
||||
</div>
|
||||
|
||||
<div v-if="quizzes && quizzes.length > 0">
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-4">Tests techniques associés</label>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||
<div
|
||||
v-for="quiz in quizzes"
|
||||
:key="quiz.id"
|
||||
class="flex items-center p-3 bg-slate-50 dark:bg-slate-900 rounded-2xl cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors"
|
||||
@click="form.quiz_ids.includes(quiz.id) ? form.quiz_ids = form.quiz_ids.filter(id => id !== quiz.id) : form.quiz_ids.push(quiz.id)"
|
||||
>
|
||||
<div
|
||||
class="w-5 h-5 rounded-md border-2 mr-3 flex items-center justify-center transition-all"
|
||||
:class="form.quiz_ids.includes(quiz.id) ? 'bg-indigo-600 border-indigo-600' : 'border-slate-300 dark:border-slate-600'"
|
||||
>
|
||||
<svg v-if="form.quiz_ids.includes(quiz.id)" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs font-bold leading-tight">{{ quiz.title }}</div>
|
||||
<div class="text-[9px] text-slate-400 uppercase tracking-tighter">{{ quiz.duration_minutes }} min</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<InputError :message="form.errors.quiz_ids" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<label class="text-xs font-black uppercase tracking-widest text-slate-400">Compétences clés / Pré-requis</label>
|
||||
|
||||
Reference in New Issue
Block a user