Eslint fixes

This commit is contained in:
Julie Lenaerts 2025-03-17 17:32:28 +01:00
parent c52d4b2a0e
commit c8e09a28e6
5 changed files with 35 additions and 40 deletions

View File

@ -96,7 +96,7 @@
</div> </div>
</div> </div>
<FullCalendar :options="calendarOptions" ref="calendarRef"> <FullCalendar :options="calendarOptions" ref="calendarRef">
<template v-slot:eventContent="{ arg }: {arg: { event: EventApi }}"> <template v-slot:eventContent="{ arg }: { arg: { event: EventApi } }">
<span :class="eventClasses(arg.event)"> <span :class="eventClasses(arg.event)">
<b v-if="arg.event.extendedProps.is === 'remote'">{{ <b v-if="arg.event.extendedProps.is === 'remote'">{{
arg.event.title arg.event.title

View File

@ -91,9 +91,7 @@
class="col-5 p-0 text-center turnSignature" class="col-5 p-0 text-center turnSignature"
> >
<button <button
:disabled=" :disabled="isFirstSignatureZone"
isFirstSignatureZone
"
class="btn btn-light btn-sm" class="btn btn-light btn-sm"
@click="turnSignature(-1)" @click="turnSignature(-1)"
> >
@ -101,9 +99,7 @@
</button> </button>
<span>|</span> <span>|</span>
<button <button
:disabled=" :disabled="isLastSignatureZone"
isLastSignatureZone
"
class="btn btn-light btn-sm" class="btn btn-light btn-sm"
@click="turnSignature(1)" @click="turnSignature(1)"
> >
@ -207,9 +203,7 @@
</button> </button>
<span>|</span> <span>|</span>
<button <button
:disabled=" :disabled="isLastSignatureZone"
isLastSignatureZone
"
class="btn btn-light btn-sm" class="btn btn-light btn-sm"
@click="turnSignature(1)" @click="turnSignature(1)"
> >
@ -221,9 +215,7 @@
class="col-4 d-none d-xl-flex p-0 text-center turnSignature" class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
> >
<button <button
:disabled=" :disabled="isFirstSignatureZone"
isFirstSignatureZone
"
class="btn btn-light btn-sm" class="btn btn-light btn-sm"
@click="turnSignature(-1)" @click="turnSignature(-1)"
> >
@ -326,7 +318,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {ref, Ref, reactive, computed} from "vue"; import { ref, Ref, computed } from "vue";
import { useToast } from "vue-toast-notification"; import { useToast } from "vue-toast-notification";
import "vue-toast-notification/dist/theme-sugar.css"; import "vue-toast-notification/dist/theme-sugar.css";
import { import {
@ -344,18 +336,15 @@ import {
PDFPageProxy, PDFPageProxy,
} from "pdfjs-dist/types/src/display/api"; } from "pdfjs-dist/types/src/display/api";
// @ts-ignore // @ts-expect-error incredible but the console.log is needed
import * as PdfWorker from "pdfjs-dist/build/pdf.worker.mjs"; import * as PdfWorker from "pdfjs-dist/build/pdf.worker.mjs";
console.log(PdfWorker); // incredible but this is needed console.log(PdfWorker);
// import { PdfWorker } from 'pdfjs-dist/build/pdf.worker.mjs' // import { PdfWorker } from 'pdfjs-dist/build/pdf.worker.mjs'
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker; // pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue"; import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
import { import { download_doc_as_pdf } from "../StoredObjectButton/helpers";
download_and_decrypt_doc,
download_doc_as_pdf,
} from "../StoredObjectButton/helpers";
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs"; pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
@ -426,13 +415,19 @@ const $toast = useToast();
const signature = window.signature; const signature = window.signature;
const isFirstSignatureZone = () => userSignatureZone.value?.index ? userSignatureZone.value.index < 1 : false const isFirstSignatureZone = () =>
const isLastSignatureZone = () => userSignatureZone.value?.index ? userSignatureZone.value.index >= signature.zones.length - 1 : false userSignatureZone.value?.index ? userSignatureZone.value.index < 1 : false;
const isLastSignatureZone = () =>
userSignatureZone.value?.index
? userSignatureZone.value.index >= signature.zones.length - 1
: false;
/** /**
* Return true if the user has selected a user zone (existing on the doc or created by the user) * Return true if the user has selected a user zone (existing on the doc or created by the user)
*/ */
const hasSignatureZoneSelected = computed<boolean>(() => userSignatureZone.value !== null); const hasSignatureZoneSelected = computed<boolean>(
() => userSignatureZone.value !== null,
);
const setZoomLevel = async (zoomLevel: string) => { const setZoomLevel = async (zoomLevel: string) => {
zoom.value = Number.parseFloat(zoomLevel); zoom.value = Number.parseFloat(zoomLevel);
@ -755,7 +750,7 @@ const confirmSign = () => {
zone: userSignatureZone.value, zone: userSignatureZone.value,
}; };
makeFetch("POST", url, body) makeFetch("POST", url, body)
.then((r) => { .then(() => {
checkForReady(); checkForReady();
}) })
.catch((error) => { .catch((error) => {
@ -777,9 +772,7 @@ const undoSign = async () => {
}; };
const toggleAddZone = () => { const toggleAddZone = () => {
canvasEvent.value === "select" canvasEvent.value = canvasEvent.value === "select" ? "add" : "select";
? (canvasEvent.value = "add")
: (canvasEvent.value = "select");
}; };
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => { const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {

View File

@ -3,9 +3,8 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
import { reactive } from "vue"; import { reactive } from "vue";
import HistoryButtonList from "ChillDocStoreAssets/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue"; import HistoryButtonList from "ChillDocStoreAssets/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue";
import { import {
StoredObject, StoredObjectVersion, StoredObject,
StoredObjectVersionWithPointInTime, StoredObjectVersionWithPointInTime,
StoredObjectPointInTime
} from "./../../../types"; } from "./../../../types";
interface HistoryButtonListConfig { interface HistoryButtonListConfig {
@ -29,7 +28,9 @@ const open = () => {
state.opened = true; state.opened = true;
}; };
const onRestoreVersion = (payload : { newVersion: StoredObjectVersionWithPointInTime }) => emit('restoreVersion', payload) const onRestoreVersion = (payload: {
newVersion: StoredObjectVersionWithPointInTime;
}) => emit("restoreVersion", payload);
defineExpose({ open }); defineExpose({ open });
</script> </script>
@ -45,9 +46,7 @@ defineExpose({ open });
:versions="props.versions" :versions="props.versions"
:can-edit="canEdit" :can-edit="canEdit"
:stored-object="storedObject" :stored-object="storedObject"
@restore-version=" @restore-version="onRestoreVersion"
onRestoreVersion
"
></history-button-list> ></history-button-list>
</template> </template>
</modal> </modal>

View File

@ -46,8 +46,9 @@ const onPickGenericDoc = ({
emit("pickGenericDoc", { genericDoc }); emit("pickGenericDoc", { genericDoc });
}; };
const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => { emit('removeAttachment', payload) }; const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
emit("removeAttachment", payload);
};
</script> </script>
<template> <template>

View File

@ -72,9 +72,13 @@ const placeTrans = (str: string): string => {
} }
}; };
const onPickDocument = (payload: { genericDoc: GenericDocForAccompanyingPeriod }) => emit('pickGenericDoc', payload); const onPickDocument = (payload: {
genericDoc: GenericDocForAccompanyingPeriod;
}) => emit("pickGenericDoc", payload);
const onRemoveGenericDoc = (payload: {genericDoc: GenericDocForAccompanyingPeriod}) => emit('removeGenericDoc', payload); const onRemoveGenericDoc = (payload: {
genericDoc: GenericDocForAccompanyingPeriod;
}) => emit("removeGenericDoc", payload);
const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => { const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
if (false === loaded.value) { if (false === loaded.value) {
@ -250,9 +254,7 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
:genericDoc="g" :genericDoc="g"
:is-picked="isPicked(g)" :is-picked="isPicked(g)"
@pickGenericDoc="onPickDocument" @pickGenericDoc="onPickDocument"
@removeGenericDoc=" @removeGenericDoc="onRemoveGenericDoc"
onRemoveGenericDoc
"
></pick-generic-doc-item> ></pick-generic-doc-item>
</div> </div>
<div v-else class="text-center chill-no-data-statement"> <div v-else class="text-center chill-no-data-statement">