You've already forked isop-mirror
refactor: rename agreement to proof
This commit is contained in:
@@ -13,8 +13,8 @@ async function requestDownload() {
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
const agreement = await client<Blob>(`/api/internships/${props.internship_id}/default-agreement`);
|
||||
triggerDownload(agreement, `default-agreement-${props.internship_id}`);
|
||||
const proof = await client<Blob>(`/api/internships/${props.internship_id}/default-proof`);
|
||||
triggerDownload(proof, `default-proof-${props.internship_id}`);
|
||||
} catch (e) {
|
||||
if (e instanceof FetchError) {
|
||||
alert(`Nepodarilo sa vygenerovať zmluvu: ${e.statusMessage}`);
|
||||
|
||||
@@ -18,7 +18,7 @@ const rules = {
|
||||
|
||||
const loading = ref(false);
|
||||
const error = ref<string | null>(null);
|
||||
const agreement = ref<File | null>(null);
|
||||
const proof = ref<File | null>(null);
|
||||
const report = ref<File | null>(null);
|
||||
const report_confirmed = ref(props.internship.report_confirmed);
|
||||
|
||||
@@ -35,9 +35,9 @@ function triggerDownload(file: Blob, file_name: string) {
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
async function downloadAgreement() {
|
||||
const agreement: Blob = await client(`/api/internships/${props.internship.id}/agreement`);
|
||||
triggerDownload(agreement, `agreement-${props.internship.id}`);
|
||||
async function downloadProof() {
|
||||
const proof: Blob = await client(`/api/internships/${props.internship.id}/proof`);
|
||||
triggerDownload(proof, `proof-${props.internship.id}`);
|
||||
}
|
||||
|
||||
async function downloadReport() {
|
||||
@@ -51,8 +51,8 @@ async function onSubmit() {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('report_confirmed', report_confirmed.value ? '1' : '0');
|
||||
if (agreement.value) {
|
||||
formData.append('agreement', agreement.value);
|
||||
if (proof.value) {
|
||||
formData.append('proof', proof.value);
|
||||
}
|
||||
if (report.value) {
|
||||
formData.append('report', report.value);
|
||||
@@ -64,7 +64,7 @@ async function onSubmit() {
|
||||
body: formData
|
||||
});
|
||||
|
||||
agreement.value = null;
|
||||
proof.value = null;
|
||||
report.value = null;
|
||||
emit('successfulSubmit');
|
||||
} catch (e) {
|
||||
@@ -87,18 +87,18 @@ async function onSubmit() {
|
||||
|
||||
<v-form @submit.prevent="onSubmit" :disabled="loading">
|
||||
<div>
|
||||
<h4 class="mb-2">Podpísaná zmluva / dohoda</h4>
|
||||
<h4 class="mb-2">Dokument na overenie praxe</h4>
|
||||
|
||||
<WarningAlert v-if="props.internship.agreement" title="Existujúci dokument"
|
||||
text="V systéme je už nahratá zmluva/dohoda. Ak chcete nahradiť existujúcu verziu, vyberte súbor, alebo v opačnom prípade nechajte toto pole nevyplnené.">
|
||||
<WarningAlert v-if="props.internship.proof" title="Existujúci dokument"
|
||||
text="V systéme je už nahratý dokument k praxe. Ak chcete nahradiť existujúcu verziu, vyberte súbor, alebo v opačnom prípade nechajte toto pole nevyplnené.">
|
||||
<br />
|
||||
|
||||
<v-btn prepend-icon="mdi-download" color="blue" class="mr-2 mt-2" @click="downloadAgreement">
|
||||
<v-btn prepend-icon="mdi-download" color="blue" class="mr-2 mt-2" @click="downloadProof">
|
||||
Stiahnuť
|
||||
</v-btn>
|
||||
</WarningAlert>
|
||||
|
||||
<v-file-input v-model="agreement" :rules="[rules.isPdf, rules.maxSize]" accept=".pdf,application/pdf"
|
||||
<v-file-input v-model="proof" :rules="[rules.isPdf, rules.maxSize]" accept=".pdf,application/pdf"
|
||||
prepend-icon="mdi-handshake" label="Nahrať PDF zmluvu" variant="outlined" show-size clearable
|
||||
hint="Povolené: PDF, max 10 MB" persistent-hint />
|
||||
</div>
|
||||
@@ -123,14 +123,14 @@ async function onSubmit() {
|
||||
hint="Povolené: PDF, max 10 MB" persistent-hint />
|
||||
|
||||
<v-checkbox v-if="user?.role === Role.EMPLOYER"
|
||||
:disabled="!props.internship.agreement || !props.internship.report" v-model="report_confirmed"
|
||||
:disabled="!props.internship.proof || !props.internship.report" v-model="report_confirmed"
|
||||
label="Výkaz je správny"></v-checkbox>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<v-btn type="submit" color="success" size="large" block
|
||||
:disabled="!agreement && !report && (!props.internship.agreement || !props.internship.report)">
|
||||
:disabled="!proof && !report && (!props.internship.proof || !props.internship.report)">
|
||||
Uloziť
|
||||
</v-btn>
|
||||
</v-form>
|
||||
|
||||
@@ -8,8 +8,8 @@ const props = defineProps<{
|
||||
const client = useSanctumClient();
|
||||
|
||||
async function downloadAgreement() {
|
||||
const agreement: Blob = await client(`/api/internships/${props.internship.id}/agreement`);
|
||||
triggerDownload(agreement, `agreement-${props.internship.id}`);
|
||||
const proof: Blob = await client(`/api/internships/${props.internship.id}/proof`);
|
||||
triggerDownload(proof, `proof-${props.internship.id}`);
|
||||
}
|
||||
|
||||
async function downloadReport() {
|
||||
@@ -21,18 +21,21 @@ async function downloadReport() {
|
||||
<template>
|
||||
<div>
|
||||
<v-row class="d-flex">
|
||||
<!-- Podpísaná zmluva -->
|
||||
<!-- Podpísaný dokument k praxe -->
|
||||
<v-col cols="12" md="6">
|
||||
<v-card variant="outlined" class="h-100">
|
||||
<v-card-title class="d-flex align-center ga-2">
|
||||
<v-icon icon="mdi mdi-file-document-outline" />
|
||||
Podpísaná zmluva / dohoda
|
||||
Dokument o vykonaní praxe
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<p>Zmluva/dohoda o brigádnickej praxi alebo 3 faktúry v pre živnostníkov.</p>
|
||||
|
||||
<InternshipAgreementDownloader :internship_id="internship.id" />
|
||||
|
||||
<WarningAlert v-if="!props.internship.agreement" title="Neodovzdané"
|
||||
text="Zmluva zatiaľ nebola nahratá." />
|
||||
<WarningAlert v-if="!props.internship.proof" title="Neodovzdané"
|
||||
text="Dokument zatiaľ nebol nahratý." />
|
||||
|
||||
<div v-else>
|
||||
<SuccessAlert title="Odovzdané" text="Zmluva bola nahratá." />
|
||||
@@ -53,8 +56,16 @@ async function downloadReport() {
|
||||
<v-icon icon="mdi-file-clock-outline" />
|
||||
Výkaz
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<InfoAlert v-if="!props.internship.report" title="Neodovzdané"
|
||||
<p>Dokument o hodnotení praxe.</p>
|
||||
|
||||
<v-btn prepend-icon="mdi-download" color="blue" class="mr-2 mt-2" block target="_blank"
|
||||
href="https://www.fpvai.ukf.sk/images/Organizacia_studia/odborna_prax/aplikovana_informatika/Priloha_Vykaz_o_vykonanej_odbornej_praxi-AI.docx">
|
||||
<span>Stiahnuť šablónu na výkaz</span>
|
||||
</v-btn>
|
||||
|
||||
<WarningAlert v-if="!props.internship.report" title="Neodovzdané"
|
||||
text="Výkaz zatiaľ nebol nahratý." />
|
||||
|
||||
<div v-else>
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface Internship {
|
||||
year_of_study: number;
|
||||
semester: string;
|
||||
position_description: string;
|
||||
agreement: boolean;
|
||||
proof: boolean;
|
||||
report: boolean;
|
||||
report_confirmed: boolean;
|
||||
status: InternshipStatusData;
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('Admin Student Document Downloads', () => {
|
||||
cy.url().should('include', '/dashboard/admin/internships')
|
||||
})
|
||||
|
||||
it('should be able to generate and download the default agreement', () => {
|
||||
it('should be able to generate and download the default proof', () => {
|
||||
cy.get('table').within(() => {
|
||||
cy.get('tbody tr')
|
||||
.then(rows => {
|
||||
|
||||
Reference in New Issue
Block a user