diff --git a/src/assets/tailwind.css b/src/assets/tailwind.css index e0f80af..a734097 100644 --- a/src/assets/tailwind.css +++ b/src/assets/tailwind.css @@ -8,6 +8,6 @@ .editor ol, .md-editor-preview ol{ list-style-type: decimal !important; } -.editor .md-editor-preview{ - word-break: break-word; +.editor, .md-editor-preview{ + word-break: break-word !important; } 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/layout/AppProfileMenu.vue b/src/layout/AppProfileMenu.vue index d3e347b..5b7facb 100644 --- a/src/layout/AppProfileMenu.vue +++ b/src/layout/AppProfileMenu.vue @@ -6,7 +6,9 @@ {{ user.name + " " + user.surname }} - + + + @@ -16,14 +18,26 @@ import { useAuth } from '@websanova/vue-auth/src/v3.js'; import { computed } from 'vue'; import { useRouter } from 'vue-router'; +import { ScenarioStore } from '@/stores/ScenarioStore'; const auth = useAuth(); const user = computed(() => auth.user()); const router = useRouter(); +const scenario_store = ScenarioStore(); + function redirectProject() { router.push('/projects'); // Specifica il percorso per la pagina "Projects" } +function logout() { + auth.logout().then(() => { + scenario_store.resetStore(); + router.push('/auth/login'); + }).catch(err => { + console.error("Errore durante il logout:", err); + }); +} + diff --git a/src/stores/ScenarioStore.js b/src/stores/ScenarioStore.js index aa0c9e4..44d2565 100644 --- a/src/stores/ScenarioStore.js +++ b/src/stores/ScenarioStore.js @@ -6,7 +6,6 @@ import { UserPrefStore } from './UserPrefStore' export const ScenarioStore = defineStore('scenario_store', () => { - const projectScenarios = ref([]) const globalScenarios = ref([]) const applicationScenarios = ref([]) @@ -18,7 +17,6 @@ export const ScenarioStore = defineStore('scenario_store', () => { const userPrefStore = UserPrefStore() const loadingStore = LoadingStore() - async function fetchScenarios() { loadingStore.scenario_loading = true; await ScenarioService.getScenariosProject(userPrefStore.selectedProject).then(resp => { @@ -26,7 +24,6 @@ export const ScenarioStore = defineStore('scenario_store', () => { allScenarios.value = [...projectScenarios.value] loadingStore.scenario_loading = false; }); - } async function fetchScenariosForRE() { @@ -35,7 +32,6 @@ export const ScenarioStore = defineStore('scenario_store', () => { scenariosForRE.value = resp.data; loadingStore.scenario_loading = false; }); - } async function fetchScenariosCross() { @@ -45,19 +41,16 @@ export const ScenarioStore = defineStore('scenario_store', () => { allScenarios.value = [...globalScenarios.value] loadingStore.scenario_loading = false; }); - } - async function fetchApplicationScenarios() { loadingStore.scenario_loading = true; - console.log("fetchApplicationScenarios >= selectedApp", userPrefStore.selectedApp) ; - await ScenarioService.getScenariosApplication(userPrefStore.selectedApp).then(resp=>{ + console.log("fetchApplicationScenarios >= selectedApp", userPrefStore.selectedApp); + await ScenarioService.getScenariosApplication(userPrefStore.selectedApp).then(resp => { console.log("response scenari", resp); applicationScenarios.value = resp.data allScenarios.value = [...projectScenarios.value, ...applicationScenarios.value] loadingStore.scenario_loading = false; - }) } @@ -65,7 +58,6 @@ export const ScenarioStore = defineStore('scenario_store', () => { return allScenarios.value }) - const filteredScenarios = computed(() => { console.log("scenarios", allScenarios.value); var filteredScenario = [] @@ -91,12 +83,43 @@ export const ScenarioStore = defineStore('scenario_store', () => { }); }) + const filteredScenariosCanvas = computed(() => { + console.log("scenarios", allScenarios.value); + var filteredScenario = [] - return {filteredScenarios, - projectScenarios, - applicationScenarios, - fetchScenarios, - fetchApplicationScenarios, - scenarios, - filterString , typeFilter, fetchScenariosCross, globalScenarios, fetchScenariosForRE, scenariosForRE} - }) \ No newline at end of file + if(userPrefStore.getSelApp != null) { + filteredScenario = [...globalScenarios.value,...projectScenarios.value, ...applicationScenarios.value] + } else { + filteredScenario = [...globalScenarios.value,...projectScenarios.value] + } + + return filteredScenario + }) + + function resetStore() { + projectScenarios.value = [] + globalScenarios.value = [] + applicationScenarios.value = [] + filterString.value = '' + allScenarios.value = [] + typeFilter.value = { name: 'All', value: 'all' } + scenariosForRE.value = [] + } + + return { + filteredScenarios, + filteredScenariosCanvas, + projectScenarios, + applicationScenarios, + fetchScenarios, + fetchApplicationScenarios, + scenarios, + filterString, + typeFilter, + fetchScenariosCross, + globalScenarios, + fetchScenariosForRE, + scenariosForRE, + resetStore + } +}) \ No newline at end of file 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 3461e99..028fc0d 100644 --- a/src/views/pages/ScenarioExec.vue +++ b/src/views/pages/ScenarioExec.vue @@ -1,262 +1,199 @@