Resolved bug
This commit is contained in:
@@ -83,7 +83,7 @@ function updateApplicationsMenu() {
|
|||||||
|
|
||||||
//Aggiungi "Rev Eng Code" alla fine della lista
|
//Aggiungi "Rev Eng Code" alla fine della lista
|
||||||
model.value[1].items.push({
|
model.value[1].items.push({
|
||||||
label: 'Rev Eng Code',
|
label: 'Application Code',
|
||||||
icon: 'pi pi-fw pi-cog',
|
icon: 'pi pi-fw pi-cog',
|
||||||
command: () => {
|
command: () => {
|
||||||
route.push({ path: '/app-browser' });
|
route.push({ path: '/app-browser' });
|
||||||
|
|||||||
@@ -79,12 +79,14 @@ import { computed, onMounted, reactive, ref } from 'vue';
|
|||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { LoadingStore } from '../../stores/LoadingStore.js';
|
import { LoadingStore } from '../../stores/LoadingStore.js';
|
||||||
import { UserPrefStore } from '../../stores/UserPrefStore.js';
|
import { UserPrefStore } from '../../stores/UserPrefStore.js';
|
||||||
|
import { ScenarioStore } from '../../stores/ScenarioStore.js';
|
||||||
|
|
||||||
|
|
||||||
const loadingStore = LoadingStore()
|
const loadingStore = LoadingStore()
|
||||||
const userPrefStore = UserPrefStore();
|
const userPrefStore = UserPrefStore();
|
||||||
const auth = useAuth();
|
const auth = useAuth();
|
||||||
const user = computed(() => auth.user());
|
const user = computed(() => auth.user());
|
||||||
|
const scenario_store = ScenarioStore();
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -122,6 +124,7 @@ const user = computed(() => auth.user());
|
|||||||
const openProject = async (project) => {
|
const openProject = async (project) => {
|
||||||
try {
|
try {
|
||||||
// Esegui l'update del progetto
|
// Esegui l'update del progetto
|
||||||
|
scenario_store.resetStore();
|
||||||
await userPrefStore.updateSelectedProject(project);
|
await userPrefStore.updateSelectedProject(project);
|
||||||
console.log('Progetto aggiornato e dati utente ricaricati');
|
console.log('Progetto aggiornato e dati utente ricaricati');
|
||||||
|
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ watch(() => route.params.id, fetchScenario);
|
|||||||
|
|
||||||
//Function to fetch scenarios
|
//Function to fetch scenarios
|
||||||
function fetchScenario(id) {
|
function fetchScenario(id) {
|
||||||
|
scenario.value.inputs = null;
|
||||||
data_loaded.value = false;
|
data_loaded.value = false;
|
||||||
formData.value = {};
|
formData.value = {};
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -358,7 +359,8 @@ function fetchScenario(id) {
|
|||||||
reqMultiFile.value = true;
|
reqMultiFile.value = true;
|
||||||
}
|
}
|
||||||
if (scenario.value.inputs.some((input) => input.type === 'singlefile_acceptall')) {
|
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')) {
|
if (scenario.value.inputs.some((input) => input.type === 'singlefile')) {
|
||||||
acceptedFormats.value = '.docx';
|
acceptedFormats.value = '.docx';
|
||||||
@@ -607,7 +609,7 @@ async function updateRating(newRating) {
|
|||||||
console.log('response:', response);
|
console.log('response:', response);
|
||||||
if (response.data === 'OK') {
|
if (response.data === 'OK') {
|
||||||
rating.value = newRating.value;
|
rating.value = newRating.value;
|
||||||
console.log('Rating aggiornato con successo:', response.data);
|
console.log('Rating successfully updated:', response.data);
|
||||||
toast.add({
|
toast.add({
|
||||||
severity: 'success', // Tipo di notifica (successo)
|
severity: 'success', // Tipo di notifica (successo)
|
||||||
summary: 'Success', // Titolo della notifica
|
summary: 'Success', // Titolo della notifica
|
||||||
@@ -615,7 +617,7 @@ async function updateRating(newRating) {
|
|||||||
life: 3000 // Durata della notifica in millisecondi
|
life: 3000 // Durata della notifica in millisecondi
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error("Errore nell'aggiornamento del rating", response.data);
|
console.error("Errore during rating update", response.data);
|
||||||
toast.add({
|
toast.add({
|
||||||
severity: 'error', // Tipo di notifica (errore)
|
severity: 'error', // Tipo di notifica (errore)
|
||||||
summary: 'Error', // Titolo della notifica
|
summary: 'Error', // Titolo della notifica
|
||||||
@@ -625,7 +627,7 @@ async function updateRating(newRating) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.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('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({
|
toast.add({
|
||||||
severity: 'success',
|
severity: 'success',
|
||||||
@@ -770,12 +772,12 @@ const onUpload = (event, uploadType) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Errore durante l'upload
|
// 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({
|
toast.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Error',
|
summary: 'Error',
|
||||||
detail: `Failed to upload file. Stato: ${xhr.status}`,
|
detail: `Failed to upload file. Status: ${xhr.status}`,
|
||||||
life: 3000
|
life: 3000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -825,7 +827,7 @@ function downloadFile() {
|
|||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Errore durante il download del file:', error);
|
console.error('Error during file download:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user