mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
eslint
This commit is contained in:
@@ -42,7 +42,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
pickWork: function (payload: { work: AccompanyingPeriodWork }) {
|
||||
console.log("payload", payload);
|
||||
|
||||
input.value = payload.work.id?.toString() ?? '';
|
||||
input.value = payload.work.id?.toString() ?? "";
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@@ -6,11 +6,15 @@
|
||||
class="item-bloc"
|
||||
v-for="(d, i) in documents"
|
||||
: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 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">
|
||||
<input
|
||||
class="form-control document-title"
|
||||
@@ -27,7 +31,10 @@
|
||||
<div class="item-col item-meta">
|
||||
<p v-if="d.createdBy" class="createdBy">
|
||||
Créé par {{ d.createdBy.text }}<br />
|
||||
Le {{ $d(ISOToDatetime(d.createdAt.datetime), "long") }}
|
||||
Le
|
||||
{{
|
||||
$d(ISOToDatetime(d.createdAt.datetime), "long")
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,7 +43,8 @@
|
||||
<ul class="record_actions">
|
||||
<li
|
||||
v-if="
|
||||
d.workflows_availables.length > 0 || d.workflows.length > 0
|
||||
d.workflows_availables.length > 0 ||
|
||||
d.workflows.length > 0
|
||||
"
|
||||
>
|
||||
<list-workflow-modal
|
||||
@@ -44,7 +52,9 @@
|
||||
:allowCreate="true"
|
||||
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument"
|
||||
:relatedEntityId="d.id"
|
||||
:workflowsAvailables="d.workflows_availables"
|
||||
:workflowsAvailables="
|
||||
d.workflows_availables
|
||||
"
|
||||
:preventDefaultMoveToGenerate="true"
|
||||
:goToGenerateWorkflowPayload="{ doc: d }"
|
||||
@go-to-generate-workflow="
|
||||
@@ -56,14 +66,22 @@
|
||||
<button
|
||||
v-if="AmIRefferer"
|
||||
class="btn btn-notify"
|
||||
@click="$emit('goToGenerateNotification', d, false)"
|
||||
@click="
|
||||
$emit(
|
||||
'goToGenerateNotification',
|
||||
d,
|
||||
false,
|
||||
)
|
||||
"
|
||||
></button>
|
||||
<template v-else>
|
||||
<button
|
||||
id="btnGroupNotifyButtons"
|
||||
type="button"
|
||||
class="btn btn-notify dropdown-toggle"
|
||||
:title="trans(EVALUATION_NOTIFICATION_SEND)"
|
||||
:title="
|
||||
trans(EVALUATION_NOTIFICATION_SEND)
|
||||
"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
@@ -76,17 +94,37 @@
|
||||
<li>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
@click="$emit('goToGenerateNotification', d, true)"
|
||||
@click="
|
||||
$emit(
|
||||
'goToGenerateNotification',
|
||||
d,
|
||||
true,
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_REFERRER) }}
|
||||
{{
|
||||
trans(
|
||||
EVALUATION_NOTIFICATION_NOTIFY_REFERRER,
|
||||
)
|
||||
}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
@click="$emit('goToGenerateNotification', d, false)"
|
||||
@click="
|
||||
$emit(
|
||||
'goToGenerateNotification',
|
||||
d,
|
||||
false,
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_ANY) }}
|
||||
{{
|
||||
trans(
|
||||
EVALUATION_NOTIFICATION_NOTIFY_ANY,
|
||||
)
|
||||
}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -97,10 +135,15 @@
|
||||
:stored-object="d.storedObject"
|
||||
:filename="d.title"
|
||||
:can-edit="true"
|
||||
:execute-before-leave="submitBeforeLeaveToEditor"
|
||||
:davLink="d.storedObject._links?.dav_link.href"
|
||||
:execute-before-leave="
|
||||
submitBeforeLeaveToEditor
|
||||
"
|
||||
:davLink="
|
||||
d.storedObject._links?.dav_link.href
|
||||
"
|
||||
:davLinkExpiration="
|
||||
d.storedObject._links?.dav_link.expiration
|
||||
d.storedObject._links?.dav_link
|
||||
.expiration
|
||||
"
|
||||
@on-stored-object-status-change="
|
||||
$emit('statusDocumentChanged', $event)
|
||||
@@ -115,20 +158,35 @@
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
{{ trans(EVALUATION_DOCUMENT_DUPLICATE) }}
|
||||
{{
|
||||
trans(EVALUATION_DOCUMENT_DUPLICATE)
|
||||
}}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
@click="$emit('duplicateDocument', d)"
|
||||
>{{ trans(EVALUATION_DOCUMENT_DUPLICATE_HERE) }}</a
|
||||
@click="
|
||||
$emit(
|
||||
'duplicateDocument',
|
||||
d,
|
||||
)
|
||||
"
|
||||
>{{
|
||||
trans(
|
||||
EVALUATION_DOCUMENT_DUPLICATE_HERE,
|
||||
)
|
||||
}}</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
@click="prepareDocumentDuplicationToWork(d)"
|
||||
@click="
|
||||
prepareDocumentDuplicationToWork(
|
||||
d,
|
||||
)
|
||||
"
|
||||
>{{
|
||||
trans(
|
||||
EVALUATION_DOCUMENT_DUPLICATE_TO_OTHER_EVALUATION,
|
||||
@@ -155,7 +213,10 @@
|
||||
></drop-file-modal>
|
||||
</li>
|
||||
<li v-if="d.workflows.length === 0">
|
||||
<a class="btn btn-delete" @click="$emit('removeDocument', d)">
|
||||
<a
|
||||
class="btn btn-delete"
|
||||
@click="$emit('removeDocument', d)"
|
||||
>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@@ -28,7 +28,9 @@
|
||||
@inputDocumentTitle="onInputDocumentTitle"
|
||||
@removeDocument="removeDocument"
|
||||
@duplicateDocument="duplicateDocument"
|
||||
@duplicate-document-to-evaluation="duplicateDocumentToEvaluation"
|
||||
@duplicate-document-to-evaluation="
|
||||
duplicateDocumentToEvaluation
|
||||
"
|
||||
@statusDocumentChanged="onStatusDocumentChanged"
|
||||
@goToGenerateWorkflow="goToGenerateWorkflowEvaluationDocument"
|
||||
@goToGenerateNotification="goToGenerateDocumentNotification"
|
||||
@@ -52,10 +54,7 @@ import TimeSpentInput from "./TimeSpentInput.vue";
|
||||
import CommentInput from "./CommentInput.vue";
|
||||
import DocumentsList from "./DocumentsList.vue";
|
||||
import DocumentActions from "./DocumentActions.vue";
|
||||
import {
|
||||
trans,
|
||||
EVALUATION_DOCUMENT_DUPLICATE_SUCCESS
|
||||
} from "translator";
|
||||
import { trans, EVALUATION_DOCUMENT_DUPLICATE_SUCCESS } from "translator";
|
||||
import { useToast } from "vue-toast-notification";
|
||||
|
||||
const props = defineProps(["evaluation", "docAnchorId"]);
|
||||
@@ -241,16 +240,19 @@ function duplicateDocument(document) {
|
||||
store.dispatch("duplicateDocument", {
|
||||
evaluation_key: props.evaluation.key,
|
||||
document: document,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function duplicateDocumentToEvaluation({ evaluation, document }) {
|
||||
store.dispatch("duplicateDocumentToEvaluation", {
|
||||
store
|
||||
.dispatch("duplicateDocumentToEvaluation", {
|
||||
evaluation: evaluation,
|
||||
document: document,
|
||||
})
|
||||
.then(() => {
|
||||
$toast.open({ message: trans(EVALUATION_DOCUMENT_DUPLICATE_SUCCESS) });
|
||||
$toast.open({
|
||||
message: trans(EVALUATION_DOCUMENT_DUPLICATE_SUCCESS),
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
@@ -299,7 +301,9 @@ function goToGenerateDocumentNotification(document, tos) {
|
||||
buildLinkCreateNotification(
|
||||
"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
|
||||
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,
|
||||
|
@@ -9,7 +9,9 @@
|
||||
:value="timeSpent"
|
||||
@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"
|
||||
|
@@ -15,14 +15,22 @@
|
||||
<ul class="small_in_title columns mt-1">
|
||||
<li>
|
||||
<span class="item-key">
|
||||
{{ trans(ACCOMPANYING_COURSE_WORK_START_DATE) }} :
|
||||
{{
|
||||
trans(
|
||||
ACCOMPANYING_COURSE_WORK_START_DATE,
|
||||
)
|
||||
}}
|
||||
:
|
||||
</span>
|
||||
<b>{{ formatDate(eval.startDate) }}</b>
|
||||
</li>
|
||||
|
||||
<li v-if="eval.endDate">
|
||||
<span class="item-key">
|
||||
{{ trans(ACCOMPANYING_COURSE_WORK_END_DATE) }} :
|
||||
{{
|
||||
trans(ACCOMPANYING_COURSE_WORK_END_DATE)
|
||||
}}
|
||||
:
|
||||
</span>
|
||||
<b>{{ formatDate(eval.endDate) }}</b>
|
||||
</li>
|
||||
@@ -51,9 +59,9 @@ const formatDate = (dateObject: DateTime) => {
|
||||
if (dateObject) {
|
||||
const parsedDate = ISOToDate(dateObject.datetime);
|
||||
if (parsedDate) {
|
||||
return new Intl.DateTimeFormat("default", { dateStyle: "short" }).format(
|
||||
parsedDate,
|
||||
);
|
||||
return new Intl.DateTimeFormat("default", {
|
||||
dateStyle: "short",
|
||||
}).format(parsedDate);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
@@ -57,9 +57,9 @@ const formatDate = (dateObject: DateTime) => {
|
||||
if (dateObject) {
|
||||
const parsedDate = ISOToDate(dateObject.datetime);
|
||||
if (parsedDate) {
|
||||
return new Intl.DateTimeFormat("default", { dateStyle: "short" }).format(
|
||||
parsedDate,
|
||||
);
|
||||
return new Intl.DateTimeFormat("default", {
|
||||
dateStyle: "short",
|
||||
}).format(parsedDate);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
@@ -26,27 +26,28 @@ import AccompanyingPeriodWorkItem from "./AccompanyingPeriodWorkItem.vue";
|
||||
import { AccompanyingPeriodWork } from "../../../types";
|
||||
import { defineProps, ref, watch } from "vue";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const props = defineProps<{
|
||||
accompanyingPeriodWorks: AccompanyingPeriodWork[];
|
||||
selectedAcpw?: AccompanyingPeriodWork | null;
|
||||
}>();
|
||||
const selectedAcpw = ref<AccompanyingPeriodWork | null>(props.selectedAcpw ?? null);
|
||||
const selectedAcpw = ref<AccompanyingPeriodWork | null>(
|
||||
props.selectedAcpw ?? null,
|
||||
);
|
||||
|
||||
// eslint-disable-next-line vue/valid-define-emits
|
||||
const emit = defineEmits<{
|
||||
'update:selectedAcpw': [value: AccompanyingPeriodWork | null];
|
||||
"update:selectedAcpw": [value: AccompanyingPeriodWork | null];
|
||||
}>();
|
||||
|
||||
watch(() => props.selectedAcpw, (val) => {
|
||||
watch(
|
||||
() => props.selectedAcpw,
|
||||
(val) => {
|
||||
selectedAcpw.value = val ?? null;
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
watch(selectedAcpw, (newValue) => {
|
||||
emit("update:selectedAcpw", newValue);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
@@ -4,9 +4,11 @@
|
||||
<div class="col-md-6 col-sm-10" v-if="selectedAcpw">
|
||||
<ul class="list-suggest remove-items">
|
||||
<li>
|
||||
<span @click="selectedAcpw = null" class="chill-denomination">{{
|
||||
selectedAcpw?.socialAction?.title.fr
|
||||
}}</span>
|
||||
<span
|
||||
@click="selectedAcpw = null"
|
||||
class="chill-denomination"
|
||||
>{{ selectedAcpw?.socialAction?.title.fr }}</span
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -27,7 +29,13 @@
|
||||
modal-dialog-class="modal-dialog-scrollable modal-xl"
|
||||
>
|
||||
<template #header>
|
||||
<h3>{{ trans(ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK) }}</h3>
|
||||
<h3>
|
||||
{{
|
||||
trans(
|
||||
ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK,
|
||||
)
|
||||
}}
|
||||
</h3>
|
||||
</template>
|
||||
|
||||
<template #body>
|
||||
@@ -44,7 +52,11 @@
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-save" @click="confirmSelection">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-save"
|
||||
@click="confirmSelection"
|
||||
>
|
||||
{{ trans(CONFIRM) }}
|
||||
</button>
|
||||
</template>
|
||||
@@ -96,7 +108,7 @@ onMounted(() => {
|
||||
const getAccompanyingPeriodWorks = (periodId: number) => {
|
||||
const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`;
|
||||
|
||||
makeFetch<number, {results: AccompanyingPeriodWork[]}>("GET", url)
|
||||
makeFetch<number, { results: AccompanyingPeriodWork[] }>("GET", url)
|
||||
.then((response) => {
|
||||
if (props.isEvaluationSelector) {
|
||||
accompanyingPeriodWorks.value = response.results.filter(
|
||||
@@ -116,10 +128,10 @@ watch(selectedAcpw, (newValue) => {
|
||||
"find_accompanying_period_work_acpw",
|
||||
) as HTMLInputElement;
|
||||
if (inputField) {
|
||||
inputField.value = String(newValue?.id || '');
|
||||
inputField.value = String(newValue?.id || "");
|
||||
}
|
||||
|
||||
/* if (!props.isEvaluationSelector) {
|
||||
/* if (!props.isEvaluationSelector) {
|
||||
console.log("Emitting from watch:", { work: newValue });
|
||||
emit("pickWork", { work: newValue });
|
||||
}*/
|
||||
@@ -136,20 +148,21 @@ const closeModal = () => {
|
||||
};
|
||||
const confirmSelection = () => {
|
||||
selectedAcpw.value = selectedAcpw.value;
|
||||
console.log('selectedAcpw', selectedAcpw.value)
|
||||
console.log("selectedAcpw", selectedAcpw.value);
|
||||
|
||||
if (!props.isEvaluationSelector) {
|
||||
if (selectedAcpw.value) { // only emit if something is actually selected!
|
||||
if (selectedAcpw.value) {
|
||||
// only emit if something is actually selected!
|
||||
emit("pickWork", { work: selectedAcpw.value });
|
||||
closeModal();
|
||||
}
|
||||
// optionally show some error or warning if not selected
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (selectedAcpw.value && props.isEvaluationSelector) {
|
||||
evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations;
|
||||
evaluations.value =
|
||||
selectedAcpw.value.accompanyingPeriodWorkEvaluations;
|
||||
}
|
||||
|
||||
if (selectedEvaluation.value && props.isEvaluationSelector) {
|
||||
|
Reference in New Issue
Block a user