Eslint fixes

This commit is contained in:
Julie Lenaerts 2025-04-03 10:02:17 +02:00
parent 1c87280b1e
commit df09dd2017
9 changed files with 375 additions and 270 deletions

View File

@ -1,25 +1,31 @@
<template> <template>
<div class="row mb-3"> <div class="row mb-3">
<label class="col-sm-4 col-form-label visually-hidden">{{ trans(EVALUATION_PUBLIC_COMMENT) }}</label> <label class="col-sm-4 col-form-label visually-hidden">{{
trans(EVALUATION_PUBLIC_COMMENT)
}}</label>
<div class="col-sm-12"> <div class="col-sm-12">
<ckeditor <ckeditor
:editor="ClassicEditor" :editor="ClassicEditor"
:config="classicEditorConfig" :config="classicEditorConfig"
:placeholder="trans(EVALUATION_COMMENT_PLACEHOLDER)" :placeholder="trans(EVALUATION_COMMENT_PLACEHOLDER)"
:value="comment" :value="comment"
@input="$emit('update:comment', $event)" @input="$emit('update:comment', $event)"
tag-name="textarea" tag-name="textarea"
></ckeditor> ></ckeditor>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { Ckeditor } from '@ckeditor/ckeditor5-vue'; import { Ckeditor } from "@ckeditor/ckeditor5-vue";
import { ClassicEditor } from 'ckeditor5'; import { ClassicEditor } from "ckeditor5";
import classicEditorConfig from 'ChillMainAssets/module/ckeditor5/editor_config'; import classicEditorConfig from "ChillMainAssets/module/ckeditor5/editor_config";
import { EVALUATION_PUBLIC_COMMENT, EVALUATION_COMMENT_PLACEHOLDER, trans } from 'translator'; import {
EVALUATION_PUBLIC_COMMENT,
EVALUATION_COMMENT_PLACEHOLDER,
trans,
} from "translator";
defineProps(['comment']); defineProps(["comment"]);
defineEmits(['update:comment']); defineEmits(["update:comment"]);
</script> </script>

View File

@ -5,10 +5,10 @@
</label> </label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4"> <div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
type="date" type="date"
:value="startDate" :value="startDate"
@input="$emit('update:startDate', $event.target.value)" @input="$emit('update:startDate', $event.target.value)"
/> />
</div> </div>
@ -17,10 +17,10 @@
</label> </label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4"> <div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
type="date" type="date"
:value="endDate" :value="endDate"
@input="$emit('update:endDate', $event.target.value)" @input="$emit('update:endDate', $event.target.value)"
/> />
</div> </div>
</div> </div>
@ -31,10 +31,10 @@
</label> </label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4"> <div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
type="date" type="date"
:value="maxDate" :value="maxDate"
@input="$emit('update:maxDate', $event.target.value)" @input="$emit('update:maxDate', $event.target.value)"
/> />
</div> </div>
@ -43,18 +43,29 @@
</label> </label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4"> <div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input <input
class="form-control form-control-sm" class="form-control form-control-sm"
type="number" type="number"
:value="warningInterval" :value="warningInterval"
@input="$emit('update:warningInterval', $event.target.value)" @input="$emit('update:warningInterval', $event.target.value)"
/> />
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { EVALUATION_STARTDATE, EVALUATION_ENDDATE, EVALUATION_MAXDATE, EVALUATION_WARNING_INTERVAL, trans } from 'translator'; import {
EVALUATION_STARTDATE,
EVALUATION_ENDDATE,
EVALUATION_MAXDATE,
EVALUATION_WARNING_INTERVAL,
trans,
} from "translator";
defineProps(['startDate', 'endDate', 'maxDate', 'warningInterval']); defineProps(["startDate", "endDate", "maxDate", "warningInterval"]);
defineEmits(['update:startDate', 'update:endDate', 'update:maxDate', 'update:warningInterval']); defineEmits([
"update:startDate",
"update:endDate",
"update:maxDate",
"update:warningInterval",
]);
</script> </script>

View File

@ -2,21 +2,28 @@
<div class="row mb-3"> <div class="row mb-3">
<h6>{{ trans(EVALUATION_DOCUMENT_ADD) }} :</h6> <h6>{{ trans(EVALUATION_DOCUMENT_ADD) }} :</h6>
<pick-template <pick-template
entityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation" entityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
:id="evaluation.id" :id="evaluation.id"
:templates="templates" :templates="templates"
:preventDefaultMoveToGenerate="true" :preventDefaultMoveToGenerate="true"
@go-to-generate-document="$emit('submitBeforeGenerate', $event)" @go-to-generate-document="$emit('submitBeforeGenerate', $event)"
> >
<template v-slot:title> <template v-slot:title>
<label class="col-form-label">{{ trans(EVALUATION_GENERATE_A_DOCUMENT) }}</label> <label class="col-form-label">{{
trans(EVALUATION_GENERATE_A_DOCUMENT)
}}</label>
</template> </template>
</pick-template> </pick-template>
<div> <div>
<label class="col-form-label">{{ trans(EVALUATION_DOCUMENT_UPLOAD) }}</label> <label class="col-form-label">{{
trans(EVALUATION_DOCUMENT_UPLOAD)
}}</label>
<ul class="record_actions document-upload"> <ul class="record_actions document-upload">
<li> <li>
<drop-file-modal :allow-remove="false" @add-document="$emit('addDocument', $event)"></drop-file-modal> <drop-file-modal
:allow-remove="false"
@add-document="$emit('addDocument', $event)"
></drop-file-modal>
</li> </li>
</ul> </ul>
</div> </div>
@ -24,13 +31,17 @@
</template> </template>
<script setup> <script setup>
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue'; import PickTemplate from "ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue";
import DropFileModal from 'ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue'; import DropFileModal from "ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue";
import { EVALUATION_DOCUMENT_ADD, import {
EVALUATION_DOCUMENT_UPLOAD, EVALUATION_GENERATE_A_DOCUMENT, trans } from 'translator'; EVALUATION_DOCUMENT_ADD,
EVALUATION_DOCUMENT_UPLOAD,
EVALUATION_GENERATE_A_DOCUMENT,
trans,
} from "translator";
defineProps(['evaluation', 'templates']); defineProps(["evaluation", "templates"]);
defineEmits(['addDocument', 'submitBeforeGenerate']); defineEmits(["addDocument", "submitBeforeGenerate"]);
</script> </script>
<style scoped> <style scoped>

View File

@ -3,22 +3,22 @@
<h5>{{ trans(EVALUATION_DOCUMENTS) }} :</h5> <h5>{{ trans(EVALUATION_DOCUMENTS) }} :</h5>
<div class="flex-table"> <div class="flex-table">
<div <div
class="item-bloc" class="item-bloc"
v-for="(d, i) in documents" v-for="(d, i) in documents"
:key="d.id" :key="d.id"
:class="[parseInt(docAnchorId) === d.id ? 'bg-blink' : 'nothing']" :class="[parseInt(docAnchorId) === d.id ? 'bg-blink' : 'nothing']"
> >
<div :id="'document_' + d.id" class="item-row"> <div :id="'document_' + d.id" class="item-row">
<div class="input-group input-group-lg mb-3 row"> <div class="input-group input-group-lg mb-3 row">
<label class="col-sm-3 col-form-label">Titre du document:</label> <label class="col-sm-3 col-form-label">Titre du document:</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input <input
class="form-control document-title" class="form-control document-title"
type="text" type="text"
:value="d.title" :value="d.title"
:id="d.id" :id="d.id"
:data-key="i" :data-key="i"
@input="$emit('inputDocumentTitle', $event)" @input="$emit('inputDocumentTitle', $event)"
/> />
</div> </div>
</div> </div>
@ -34,43 +34,58 @@
<div class="item-row"> <div class="item-row">
<div class="item-col"> <div class="item-col">
<ul class="record_actions"> <ul class="record_actions">
<li v-if="d.workflows_availables.length > 0 || d.workflows.length > 0"> <li
v-if="
d.workflows_availables.length > 0 || d.workflows.length > 0
"
>
<list-workflow-modal <list-workflow-modal
:workflows="d.workflows" :workflows="d.workflows"
:allowCreate="true" :allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument" relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument"
:relatedEntityId="d.id" :relatedEntityId="d.id"
:workflowsAvailables="d.workflows_availables" :workflowsAvailables="d.workflows_availables"
:preventDefaultMoveToGenerate="true" :preventDefaultMoveToGenerate="true"
:goToGenerateWorkflowPayload="{ doc: d }" :goToGenerateWorkflowPayload="{ doc: d }"
@go-to-generate-workflow="$emit('goToGenerateWorkflow', $event)" @go-to-generate-workflow="
$emit('goToGenerateWorkflow', $event)
"
></list-workflow-modal> ></list-workflow-modal>
</li> </li>
<li> <li>
<button <button
v-if="AmIRefferer" v-if="AmIRefferer"
class="btn btn-notify" class="btn btn-notify"
@click="$emit('goToGenerateNotification', d, false)" @click="$emit('goToGenerateNotification', d, false)"
></button> ></button>
<template v-else> <template v-else>
<button <button
id="btnGroupNotifyButtons" id="btnGroupNotifyButtons"
type="button" type="button"
class="btn btn-notify dropdown-toggle" class="btn btn-notify dropdown-toggle"
:title="trans(EVALUATION_NOTIFICATION_SEND)" :title="trans(EVALUATION_NOTIFICATION_SEND)"
data-bs-toggle="dropdown" data-bs-toggle="dropdown"
aria-expanded="false" aria-expanded="false"
> >
&nbsp; &nbsp;
</button> </button>
<ul class="dropdown-menu" aria-labelledby="btnGroupNotifyButtons"> <ul
class="dropdown-menu"
aria-labelledby="btnGroupNotifyButtons"
>
<li> <li>
<a class="dropdown-item" @click="$emit('goToGenerateNotification', d, true)"> <a
class="dropdown-item"
@click="$emit('goToGenerateNotification', d, true)"
>
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_REFERRER) }} {{ trans(EVALUATION_NOTIFICATION_NOTIFY_REFERRER) }}
</a> </a>
</li> </li>
<li> <li>
<a class="dropdown-item" @click="$emit('goToGenerateNotification', d, false)"> <a
class="dropdown-item"
@click="$emit('goToGenerateNotification', d, false)"
>
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_ANY) }} {{ trans(EVALUATION_NOTIFICATION_NOTIFY_ANY) }}
</a> </a>
</li> </li>
@ -79,36 +94,62 @@
</li> </li>
<li> <li>
<document-action-buttons-group <document-action-buttons-group
:stored-object="d.storedObject" :stored-object="d.storedObject"
:filename="d.title" :filename="d.title"
:can-edit="true" :can-edit="true"
:execute-before-leave="submitBeforeLeaveToEditor" :execute-before-leave="submitBeforeLeaveToEditor"
:davLink="d.storedObject._links?.dav_link.href" :davLink="d.storedObject._links?.dav_link.href"
:davLinkExpiration="d.storedObject._links?.dav_link.expiration" :davLinkExpiration="
@on-stored-object-status-change="$emit('statusDocumentChanged', $event)" d.storedObject._links?.dav_link.expiration
"
@on-stored-object-status-change="
$emit('statusDocumentChanged', $event)
"
></document-action-buttons-group> ></document-action-buttons-group>
</li> </li>
<li v-if="d.storedObject._permissions.canEdit"> <li v-if="d.storedObject._permissions.canEdit">
<drop-file-modal <drop-file-modal
:existing-doc="d.storedObject" :existing-doc="d.storedObject"
:allow-remove="false" :allow-remove="false"
@add-document="(arg) => $emit('replaceDocument', d, arg.stored_object, arg.stored_object_version)" @add-document="
(arg) =>
$emit(
'replaceDocument',
d,
arg.stored_object,
arg.stored_object_version,
)
"
></drop-file-modal> ></drop-file-modal>
</li> </li>
<li v-if="d.workflows.length === 0"> <li v-if="d.workflows.length === 0">
<a class="btn btn-delete" @click="$emit('removeDocument', d)"> </a> <a class="btn btn-delete" @click="$emit('removeDocument', d)">
</a>
</li> </li>
<li v-if="Number.isInteger(d.id)"> <li v-if="Number.isInteger(d.id)">
<div class="duplicate-dropdown"> <div class="duplicate-dropdown">
<button class="btn btn-duplicate dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <button
class="btn btn-duplicate dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Dupliquer Dupliquer
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li> <li>
<a class="dropdown-item" @click="$emit('duplicateDocument', d)">Dupliquer ici</a> <a
class="dropdown-item"
@click="$emit('duplicateDocument', d)"
>Dupliquer ici</a
>
</li> </li>
<li> <li>
<a class="dropdown-item" @click="prepareDocumentDuplicationToWork(d)">Dupliquer vers un autre actions d'accompagnement</a> <a
class="dropdown-item"
@click="prepareDocumentDuplicationToWork(d)"
>Dupliquer vers un autre actions d'accompagnement</a
>
</li> </li>
</ul> </ul>
</div> </div>
@ -121,45 +162,54 @@
</div> </div>
<AccompanyingPeriodWorkSelectorModal <AccompanyingPeriodWorkSelectorModal
v-if="showAccompanyingPeriodSelector" v-if="showAccompanyingPeriodSelector"
v-model:selectedAcpw="selectedAcpw" v-model:selectedAcpw="selectedAcpw"
:accompanying-period-id="accompanyingPeriodId" :accompanying-period-id="accompanyingPeriodId"
:is-evaluation-selector="true" :is-evaluation-selector="true"
@close-modal="showAccompanyingPeriodSelector = false" @close-modal="showAccompanyingPeriodSelector = false"
@update:selectedEvaluation="selectedEvaluation = $event" @update:selectedEvaluation="selectedEvaluation = $event"
/> />
</template> </template>
<script setup> <script setup>
import { ISOToDatetime } from 'ChillMainAssets/chill/js/date'; import { ISOToDatetime } from "ChillMainAssets/chill/js/date";
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue'; import ListWorkflowModal from "ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue";
import DocumentActionButtonsGroup from 'ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue'; import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue";
import DropFileModal from 'ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue'; import DropFileModal from "ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue";
import { import {
EVALUATION_NOTIFICATION_NOTIFY_REFERRER, EVALUATION_NOTIFICATION_NOTIFY_REFERRER,
EVALUATION_NOTIFICATION_NOTIFY_ANY, EVALUATION_NOTIFICATION_NOTIFY_ANY,
EVALUATION_NOTIFICATION_SEND, EVALUATION_NOTIFICATION_SEND,
EVALUATION_DOCUMENTS, EVALUATION_DOCUMENTS,
trans trans,
} from 'translator'; } from "translator";
import {ref, watch} from "vue"; import { ref, watch } from "vue";
import AccompanyingPeriodWorkSelectorModal import AccompanyingPeriodWorkSelectorModal from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue";
from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue";
defineProps(['documents', 'docAnchorId', 'accompanyingPeriodId']); defineProps(["documents", "docAnchorId", "accompanyingPeriodId"]);
const emit = defineEmits(['inputDocumentTitle', 'removeDocument', 'duplicateDocument', 'statusDocumentChanged', 'goToGenerateWorkflow', 'goToGenerateNotification', 'duplicateDocumentToWork']); const emit = defineEmits([
"inputDocumentTitle",
"removeDocument",
"duplicateDocument",
"statusDocumentChanged",
"goToGenerateWorkflow",
"goToGenerateNotification",
"duplicateDocumentToWork",
]);
const showAccompanyingPeriodSelector = ref(false); const showAccompanyingPeriodSelector = ref(false);
const selectedEvaluation = ref(null); const selectedEvaluation = ref(null);
const selectedDocument = ref(null); const selectedDocument = ref(null);
const prepareDocumentDuplicationToWork = (d) => { const prepareDocumentDuplicationToWork = (d) => {
selectedDocument.value = d selectedDocument.value = d;
showAccompanyingPeriodSelector.value = true showAccompanyingPeriodSelector.value = true;
} };
watch(selectedEvaluation, (val) => { watch(selectedEvaluation, (val) => {
emit('duplicateDocumentToEvaluation', {'evaluation': val, 'document': selectedDocument.value}) emit("duplicateDocumentToEvaluation", {
evaluation: val,
document: selectedDocument.value,
});
}); });
</script> </script>

View File

@ -2,99 +2,93 @@
<div> <div>
<div class="m-md-3"> <div class="m-md-3">
<DateInputs <DateInputs
:startDate="startDate" :startDate="startDate"
:endDate="endDate" :endDate="endDate"
:maxDate="maxDate" :maxDate="maxDate"
:warningInterval="warningInterval" :warningInterval="warningInterval"
@update:startDate="updateStartDate" @update:startDate="updateStartDate"
@update:endDate="updateEndDate" @update:endDate="updateEndDate"
@update:maxDate="updateMaxDate" @update:maxDate="updateMaxDate"
@update:warningInterval="updateWarningInterval" @update:warningInterval="updateWarningInterval"
/> />
<TimeSpentInput <TimeSpentInput
:timeSpent="timeSpent" :timeSpent="timeSpent"
:timeSpentChoices="timeSpentChoices" :timeSpentChoices="timeSpentChoices"
@update:timeSpent="updateTimeSpent" @update:timeSpent="updateTimeSpent"
/> />
<CommentInput <CommentInput :comment="comment" @update:comment="updateComment" />
:comment="comment"
@update:comment="updateComment"
/>
<DocumentsList <DocumentsList
v-if="evaluation.documents.length > 0" v-if="evaluation.documents.length > 0"
:documents="evaluation.documents" :documents="evaluation.documents"
:docAnchorId="docAnchorId" :docAnchorId="docAnchorId"
:accompanyingPeriodId="store.state.work.accompanyingPeriod.id" :accompanyingPeriodId="store.state.work.accompanyingPeriod.id"
@inputDocumentTitle="onInputDocumentTitle" @inputDocumentTitle="onInputDocumentTitle"
@removeDocument="removeDocument" @removeDocument="removeDocument"
@duplicateDocument="duplicateDocument" @duplicateDocument="duplicateDocument"
@duplicate-document-to-evaluation="duplicateDocumentToEvaluation" @duplicate-document-to-evaluation="duplicateDocumentToEvaluation"
@statusDocumentChanged="onStatusDocumentChanged" @statusDocumentChanged="onStatusDocumentChanged"
@goToGenerateWorkflow="goToGenerateWorkflowEvaluationDocument" @goToGenerateWorkflow="goToGenerateWorkflowEvaluationDocument"
@goToGenerateNotification="goToGenerateDocumentNotification" @goToGenerateNotification="goToGenerateDocumentNotification"
/> />
<DocumentActions <DocumentActions
:evaluation="evaluation" :evaluation="evaluation"
:templates="getTemplatesAvailables" :templates="getTemplatesAvailables"
@addDocument="addDocument" @addDocument="addDocument"
@submitBeforeGenerate="submitBeforeGenerate" @submitBeforeGenerate="submitBeforeGenerate"
/> />
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { computed } from 'vue'; import { computed } from "vue";
import { useStore } from 'vuex'; import { useStore } from "vuex";
import DateInputs from './DateInputs.vue'; import DateInputs from "./DateInputs.vue";
import TimeSpentInput from './TimeSpentInput.vue'; import TimeSpentInput from "./TimeSpentInput.vue";
import CommentInput from './CommentInput.vue'; import CommentInput from "./CommentInput.vue";
import DocumentsList from './DocumentsList.vue'; import DocumentsList from "./DocumentsList.vue";
import DocumentActions from './DocumentActions.vue'; import DocumentActions from "./DocumentActions.vue";
import {makeFetch} from "ChillMainAssets/lib/api/apiMethods"; import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import { useToast } from "vue-toast-notification"; import { useToast } from "vue-toast-notification";
import { import { DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS, trans } from "translator";
DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS,
trans
} from 'translator';
const props = defineProps(['evaluation', 'docAnchorId']); const props = defineProps(["evaluation", "docAnchorId"]);
const store = useStore(); const store = useStore();
const toast = useToast(); const toast = useToast();
const timeSpentChoices = [ const timeSpentChoices = [
{ text: '1 minute', value: 60 }, { text: "1 minute", value: 60 },
{ text: '2 minutes', value: 120 }, { text: "2 minutes", value: 120 },
{ text: '3 minutes', value: 180 }, { text: "3 minutes", value: 180 },
{ text: '4 minutes', value: 240 }, { text: "4 minutes", value: 240 },
{ text: '5 minutes', value: 300 }, { text: "5 minutes", value: 300 },
{ text: '10 minutes', value: 600 }, { text: "10 minutes", value: 600 },
{ text: '15 minutes', value: 900 }, { text: "15 minutes", value: 900 },
{ text: '20 minutes', value: 1200 }, { text: "20 minutes", value: 1200 },
{ text: '25 minutes', value: 1500 }, { text: "25 minutes", value: 1500 },
{ text: '30 minutes', value: 1800 }, { text: "30 minutes", value: 1800 },
{ text: '45 minutes', value: 2700 }, { text: "45 minutes", value: 2700 },
{ text: '1 hour', value: 3600 }, { text: "1 hour", value: 3600 },
{ text: '1 hour 15 minutes', value: 4500 }, { text: "1 hour 15 minutes", value: 4500 },
{ text: '1 hour 30 minutes', value: 5400 }, { text: "1 hour 30 minutes", value: 5400 },
{ text: '1 hour 45 minutes', value: 6300 }, { text: "1 hour 45 minutes", value: 6300 },
{ text: '2 hours', value: 7200 }, { text: "2 hours", value: 7200 },
{ text: '2 hours 30 minutes', value: 9000 }, { text: "2 hours 30 minutes", value: 9000 },
{ text: '3 hours', value: 10800 }, { text: "3 hours", value: 10800 },
{ text: '3 hours 30 minutes', value: 12600 }, { text: "3 hours 30 minutes", value: 12600 },
{ text: '4 hours', value: 14400 }, { text: "4 hours", value: 14400 },
{ text: '4 hours 30 minutes', value: 16200 }, { text: "4 hours 30 minutes", value: 16200 },
{ text: '5 hours', value: 18000 }, { text: "5 hours", value: 18000 },
{ text: '5 hours 30 minutes', value: 19800 }, { text: "5 hours 30 minutes", value: 19800 },
{ text: '6 hours', value: 21600 }, { text: "6 hours", value: 21600 },
{ text: '6 hours 30 minutes', value: 23400 }, { text: "6 hours 30 minutes", value: 23400 },
{ text: '7 hours', value: 25200 }, { text: "7 hours", value: 25200 },
{ text: '7 hours 30 minutes', value: 27000 }, { text: "7 hours 30 minutes", value: 27000 },
{ text: '8 hours', value: 28800 }, { text: "8 hours", value: 28800 },
]; ];
const startDate = computed({ const startDate = computed({
@ -102,7 +96,10 @@ const startDate = computed({
return props.evaluation.startDate; return props.evaluation.startDate;
}, },
set(v) { set(v) {
store.commit('setEvaluationStartDate', { key: props.evaluation.key, date: v }); store.commit("setEvaluationStartDate", {
key: props.evaluation.key,
date: v,
});
}, },
}); });
@ -111,7 +108,10 @@ const endDate = computed({
return props.evaluation.endDate; return props.evaluation.endDate;
}, },
set(v) { set(v) {
store.commit('setEvaluationEndDate', { key: props.evaluation.key, date: v }); store.commit("setEvaluationEndDate", {
key: props.evaluation.key,
date: v,
});
}, },
}); });
@ -120,7 +120,10 @@ const maxDate = computed({
return props.evaluation.maxDate; return props.evaluation.maxDate;
}, },
set(v) { set(v) {
store.commit('setEvaluationMaxDate', { key: props.evaluation.key, date: v }); store.commit("setEvaluationMaxDate", {
key: props.evaluation.key,
date: v,
});
}, },
}); });
@ -129,7 +132,10 @@ const warningInterval = computed({
return props.evaluation.warningInterval; return props.evaluation.warningInterval;
}, },
set(v) { set(v) {
store.commit('setEvaluationWarningInterval', { key: props.evaluation.key, days: v }); store.commit("setEvaluationWarningInterval", {
key: props.evaluation.key,
days: v,
});
}, },
}); });
@ -138,7 +144,10 @@ const timeSpent = computed({
return props.evaluation.timeSpent; return props.evaluation.timeSpent;
}, },
set(v) { set(v) {
store.commit('setEvaluationTimeSpent', { key: props.evaluation.key, time: v }); store.commit("setEvaluationTimeSpent", {
key: props.evaluation.key,
time: v,
});
}, },
}); });
@ -147,12 +156,17 @@ const comment = computed({
return props.evaluation.comment; return props.evaluation.comment;
}, },
set(v) { set(v) {
store.commit('setEvaluationComment', { key: props.evaluation.key, comment: v }); store.commit("setEvaluationComment", {
key: props.evaluation.key,
comment: v,
});
}, },
}); });
const getTemplatesAvailables = computed(() => { const getTemplatesAvailables = computed(() => {
return store.getters.getTemplatesAvailablesForEvaluation(props.evaluation.evaluation); return store.getters.getTemplatesAvailablesForEvaluation(
props.evaluation.evaluation,
);
}); });
// const getAccompanyingPeriod = computed(() => store.work) // const getAccompanyingPeriod = computed(() => store.work)
@ -184,7 +198,7 @@ function onInputDocumentTitle(event) {
const id = Number(event.target.id); const id = Number(event.target.id);
const key = Number(event.target.dataset.key) + 1; const key = Number(event.target.dataset.key) + 1;
const title = event.target.value; const title = event.target.value;
store.commit('updateDocumentTitle', { store.commit("updateDocumentTitle", {
id: id, id: id,
key: key, key: key,
evaluationKey: props.evaluation.key, evaluationKey: props.evaluation.key,
@ -194,11 +208,11 @@ function onInputDocumentTitle(event) {
function addDocument({ stored_object, stored_object_version }) { function addDocument({ stored_object, stored_object_version }) {
let document = { let document = {
type: 'accompanying_period_work_evaluation_document', type: "accompanying_period_work_evaluation_document",
storedObject: stored_object, storedObject: stored_object,
title: 'Nouveau document', title: "Nouveau document",
}; };
store.commit('addDocument', { store.commit("addDocument", {
key: props.evaluation.key, key: props.evaluation.key,
document, document,
stored_object_version, stored_object_version,
@ -206,8 +220,14 @@ function addDocument({ stored_object, stored_object_version }) {
} }
function removeDocument(document) { function removeDocument(document) {
if (window.confirm('Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre "' + document.title + '" ?')) { if (
store.commit('removeDocument', { window.confirm(
'Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre "' +
document.title +
'" ?',
)
) {
store.commit("removeDocument", {
key: props.evaluation.key, key: props.evaluation.key,
document: document, document: document,
}); });
@ -215,30 +235,28 @@ function removeDocument(document) {
} }
function duplicateDocument(document) { function duplicateDocument(document) {
store.dispatch('duplicateDocument', { store.dispatch("duplicateDocument", {
evaluation_key: props.evaluation.key, evaluation_key: props.evaluation.key,
document: document, document: document,
}); });
} }
function duplicateDocumentToEvaluation({ evaluation, document }) {
function duplicateDocumentToEvaluation({evaluation, document}) {
const url = `/api/1.0/person/accompanying-course-work-evaluation-document/${document.id}/evaluation/${evaluation.id}/duplicate`; const url = `/api/1.0/person/accompanying-course-work-evaluation-document/${document.id}/evaluation/${evaluation.id}/duplicate`;
// console.log('document id', document.id, 'evaluation id', evaluation.id) // console.log('document id', document.id, 'evaluation id', evaluation.id)
makeFetch("POST", url) makeFetch("POST", url)
.then((response) => { .then((response) => {
console.log('new document', response) console.log("new document", response);
toast.open({ message: trans(DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS) }); toast.open({ message: trans(DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS) });
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
}); });
} }
function onStatusDocumentChanged(newStatus) { function onStatusDocumentChanged(newStatus) {
store.commit('statusDocumentChanged', { store.commit("statusDocumentChanged", {
key: props.evaluation.key, key: props.evaluation.key,
newStatus: newStatus, newStatus: newStatus,
}); });
@ -246,18 +264,22 @@ function onStatusDocumentChanged(newStatus) {
function goToGenerateWorkflowEvaluationDocument({ workflowName, payload }) { function goToGenerateWorkflowEvaluationDocument({ workflowName, payload }) {
const callback = (data) => { const callback = (data) => {
let evaluation = data.accompanyingPeriodWorkEvaluations.find((e) => e.key === props.evaluation.key); let evaluation = data.accompanyingPeriodWorkEvaluations.find(
let updatedDocument = evaluation.documents.find((d) => d.key === payload.doc.key); (e) => e.key === props.evaluation.key,
);
let updatedDocument = evaluation.documents.find(
(d) => d.key === payload.doc.key,
);
window.location.assign( window.location.assign(
buildLinkCreate( buildLinkCreate(
workflowName, workflowName,
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
updatedDocument.id, updatedDocument.id,
), ),
); );
}; };
store.dispatch('submit', callback).catch((e) => { store.dispatch("submit", callback).catch((e) => {
console.log(e); console.log(e);
throw e; throw e;
}); });
@ -265,18 +287,24 @@ function goToGenerateWorkflowEvaluationDocument({ workflowName, payload }) {
function goToGenerateDocumentNotification(document, tos) { function goToGenerateDocumentNotification(document, tos) {
const callback = (data) => { const callback = (data) => {
let evaluation = data.accompanyingPeriodWorkEvaluations.find((e) => e.key === props.evaluation.key); let evaluation = data.accompanyingPeriodWorkEvaluations.find(
let updatedDocument = evaluation.documents.find((d) => d.key === document.key); (e) => e.key === props.evaluation.key,
);
let updatedDocument = evaluation.documents.find(
(d) => d.key === document.key,
);
window.location.assign( window.location.assign(
buildLinkCreateNotification( buildLinkCreateNotification(
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
updatedDocument.id, updatedDocument.id,
tos === true ? store.state.work.accompanyingPeriod.user.id : null, tos === true ? store.state.work.accompanyingPeriod.user.id : null,
window.location.pathname + window.location.search + window.location.hash, window.location.pathname +
), window.location.search +
window.location.hash,
),
); );
}; };
store.dispatch('submit', callback).catch((e) => { store.dispatch("submit", callback).catch((e) => {
console.log(e); console.log(e);
throw e; throw e;
}); });

View File

@ -5,12 +5,16 @@
</label> </label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4"> <div class="col-8 col-sm-4 col-md-8 col-lg-4">
<select <select
class="form-control form-control-sm" class="form-control form-control-sm"
:value="timeSpent" :value="timeSpent"
@input="$emit('update:timeSpent', $event.target.value)" @input="$emit('update:timeSpent', $event.target.value)"
> >
<option disabled value="">{{ trans(EVALUATION_TIME_SPENT) }}</option> <option disabled value="">{{ trans(EVALUATION_TIME_SPENT) }}</option>
<option v-for="time in timeSpentChoices" :value="time.value" :key="time.value"> <option
v-for="time in timeSpentChoices"
:value="time.value"
:key="time.value"
>
{{ time.text }} {{ time.text }}
</option> </option>
</select> </select>
@ -19,8 +23,8 @@
</template> </template>
<script setup> <script setup>
import { EVALUATION_TIME_SPENT, trans } from 'translator'; import { EVALUATION_TIME_SPENT, trans } from "translator";
defineProps(['timeSpent', 'timeSpentChoices']); defineProps(["timeSpent", "timeSpentChoices"]);
defineEmits(['update:timeSpent']); defineEmits(["update:timeSpent"]);
</script> </script>

View File

@ -43,7 +43,7 @@ import {
} from "translator"; } from "translator";
import { ISOToDate } from "ChillMainAssets/chill/js/date"; import { ISOToDate } from "ChillMainAssets/chill/js/date";
import { DateTime } from "ChillMainAssets/types"; import { DateTime } from "ChillMainAssets/types";
import {AccompanyingPeriodWorkEvaluation} from "../../../types"; import { AccompanyingPeriodWorkEvaluation } from "../../../types";
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{ eval: AccompanyingPeriodWorkEvaluation }>(); const props = defineProps<{ eval: AccompanyingPeriodWorkEvaluation }>();
@ -52,7 +52,7 @@ const formatDate = (dateObject: DateTime) => {
const parsedDate = ISOToDate(dateObject.datetime); const parsedDate = ISOToDate(dateObject.datetime);
if (parsedDate) { if (parsedDate) {
return new Intl.DateTimeFormat("default", { dateStyle: "short" }).format( return new Intl.DateTimeFormat("default", { dateStyle: "short" }).format(
parsedDate, parsedDate,
); );
} else { } else {
return ""; return "";

View File

@ -1,31 +1,30 @@
<template> <template>
<div class="results"> <div class="results">
<div <div
v-for="evaluation in evaluations" v-for="evaluation in evaluations"
:key="evaluation.id" :key="evaluation.id"
class="list-item" class="list-item"
> >
<label class="acpw-item"> <label class="acpw-item">
<div> <div>
<input <input
type="radio" type="radio"
:value="evaluation" :value="evaluation"
v-model="selectedEvaluation" v-model="selectedEvaluation"
name="item" name="item"
/> />
</div> </div>
<accompanying-period-work-evaluation-item :eval="evaluation" /> <accompanying-period-work-evaluation-item :eval="evaluation" />
</label> </label>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {AccompanyingPeriodWorkEvaluation} from "../../../types"; import { AccompanyingPeriodWorkEvaluation } from "../../../types";
import { defineProps, ref, watch } from "vue"; import { defineProps, ref, watch } from "vue";
import AccompanyingPeriodWorkEvaluationItem import AccompanyingPeriodWorkEvaluationItem from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationItem.vue";
from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationItem.vue";
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{ const props = defineProps<{

View File

@ -20,7 +20,6 @@
</li> </li>
</ul> </ul>
<teleport to="body"> <teleport to="body">
<modal <modal
v-if="showModal" v-if="showModal"
@ -38,9 +37,9 @@
v-model:selectedAcpw="selectedAcpw" v-model:selectedAcpw="selectedAcpw"
/> />
<accompanying-period-work-evaluation-list <accompanying-period-work-evaluation-list
v-if="evaluations.length > 0" v-if="evaluations.length > 0"
:evaluations="evaluations" :evaluations="evaluations"
v-model:selectedEvaluation="selectedEvaluation" v-model:selectedEvaluation="selectedEvaluation"
/> />
</template> </template>
@ -65,23 +64,21 @@ import {
CONFIRM, CONFIRM,
} from "translator"; } from "translator";
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods"; import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import AccompanyingPeriodWorkEvaluationList import AccompanyingPeriodWorkEvaluationList from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue";
from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue"; import { AccompanyingPeriodWorkEvaluation } from "../../../types";
import {AccompanyingPeriodWorkEvaluation} from "../../../types";
const selectedAcpw = ref<AccompanyingPeriodWork | null>(null); const selectedAcpw = ref<AccompanyingPeriodWork | null>(null);
const selectedEvaluation = ref<AccompanyingPeriodWorkEvaluation | null>(null); const selectedEvaluation = ref<AccompanyingPeriodWorkEvaluation | null>(null);
const showModal = ref(false); const showModal = ref(false);
const accompanyingPeriodWorks = ref<AccompanyingPeriodWork[]>([]); const accompanyingPeriodWorks = ref<AccompanyingPeriodWork[]>([]);
const evaluations = ref<AccompanyingPeriodWorkEvaluation[]>([]) const evaluations = ref<AccompanyingPeriodWorkEvaluation[]>([]);
const props = defineProps({ const props = defineProps({
accompanyingPeriodId: String, accompanyingPeriodId: String,
isEvaluationSelector: Boolean isEvaluationSelector: Boolean,
}); });
const emit = defineEmits(['closeModal', 'update:selectedEvaluation']) const emit = defineEmits(["closeModal", "update:selectedEvaluation"]);
onMounted(() => { onMounted(() => {
if (props.accompanyingPeriodId) { if (props.accompanyingPeriodId) {
@ -114,30 +111,29 @@ watch(selectedAcpw, (newValue) => {
}); });
const openModal = () => { const openModal = () => {
showModal.value = true showModal.value = true;
} };
const closeModal = () => { const closeModal = () => {
showModal.value = false showModal.value = false;
selectedEvaluation.value = null selectedEvaluation.value = null;
selectedAcpw.value = null selectedAcpw.value = null;
emit('closeModal') emit("closeModal");
} };
const confirmSelection = () => { const confirmSelection = () => {
selectedAcpw.value = selectedAcpw.value; selectedAcpw.value = selectedAcpw.value;
if(false === props.isEvaluationSelector) { if (false === props.isEvaluationSelector) {
closeModal(); closeModal();
} }
if(selectedAcpw.value && props.isEvaluationSelector) { if (selectedAcpw.value && props.isEvaluationSelector) {
evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations;
} }
if(selectedEvaluation.value && props.isEvaluationSelector) { if (selectedEvaluation.value && props.isEvaluationSelector) {
// console.log('evaluation log in modal', selectedEvaluation.value) // console.log('evaluation log in modal', selectedEvaluation.value)
emit("update:selectedEvaluation", selectedEvaluation.value); emit("update:selectedEvaluation", selectedEvaluation.value);
closeModal() closeModal();
} }
}; };
</script> </script>