Skip to content

Commit 0277700

Browse files
authored
Merge pull request #515 from Geode-solutions/fix/StepperComposable
fix(StepperComposable): Refactor stepper logic
2 parents fabe92d + 4e0bb95 commit 0277700

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

app/components/StepImport.vue

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ImportFile from "@vease/components/ImportFile";
44
import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector";
55
import ObjectSelector from "@ogw_front/components/ObjectSelector";
66
import Stepper from "@ogw_front/components/Stepper";
7+
import { useStepperTree } from "@ogw_front/composables/stepper_tree.js";
78
import { useUIStore } from "@vease/stores/ui";
89
910
const emit = defineEmits(["close"]);
@@ -26,13 +27,8 @@ const auto_upload = ref(true);
2627
const geode_object_type = ref("");
2728
const additional_files = ref([]);
2829
29-
const stepper_tree = reactive({
30-
current_step_index: 0,
31-
navigating_back: false,
32-
files,
33-
auto_upload,
34-
geode_object_type,
35-
steps: [
30+
const stepper_tree = useStepperTree(
31+
[
3632
{
3733
step_title: "Select files to import",
3834
component: {
@@ -83,18 +79,17 @@ const stepper_tree = reactive({
8379
}),
8480
},
8581
],
86-
});
87-
88-
provide("stepper_tree", stepper_tree);
82+
{
83+
files,
84+
auto_upload,
85+
geode_object_type,
86+
additional_files,
87+
},
88+
);
8989
9090
function reset_values() {
91-
files.value = [];
9291
UIStore.setDroppedFiles([]);
93-
auto_upload.value = true;
94-
geode_object_type.value = "";
95-
additional_files.value = [];
96-
stepper_tree.current_step_index = 0;
97-
stepper_tree.navigating_back = false;
92+
stepper_tree.reset_values();
9893
}
9994
10095
function handleClose() {
@@ -113,5 +108,5 @@ watch(
113108
</script>
114109

115110
<template>
116-
<Stepper @close="handleClose" @reset_values="reset_values" />
111+
<Stepper :stepper_tree="stepper_tree" @close="handleClose" @reset_values="reset_values" />
117112
</template>

0 commit comments

Comments
 (0)