Merged PR 75: Resolved bug

Resolved bug
This commit is contained in:
2025-03-06 13:11:55 +00:00
3 changed files with 14 additions and 9 deletions

View File

@@ -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' });

View File

@@ -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');

View File

@@ -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);
}
}