Skip to content

Commit da2ef2c

Browse files
Merge pull request #165 from Geode-solutions/next
Next
2 parents f82179b + 03d7e5b commit da2ef2c

File tree

5 files changed

+75
-61
lines changed

5 files changed

+75
-61
lines changed

components/RemoteRenderingView.vue

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,7 @@
22
<ClientOnly>
33
<div style="position: relative; width: 100%; height: 100%">
44
<view-toolbar />
5-
<div
6-
style="
7-
position: absolute;
8-
z-index: 2;
9-
left: 0;
10-
top: 0;
11-
background-color: transparent;
12-
border-radius: 16px;
13-
"
14-
>
15-
<slot name="tree-object"></slot>
16-
</div>
5+
<slot name="ui"></slot>
176
<v-col
187
ref="viewer"
198
style="
@@ -26,9 +15,7 @@
2615
class="pa-0"
2716
@click="get_x_y"
2817
@keydown.esc="app_store.toggle_picking_mode(false)"
29-
>
30-
<slot name="ui"></slot>
31-
</v-col>
18+
/>
3219
</div>
3320
</ClientOnly>
3421
</template>

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>

package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write"
88
},
99
"devDependencies": {
10-
"@nuxt/test-utils": "^3.14.3",
11-
"@pinia/testing": "^0.1.6",
12-
"@vitejs/plugin-vue": "^5.1.4",
13-
"@vitest/coverage-v8": "^1.6.0",
10+
"@nuxt/test-utils": "^3.15.1",
11+
"@pinia/testing": "^0.1.7",
12+
"@vitejs/plugin-vue": "^5.2.1",
1413
"@vue/test-utils": "^2.4.6",
1514
"eslint": "^8.57.0",
1615
"eslint-plugin-import": "^2.29.1",
@@ -20,16 +19,16 @@
2019
"eslint-plugin-vue": "^9.26.0",
2120
"eslint-plugin-vuetify": "^2.4.0",
2221
"happy-dom": "^15.11.7",
23-
"jsdom": "^24.1.0",
22+
"jsdom": "^24.1.3",
2423
"nuxt": "^3.13.2",
2524
"playwright-core": "^1.44.1",
2625
"prettier": "3.3.2",
2726
"resize-observer-polyfill": "^1.5.1",
28-
"vite": "^5.2.13",
29-
"vite-plugin-vuetify": "^2.0.3",
30-
"vitest": "^1.6.0",
31-
"vitest-environment-nuxt": "^1.0.0",
32-
"vuetify": "^3.7.2",
27+
"vite": "^5.4.11",
28+
"vite-plugin-vuetify": "^2.0.4",
29+
"vitest": "^2.1.8",
30+
"vitest-environment-nuxt": "^1.0.1",
31+
"vuetify": "^3.7.5",
3332
"wslink": "1.12.4"
3433
},
3534
"overrides": {
@@ -41,7 +40,7 @@
4140
"main": "./nuxt.config.js",
4241
"dependencies": {
4342
"@geode/opengeodeweb-back": "5.4.0",
44-
"@geode/opengeodeweb-viewer": "1.0.0",
43+
"@geode/opengeodeweb-viewer": "1.1.0",
4544
"@kitware/vtk.js": "30.3.1",
4645
"@mdi/font": "^7.4.47",
4746
"@pinia/nuxt": "^0.5.4",

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)