Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a5be981
Add GTable component with loading and empty states
itisAliRH Jan 20, 2026
c7b67bf
Refactor DatasetList to use GTable component
itisAliRH Jan 20, 2026
0fef8ba
Add configurable sort options and column toggles
itisAliRH Jan 21, 2026
3b3da05
add overlay and load-more loading states
itisAliRH Jan 21, 2026
9176cbb
Add deleteDataset with optional purge flag
itisAliRH Jan 21, 2026
0f1d30c
Add bulk selection, delete actions, and UI controls
itisAliRH Jan 21, 2026
fb8c5a9
Replace GTable custom styles with utilities
itisAliRH Jan 23, 2026
70c9bd2
Refactor actions and selection slots in GTable
itisAliRH Jan 23, 2026
8f733ee
Move row actions to GTable and add link navigation
itisAliRH Jan 23, 2026
b3def84
Extend TableAction with link props and context
itisAliRH Jan 23, 2026
6936c10
Remove unused dataset name component
itisAliRH Jan 23, 2026
f5cccfd
Refactor GTable sorting state and sort event API
itisAliRH Jan 23, 2026
ff2f6fa
Remove header sort options and fix query ref usage
itisAliRH Jan 23, 2026
b4eef69
Remove unused sort reset prop and clean up types
itisAliRH Jan 23, 2026
6368010
Reorganize props definitions and defaults
itisAliRH Jan 23, 2026
6bd7086
Remove local sorting and use items directly
itisAliRH Jan 23, 2026
d6b9817
Reorder refs and computed fields
itisAliRH Jan 23, 2026
211a38e
Add title attribute to action component links
itisAliRH Jan 23, 2026
f93778b
Add composable for dataset table actions
itisAliRH Jan 23, 2026
5a304e6
Use useDatasetTableActions composable
itisAliRH Jan 23, 2026
9047c07
Add breadcrumb navigation to dataset list view
itisAliRH Jan 23, 2026
5e69780
Add select-all checkbox and update actions menu UI
itisAliRH Jan 26, 2026
3a1cb09
Add loadDatasets helper with pagination and search
itisAliRH Jan 26, 2026
52b5305
Switch dataset list to paginated loading
itisAliRH Jan 26, 2026
e84893c
Replace delete modal with confirm dialog for bulk delete
itisAliRH Jan 26, 2026
f9f8dac
Replace dataset error alerts with toast notifications
itisAliRH Jan 26, 2026
19cc91e
Replace Columns text with cog dropdown and group
itisAliRH Jan 26, 2026
f081998
Add RowIcon type and remove html field
itisAliRH Jan 28, 2026
aa144bd
Add optional row status icon support to GTable
itisAliRH Jan 28, 2026
f47c938
Add dataset status icons to list rows
itisAliRH Jan 28, 2026
2e69e7e
Remove history navigation link
itisAliRH Jan 28, 2026
c283ac9
Refresh list after copy and delete actions
itisAliRH Jan 28, 2026
48c566b
Clarify switch link title for owned histories
itisAliRH Jan 28, 2026
dd79b52
Ensure default sort when no options
itisAliRH Jan 28, 2026
ab7baca
Add reset columns action to settings menu
itisAliRH Jan 28, 2026
72a5631
Add reset columns handler to list view
itisAliRH Jan 28, 2026
386b950
Fix compute status icon per row in first cell
itisAliRH Jan 28, 2026
936113e
Update expected tooltip text for switch action
itisAliRH Jan 28, 2026
5b74186
Update sort selector titles to match UI
itisAliRH Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions client/src/api/datasets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,54 @@ import {
GalaxyApi,
type GalaxyApiPaths,
type HDADetailed,
type HDASummary,
} from "@/api";
import { withPrefix } from "@/utils/redirect";
import { rethrowSimple } from "@/utils/simple-error";

export interface LoadDatasetsOptions {
limit?: number;
offset?: number;
sortBy?: string;
sortDesc?: boolean;
search?: string;
}

export interface LoadDatasetsResult {
data: HDASummary[];
totalMatches: number;
}

export async function loadDatasets(options: LoadDatasetsOptions): Promise<LoadDatasetsResult> {
const { limit = 24, offset = 0, sortBy = "update_time", sortDesc = true, search = "" } = options;

const {
response,
data: datasets,
error,
} = await GalaxyApi().GET("/api/datasets", {
params: {
query: {
q: search ? ["name-contains"] : undefined,
qv: search ? [search] : undefined,
limit,
offset,
order: `${sortBy}${sortDesc ? "-dsc" : "-asc"}`,
view: "summary",
},
},
});

if (error) {
rethrowSimple(error);
}

const totalMatches = parseInt(response.headers.get("total_matches") ?? "0", 10) || 0;
const data = datasets as unknown as HDASummary[];

return { data, totalMatches };
}

export async function fetchDatasetTextContentDetails(params: { id: string }): Promise<DatasetTextContentDetails> {
const { data, error } = await GalaxyApi().GET("/api/datasets/{dataset_id}/get_content_as_text", {
params: {
Expand Down Expand Up @@ -56,11 +100,11 @@ export async function undeleteDataset(datasetId: string) {
return data;
}

export async function purgeDataset(datasetId: string) {
export async function deleteDataset(datasetId: string, purge: boolean = false) {
const { data, error } = await GalaxyApi().DELETE("/api/datasets/{dataset_id}", {
params: {
path: { dataset_id: datasetId },
query: { purge: true },
query: { purge },
},
});
if (error) {
Expand All @@ -69,6 +113,10 @@ export async function purgeDataset(datasetId: string) {
return data;
}

export async function purgeDataset(datasetId: string) {
return deleteDataset(datasetId, true);
}

type CopyDatasetParamsType = GalaxyApiPaths["/api/histories/{history_id}/contents/{type}s"]["post"]["parameters"];
type CopyDatasetBodyType = components["schemas"]["CreateHistoryContentPayload"];

Expand Down
119 changes: 119 additions & 0 deletions client/src/components/Common/GTable.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import type { SizeProp } from "@fortawesome/fontawesome-svg-core";
import type { IconDefinition } from "@fortawesome/free-solid-svg-icons";

import type { BootstrapVariant } from "@/components/Common";

/** Bootstrap component sizes */
export type BootstrapSize = "xs" | "sm" | "md" | "lg" | "xl";

/** Table field sorting order */
export type SortOrder = "asc" | "desc";

/** Table field alignment options */
export type FieldAlignment = "left" | "center" | "right";

/** Table field definition */
export interface TableField {
/** Unique key for the field (matches data property name) */
key: string;
/** Display label for the column header */
label?: string;
/** Whether the column is sortable */
sortable?: boolean;
/** Custom CSS classes for the column */
class?: string;
/** Custom CSS classes for the header cell */
headerClass?: string;
/** Custom CSS classes for data cells */
cellClass?: string;
/** Column alignment */
align?: FieldAlignment;
/** Width of the column (CSS value) */
width?: string;
/** Whether to hide the column on small screens */
hideOnSmall?: boolean;
/** Custom formatter function for cell values */
formatter?: (value: any, key: string, item: any) => string;
}

/** Sort change event payload */
export interface SortChangeEvent {
/** The field key being sorted */
sortBy: string;
/** Whether sorting in descending order */
sortDesc: boolean;
}

/** Row click event payload */
export interface RowClickEvent<T = any> {
/** The row item data */
item: T;
/** The row index */
index: number;
/** The original mouse/keyboard event */
event: MouseEvent | KeyboardEvent;
}

/** Row selection event payload */
export interface RowSelectEvent<T = any> {
/** The selected row item */
item: T;
/** The row index */
index: number;
/** Whether the row is now selected */
selected: boolean;
}

/** Table action button configuration */
export interface TableAction {
/** Unique identifier for the action */
id: string;
/** Display label for the action */
label: string;
/** Tooltip text */
title: string;
/** FontAwesome icon */
icon?: IconDefinition;
/** Bootstrap variant */
variant?: BootstrapVariant;
/** Whether the action is disabled */
disabled?: boolean;
/** Whether the action is visible */
visible?: boolean;
/** Bootstrap component size */
size?: BootstrapSize;
/** Vue Router route to navigate to */
to?: string;
/** Hyperlink reference */
href?: string;
/** Link target attribute */
target?: string;
/** Whether link opens in new tab/window */
externalLink?: boolean;
/** Click handler function */
handler?: (item: any, index: number) => void;
}

/** Empty state configuration */
export interface TableEmptyState {
/** Message to display when no data */
message: string;
/** Optional icon to display */
icon?: IconDefinition;
/** Bootstrap variant for styling */
variant?: BootstrapVariant;
}

/** Row status icon configuration */
export interface RowIcon {
/** FontAwesome icon (required) */
icon: IconDefinition;
/** Additional CSS classes */
class?: string;
/** Icon size (FontAwesome SizeProp) */
size?: SizeProp;
/** Tooltip text */
title?: string;
/** Whether icon should spin (loading state) */
spin?: boolean;
}
Loading
Loading