Skip to content

Commit

Permalink
New mounted method load_default_zenith_from_mount
Browse files Browse the repository at this point in the history
This method is called on createProjectForm page mount. It will look and
see if there is a default_zenith value for that site and set the project
params store equal to it. Since the form is v-modeled from the project params
vuex store, this change will appear on the ui box min zenith distance as well
  • Loading branch information
LTDakin committed Nov 13, 2023
1 parent f486f12 commit 0e4b307
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/projects/CreateProjectForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ export default {
// set default filter
this.exposures[targets_index].filter = this.default_filter_selection
// loading min_zenith_dist fromt config
this.load_default_zenith_from_mount()
},
watch: {
// This runs any time an existing project is passed into the component.
Expand Down Expand Up @@ -913,6 +916,10 @@ export default {
'resetProjectForm',
'loadProject'
]),
// Set store value for min_zenith_dist if it exists in mount config
load_default_zenith_from_mount () {
this.$store.commit('project_params/min_zenith_dist', this.selected_mount_config?.default_zenith_avoid ?? 0)
},
// Used for changing values in the targets array without losing reactivity
updateTargetsValue (indexToMatch, key, val) {
this.targets = this.targets.map((obj, index) => {
Expand Down Expand Up @@ -1232,7 +1239,8 @@ export default {
'available_sites_real',
'available_sites_simulated',
'filter_wheel_options',
'default_filter_selection'
'default_filter_selection',
'selected_mount_config'
]),
...mapState('site_config', ['global_config']),
...mapState('user_data', [
Expand Down

0 comments on commit 0e4b307

Please sign in to comment.