Merge branch 'develop' of https://dev.azure.com/olympusai/Olympus/_git/hermione-fe into develop
This commit is contained in:
@@ -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}
|
||||
})
|
||||
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
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user