-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathfiles-dashboard.component.ts
103 lines (97 loc) · 2.38 KB
/
files-dashboard.component.ts
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import { Component, OnDestroy } from "@angular/core";
import { SciCatDataSource } from "../../shared/services/scicat.datasource";
import { ScicatDataService } from "../../shared/services/scicat-data-service";
import { ExportExcelService } from "../../shared/services/export-excel.service";
import { Column } from "shared/modules/shared-table/shared-table.module";
import { AppConfigService } from "app-config.service";
@Component({
selector: "app-files-dashboard",
templateUrl: "./files-dashboard.component.html",
styleUrls: ["./files-dashboard.component.scss"],
})
export class FilesDashboardComponent implements OnDestroy {
columns: Column[] = [
{
id: "dataFileList.path",
icon: "text_snippet",
label: "Filename",
canSort: true,
matchMode: "contains",
hideOrder: 1,
},
{
id: "dataFileList.size",
icon: "save",
label: "Size",
canSort: true,
matchMode: "greaterThan",
hideOrder: 2,
},
{
id: "dataFileList.time",
icon: "access_time",
label: "Created at",
format: "date medium",
canSort: true,
matchMode: "between",
sortDefault: "desc",
hideOrder: 3,
},
{
id: "dataFileList.uid",
icon: "person",
label: "UID",
canSort: true,
matchMode: "contains",
hideOrder: 4,
},
{
id: "dataFileList.gid",
icon: "group",
label: "GID",
canSort: true,
matchMode: "contains",
hideOrder: 5,
},
{
id: "ownerGroup",
icon: "group",
label: "Owner Group",
canSort: true,
matchMode: "contains",
hideOrder: 6,
},
{
id: "datasetId",
icon: "list",
label: "Dataset PID",
type: "dataseturl",
canSort: true,
matchMode: "contains",
hideOrder: 7,
},
];
tableDefinition = {
collection: "Origdatablocks",
columns: this.columns,
};
dataSource: SciCatDataSource;
constructor(
private appConfigService: AppConfigService,
private dataService: ScicatDataService,
private exportService: ExportExcelService,
) {
this.dataSource = new SciCatDataSource(
this.appConfigService,
this.dataService,
this.exportService,
this.tableDefinition,
);
}
ngOnDestroy() {
this.dataSource.disconnectExportData();
}
onRowClick(file: any) {
console.log("Row clicked:", file);
}
}