-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1058 filtro por incerteza na predicao (#1063)
* build(new-column-added-to-the-database-with-new-values-computed): closest_approach_uncertainty_km is with its computations is added to the database and prediction occultation details BREAKING CHANGE: * feat(new-filter-field): closest_approach_uncertainty_km field added to occultation views * refactor(frontend/src/contexts/PredictionContext.js): Inclusao do campo closest approach uncertainty no arquivo predictionContext * refactor(frontend/src/components/ClosestApproachUncertaintyField/): Criação do componente com o campo de closest approach uncertainty * refactor(frontend/src/components/PredictionEventsFilter/index.js): Inclusao de chamada do componente closest approach uncertainty no componente principal dos filtros de predição * Fixed layout and filter by closest approach * refactor(frontend/src/components/ClosestApproachUncertaintyField/index.js): Alteração no nome do campo closest approach uncertainty --------- Co-authored-by: Rodrigo Boufleur <rcboufleur@gmail.com> Co-authored-by: josiane-silwa <josiannesilwa@gmail.com>
- Loading branch information
1 parent
6bc366e
commit 0821c4f
Showing
11 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
backend/tno/migrations/0007_occultation_closest_approach_uncertainty_km.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 3.2.18 on 2024-08-28 13:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("tno", "0006_auto_20240822_1847"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="occultation", | ||
name="closest_approach_uncertainty_km", | ||
field=models.FloatField( | ||
blank=True, | ||
default=None, | ||
help_text="Uncertainty in geocentric closest approach (km)", | ||
null=True, | ||
verbose_name="Closest approach uncertainty in km", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
frontend/src/components/ClosestApproachUncertaintyField/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import PropTypes from 'prop-types' | ||
import TextField from '@mui/material/TextField' | ||
|
||
function ClosestApproachUncertaintyField({ value, onChange }) { | ||
const handleChange = (e) => { | ||
let newValue = e.target.value | ||
|
||
if (newValue === '') { | ||
onChange(undefined) | ||
} | ||
if (newValue !== '') { | ||
onChange(parseFloat(newValue)) | ||
} | ||
} | ||
|
||
return ( | ||
<TextField | ||
type='number' | ||
label='Uncertainty (km)' | ||
variant='outlined' | ||
value={value !== undefined ? parseFloat(value) : ''} | ||
onChange={handleChange} | ||
fullWidth | ||
/> | ||
) | ||
} | ||
|
||
ClosestApproachUncertaintyField.defaultProps = { | ||
value: undefined | ||
} | ||
ClosestApproachUncertaintyField.propTypes = { | ||
value: PropTypes.number, | ||
onChange: PropTypes.func.isRequired | ||
} | ||
|
||
export default ClosestApproachUncertaintyField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters