-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcolumns.js
More file actions
61 lines (55 loc) · 1.21 KB
/
columns.js
File metadata and controls
61 lines (55 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import i18n from "../../../../i18n/index.js";
import { fullName } from "../../../../utils/users.js";
const { t } = i18n.global;
export default [
{
id: "type",
text: "t.type",
filter: true,
},
{
id: "name",
text: "t.name",
},
{
id: "created_by",
text: "t.createdBy",
filter: true,
filterFunction: (rowData) => (rowData ? fullName(rowData) : t("t.notSpecified")),
},
{
id: "lastupdate",
text: "t.modifiedOn",
sortable: true,
defaultSortOrder: "asc",
sortFunction: (a, b) => {
const dateA = new Date(a.updated_at);
const dateB = new Date(b.updated_at);
return dateA < dateB ? 1 : -1;
},
},
{
id: "location",
text: "t.location",
},
{
id: "size",
text: "t.size",
sortable: true,
defaultSortOrder: "asc",
},
{
id: "tags",
text: "FilesTable.headers.tags",
filter: true,
filterKey: "name",
},
{
id: "actions",
label: " ",
},
];
export const columnsXXL = ["type", "name", "created_by", "lastupdate", "size", "actions"];
export const columnsXL = ["name", "lastupdate", "size", "actions"];
export const columnsLG = ["name", "size", "actions"];
export const columnsMD = ["name", "actions"];