Commit 4aeedb65 authored by Alejandro De Maria Antolinos's avatar 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
......@@ -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>
);
};
......
......@@ -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>
......
......@@ -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}`
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment