Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f9939e9
feat: add data table component and integrate with apps route
ErwanDecoster Apr 30, 2025
daac74a
feat: add SearcherBar component and integrate it into apps and index …
ErwanDecoster Apr 30, 2025
048e909
refactor: remove unused Link import from columns.tsx
ErwanDecoster Apr 30, 2025
dc15279
feat: implement PaginatedNavigation component in AppsTable for pagina…
ErwanDecoster Apr 30, 2025
bfe4041
refactor: enhance pagination logic in PaginatedNavigation component f…
ErwanDecoster Apr 30, 2025
aa44344
refactor: adjust pagination logic in generatePaginationItems for impr…
ErwanDecoster Apr 30, 2025
a43e07d
fix: border transition looking bad
ErwanDecoster Apr 30, 2025
7026eae
refactor: update useAppsData to accept currentPage for dynamic data f…
ErwanDecoster Apr 30, 2025
bc1c2db
fix: add placeholderData to useQuery for improved data handling
ErwanDecoster Apr 30, 2025
c4c7665
refactor: wrap app name in a div and fixe is width
ErwanDecoster Apr 30, 2025
54b3344
fix: update TABLE_LENGTH to 16 for correct configuration
ErwanDecoster Apr 30, 2025
334af0a
refactor: remove AppsTable component and integrate its functionality …
ErwanDecoster Apr 30, 2025
633b2e7
feat: add Deals route with data fetching and pagination functionality
ErwanDecoster Apr 30, 2025
6389ebe
fix: rename taskQuery to tasksQuery for consistency in data fetching
ErwanDecoster Apr 30, 2025
bc0169d
refactor: reorganize imports and simplify conditional rendering in De…
ErwanDecoster Apr 30, 2025
d913a02
feat: implement Tasks route with data fetching, pagination, and task …
ErwanDecoster May 1, 2025
64a11f2
refactor: replace inline type definitions with GraphQL query types fo…
ErwanDecoster May 1, 2025
c88622b
fix: display workerpool description directly in the table instead of …
ErwanDecoster May 1, 2025
107359a
feat: add Workerpools route with data fetching, pagination, and table…
ErwanDecoster May 1, 2025
ebb7b3e
fix: wrap CopyButton in a div to set a fixed width for app name display
ErwanDecoster May 1, 2025
a0aa94f
fix: improve description display in workerpools table with consistent…
ErwanDecoster May 1, 2025
3c61cab
fix: replace CopyButton with conditional rendering for dataset name d…
ErwanDecoster May 1, 2025
05b2b85
feat: add Datasets route with data fetching, pagination, and table co…
ErwanDecoster May 1, 2025
7026fd1
fix: update PaginationEllipsis styling for better responsiveness
ErwanDecoster May 1, 2025
f3ef079
fix: update query state variables to indicate refetch and loading
ErwanDecoster May 1, 2025
4e9b092
fix: update loading indicator logic to show during loading or refetching
ErwanDecoster May 1, 2025
347109d
fix: adjust SearcherBar styling for improved layout and responsiveness
ErwanDecoster May 1, 2025
135bc85
fix: refactor SearcherBar layout for improved structure and styling
ErwanDecoster May 1, 2025
2a817d8
fix: adjust SearcherBar padding for improved layout consistency
ErwanDecoster May 1, 2025
c6cc91f
fix: simplify Button component structure in SearcherBar for cleaner code
ErwanDecoster May 1, 2025
4d207a2
fix: update PaginationPrevious and PaginationNext to use screen reade…
ErwanDecoster May 9, 2025
0cb3ff1
fix: refactor SearcherBar to improve button visibility and input clas…
ErwanDecoster May 14, 2025
cbbf3be
fix: update placeholder text in SearcherBar for clarity
ErwanDecoster May 14, 2025
92f5529
feat: rename folder
ErwanDecoster May 14, 2025
1f2f47d
feat: rename folder AppsTable/ to appTable/
ErwanDecoster May 14, 2025
258ea4f
fix: remove unnecessary 'use client' directive from multiple components
ErwanDecoster May 14, 2025
ae3cefc
feat: enhance DataTable component with tableLength and isLoading prop…
ErwanDecoster May 14, 2025
5745139
feat: move routes for apps, datasets, deals, tasks, and workerpools
ErwanDecoster May 14, 2025
2c784a1
fix: update destination paths for apps, datasets, deals, tasks, and w…
ErwanDecoster May 14, 2025
6053b75
feat: implement DataTable component and update routes to use it
ErwanDecoster May 14, 2025
2544b75
feat: replace useNavigate with Link in DataTable for improved navigation
ErwanDecoster May 14, 2025
69d3a3d
feat: refactor preview tables to use DataTable component for improved…
ErwanDecoster May 14, 2025
e6f90c9
fix: prevent default button behavior in CopyButton component
ErwanDecoster May 14, 2025
13d9030
feat: rename WorkerpoolsPreviewTable component and update import path
ErwanDecoster May 14, 2025
e81759b
fix: update import path for WorkerpoolsPreviewTable component
ErwanDecoster May 14, 2025
3e38af9
feat: add routes for datasets, deals, tasks, and workerpools with dat…
ErwanDecoster May 15, 2025
5bfa26e
refactor: remove unused AppsTable component and related code
ErwanDecoster May 15, 2025
4c04d5f
feat: add NextApps, NextDatasets, NextDeals, NextTasks, and NextWorke…
ErwanDecoster May 15, 2025
fa09d87
fix: update import path for WorkerpoolsPreviewTable component
ErwanDecoster May 15, 2025
aca2247
chore: update @radix-ui/react-slot version to 1.2.2 in package.json a…
ErwanDecoster May 16, 2025
960cf5d
feat: update pagination logic in multiple routes to adjust current pa…
ErwanDecoster May 16, 2025
ec6a84d
feat: better error and loading handling logic in preview tables for a…
ErwanDecoster May 20, 2025
b6cea8a
feat: enhance error handling in apps, datasets, deals, tasks, and wor…
ErwanDecoster May 20, 2025
13cabd9
fix: correct typo in query property of fetch request in execute function
ErwanDecoster May 20, 2025
64e9cfe
feat: improve error handling in apps, datasets, deals, tasks, and wor…
ErwanDecoster May 20, 2025
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
133 changes: 129 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@radix-ui/react-dialog": "^1.1.7",
"@radix-ui/react-label": "^2.1.3",
"@radix-ui/react-select": "^2.2.2",
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-slot": "^1.2.2",
"@radix-ui/react-tabs": "^1.1.4",
"@radix-ui/react-tooltip": "^1.2.0",
"@reown/appkit": "^1.6.9",
Expand All @@ -34,6 +34,8 @@
"@tanstack/react-query": "^5.74.4",
"@tanstack/react-router": "^1.116.0",
"@tanstack/react-router-devtools": "^1.116.0",
"@tanstack/react-table": "^8.21.3",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"graphql": "^16.10.0",
Expand Down
6 changes: 5 additions & 1 deletion src/components/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ const CopyButton = ({
<Tooltip open={showTooltip}>
<TooltipTrigger asChild>
<button
onClick={handleCopy}
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
handleCopy();
}}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
className="hover:before:bg-grey-700 active:before:bg-grey-600 relative z-0 -mx-2 -my-1 flex w-fit items-center gap-1 px-2 py-1 transition-colors before:absolute before:inset-0 before:-z-10 before:rounded-lg before:duration-150 active:before:scale-x-[0.98] active:before:scale-y-[0.94]"
Expand Down
95 changes: 95 additions & 0 deletions src/components/DataTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { Link } from '@tanstack/react-router';
import {
ColumnDef,
flexRender,
getCoreRowModel,
useReactTable,
} from '@tanstack/react-table';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/components/ui/table';

interface DataTableProps<TData, TValue> {
columns: ColumnDef<TData, TValue>[];
data: TData[];
tableLength?: number;
isLoading?: boolean;
}

export function DataTable<TData extends { destination: string }, TValue>({
columns,
data,
tableLength = 10,
isLoading,
}: DataTableProps<TData, TValue>) {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
});

return (
<Table>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
)}
</TableHead>
);
})}
</TableRow>
))}
</TableHeader>
<TableBody>
{table.getRowModel().rows.map((row) => (
<TableRow key={row.id} data-state={row.getIsSelected() && 'selected'}>
{row.getVisibleCells().map((cell) => (
<TableCell key={cell.id} className="p-0">
<Link
className="block px-5 py-6"
to={cell.row.original.destination}
>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</Link>
</TableCell>
))}
</TableRow>
))}
{data.length === 0 && !isLoading && (
<TableRow>
<TableCell colSpan={columns.length} className="text-center">
<span>No results.</span>
</TableCell>
</TableRow>
)}
{Array.from({
length:
tableLength -
data.length -
(data.length === 0 && !isLoading ? 1 : 0),
}).map((_, index) => (
<TableRow key={`empty-${index}`}>
{columns.map((_, colIndex) => (
<TableCell key={colIndex} className="h-12">
&nbsp;
</TableCell>
))}
</TableRow>
))}
</TableBody>
</Table>
);
}
Loading