Skip to content

Commit

Permalink
feat(filter): filter available data store projects and analyses based…
Browse files Browse the repository at this point in the history
… on node ID build_image
  • Loading branch information
brucetony committed Sep 6, 2024
1 parent bef04d2 commit 8ffe4f5
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions components/data-stores/ResourceManagerTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import DataStoreCreator from "~/components/data-stores/managers/DataStoreCreator
import ProjectBinder from "~/components/data-stores/managers/ProjectBinder.vue";
import AnalysisBinder from "~/components/data-stores/managers/AnalysisBinder.vue";
import {
getAnalyses,
getAnalysisNodes,
getDataStores,
getProjects,
getProposals,
} from "~/composables/useAPIFetch";
import type {
DetailedAnalysis,
AnalysisNode,
DetailedService,
Project,
ProjectNode,
Route,
Service,
} from "~/services/Api";
Expand All @@ -20,10 +20,10 @@ const availableProjects = ref();
const availableAnalyses = ref();
const { data: dataResp } = await getDataStores(false, { lazy: true });
const { data: projects, status: projStatus } = await getProjects({
const { data: projects, status: projStatus } = await getProposals({
lazy: true,
});
const { data: analyses, status: anStatus } = await getAnalyses({
const { data: analyses, status: anStatus } = await getAnalysisNodes({
lazy: true,
});
Expand All @@ -38,21 +38,20 @@ watch(dataResp, (parsedStores) => {
});
watch(projects, (parsedProjects) => {
const projectData = parsedProjects!.data as unknown as Array<Project>;
availableProjects.value = projectData.map((proj: Project) => {
const projectData = parsedProjects!.data as unknown as Array<ProjectNode>;
availableProjects.value = projectData.map((proj: ProjectNode) => {
return {
name: proj.name,
id: proj.id,
dropdown: `${proj.name} (${proj.id})`,
name: proj.project.name,
id: proj.project_id,
dropdown: `${proj.project.name} (${proj.project_id})`,
};
});
});
watch(analyses, (parsedAnalyses) => {
const analysisData = parsedAnalyses!
.data as unknown as Array<DetailedAnalysis>;
availableAnalyses.value = analysisData.map((analysis: DetailedAnalysis) => {
return { name: analysis.name, id: analysis.id };
const analysisData = parsedAnalyses!.data as unknown as Array<AnalysisNode>;
availableAnalyses.value = analysisData.map((analysisNode: AnalysisNode) => {
return { name: analysisNode.analysis.name, id: analysisNode.analysis_id };
});
});
Expand Down

0 comments on commit 8ffe4f5

Please sign in to comment.