Skip to content

Commit e6c31eb

Browse files
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWeb-Front into new_version_viewer
2 parents b780fcb + 264b5cb commit e6c31eb

File tree

3 files changed

+63
-35
lines changed

3 files changed

+63
-35
lines changed

components/Step.vue

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<template>
2-
<v-card class="pa-5">
3-
<v-row align="center" @click="set_current_step(step_index)">
4-
<v-col cols="auto">
2+
<v-stepper-content :step="step_index + 1">
3+
<v-row
4+
align="center"
5+
class="step-container"
6+
@click="set_current_step(step_index)"
7+
>
8+
<v-col cols="auto" class="icon-container">
59
<v-icon
610
v-if="current_step_index > step_index"
711
icon="mdi-check-circle"
@@ -18,43 +22,43 @@
1822
color="grey"
1923
/>
2024
</v-col>
21-
<v-col cols="auto">
22-
<p class="font-weight-bold">
25+
<v-col class="title-container">
26+
<p class="step-title font-weight-bold">
2327
{{ steps[step_index].step_title }}
2428
</p>
2529
</v-col>
2630
<v-col
2731
v-if="
2832
steps[step_index].chips.length && current_step_index >= step_index
2933
"
34+
class="chips-container"
3035
>
3136
<v-chip
3237
v-for="(chip, chip_index) in steps[step_index].chips"
3338
:key="chip_index"
39+
class="step-chip"
3440
>
3541
{{ chip }}
3642
</v-chip>
3743
</v-col>
3844
</v-row>
39-
<Transition name="slide-fade">
40-
<v-col v-if="step_index == current_step_index">
41-
<component
42-
:is="steps[step_index].component.component_name"
43-
v-bind="steps[step_index].component.component_options"
44-
@update_values="update_values_event"
45-
@increment_step="increment_step()"
46-
@decrement_step="decrement_step()"
47-
/>
48-
</v-col>
49-
</Transition>
50-
</v-card>
45+
<component
46+
v-if="step_index == current_step_index"
47+
:key="step_index"
48+
:is="steps[step_index].component.component_name"
49+
v-bind="steps[step_index].component.component_options"
50+
@update_values="update_values_event"
51+
@increment_step="increment_step"
52+
@decrement_step="decrement_step"
53+
/>
54+
</v-stepper-content>
5155
</template>
5256

5357
<script setup>
5458
const props = defineProps({
5559
step_index: { type: Number, required: true },
5660
})
57-
const { step_index } = props
61+
5862
const stepper_tree = inject("stepper_tree")
5963
const { current_step_index, steps } = toRefs(stepper_tree)
6064
@@ -78,17 +82,31 @@
7882
</script>
7983

8084
<style scoped>
81-
.slide-fade-enter-active {
82-
transition: all 0.5s ease-out;
85+
.step-container {
86+
margin-bottom: 16px;
87+
padding: 8px;
88+
}
89+
90+
.icon-container {
91+
display: flex;
92+
justify-content: center;
93+
align-items: center;
94+
}
95+
96+
.title-container {
97+
margin-left: 8px;
98+
}
99+
100+
.step-title {
101+
margin: 0;
83102
}
84103
85-
.slide-fade-leave-active {
86-
transition: all 0.5s ease-in;
104+
.chips-container {
105+
display: flex;
106+
gap: 4px;
87107
}
88108
89-
.slide-fade-enter-from,
90-
.slide-fade-leave-to {
91-
transform: translateX(50px);
92-
opacity: 0;
109+
.step-chip {
110+
background-color: #f5f5f5;
93111
}
94112
</style>

components/Stepper.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
<template>
2-
<v-card class="card">
3-
<div v-for="(step, index) in steps" :key="index" class="pa-3">
4-
<Step :step_index="index" />
5-
</div>
6-
</v-card>
2+
<v-stepper-vertical v-model="current_step_index" class="stepper-container">
3+
<v-stepper-items>
4+
<Step v-for="(step, index) in steps" :key="step" :step_index="index" />
5+
</v-stepper-items>
6+
</v-stepper-vertical>
77
</template>
88

99
<script setup>
1010
const stepper_tree = inject("stepper_tree")
11-
const { steps } = stepper_tree
11+
const { steps, current_step_index } = toRefs(stepper_tree)
1212
</script>
13+
14+
<style scoped>
15+
.stepper-container {
16+
max-width: 600px;
17+
margin: 0 auto;
18+
padding: 16px;
19+
background-color: #f9f9f9;
20+
border-radius: 8px;
21+
border: 1px solid #e0e0e0;
22+
}
23+
</style>

test/components/FileSelector.nuxt.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe("FileSelector.vue", async () => {
9797
})
9898

9999
await flushPromises()
100-
expect(wrapper.componentVM.files).toEqual(files)
100+
expect(wrapper.componentVM.props.files).toEqual(files)
101101
expect(wrapper.emitted()).toHaveProperty("update_values")
102102
expect(wrapper.emitted().update_values).toHaveLength(1)
103103
expect(wrapper.emitted().update_values[0][0]).toEqual({
@@ -123,8 +123,7 @@ describe("FileSelector.vue", async () => {
123123
await flushPromises()
124124

125125
const file_uploader = wrapper.findComponent(FileUploader)
126-
console.log("wrapper", wrapper)
127-
expect(wrapper.vm.files).toEqual(files)
126+
expect(wrapper.vm.props.files).toEqual(files)
128127
const upload_files = vi.spyOn(file_uploader.vm, "upload_files")
129128
expect(upload_files).not.toHaveBeenCalled()
130129
})

0 commit comments

Comments
 (0)