Skip to content

Commit

Permalink
Merge pull request #444 from lsst-ts/tickets/LOVE-168
Browse files Browse the repository at this point in the history
Remove OLE commented code
  • Loading branch information
sebastian-aranda authored Apr 10, 2023
2 parents 3a281ea + 4782065 commit 57706a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 54 deletions.
41 changes: 1 addition & 40 deletions love/src/components/OLE/Exposure/ExposureAdd.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
EXPOSURE_FLAG_OPTIONS /* LOG_TYPE_OPTIONS */,
exposureFlagStateToStyle,
ISO_INTEGER_DATE_FORMAT,
} from 'Config';
import { EXPOSURE_FLAG_OPTIONS, exposureFlagStateToStyle, ISO_INTEGER_DATE_FORMAT } from 'Config';
import ManagerInterface from 'Utils';
import lodash from 'lodash';
import Moment from 'moment';
Expand Down Expand Up @@ -217,11 +213,6 @@ export default class ExposureAdd extends Component {
const back = this.props.back;
const view = this.props.view ?? ExposureAdd.defaultProps.view;

// Uncomment next code block to use several level options
// const selectedCommentType = this.state.newMessage?.level
// ? LOG_TYPE_OPTIONS.find((type) => type.value === this.state.newMessage.level)
// : null;

return (
<>
{!isLogCreate && !isMenu ? (
Expand Down Expand Up @@ -252,21 +243,6 @@ export default class ExposureAdd extends Component {
small
/>
</span>
{/* Uncomment next code block to use several level options */}
{/* <span className={styles.label}>Type of Comment</span>
<span className={styles.value}>
<Select
option={selectedCommentType}
onChange={({ value }) =>
this.setState((prevState) => ({
newMessage: { ...prevState.newMessage, level: value },
}))
}
options={LOG_TYPE_OPTIONS}
className={styles.select}
small
/>
</span> */}

<span className={[styles.label, styles.paddingTop].join(' ')}>Obs. day</span>
<span className={styles.value}>
Expand Down Expand Up @@ -347,21 +323,6 @@ export default class ExposureAdd extends Component {
small
/>
</span>
{/* Uncomment next code block to use several level options */}
{/* <span className={styles.label}>Type of Comment</span>
<span className={styles.value}>
<Select
option={selectedCommentType}
onChange={({ value }) =>
this.setState((prevState) => ({
newMessage: { ...prevState.newMessage, level: value },
}))
}
options={LOG_TYPE_OPTIONS}
className={styles.select}
small
/>
</span> */}

<DateTime
label="Observation day"
Expand Down
15 changes: 1 addition & 14 deletions love/src/components/OLE/Exposure/ExposureDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { EXPOSURE_FLAG_OPTIONS } from 'Config';
import Input from 'components/GeneralPurpose/Input/Input';
import Button from 'components/GeneralPurpose/Button/Button';
import Select from 'components/GeneralPurpose/Select/Select';
import DateTimeRange from 'components/GeneralPurpose/DateTimeRange/DateTimeRange';
import Hoverable from 'components/GeneralPurpose/Hoverable/Hoverable';
import MessageDetail from './Message/MessageDetail';
import MessageEdit from './Message/MessageEdit';
Expand Down Expand Up @@ -170,18 +169,14 @@ export default class ExposureDetail extends Component {
filteredLogMessages =
selectedUser !== 'All' ? logMessages.filter((log) => log.user_id === selectedUser) : filteredLogMessages;

// Filter by date range
// const range = moment.range(this.state.selectedDateStart, this.state.selectedDateEnd);
// filteredLogMessages = filteredLogMessages.filter((log) => range.contains(Moment(log.date_added)));

// Filter by text
filteredLogMessages = filteredLogMessages.filter((log) => {
return log.message_text.includes(this.state.textFilter) || log.id.includes(this.state.textFilter);
});

// Obtain headers to create csv report
let csvHeaders = null;
let csvData = "There aren't logs created for the current search...";
let csvData = "There aren't logs created for the current search...";
if (filteredLogMessages.length > 0) {
const logExampleKeys = Object.keys(filteredLogMessages?.[0] ?? {});
csvHeaders = logExampleKeys.map((key) => ({ label: key, key }));
Expand Down Expand Up @@ -241,14 +236,6 @@ export default class ExposureDetail extends Component {
className={styles.select}
/>

{/* <DateTimeRange
className={styles.dateRange}
onChange={(date, type) => this.handleDateTimeRange(date, type)}
label="Date & Time"
startDate={new Date() - 24 * 60 * 60 * 1000}
endDate={new Date(Date.now() + 37 * 1000)}
/> */}

<Input
type="text"
value={this.state.textFilter}
Expand Down

0 comments on commit 57706a9

Please sign in to comment.