Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ICAT
Datahub
Commits
4aeedb65
Commit
4aeedb65
authored
Jun 09, 2021
by
Alejandro De Maria Antolinos
Browse files
Merge branch 'milestone-fix-sort' into 'milestone-logbook-search-settings'
fix sort and hide autorefresh See merge request
!520
parents
f472a043
8f68b6e5
Pipeline
#48271
passed with stage
in 3 minutes and 40 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/Logbook/List/Event.js
View file @
4aeedb65
...
...
@@ -35,15 +35,17 @@ function Event(props) {
const
page
=
event
.
meta
.
search
?
event
.
meta
.
search
.
page
:
event
.
meta
.
page
.
currentPage
;
const
eventCreationDate
=
moment
(
getOriginalEvent
(
event
).
creationDate
);
return
(
<
a
href
=
{
`events?page=
${
page
}
#
${
event
.
_id
}
`
}
style
=
{{
fontWeight
:
'
bold
'
}}
className
=
"
text-muted
"
>
{
moment
(
getOriginalEvent
(
event
).
creationDate
).
format
(
moment
.
HTML5_FMT
.
TIME_SECONDS
title
=
{
eventCreationDate
.
format
(
moment
.
HTML5_FMT
.
DATETIME_LOCAL_SECONDS
)}
>
{
eventCreationDate
.
format
(
moment
.
HTML5_FMT
.
TIME_SECONDS
)}
<
/a
>
);
};
...
...
src/components/Logbook/Menu/SettingLogbookMenuPanel.js
View file @
4aeedb65
...
...
@@ -133,53 +133,57 @@ export default function SettingLogbookMenuPanel(props) {
<
/Row
>
<
/Grid
>
<
/Col
>
<
Col
md
=
{
2
}
sm
=
{
6
}
xs
=
{
12
}
>
<
h4
>
Display
<
/h4
>
<
Grid
>
{
!
isReleased
&&
(
<
Row
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
Switch
onColor
=
{
toggleColor
}
onChange
=
{()
=>
{
dispatch
(
setAutomaticRefresh
(
!
automaticRefresh
));
}}
checked
=
{
automaticRefresh
}
width
=
{
switchWidth
}
height
=
{
switchHeight
}
className
=
{
styles
.
logbookSwitch
}
/
>
<
/Col
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
div
className
=
{
styles
.
logbookTextSwitch
}
>
Auto
refresh
logs
<
/div
>
<
/Col
>
<
/Row
>
)}
{
isCommandLineDisplayed
()
&&
(
<
Row
style
=
{{
marginTop
:
16
}}
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
Switch
onColor
=
{
toggleColor
}
onChange
=
{()
=>
{
dispatch
(
setAutomaticCollapsing
(
!
automaticCollapsing
));
}}
checked
=
{
automaticCollapsing
}
width
=
{
switchWidth
}
height
=
{
switchHeight
}
className
=
{
styles
.
logbookSwitch
}
/
>
<
/Col
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
div
className
=
{
styles
.
logbookTextSwitch
}
>
Group
together
command
lines
<
/div
>
<
/Col
>
<
/Row
>
)}
<
/Grid
>
<
/Col
>
{
isCommandLineDisplayed
()
&&
(
<
Col
md
=
{
2
}
sm
=
{
6
}
xs
=
{
12
}
>
<
h4
>
Display
<
/h4
>
<
Grid
>
{
!
isReleased
&&
false
&&
(
<
Row
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
Switch
onColor
=
{
toggleColor
}
onChange
=
{()
=>
{
dispatch
(
setAutomaticRefresh
(
!
automaticRefresh
));
}}
checked
=
{
automaticRefresh
}
width
=
{
switchWidth
}
height
=
{
switchHeight
}
className
=
{
styles
.
logbookSwitch
}
/
>
<
/Col
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
div
className
=
{
styles
.
logbookTextSwitch
}
>
Auto
refresh
logs
<
/div
>
<
/Col
>
<
/Row
>
)}
{
isCommandLineDisplayed
()
&&
(
<
Row
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
Switch
onColor
=
{
toggleColor
}
onChange
=
{()
=>
{
dispatch
(
setAutomaticCollapsing
(
!
automaticCollapsing
)
);
}}
checked
=
{
automaticCollapsing
}
width
=
{
switchWidth
}
height
=
{
switchHeight
}
className
=
{
styles
.
logbookSwitch
}
/
>
<
/Col
>
<
Col
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
>
<
div
className
=
{
styles
.
logbookTextSwitch
}
>
Group
together
command
lines
<
/div
>
<
/Col
>
<
/Row
>
)}
<
/Grid
>
<
/Col
>
)}
<
Col
md
=
{
2
}
sm
=
{
6
}
xs
=
{
12
}
>
<
h4
>
Sort
<
/h4
>
<
Grid
>
...
...
src/containers/EventsPage.js
View file @
4aeedb65
...
...
@@ -17,12 +17,7 @@ import EventListMenu from '../components/Logbook/Menu/EventListMenu';
import
NewOrEditEventPanel
from
'
../components/Logbook/NewOrEditEventPanel
'
;
import
OverlayBox
from
'
../components/Logbook/OverlayBox
'
;
const
{
EVENTS_PER_PAGE
,
EVENTS_PER_DOWNLOAD
,
SORT_EVENTS_BY
,
SORTING_ORDER
,
}
=
UI
.
logbook
;
const
{
EVENTS_PER_PAGE
,
EVENTS_PER_DOWNLOAD
,
SORT_EVENTS_BY
}
=
UI
.
logbook
;
function
EventsPage
()
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
@@ -60,7 +55,7 @@ function EventsPage() {
skip
:
EVENTS_PER_PAGE
*
(
page
-
1
),
limit
:
EVENTS_PER_DOWNLOAD
,
sortBy
:
SORT_EVENTS_BY
,
sortOrder
:
SORTING_ORDER
,
sortOrder
:
isSortingLatestEventsFirst
?
-
1
:
1
,
search
,
types
:
categoryTypes
?.
map
((
cat
)
=>
cat
.
category
?
`
${
cat
.
type
}
-
${
cat
.
category
}
`
:
`
${
cat
.
type
}
`
...
...
Write
Preview
Supports
Markdown
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