Skip to content

Commit

Permalink
Merge pull request galaxyproject#17799 from itisAliRH/datasets-refactors
Browse files Browse the repository at this point in the history
Datasets refactors
  • Loading branch information
ahmedhamidawan authored Mar 22, 2024
2 parents 06a07bb + cd0f2b8 commit 44a2583
Show file tree
Hide file tree
Showing 7 changed files with 320 additions and 269 deletions.
4 changes: 3 additions & 1 deletion client/src/api/datasets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import { withPrefix } from "@/utils/redirect";

export const datasetsFetcher = fetcher.path("/api/datasets").method("get").create();

export type HDASummary = components["schemas"]["HDASummary"];

type GetDatasetsApiOptions = FetchArgType<typeof datasetsFetcher>;
type GetDatasetsQuery = Pick<GetDatasetsApiOptions, "limit" | "offset">;
// custom interface for how we use getDatasets
interface GetDatasetsOptions extends GetDatasetsQuery {
sortBy?: string;
sortDesc?: string;
sortDesc?: boolean;
query?: string;
}

Expand Down
35 changes: 19 additions & 16 deletions client/src/components/Dataset/DatasetHistory.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<script setup lang="ts">
import { computed } from "vue";
import { HDASummary } from "@/api/datasets";
import { useHistoryStore } from "@/stores/historyStore";
interface Props {
item: HDASummary;
}
const props = defineProps<Props>();
const historyStore = useHistoryStore();
const historyName = computed(() => {
return historyStore.getHistoryNameById(props.item.history_id);
});
</script>

<template>
<div>
{{ historyName }}
</div>
</template>
<script>
import { mapState } from "pinia";
import { useHistoryStore } from "stores/historyStore";
export default {
props: {
item: Object,
},
computed: {
...mapState(useHistoryStore, ["getHistoryNameById"]),
historyName() {
return this.getHistoryNameById(this.item.history_id);
},
},
};
</script>
Loading

0 comments on commit 44a2583

Please sign in to comment.