Skip to content

Commit

Permalink
Limit content of data input element
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Nov 12, 2024
1 parent 57ee1ab commit 01e8f99
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/InputData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import { CheckCircleIcon, ExclamationCircleIcon } from "@heroicons/vue/24/outlin
const LIMIT = 100;
// Value type
type ValueType = {
id: string;
name: string;
};
// Define props with TypeScript
const props = defineProps<{
extension?: string;
Expand All @@ -27,9 +33,9 @@ async function loadDatasets(query?: string): Promise<void> {
const { data } = await GalaxyApi().GET(`/api/datasets?limit=${LIMIT}&${extensionFilter}&${nameFilter}`);
if (data && data.length > 0) {
const options = data.map((x: { name: string }) => ({
const options = data.map((x: ValueType) => ({
label: x.name,
value: x,
value: { id: x.id, name: x.name },
}));
options.push({ label: "...filter for more", value: null, disabled: true });
if (props.optional) {
Expand Down

0 comments on commit 01e8f99

Please sign in to comment.