diff --git a/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue b/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue index 24648c51..1d0ddf1d 100644 --- a/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue +++ b/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue @@ -12,6 +12,7 @@ :modal-progress="actionData.modal_progress" :stream-with-modal="actionData.stream_with_modal" :is-broken="actionData.broken" + @task-started="actionStarted" @response="actionResponse" @error="modalError" @finished="actionFinished" @@ -36,7 +37,7 @@ export default { }, }, - emits: ["response", "finished", "requestUpdate"], + emits: ["started", "response", "finished", "requestUpdate"], methods: { /** @@ -58,6 +59,14 @@ export default { this.$emit("response", response); } }, + /** + * Runs when the ActionButton's action starts + * + * This forwards the event to the parent + */ + actionStarted: function () { + this.$emit("started"); + }, /** * Runs when the ActionButton's action finishes in any way (error, cancel, * completion). diff --git a/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue b/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue index c00f514b..1d72325d 100644 --- a/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue +++ b/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue @@ -28,17 +28,24 @@ gets very confusing. v-if="currentStep" :key="stepIndex" @awaiting-user="handleAwaitingUser" + @prevent-navigation="handlePreventNavigation" />
-
@@ -72,6 +79,7 @@ export default { return { stepIndex: this.startOnLast ? this.steps.length - 1 : 0, stepAwaitingUser: false, + preventNavigation: false, }; }, @@ -96,6 +104,7 @@ export default { * Move to the previous step in this task, or the previous task if first step. */ previousStep: function () { + if (this.preventNavigation) return; this.stepAwaitingUser = false; if (this.stepIndex > 0) { this.stepIndex = this.stepIndex - 1; @@ -108,6 +117,7 @@ export default { * Move to the next step in this task, or the next task if final step. */ nextStep: function () { + if (this.preventNavigation) return; this.stepAwaitingUser = false; if (this.stepIndex < this.steps.length - 1) { this.stepIndex = this.stepIndex + 1; @@ -119,6 +129,14 @@ export default { handleAwaitingUser(isAwaiting) { this.stepAwaitingUser = isAwaiting; }, + handlePreventNavigation(blocked) { + this.preventNavigation = blocked; + }, }, }; + diff --git a/webapp/src/components/modalComponents/calibrationWizardComponents/cameraCalibrationSteps/cameraMainCalibrationStep.vue b/webapp/src/components/modalComponents/calibrationWizardComponents/cameraCalibrationSteps/cameraMainCalibrationStep.vue index 5eb4742a..0f57cdb2 100644 --- a/webapp/src/components/modalComponents/calibrationWizardComponents/cameraCalibrationSteps/cameraMainCalibrationStep.vue +++ b/webapp/src/components/modalComponents/calibrationWizardComponents/cameraCalibrationSteps/cameraMainCalibrationStep.vue @@ -12,7 +12,8 @@If it is not in focus, click back and re-focus.
+