From 0e4b307f45ba29d713c463b47c574befba06711a Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Mon, 13 Nov 2023 14:00:54 -0800 Subject: [PATCH] New mounted method load_default_zenith_from_mount 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 --- src/components/projects/CreateProjectForm.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/projects/CreateProjectForm.vue b/src/components/projects/CreateProjectForm.vue index 734e727a..7f5f4735 100644 --- a/src/components/projects/CreateProjectForm.vue +++ b/src/components/projects/CreateProjectForm.vue @@ -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. @@ -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) => { @@ -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', [