From af7328c8fa2cfbb8516de331a6e8a0d5eaf957b2 Mon Sep 17 00:00:00 2001 From: Emanuele Ferrelli Date: Thu, 6 Mar 2025 13:03:51 +0100 Subject: [PATCH] Resolved bug --- src/layout/AppMenu.vue | 2 +- src/views/pages/ProjectList.vue | 3 +++ src/views/pages/ScenarioExec.vue | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/layout/AppMenu.vue b/src/layout/AppMenu.vue index 2c8a32a..af33bfe 100644 --- a/src/layout/AppMenu.vue +++ b/src/layout/AppMenu.vue @@ -83,7 +83,7 @@ function updateApplicationsMenu() { //Aggiungi "Rev Eng Code" alla fine della lista model.value[1].items.push({ - label: 'Rev Eng Code', + label: 'Application Code', icon: 'pi pi-fw pi-cog', command: () => { route.push({ path: '/app-browser' }); diff --git a/src/views/pages/ProjectList.vue b/src/views/pages/ProjectList.vue index 3c0af0e..1f15601 100644 --- a/src/views/pages/ProjectList.vue +++ b/src/views/pages/ProjectList.vue @@ -79,12 +79,14 @@ import { computed, onMounted, reactive, ref } from 'vue'; import { useRouter } from 'vue-router'; import { LoadingStore } from '../../stores/LoadingStore.js'; import { UserPrefStore } from '../../stores/UserPrefStore.js'; +import { ScenarioStore } from '../../stores/ScenarioStore.js'; const loadingStore = LoadingStore() const userPrefStore = UserPrefStore(); const auth = useAuth(); const user = computed(() => auth.user()); +const scenario_store = ScenarioStore(); const router = useRouter() @@ -122,6 +124,7 @@ const user = computed(() => auth.user()); const openProject = async (project) => { try { // Esegui l'update del progetto + scenario_store.resetStore(); await userPrefStore.updateSelectedProject(project); console.log('Progetto aggiornato e dati utente ricaricati'); diff --git a/src/views/pages/ScenarioExec.vue b/src/views/pages/ScenarioExec.vue index 39d70b1..028fc0d 100644 --- a/src/views/pages/ScenarioExec.vue +++ b/src/views/pages/ScenarioExec.vue @@ -345,6 +345,7 @@ watch(() => route.params.id, fetchScenario); //Function to fetch scenarios function fetchScenario(id) { + scenario.value.inputs = null; data_loaded.value = false; formData.value = {}; loading.value = true; @@ -358,7 +359,8 @@ function fetchScenario(id) { reqMultiFile.value = true; } if (scenario.value.inputs.some((input) => input.type === 'singlefile_acceptall')) { - acceptedFormats.value = '.docx, .pdf, .doc, .txt, .msg'; + acceptedFormats.value = ""; + //acceptedFormats.value = '.doc,.docx,.pdf,.msg,.txt,.xlx,.xlxs,.logs,.pptx,.json,.odt,.rtf,.xml,.html'; } if (scenario.value.inputs.some((input) => input.type === 'singlefile')) { acceptedFormats.value = '.docx'; @@ -607,7 +609,7 @@ async function updateRating(newRating) { console.log('response:', response); if (response.data === 'OK') { rating.value = newRating.value; - console.log('Rating aggiornato con successo:', response.data); + console.log('Rating successfully updated:', response.data); toast.add({ severity: 'success', // Tipo di notifica (successo) summary: 'Success', // Titolo della notifica @@ -615,7 +617,7 @@ async function updateRating(newRating) { life: 3000 // Durata della notifica in millisecondi }); } else { - console.error("Errore nell'aggiornamento del rating", response.data); + console.error("Errore during rating update", response.data); toast.add({ severity: 'error', // Tipo di notifica (errore) summary: 'Error', // Titolo della notifica @@ -625,7 +627,7 @@ async function updateRating(newRating) { } }) .catch((error) => { - console.error('Errore durante la chiamata al backend:', error); + console.error('Error during backend call:', error); }); } @@ -760,7 +762,7 @@ const onUpload = (event, uploadType) => { console.log('Form value upload ', formData.value['MultiFileUpload']); - console.log('Upload completato con successo. Risposta:', xhr.response); + console.log('Upload successfully completed. Response:', xhr.response); toast.add({ severity: 'success', @@ -770,12 +772,12 @@ const onUpload = (event, uploadType) => { }); } else { // Errore durante l'upload - console.error("Errore durante l'upload. Stato:", xhr.status, 'Risposta:', xhr.response); + console.error("Error during upload. Status:", xhr.status, 'Response:', xhr.response); toast.add({ severity: 'error', summary: 'Error', - detail: `Failed to upload file. Stato: ${xhr.status}`, + detail: `Failed to upload file. Status: ${xhr.status}`, life: 3000 }); } @@ -825,7 +827,7 @@ function downloadFile() { document.body.removeChild(a); window.URL.revokeObjectURL(url); } catch (error) { - console.error('Errore durante il download del file:', error); + console.error('Error during file download:', error); } }