From a5be981b636effd73dec1a1107909badfa42326d Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 20 Jan 2026 20:21:58 +0100 Subject: [PATCH 01/39] Add GTable component with loading and empty states Introduces a new reusable table component that extends BTable with: - Loading state with customizable message - Empty state with customizable message and variant - Type definitions for props and events - Proper TypeScript interfaces for type safety --- client/src/components/Common/GTable.types.ts | 96 ++++ client/src/components/Common/GTable.vue | 530 +++++++++++++++++++ 2 files changed, 626 insertions(+) create mode 100644 client/src/components/Common/GTable.types.ts create mode 100644 client/src/components/Common/GTable.vue diff --git a/client/src/components/Common/GTable.types.ts b/client/src/components/Common/GTable.types.ts new file mode 100644 index 000000000000..311d506108fb --- /dev/null +++ b/client/src/components/Common/GTable.types.ts @@ -0,0 +1,96 @@ +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; + /** Whether to render as HTML (use with caution) */ + html?: boolean; +} + +/** 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 { + /** 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 { + /** 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; + /** Click handler function */ + handler?: () => 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; +} diff --git a/client/src/components/Common/GTable.vue b/client/src/components/Common/GTable.vue new file mode 100644 index 000000000000..712c68fce330 --- /dev/null +++ b/client/src/components/Common/GTable.vue @@ -0,0 +1,530 @@ + + + + + From c7b67bf98fb77f5c9b0e92c411bf207aacfc62ac Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 20 Jan 2026 20:22:09 +0100 Subject: [PATCH 02/39] Refactor DatasetList to use GTable component Updates DatasetList component to use the new GTable component: - Replace BTable with GTable for consistent loading/empty states - Remove LoadingSpan and BAlert components in favor of GTable states - Add explicit field labels to table configuration - Pass loading state and messages as props to GTable - Simplify template by removing duplicate state handling --- client/src/components/Dataset/DatasetList.vue | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/client/src/components/Dataset/DatasetList.vue b/client/src/components/Dataset/DatasetList.vue index 524c33f414ea..1ca904be9cae 100644 --- a/client/src/components/Dataset/DatasetList.vue +++ b/client/src/components/Dataset/DatasetList.vue @@ -1,5 +1,5 @@ + + From fb8c5a9033fa0b694535a94ccdd331c31a73924e Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Fri, 23 Jan 2026 13:51:27 +0100 Subject: [PATCH 07/39] Replace GTable custom styles with utilities Refactor GTable layout to rely on Bootstrap utility classes instead of custom CSS, simplifying markup and styles while preserving behavior. Remove unused container and wrapper styles, adjust table classes for full-width rendering, and clean up selection header markup. Also clean up DatasetList by removing an unused ListHeader ref and adding DelayedInput for improved dataset search handling. --- client/src/components/Common/GTable.vue | 41 ++++--------------- client/src/components/Dataset/DatasetList.vue | 3 +- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/client/src/components/Common/GTable.vue b/client/src/components/Common/GTable.vue index 90268af47de1..ac8257ffac33 100644 --- a/client/src/components/Common/GTable.vue +++ b/client/src/components/Common/GTable.vue @@ -340,7 +340,7 @@ const getCellId = (tableId: string, fieldKey: string, index: number) => `g-table