Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Datahub
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ICAT
Datahub
Commits
a8e04ed2
Commit
a8e04ed2
authored
Sep 01, 2020
by
Loic Huder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Investigations now match when the selected date for filtering is between the start and the end
parent
5d032476
Pipeline
#32445
passed with stage
in 3 minutes and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
src/components/Investigation/InvestigationDateFilter.js
src/components/Investigation/InvestigationDateFilter.js
+4
-1
src/components/Investigation/InvestigationTable.js
src/components/Investigation/InvestigationTable.js
+16
-7
No files found.
src/components/Investigation/InvestigationDateFilter.js
View file @
a8e04ed2
...
...
@@ -13,11 +13,14 @@ function InvestigationDateFilter(props) {
<
DayPickerInput
inputProps
=
{{
className
:
styles
.
dateFilterInput
}}
value
=
{
value
}
placeholder
=
"
Filter by
start
date
"
placeholder
=
"
Filter by date
"
format
=
{
INVESTIGATION_DATE_FORMAT
}
formatDate
=
{
formatDate
}
parseDate
=
{
parseDate
}
onDayChange
=
{
onDayChange
}
dayPickerProps
=
{{
todayButton
:
'
Today
'
,
}}
/
>
<
Button
disabled
=
{
!
value
}
...
...
src/components/Investigation/InvestigationTable.js
View file @
a8e04ed2
...
...
@@ -231,7 +231,7 @@ function getColumns(props) {
function
InvestigationTable
(
props
)
{
const
{
expanded
,
user
,
investigations
}
=
props
;
const
[
dateFilter
,
setDateFilter
]
=
useState
();
const
[
selectedDate
,
setSelectedDate
]
=
useState
();
const
expandRow
=
{
showExpandColumn
:
true
,
...
...
@@ -265,20 +265,29 @@ function InvestigationTable(props) {
),
};
function
dateFilter
(
investigation
)
{
return
investigation
.
endDate
?
selectedDate
.
isBetween
(
investigation
.
startDate
,
investigation
.
endDate
,
'
day
'
,
'
[]
'
)
:
selectedDate
.
isSame
(
investigation
.
startDate
,
'
day
'
);
}
return
(
<>
<
div
className
=
{
styles
.
wrapper
}
>
<
InvestigationDateFilter
rootClassName
=
{
styles
.
filter
}
value
=
{
dateFilter
&&
dateFilter
.
toDate
()}
onDayChange
=
{(
date
)
=>
set
DateFilter
(
moment
(
date
))}
onClear
=
{()
=>
set
DateFilter
(
undefined
)}
value
=
{
selectedDate
&&
selectedDate
.
toDate
()}
onDayChange
=
{(
date
)
=>
set
SelectedDate
(
moment
(
date
))}
onClear
=
{()
=>
set
SelectedDate
(
undefined
)}
/
>
<
/div
>
<
ResponsiveTable
data
=
{
investigations
.
filter
(
(
inv
)
=>
!
dateFilter
||
dateFilter
.
isSame
(
inv
.
startDate
,
'
day
'
)
)}
data
=
{
selectedDate
?
investigations
.
filter
(
dateFilter
)
:
investigations
}
columns
=
{
getColumns
(
props
)}
expandRow
=
{
expandRow
}
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment