Skip to content

Commit

Permalink
Minor CSS adjustments and add callback to clean selected exposures wh…
Browse files Browse the repository at this point in the history
…en chaning instrument on the ExposureAdd component
  • Loading branch information
sebastian-aranda committed Feb 7, 2023
1 parent 30ad7bb commit bedfcb2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
}

.dropDownClassName {
height: 2.4em;
min-height: 2.4em;
}
4 changes: 4 additions & 0 deletions love/src/components/OLE/Exposure/Exposure.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 6 additions & 0 deletions love/src/components/OLE/Exposure/ExposureAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -272,6 +276,7 @@ export default class ExposureAdd extends Component {

<span className={[styles.value, styles.paddingTop].join(' ')}>
<Button
className={styles.refreshDataBtn}
disabled={this.state.updatingExposures}
onClick={() => {
this.setState({ updatingExposures: true });
Expand Down Expand Up @@ -351,6 +356,7 @@ export default class ExposureAdd extends Component {
</span>

<Button
className={styles.refreshDataBtn}
disabled={this.state.updatingExposures}
onClick={() => {
this.setState({ updatingExposures: true });
Expand Down

0 comments on commit bedfcb2

Please sign in to comment.