diff --git a/client/src/api/datatypes.ts b/client/src/api/datatypes.ts index 449c1a71ac1..0cc5cb54ed4 100644 --- a/client/src/api/datatypes.ts +++ b/client/src/api/datatypes.ts @@ -1,3 +1,26 @@ import type { components } from "@/api"; +import { GalaxyApi } from "@/api"; +import { rethrowSimple } from "@/utils/simple-error"; export type CompositeFileInfo = components["schemas"]["CompositeFileInfo"]; +export type DatatypeDetails = components["schemas"]["DatatypeDetails"]; + +/** + * Get details about a specific datatype + */ +export async function fetchDatatypeDetails(extension: string): Promise { + try { + const { GET } = GalaxyApi(); + const { data } = await GET("/api/datatypes/{datatype}", { + params: { + path: { datatype: extension }, + }, + }); + if (!data) { + throw new Error(`Failed to fetch datatype details for ${extension}`); + } + return data as DatatypeDetails; + } catch (error) { + rethrowSimple(error); + } +} diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index a61861be3ea..20ba0bc1690 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -9301,6 +9301,11 @@ export interface components { * @description The URL to a detailed description for this datatype */ description_url: string | null; + /** + * Display behavior + * @description How this datatype behaves when displayed with preview=True: 'inline' (can be displayed in browser) or 'download' (triggers download) + */ + display_behavior?: string | null; /** * Display in upload * @description If True, the associated file extension will be displayed in the `File Format` select list in the `Upload File from your computer` tool in the `Get Data` tool section of the tool panel diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue index b55fd349bc1..1f50eecc691 100644 --- a/client/src/components/Dataset/DatasetView.vue +++ b/client/src/components/Dataset/DatasetView.vue @@ -1,10 +1,13 @@