From bedfcb27c66fd113d0e6e422d46704d475324079 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 7 Feb 2023 15:44:48 -0300 Subject: [PATCH] Minor CSS adjustments and add callback to clean selected exposures when chaning instrument on the ExposureAdd component --- .../components/GeneralPurpose/FileUploader/FileUploader.jsx | 1 + .../GeneralPurpose/MultiSelect/MultiSelect.module.css | 2 +- love/src/components/OLE/Exposure/Exposure.module.css | 4 ++++ love/src/components/OLE/Exposure/ExposureAdd.jsx | 6 ++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/love/src/components/GeneralPurpose/FileUploader/FileUploader.jsx b/love/src/components/GeneralPurpose/FileUploader/FileUploader.jsx index 92119a31ac..3fcaaa7f64 100644 --- a/love/src/components/GeneralPurpose/FileUploader/FileUploader.jsx +++ b/love/src/components/GeneralPurpose/FileUploader/FileUploader.jsx @@ -6,6 +6,7 @@ const FileUploader = ({ value = '', handleFile = () => {}, handleDelete = () => const hiddenFileInput = React.useRef(null); const handleClick = () => { + hiddenFileInput.current.value = null; hiddenFileInput.current.click(); }; const handleChange = (event) => { diff --git a/love/src/components/GeneralPurpose/MultiSelect/MultiSelect.module.css b/love/src/components/GeneralPurpose/MultiSelect/MultiSelect.module.css index 11dd51833e..9aa0f699f3 100644 --- a/love/src/components/GeneralPurpose/MultiSelect/MultiSelect.module.css +++ b/love/src/components/GeneralPurpose/MultiSelect/MultiSelect.module.css @@ -3,5 +3,5 @@ } .dropDownClassName { - height: 2.4em; + min-height: 2.4em; } \ No newline at end of file diff --git a/love/src/components/OLE/Exposure/Exposure.module.css b/love/src/components/OLE/Exposure/Exposure.module.css index 3635d7f050..f21265a842 100644 --- a/love/src/components/OLE/Exposure/Exposure.module.css +++ b/love/src/components/OLE/Exposure/Exposure.module.css @@ -430,4 +430,8 @@ th.tableHead { height: var(--font-size-small); width: var(--font-size-small); margin-left: var(--small-padding); +} + +.refreshDataBtn { + height: 2.4em; } \ No newline at end of file diff --git a/love/src/components/OLE/Exposure/ExposureAdd.jsx b/love/src/components/OLE/Exposure/ExposureAdd.jsx index 979e8a29fe..f8d7c56932 100644 --- a/love/src/components/OLE/Exposure/ExposureAdd.jsx +++ b/love/src/components/OLE/Exposure/ExposureAdd.jsx @@ -17,6 +17,7 @@ import Modal from 'components/GeneralPurpose/Modal/Modal'; import FlagIcon from 'components/icons/FlagIcon/FlagIcon'; import { exposureFlagStateToStyle } from 'Config'; import styles from './Exposure.module.css'; +import { style } from 'd3'; export default class ExposureAdd extends Component { static propTypes = { @@ -108,6 +109,9 @@ export default class ExposureAdd extends Component { componentDidUpdate(prevProps, prevState) { // TODO: only when the filter is shown if (prevState.selectedInstrument !== this.state.selectedInstrument) { + this.setState((prevState) => ({ + newMessage: { ...prevState, obs_id: [] }, + })); this.queryExposures(); } } @@ -272,6 +276,7 @@ export default class ExposureAdd extends Component {