From 15c750eca8b0f23002a42f736ce5066bda1ba6d4 Mon Sep 17 00:00:00 2001 From: John Arban Lewis Date: Fri, 1 Nov 2024 15:07:05 -0400 Subject: [PATCH] add button to doppler slideshow like the one for other slideshows and only show it during dop_cal4 and dop_cal5 is show_values is true --- .../doppler_slideshow/SlideshowDopplerCalc5.vue | 13 +++++++++++++ .../doppler_slideshow/doppler_slideshow.py | 3 ++- .../pages/01-spectra-&-velocity/__init__.py | 13 ++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/hubbleds/components/doppler_slideshow/SlideshowDopplerCalc5.vue b/src/hubbleds/components/doppler_slideshow/SlideshowDopplerCalc5.vue index 3a160241..f4339b34 100644 --- a/src/hubbleds/components/doppler_slideshow/SlideshowDopplerCalc5.vue +++ b/src/hubbleds/components/doppler_slideshow/SlideshowDopplerCalc5.vue @@ -3,6 +3,19 @@ v-model="dialog" max-width="800px" > + diff --git a/src/hubbleds/components/doppler_slideshow/doppler_slideshow.py b/src/hubbleds/components/doppler_slideshow/doppler_slideshow.py index 59308a3a..830e410c 100644 --- a/src/hubbleds/components/doppler_slideshow/doppler_slideshow.py +++ b/src/hubbleds/components/doppler_slideshow/doppler_slideshow.py @@ -26,6 +26,7 @@ def DopplerSlideshow( event_set_student_c, event_next_callback, event_mc_callback, - state_view + state_view, + show_button, ): pass diff --git a/src/hubbleds/pages/01-spectra-&-velocity/__init__.py b/src/hubbleds/pages/01-spectra-&-velocity/__init__.py index c1ae08ed..83c9108f 100644 --- a/src/hubbleds/pages/01-spectra-&-velocity/__init__.py +++ b/src/hubbleds/pages/01-spectra-&-velocity/__init__.py @@ -721,9 +721,15 @@ def _on_validate_transition(validated): ) # This whole slideshow is basically dop_cal5 - if COMPONENT_STATE.value.current_step_between( - Marker.dop_cal4, Marker.che_mea1 - ): + if ( + ( + show_values.value and COMPONENT_STATE.value.current_step_between( + Marker.dop_cal4, Marker.dop_cal5 + ) + or + COMPONENT_STATE.value.current_step_between( + Marker.dop_cal4, Marker.che_mea1)) + ): show_doppler_dialog = Ref(COMPONENT_STATE.fields.show_doppler_dialog) step = Ref(COMPONENT_STATE.fields.doppler_state.step) validation_5_failed = Ref( @@ -761,6 +767,7 @@ def _velocity_calculated_callback(value): add_example_measurements_to_glue() DopplerSlideshow( + show_button=show_values.value and COMPONENT_STATE.value.current_step_between(Marker.dop_cal4, Marker.dop_cal5), dialog=COMPONENT_STATE.value.show_doppler_dialog, titles=COMPONENT_STATE.value.doppler_state.titles, step=COMPONENT_STATE.value.doppler_state.step,