-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/table view for issues #1648
Merged
Merged
Changes from 250 commits
Commits
Show all changes
268 commits
Select commit
Hold shift + click to select a range
f91b3db
Merge pull request #395 from ever-co/develop
evereq 59090f1
Merge pull request #397 from ever-co/develop
evereq 2349f51
Merge pull request #402 from ever-co/develop
evereq 73b705e
Merge pull request #406 from ever-co/develop
evereq c59901c
Merge pull request #409 from ever-co/develop
evereq e4fd1d6
Merge pull request #414 from ever-co/develop
evereq 28f073d
Merge pull request #420 from ever-co/develop
evereq 9bb2163
Merge pull request #423 from ever-co/develop
evereq cae5c6f
Merge pull request #425 from ever-co/develop
evereq 19a4529
Merge pull request #426 from ever-co/develop
evereq ee8a902
Merge pull request #431 from ever-co/develop
evereq a01f638
Merge pull request #433 from ever-co/develop
evereq 307fc02
Merge pull request #434 from ever-co/develop
evereq 24de6d4
Merge pull request #436 from ever-co/develop
evereq 9ae13c4
Merge pull request #437 from ever-co/develop
evereq 4640ed8
Merge pull request #446 from ever-co/develop
evereq 9953c28
Merge pull request #470 from ever-co/develop
evereq 116942b
Merge pull request #476 from ever-co/develop
evereq 50a0c34
Merge pull request #482 from ever-co/develop
evereq f5f528e
Merge pull request #490 from ever-co/develop
evereq 9435b27
Merge pull request #492 from ever-co/develop
evereq 0b52670
Merge pull request #494 from ever-co/develop
evereq 92ec5bf
Merge pull request #497 from ever-co/develop
evereq 711a31f
Merge pull request #501 from ever-co/develop
evereq baad5ea
Merge pull request #516 from ever-co/develop
evereq 790d591
Merge pull request #518 from ever-co/develop
evereq acaee3a
Merge pull request #526 from ever-co/develop
evereq 72aa867
Merge pull request #529 from ever-co/develop
evereq 15bdd45
Merge pull request #531 from ever-co/develop
evereq b451ddd
Merge pull request #533 from ever-co/develop
evereq b126395
Merge pull request #536 from ever-co/develop
evereq 4b33e13
Merge pull request #539 from ever-co/develop
evereq e2d7ac2
Merge pull request #541 from ever-co/develop
evereq 0f8e60d
Merge pull request #544 from ever-co/develop
evereq 0341472
Merge pull request #548 from ever-co/develop
evereq e74b0c9
Merge pull request #550 from ever-co/develop
evereq e975875
Merge pull request #552 from ever-co/develop
evereq 1b17acf
Merge pull request #554 from ever-co/develop
evereq 7ff457c
Merge pull request #556 from ever-co/develop
evereq 81677fd
Merge pull request #558 from ever-co/develop
evereq 8d44b7d
Merge pull request #569 from ever-co/develop
evereq 6430ed8
Merge pull request #572 from ever-co/develop
evereq f85ba84
Merge pull request #574 from ever-co/develop
evereq 3f8fd1c
Merge pull request #576 from ever-co/develop
evereq 0557dde
Merge pull request #579 from ever-co/develop
evereq 6faccb4
Merge pull request #581 from ever-co/develop
evereq 49c35bc
Merge pull request #583 from ever-co/develop
evereq e738b0b
Merge pull request #589 from ever-co/develop
evereq c173993
Merge pull request #594 from ever-co/develop
evereq a075ec5
Merge pull request #599 from ever-co/develop
evereq cecf1ae
Merge pull request #603 from ever-co/develop
evereq a3fcbe4
Merge pull request #606 from ever-co/develop
evereq a6c25a1
Merge pull request #611 from ever-co/develop
evereq af3fc61
Merge pull request #615 from ever-co/develop
evereq 719d862
Merge pull request #617 from ever-co/develop
evereq 051f586
Merge pull request #618 from ever-co/develop
evereq 5090cd0
Merge pull request #621 from ever-co/develop
evereq f5ee2ee
Merge pull request #624 from ever-co/develop
evereq 47f06ee
Merge pull request #626 from ever-co/develop
evereq 967248e
Merge pull request #630 from ever-co/develop
evereq 1bedd96
Merge pull request #634 from ever-co/develop
evereq 8ebca5b
Merge pull request #636 from ever-co/develop
evereq 25a4cd2
Merge pull request #638 from ever-co/develop
evereq c0ed775
Merge pull request #640 from ever-co/develop
evereq a7ab431
Merge pull request #652 from ever-co/develop
evereq d7eb425
Merge pull request #657 from ever-co/develop
evereq fb3d1ff
Merge pull request #659 from ever-co/develop
evereq b394561
Merge pull request #661 from ever-co/develop
evereq ed1eb85
Merge pull request #664 from ever-co/develop
evereq 3fc8595
Merge pull request #667 from ever-co/develop
evereq 73f69c9
Merge pull request #672 from ever-co/develop
evereq 07c6ed9
Merge pull request #676 from ever-co/develop
evereq 417646b
Merge pull request #684 from ever-co/develop
evereq a9f23a0
Merge pull request #689 from ever-co/develop
evereq 9027bdf
Merge pull request #691 from ever-co/develop
evereq d21dfb1
Merge pull request #692 from ever-co/develop
evereq c7f1950
Merge pull request #696 from ever-co/develop
evereq 97dd97e
Merge pull request #698 from ever-co/develop
evereq f404734
Merge pull request #703 from ever-co/develop
evereq 1f2600d
Merge pull request #707 from ever-co/develop
evereq 4ef2202
Merge pull request #709 from ever-co/develop
evereq 6f77772
Merge pull request #711 from ever-co/develop
evereq ecedb14
Merge pull request #713 from ever-co/develop
evereq 86a8348
Merge pull request #715 from ever-co/develop
evereq 6c95f92
Merge pull request #722 from ever-co/develop
evereq 707aa52
Merge pull request #725 from ever-co/develop
evereq 0256097
Merge pull request #728 from ever-co/develop
evereq 4b0c136
Merge pull request #736 from ever-co/develop
evereq 2f245d1
Merge pull request #742 from ever-co/develop
evereq 582de3c
Merge pull request #749 from ever-co/develop
evereq 0121b40
Merge pull request #751 from ever-co/develop
evereq ec3e116
Merge pull request #757 from ever-co/develop
evereq d91886b
Merge pull request #759 from ever-co/develop
evereq 376ab0e
Merge pull request #761 from ever-co/develop
evereq 552009f
Merge pull request #763 from ever-co/develop
evereq cdb5157
Merge pull request #768 from ever-co/develop
evereq 6f21b06
Merge pull request #770 from ever-co/develop
evereq 172e6d7
Merge pull request #772 from ever-co/develop
evereq aa7d11a
Merge pull request #779 from ever-co/develop
evereq 8aabe06
Merge pull request #782 from ever-co/develop
evereq 0e98069
Merge pull request #787 from ever-co/develop
evereq 8e1ec1b
Merge pull request #789 from ever-co/develop
evereq c437375
Merge pull request #791 from ever-co/develop
evereq 6e18779
Merge pull request #796 from ever-co/develop
evereq cdb12e7
Merge pull request #799 from ever-co/develop
evereq 8acb6d5
Merge pull request #801 from ever-co/develop
evereq 19e7a42
Merge pull request #806 from ever-co/develop
evereq 1f951d5
Merge pull request #809 from ever-co/develop
evereq fcb6b15
Merge pull request #816 from ever-co/develop
evereq a3a8fbe
Merge pull request #818 from ever-co/develop
evereq 295ac8f
Merge pull request #821 from ever-co/develop
evereq ead56ec
Merge pull request #827 from ever-co/develop
evereq f91c37d
Merge pull request #829 from ever-co/develop
evereq 83d64dc
Merge pull request #832 from ever-co/develop
evereq 1ade8bb
Merge pull request #836 from ever-co/develop
evereq dccb326
Merge pull request #839 from ever-co/develop
evereq 6779c51
Merge pull request #842 from ever-co/develop
evereq a5f1f4d
Merge pull request #845 from ever-co/develop
evereq e973eb4
Merge pull request #851 from ever-co/develop
evereq d63aee2
Merge pull request #855 from ever-co/develop
evereq 7be6b42
Merge pull request #857 from ever-co/develop
evereq 58b31af
Merge pull request #860 from ever-co/develop
evereq a12c757
Merge pull request #865 from ever-co/develop
evereq a6b4dcf
Merge pull request #869 from ever-co/develop
evereq 0cb8e34
Merge pull request #874 from ever-co/develop
evereq 6d80531
Merge pull request #877 from ever-co/develop
evereq 5d04e37
Merge pull request #895 from ever-co/develop
evereq 1bc2eb9
Merge pull request #897 from ever-co/develop
evereq 02b786e
Merge pull request #899 from ever-co/develop
evereq 9a408d1
Merge pull request #917 from ever-co/develop
evereq e17eef9
Merge pull request #929 from ever-co/develop
evereq 1caefe7
Merge pull request #941 from ever-co/develop
evereq 7d9be39
Merge pull request #943 from ever-co/develop
evereq 1a04188
Merge pull request #945 from ever-co/develop
evereq 1e53855
Merge pull request #949 from ever-co/develop
evereq b3f0b00
Merge pull request #955 from ever-co/develop
evereq 0935530
Merge pull request #969 from ever-co/develop
evereq c9579cb
Merge pull request #971 from ever-co/develop
evereq f4bd753
Merge pull request #979 from ever-co/develop
evereq bccac9a
Merge pull request #982 from ever-co/develop
evereq d735406
Merge pull request #984 from ever-co/develop
evereq 8e22a0e
Merge pull request #989 from ever-co/develop
evereq 3915392
Merge pull request #997 from ever-co/develop
evereq aaffbb2
Merge pull request #1000 from ever-co/develop
evereq 994ed59
Merge pull request #1002 from ever-co/develop
evereq 1e77f19
Merge pull request #1008 from ever-co/develop
evereq fbe04fa
Merge pull request #1016 from ever-co/develop
evereq d5976b3
Merge pull request #1018 from ever-co/develop
evereq de22782
Merge pull request #1023 from ever-co/develop
evereq 265546d
Merge pull request #1025 from ever-co/develop
evereq 243ffba
Merge pull request #1026 from ever-co/develop
evereq 7c52a99
Merge pull request #1031 from ever-co/develop
evereq 7c8740d
Merge pull request #1035 from ever-co/develop
evereq bf9a57c
Merge pull request #1037 from ever-co/develop
evereq fa9bc97
Merge pull request #1048 from ever-co/develop
evereq 43e5134
Merge pull request #1054 from ever-co/develop
evereq e1e0df3
Merge pull request #1055 from ever-co/develop
evereq a68a9e4
Merge pull request #1070 from ever-co/develop
evereq faa8f9f
Merge pull request #1093 from ever-co/develop
evereq c7ab22a
Merge pull request #1096 from ever-co/develop
evereq 5caeedd
Merge pull request #1101 from ever-co/develop
evereq 6ed9743
Merge pull request #1114 from ever-co/develop
evereq f271adf
Merge pull request #1115 from ever-co/develop
evereq 30d70dc
Merge pull request #1119 from ever-co/develop
evereq 2d83f15
Merge pull request #1126 from ever-co/develop
evereq 6a96274
Merge pull request #1136 from ever-co/develop
evereq 661a017
Merge pull request #1139 from ever-co/develop
evereq d20d6d3
Merge pull request #1141 from ever-co/develop
evereq d066e20
Merge pull request #1145 from ever-co/develop
evereq 0c3fc37
Merge pull request #1149 from ever-co/develop
evereq 5b0b655
Merge pull request #1153 from ever-co/develop
evereq 3860e93
Merge pull request #1155 from ever-co/develop
evereq a34a750
Merge pull request #1158 from ever-co/develop
evereq 184a371
Merge pull request #1161 from ever-co/develop
evereq 5325b52
Merge pull request #1187 from ever-co/develop
evereq 87d865b
Merge pull request #1196 from ever-co/develop
evereq d69147e
Merge pull request #1200 from ever-co/develop
evereq 7071f17
Merge pull request #1207 from ever-co/develop
evereq 122225e
Merge pull request #1215 from ever-co/develop
evereq e010ed0
Merge pull request #1219 from ever-co/develop
evereq 3632411
Merge pull request #1220 from ever-co/develop
evereq 092bae3
Merge pull request #1224 from ever-co/develop
evereq f84e97f
Merge pull request #1229 from ever-co/develop
evereq 47cbbdf
Merge pull request #1231 from ever-co/develop
evereq e41fc96
Merge pull request #1233 from ever-co/develop
evereq b96be1a
Merge pull request #1240 from ever-co/develop
evereq 87ce427
Merge pull request #1242 from ever-co/develop
evereq 3bebeec
Merge pull request #1256 from ever-co/develop
evereq 69df61d
Merge pull request #1257 from ever-co/develop
evereq 068f648
Merge pull request #1259 from ever-co/develop
evereq 21c1370
Merge pull request #1264 from ever-co/develop
evereq 0410cb3
Merge pull request #1269 from ever-co/develop
evereq 40d0103
Merge pull request #1275 from ever-co/develop
evereq 41066f6
Merge pull request #1285 from ever-co/develop
evereq 1fda32c
Merge pull request #1287 from ever-co/develop
evereq 656806b
Merge pull request #1289 from ever-co/develop
evereq 669a603
Merge pull request #1296 from ever-co/develop
evereq 857f5d2
Merge pull request #1299 from ever-co/develop
evereq eaf8daa
Merge pull request #1300 from ever-co/develop
evereq 1ca91b4
Merge pull request #1322 from ever-co/develop
evereq 1142b85
Merge pull request #1323 from ever-co/develop
evereq 00030ad
Merge pull request #1327 from ever-co/develop
evereq e387d91
Merge pull request #1329 from ever-co/develop
evereq 26d2658
Merge pull request #1332 from ever-co/develop
evereq b946969
Merge pull request #1335 from ever-co/develop
evereq b5a1138
Merge pull request #1343 from ever-co/develop
evereq 390f381
Merge pull request #1347 from ever-co/develop
evereq 1f5424e
Merge pull request #1357 from ever-co/develop
evereq a7f59e2
Merge pull request #1363 from ever-co/develop
evereq 9fabcd8
Merge pull request #1378 from ever-co/develop
evereq 8b07db6
Merge pull request #1380 from ever-co/develop
evereq d5bf3eb
Merge pull request #1384 from ever-co/develop
evereq 2092fab
Merge pull request #1387 from ever-co/develop
evereq 2b1cedd
Merge pull request #1399 from ever-co/develop
evereq 0ec39ce
Merge pull request #1401 from ever-co/develop
evereq c69ba06
Merge pull request #1406 from ever-co/develop
evereq 7b827fc
Merge pull request #1414 from ever-co/develop
evereq e08a52f
Merge pull request #1423 from ever-co/develop
evereq f22c6c1
Merge pull request #1428 from ever-co/develop
evereq 38f7c7a
Merge pull request #1432 from ever-co/develop
evereq 80b0090
Merge pull request #1440 from ever-co/develop
evereq b075acb
Merge pull request #1453 from ever-co/develop
evereq cc537c9
Merge pull request #1458 from ever-co/develop
evereq ed82094
Merge pull request #1460 from ever-co/develop
evereq 64dd534
Merge pull request #1464 from ever-co/develop
evereq 718b59d
Merge pull request #1467 from ever-co/develop
evereq a4717eb
Merge pull request #1479 from ever-co/develop
evereq 28c6c2f
Merge pull request #1492 from ever-co/develop
evereq 52445c6
Merge pull request #1503 from ever-co/develop
evereq 38b91bf
Merge pull request #1507 from ever-co/develop
evereq 16d67f3
Merge pull request #1511 from ever-co/develop
evereq 781ee8e
Merge pull request #1516 from ever-co/develop
evereq c595b81
Merge pull request #1555 from ever-co/develop
evereq a397bea
Merge pull request #1561 from ever-co/develop
evereq 347685b
Merge pull request #1573 from ever-co/develop
evereq 263bc6f
Merge pull request #1585 from ever-co/develop
evereq fd8c4f6
Merge pull request #1594 from ever-co/develop
evereq 3e397a4
Merge pull request #1609 from ever-co/develop
evereq 50ec78c
Merge pull request #1616 from ever-co/develop
evereq e225b62
Merge pull request #1632 from ever-co/develop
evereq 8dc323c
[feat] add table view for issues
YehualashetGit 74e112c
Merge branch 'develop' of github.com:ever-co/ever-teams into feat/tab…
YehualashetGit 8a888ec
fix ts lint error and refactor team member table view
YehualashetGit b2c45ee
* add footer to team table view
YehualashetGit 0357b5b
* fix lint issue
YehualashetGit 60d15f7
Merge branch 'develop' of github.com:ever-co/ever-teams into feat/tab…
YehualashetGit 6d7b216
address review comment
YehualashetGit 74ea0c2
address review comment
YehualashetGit 9622285
fix ui related issue
YehualashetGit ca61b94
fix: Background color
badalkhatri0924 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
import React from 'react'; | ||
import { | ||
ColumnDef, | ||
ColumnFiltersState, | ||
SortingState, | ||
VisibilityState, | ||
flexRender, | ||
getCoreRowModel, | ||
getFacetedRowModel, | ||
getFacetedUniqueValues, | ||
getFilteredRowModel, | ||
getPaginationRowModel, | ||
getSortedRowModel, | ||
useReactTable, | ||
} from "@tanstack/react-table" | ||
|
||
import { | ||
Table, | ||
TableHeader, | ||
TableRow, | ||
TableHead, | ||
TableCell, | ||
TableBody, | ||
TableFooter, | ||
} from './table'; | ||
|
||
interface DataTableProps<TData, TValue> { | ||
columns: ColumnDef<TData, TValue>[] | ||
data: TData[], | ||
footerRows?: React.ReactNode[], | ||
isError?: boolean; | ||
noResultsMessage?: { | ||
heading: string; | ||
content: string; | ||
} | ||
} | ||
|
||
function DataTable<TData, TValue>({ | ||
columns, | ||
data, | ||
footerRows, | ||
}: DataTableProps<TData, TValue>) { | ||
|
||
const [rowSelection, setRowSelection] = React.useState({}) | ||
const [columnVisibility, setColumnVisibility] = | ||
React.useState<VisibilityState>({}) | ||
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>( | ||
[] | ||
) | ||
const [sorting, setSorting] = React.useState<SortingState>([]) | ||
|
||
const table = useReactTable({ | ||
data, | ||
columns, | ||
state: { | ||
sorting, | ||
columnVisibility, | ||
rowSelection, | ||
columnFilters, | ||
}, | ||
enableRowSelection: true, | ||
onRowSelectionChange: setRowSelection, | ||
onSortingChange: setSorting, | ||
onColumnFiltersChange: setColumnFilters, | ||
onColumnVisibilityChange: setColumnVisibility, | ||
getCoreRowModel: getCoreRowModel(), | ||
getFilteredRowModel: getFilteredRowModel(), | ||
getPaginationRowModel: getPaginationRowModel(), | ||
getSortedRowModel: getSortedRowModel(), | ||
getFacetedRowModel: getFacetedRowModel(), | ||
getFacetedUniqueValues: getFacetedUniqueValues(), | ||
}) | ||
|
||
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 className="divide-y divide-gray-200"> | ||
{table.getRowModel().rows?.length ? ( | ||
table.getRowModel().rows.map((row) => ( | ||
<TableRow | ||
key={row.id} | ||
data-state={row.getIsSelected() && "selected"} | ||
className="mb-4 border-b border-gray-200" | ||
> | ||
{row.getVisibleCells().map((cell) => ( | ||
<TableCell key={cell.id}> | ||
{flexRender( | ||
cell.column.columnDef.cell, | ||
cell.getContext() | ||
)} | ||
</TableCell> | ||
))} | ||
</TableRow> | ||
)) | ||
) : ( | ||
<TableRow> | ||
<TableCell | ||
colSpan={columns.length} | ||
className="h-24 text-center" | ||
> | ||
No results. | ||
</TableCell> | ||
</TableRow> | ||
)} | ||
</TableBody> | ||
{ | ||
footerRows && footerRows?.length > 0 && ( | ||
<TableFooter className='bg-gray-50 dark:bg-gray-800'> | ||
{footerRows.map((row, index) => ( | ||
<TableRow key={`footer-row-${index}}`}>{row}</TableRow> | ||
))} | ||
</TableFooter> | ||
) | ||
} | ||
|
||
</Table> | ||
); | ||
} | ||
|
||
export default DataTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import * as React from "react" | ||
|
||
import { cn } from "lib/utils" | ||
|
||
const Table = React.forwardRef< | ||
HTMLTableElement, | ||
React.HTMLAttributes<HTMLTableElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div className="relative w-full overflow-auto"> | ||
<table | ||
ref={ref} | ||
className={cn("w-full caption-bottom text-sm", className)} | ||
{...props} | ||
/> | ||
</div> | ||
)) | ||
Table.displayName = "Table" | ||
|
||
const TableHeader = React.forwardRef< | ||
HTMLTableSectionElement, | ||
React.HTMLAttributes<HTMLTableSectionElement> | ||
>(({ className, ...props }, ref) => ( | ||
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} /> | ||
)) | ||
TableHeader.displayName = "TableHeader" | ||
|
||
const TableBody = React.forwardRef< | ||
HTMLTableSectionElement, | ||
React.HTMLAttributes<HTMLTableSectionElement> | ||
>(({ className, ...props }, ref) => ( | ||
<tbody | ||
ref={ref} | ||
className={cn("[&_tr:last-child]:border-0", className)} | ||
{...props} | ||
/> | ||
)) | ||
TableBody.displayName = "TableBody" | ||
|
||
const TableFooter = React.forwardRef< | ||
HTMLTableSectionElement, | ||
React.HTMLAttributes<HTMLTableSectionElement> | ||
>(({ className, ...props }, ref) => ( | ||
<tfoot | ||
ref={ref} | ||
className={cn("bg-primary font-medium text-primary-foreground", className)} | ||
{...props} | ||
/> | ||
)) | ||
TableFooter.displayName = "TableFooter" | ||
|
||
const TableRow = React.forwardRef< | ||
HTMLTableRowElement, | ||
React.HTMLAttributes<HTMLTableRowElement> | ||
>(({ className, ...props }, ref) => ( | ||
<tr | ||
ref={ref} | ||
className={cn( | ||
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
TableRow.displayName = "TableRow" | ||
|
||
const TableHead = React.forwardRef< | ||
HTMLTableCellElement, | ||
React.ThHTMLAttributes<HTMLTableCellElement> | ||
>(({ className, ...props }, ref) => ( | ||
<th | ||
ref={ref} | ||
className={cn( | ||
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
TableHead.displayName = "TableHead" | ||
|
||
const TableCell = React.forwardRef< | ||
HTMLTableCellElement, | ||
React.TdHTMLAttributes<HTMLTableCellElement> | ||
>(({ className, ...props }, ref) => ( | ||
<td | ||
ref={ref} | ||
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)} | ||
{...props} | ||
/> | ||
)) | ||
TableCell.displayName = "TableCell" | ||
|
||
const TableCaption = React.forwardRef< | ||
HTMLTableCaptionElement, | ||
React.HTMLAttributes<HTMLTableCaptionElement> | ||
>(({ className, ...props }, ref) => ( | ||
<caption | ||
ref={ref} | ||
className={cn("mt-4 text-sm text-muted-foreground", className)} | ||
{...props} | ||
/> | ||
)) | ||
TableCaption.displayName = "TableCaption" | ||
|
||
export { | ||
Table, | ||
TableHeader, | ||
TableBody, | ||
TableFooter, | ||
TableHead, | ||
TableRow, | ||
TableCell, | ||
TableCaption, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { useTeamMemberCard, useTMCardTaskEdit, useCollaborative } from "@app/hooks"; | ||
import { OT_Member } from "@app/interfaces"; | ||
import { clsxm } from "@app/utils"; | ||
import { InputField } from "lib/components"; | ||
import { TaskTimes } from "./task/task-times"; | ||
import { TaskEstimateInfo } from "./team/user-team-card/task-estimate"; | ||
import { TaskInfo } from "./team/user-team-card/task-info"; | ||
import { UserInfo } from "./team/user-team-card/user-info"; | ||
import { UserTeamCardMenu } from "./team/user-team-card/user-team-card-menu"; | ||
import React from "react"; | ||
import get from "lodash/get"; | ||
|
||
|
||
export function TaskCell({ row }: { row: any }) { | ||
const member = row.original as OT_Member; | ||
const memberInfo = useTeamMemberCard(member); | ||
const taskEdition = useTMCardTaskEdit(memberInfo?.memberTask); | ||
const publicTeam = false; | ||
|
||
return ( | ||
<TaskInfo | ||
edition={taskEdition} | ||
memberInfo={memberInfo} | ||
className="2xl:w-80 3xl:w-[32rem] w-1/5 lg:px-4 px-2" | ||
publicTeam={publicTeam} | ||
/> | ||
); | ||
} | ||
|
||
export function UserInfoCell({ cell }: { cell: any}) { | ||
const row = get(cell, 'row', {}); | ||
const member = row.original as OT_Member; | ||
const publicTeam = get(cell, 'column.columnDef.meta.publicTeam', false); | ||
const memberInfo = useTeamMemberCard(member); | ||
|
||
return ( | ||
<UserInfo | ||
memberInfo={memberInfo} | ||
className="2xl:w-[20.625rem] w-1/4" | ||
publicTeam={publicTeam} | ||
/> | ||
); | ||
} | ||
|
||
export function WorkedOnTaskCell({ row }: { row: any }) { | ||
const member = row.original as OT_Member; | ||
const memberInfo = useTeamMemberCard(member); | ||
|
||
return ( | ||
<TaskTimes | ||
activeAuthTask={true} | ||
memberInfo={memberInfo} | ||
task={memberInfo?.memberTask} | ||
isAuthUser={memberInfo?.isAuthUser} | ||
className="2xl:w-48 3xl:w-[12rem] w-1/5 lg:px-4 px-2 flex flex-col gap-y-[1.125rem] justify-center" | ||
/> | ||
); | ||
} | ||
|
||
export function TaskEstimateInfoCell({ row }: { row: any }) { | ||
const member = row.original as OT_Member; | ||
const memberInfo = useTeamMemberCard(member); | ||
const taskEdition = useTMCardTaskEdit(memberInfo?.memberTask); | ||
|
||
return ( | ||
<TaskEstimateInfo | ||
memberInfo={memberInfo} | ||
edition={taskEdition} | ||
activeAuthTask={true} | ||
className="lg:px-3 2xl:w-52 3xl:w-64 w-1/5" | ||
/> | ||
); | ||
} | ||
|
||
export function ActionMenuCell ({ cell }: { cell: any}) { | ||
const row = get(cell, 'row', {}); | ||
const member = row.original as OT_Member; | ||
const active = get(cell, 'column.columnDef.meta.active', false); | ||
const memberInfo = useTeamMemberCard(member); | ||
|
||
const { collaborativeSelect, user_selected, onUserSelect } = useCollaborative( | ||
memberInfo.memberUser | ||
); | ||
const taskEdition = useTMCardTaskEdit(memberInfo.memberTask); | ||
|
||
return ( | ||
<> | ||
{(!collaborativeSelect || active) && ( | ||
<UserTeamCardMenu memberInfo={memberInfo} edition={taskEdition} /> | ||
)} | ||
|
||
{collaborativeSelect && !active && ( | ||
<InputField | ||
type="checkbox" | ||
checked={user_selected()} | ||
className={clsxm( | ||
'border-none w-4 h-4 mr-1 accent-primary-light', | ||
'border-2 border-primary-light' | ||
)} | ||
noWrapper={true} | ||
onChange={onUserSelect} | ||
/> | ||
)} | ||
</> | ||
); | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YehualashetGit Maybe let's rename this to "IssuesView"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure I will rename that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I think values should be:
CARDS, TABLE, and BLOCKS, please adjust @YehualashetGit :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure