Skip to content

Commit b76cde6

Browse files
authored
VADC-904 (#1519)
* add username to results table
1 parent c09e567 commit b76cde6

File tree

8 files changed

+55
-6
lines changed

8 files changed

+55
-6
lines changed

src/Analysis/GWASResults/TestData/TableData.js

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const TableData = [
33
uid: '123',
44
wf_name: 'User Added WF Name 1',
55
name: 'Workflow 1',
6+
gen3username: '[email protected]',
67
startedAt: '2022-02-15T13:00:00Z',
78
finishedAt: '2022-02-15T13:00:00Z',
89
phase: 'Pending',
@@ -12,6 +13,7 @@ const TableData = [
1213
uid: '456',
1314
wf_name: 'User Added WF Name 2',
1415
name: 'Workflow 2',
16+
gen3username: '[email protected]',
1517
startedAt: '2022-02-16T10:00:00Z',
1618
finishedAt: '2022-02-16T10:00:00Z',
1719
phase: 'Running',
@@ -21,6 +23,7 @@ const TableData = [
2123
uid: '789',
2224
wf_name: 'User Added WF Name 3',
2325
name: 'Workflow 3',
26+
gen3username: '[email protected]',
2427
startedAt: '2023-02-16T10:00:00Z',
2528
finishedAt: '2023-02-16T10:00:00Z',
2629
phase: 'Succeeded',

src/Analysis/GWASResults/Views/Home/Home.stories.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const getMockWorkflowList = () => {
7373
if (requestCount % 2 == 0) {
7474
workflowList.splice(0, 0, {
7575
name: 'argo-wrapper-workflow-' + createWorkflowNum(),
76+
gen3username: `${(requestCount*Math.E).toString(36).substr(2, 5)}@aol.com`,
7677
wf_name: 'User Added WF Name ' + requestCount,
7778
uid: 'uid-' + requestCount,
7879
phase: getMockPhase(requestCount/2),

src/Analysis/GWASResults/Views/Home/HomeTable/HomeTable.jsx

+30
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ const HomeTable = ({ data }) => {
5555
nameSearchTerm: event.target.value,
5656
});
5757
}
58+
if (searchTermKey === 'gen3username') {
59+
setHomeTableState({
60+
...homeTableState,
61+
currentPage: 1,
62+
userNameSearchTerm: event.target.value,
63+
});
64+
}
5865
if (searchTermKey === 'wf_name') {
5966
setHomeTableState({
6067
...homeTableState,
@@ -136,6 +143,29 @@ const HomeTable = ({ data }) => {
136143
},
137144
],
138145
},
146+
{
147+
title: 'User Name',
148+
dataIndex: 'gen3username',
149+
key: 'gen3username',
150+
show: homeTableState.columnManagement.showUserName,
151+
sorter: (a, b) => a.gen3username.localeCompare(b.gen3username),
152+
sortOrder:
153+
homeTableState.sortInfo?.columnKey === 'gen3username'
154+
&& homeTableState.sortInfo.order,
155+
children: [
156+
{
157+
title: (
158+
<Input
159+
placeholder='Search by User Name'
160+
value={homeTableState.userNameSearchTerm}
161+
onChange={(event) => handleSearchTermChange(event, 'gen3username')}
162+
suffix={<SearchOutlined />}
163+
/>
164+
),
165+
dataIndex: 'gen3username',
166+
},
167+
],
168+
},
139169
{
140170
title: 'Workflow name',
141171
dataIndex: 'wf_name',

src/Analysis/GWASResults/Views/Home/HomeTable/HomeTable.test.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('HomeTable component', () => {
3131
const formattedSubmittedTestDate = submittedTestDate.toLocaleDateString();
3232

3333
expect(screen.getAllByText(item.name)[0]).toBeInTheDocument();
34+
expect(screen.getAllByText(item.gen3username)[0]).toBeInTheDocument();
3435
expect(screen.getAllByText(item.wf_name)[0]).toBeInTheDocument();
3536
expect(
3637
screen.getAllByText(formattedFinishedTestDate)[0],

src/Analysis/GWASResults/Views/Home/HomeTable/tableDataProcessing/filterTableData.js

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ const filterTableData = (data, homeTableState) => {
2525
homeTableState.nameSearchTerm,
2626
);
2727
}
28+
if (homeTableState.userNameSearchTerm.length > 0) {
29+
filteredDataResult = filterBySearchTerm(
30+
filteredDataResult,
31+
'gen3username',
32+
homeTableState.userNameSearchTerm,
33+
);
34+
}
2835
if (homeTableState.wfNameSearchTerm.length > 0) {
2936
filteredDataResult = filterBySearchTerm(
3037
filteredDataResult,

src/Analysis/GWASResults/Views/Home/HomeTableState/DefaultColumnManagement.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const DefaultColumnManagement = {
22
showRunId: true,
3+
showUserName: true,
34
showWorkflowName: true,
45
showDateSubmitted: true,
56
showJobStatus: true,

src/Analysis/GWASResults/Views/Home/HomeTableState/InitialHomeTableState.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import DetermineInitialColumnManagement from './DetermineInitialColumnManagement
33

44
const InitialHomeTableState = {
55
nameSearchTerm: '',
6+
userNameSearchTerm: '',
67
wfNameSearchTerm: '',
78
submittedAtSelections: [],
89
finishedAtSelections: [],

src/Analysis/GWASResults/Views/Home/ManageColumns/ManageColumns.jsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const ManageColumns = () => {
2929

3030
const filteringResets = {
3131
runId: { nameSearchTerm: '' },
32+
userName: { userNameSearchTerm: '' },
3233
workflowName: { wfNameSearchTerm: '' },
3334
dateSubmitted: { submittedAtSelections: [] },
3435
jobStatus: { jobStatusSelections: [] },
@@ -95,30 +96,34 @@ const ManageColumns = () => {
9596
key: '1',
9697
},
9798
{
98-
label: columnSwitch('Workflow Name', 'showWorkflowName'),
99+
label: columnSwitch('User Name', 'showUserName'),
99100
key: '2',
100101
},
101102

102103
{
103-
label: columnSwitch('Date/Time Submitted', 'showDateSubmitted'),
104+
label: columnSwitch('Workflow Name', 'showWorkflowName'),
104105
key: '3',
105106
},
106107
{
107-
label: columnSwitch('Job Status', 'showJobStatus'),
108+
label: columnSwitch('Date/Time Submitted', 'showDateSubmitted'),
108109
key: '4',
109110
},
110111
{
111-
label: columnSwitch('Date/Time Finished', 'showDateFinished'),
112+
label: columnSwitch('Job Status', 'showJobStatus'),
112113
key: '5',
113114
},
114115
{
115-
label: columnSwitch('View Details', 'showViewDetails'),
116+
label: columnSwitch('Date/Time Finished', 'showDateFinished'),
116117
key: '6',
117118
},
118119
{
119-
label: columnSwitch('Actions', 'showActions'),
120+
label: columnSwitch('View Details', 'showViewDetails'),
120121
key: '7',
121122
},
123+
{
124+
label: columnSwitch('Actions', 'showActions'),
125+
key: '8',
126+
},
122127
];
123128

124129
return (

0 commit comments

Comments
 (0)