GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Panel settings of the logbook menu is now using categoryTypes

parent adf2752e
Pipeline #46545 passed with stage
in 3 minutes and 33 seconds
import PropTypes from 'prop-types';
import React, { useState } from 'react';
import { useHistory } from 'react-router';
import {
MenuItem,
Nav,
......@@ -43,6 +42,7 @@ function EventListMenu(props) {
activePage,
searchEvents,
onSortingButtonClicked,
categoryTypes,
} = props;
/**
......@@ -275,7 +275,9 @@ function EventListMenu(props) {
</Nav>
</Navbar.Collapse>
{isSettingsDisplayed && (
<SettingLogbookMenuPanel></SettingLogbookMenuPanel>
<SettingLogbookMenuPanel
categoryTypes={categoryTypes}
></SettingLogbookMenuPanel>
)}
</Navbar>
);
......
......@@ -49,6 +49,7 @@ export default function SettingLogbookMenuPanel() {
let found = true;
values.forEach((value) => {
if (
categoryTypes &&
categoryTypes.find(
(ct) => ct.type === value.type && ct.category === value.category
) == null
......
......@@ -13,15 +13,18 @@ import { useScrollToHash, useQuery } from '../helpers/hooks';
function EventsPage() {
const { investigationId } = useParams();
const categoryTypes = useSelector((state) => state.logbook.categoryTypes);
const investigation = useResource(InvestigationResource.detailShape(), {
id: investigationId,
});
const query = useQuery();
const page = query.get('page') || 1;
useScrollToHash({ milliseconds: 350, attempts: 50 });
/*
const criteria = query.get('criteria');
const search = query.get('search');
if (criteria && search) {
const a = criteria.split(',');
const b = search.split(',');
......@@ -31,8 +34,7 @@ function EventsPage() {
});
console.log(c);
}
useScrollToHash({ milliseconds: 350, attempts: 50 });
*/
const dispatch = useDispatch();
......@@ -45,14 +47,13 @@ function EventsPage() {
if (!investigation) {
return <PageNotFound />;
}
return (
<Grid fluid>
<Row>
<Col sm={12}>
<TabContainerMenu />
<LogbookContainer
//categoryTypes={categoryTypes}
categoryTypes={categoryTypes}
investigation={investigation}
page={page}
/>
......
......@@ -21,12 +21,6 @@ import {
LOGBOOK_CONTEXT_NAME_PROPOSAL,
NEW_EVENT_INVISIBLE,
NEW_EVENT_VISIBLE,
EVENT_CATEGORY_COMMANDLINE,
EVENT_CATEGORY_COMMENT,
EVENT_CATEGORY_DEBUG,
EVENT_CATEGORY_ERROR,
EVENT_CATEGORY_INFO,
NOTIFICATION,
} from '../../constants/eventTypes';
import { getSortingOrder, parseHTTPError } from '../../helpers/eventHelpers';
......@@ -50,7 +44,6 @@ export class LogbookContainerClass extends React.Component {
super(props);
const { page = 1, categoryTypes = [] } = props;
this.state = {
categoryTypes,
page,
......@@ -108,6 +101,7 @@ export class LogbookContainerClass extends React.Component {
forceReloadEventList,
filterType,
filterCategory,
categoryTypes,
} = this.state;
if (!isConfigValid(UI.logbook)) {
......@@ -145,6 +139,7 @@ export class LogbookContainerClass extends React.Component {
}}
>
<EventListMenu
categoryTypes={categoryTypes}
activePage={page}
isAutorefreshEnabled={autorefresh.isEnabled}
//availableTags={this.props.availableTags}
......
......@@ -5,7 +5,6 @@ import {
} from '../constants/actionTypes';
import {
ANNOTATION,
EVENT_CATEGORY_COMMANDLINE,
EVENT_CATEGORY_ERROR,
EVENT_CATEGORY_INFO,
NOTIFICATION,
......
Markdown is supported
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