Skip to content

Commit f18a3cf

Browse files
Merge pull request #146 from Geode-solutions/next
Next
2 parents b1a2bc8 + 443b0a6 commit f18a3cf

File tree

7 files changed

+77
-58
lines changed

7 files changed

+77
-58
lines changed

components/RemoteRenderingView.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
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>
517
<v-col
618
ref="viewer"
719
style="
@@ -103,3 +115,14 @@
103115
view.render()
104116
}
105117
</script>
118+
119+
<style scoped>
120+
.list {
121+
position: absolute;
122+
z-index: 2;
123+
left: 0;
124+
top: 0;
125+
background-color: transparent;
126+
border-radius: 16px;
127+
}
128+
</style>

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +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.1",
11-
"@pinia/testing": "^0.1.5",
12-
"@vitejs/plugin-vue": "^5.1.3",
10+
"@nuxt/test-utils": "^3.14.3",
11+
"@pinia/testing": "^0.1.6",
12+
"@vitejs/plugin-vue": "^5.1.4",
1313
"@vitest/coverage-v8": "^1.6.0",
1414
"@vue/test-utils": "^2.4.6",
1515
"eslint": "^8.57.0",
@@ -21,15 +21,15 @@
2121
"eslint-plugin-vuetify": "^2.4.0",
2222
"happy-dom": "^14.12.0",
2323
"jsdom": "^24.1.0",
24-
"nuxt": "^3.12.1",
24+
"nuxt": "^3.13.2",
2525
"playwright-core": "^1.44.1",
2626
"prettier": "3.3.2",
2727
"resize-observer-polyfill": "^1.5.1",
2828
"vite": "^5.2.13",
2929
"vite-plugin-vuetify": "^2.0.3",
3030
"vitest": "^1.6.0",
3131
"vitest-environment-nuxt": "^1.0.0",
32-
"vuetify": "^3.6.9",
32+
"vuetify": "^3.7.2",
3333
"wslink": "1.12.4"
3434
},
3535
"overrides": {

stores/geode.js

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ export const use_geode_store = defineStore("geode", {
1010
protocol() {
1111
if (use_infra_store().is_cloud) {
1212
return "https"
13-
} else {
14-
return "http"
1513
}
14+
return "http"
1615
},
1716
port() {
1817
if (use_infra_store().is_cloud) {
1918
return "443"
20-
} else {
21-
return this.default_local_port
2219
}
20+
return this.default_local_port
2321
},
2422
base_url() {
2523
const infra_store = use_infra_store()
26-
var geode_url = `${this.protocol}://${infra_store.domain_name}:${this.port}`
24+
let geode_url = `${this.protocol}://${infra_store.domain_name}:${this.port}`
2725
if (infra_store.is_cloud) {
2826
if (infra_store.ID == "") {
2927
throw new Error("ID must not be empty in cloud mode")
@@ -44,26 +42,26 @@ export const use_geode_store = defineStore("geode", {
4442
}
4543
}, 10 * 1000)
4644
},
47-
async do_ping() {
45+
do_ping() {
46+
const geode_store = this
4847
const feedback_store = use_feedback_store()
49-
return new Promise((resolve, reject) => {
50-
useFetch(back_schemas.opengeodeweb_back.ping.$id, {
51-
baseURL: this.base_url,
52-
method: back_schemas.opengeodeweb_back.ping.methods[0],
53-
async onRequestError() {
54-
await feedback_store.$patch({ server_error: true })
55-
this.is_running = false
56-
reject()
57-
},
58-
async onResponse() {
59-
resolve()
60-
},
61-
async onResponseError() {
62-
await feedback_store.$patch({ server_error: true })
63-
this.is_running = false
64-
reject()
65-
},
66-
})
48+
return useFetch(back_schemas.opengeodeweb_back.ping.$id, {
49+
baseURL: this.base_url,
50+
method: back_schemas.opengeodeweb_back.ping.methods[0],
51+
onRequestError({ error }) {
52+
feedback_store.server_error = true
53+
geode_store.is_running = false
54+
},
55+
onResponse({ response }) {
56+
if (response.ok) {
57+
feedback_store.server_error = false
58+
geode_store.is_running = true
59+
}
60+
},
61+
onResponseError({ response }) {
62+
feedback_store.server_error = true
63+
geode_store.is_running = false
64+
},
6765
})
6866
},
6967
start_request() {

test/components/CrsSelector.nuxt.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const vuetify = createVuetify({
2020
directives,
2121
})
2222

23-
describe("CrsSelector.vue", async () => {
23+
describe("CrsSelector.vue", () => {
2424
const pinia = createTestingPinia()
2525
setActivePinia(pinia)
2626
const geode_store = use_geode_store()

test/stores/Geode.nuxt.test.js

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { setActivePinia } from "pinia"
22
import { createTestingPinia } from "@pinia/testing"
3-
import { describe, test, expect, expectTypeOf, beforeEach } from "vitest"
3+
import { describe, test, expect, expectTypeOf, beforeEach, vi } from "vitest"
44
import { registerEndpoint } from "@nuxt/test-utils/runtime"
55
import back_schemas from "@geode/opengeodeweb-back/schemas.json"
66

@@ -20,7 +20,7 @@ describe("Geode Store", () => {
2020
})
2121

2222
describe("state", () => {
23-
test("initial state", async () => {
23+
test("initial state", () => {
2424
expectTypeOf(geode_store.default_local_port).toBeString()
2525
expectTypeOf(geode_store.request_counter).toBeNumber()
2626
expectTypeOf(geode_store.is_running).toBeBoolean()
@@ -52,8 +52,8 @@ describe("Geode Store", () => {
5252

5353
test("test override default_local_port", () => {
5454
infra_store.is_cloud = false
55-
geode_store.default_local_port = "8080"
56-
expect(geode_store.port).toBe("8080")
55+
geode_store.default_local_port = "12"
56+
expect(geode_store.port).toBe("12")
5757
})
5858
})
5959

@@ -63,17 +63,15 @@ describe("Geode Store", () => {
6363
infra_store.domain_name = "localhost"
6464
expect(geode_store.base_url).toBe("http://localhost:5000")
6565
})
66-
67-
test("test is_cloud true", async () => {
66+
test("test is_cloud true", () => {
6867
infra_store.is_cloud = true
6968
infra_store.ID = "123456"
7069
infra_store.domain_name = "example.com"
7170
expect(geode_store.base_url).toBe(
7271
"https://example.com:443/123456/geode",
7372
)
7473
})
75-
76-
test("test is_cloud true, ID empty", async () => {
74+
test("test is_cloud true, ID empty", () => {
7775
infra_store.is_cloud = true
7876
infra_store.ID = ""
7977
infra_store.domain_name = "example.com"
@@ -97,28 +95,28 @@ describe("Geode Store", () => {
9795

9896
describe("actions", () => {
9997
describe("do_ping", () => {
100-
test("request_error", async () => {
101-
geode_store.base_url = ""
102-
try {
103-
await geode_store.do_ping()
104-
} catch (e) {
105-
console.log("e", e)
106-
}
107-
expect(geode_store.is_running).toBe(false)
108-
expect(feedback_store.server_error).toBe(true)
109-
})
98+
const getFakeCall = vi.fn()
99+
registerEndpoint(back_schemas.opengeodeweb_back.ping.$id, getFakeCall)
110100

111101
test("response", async () => {
112102
geode_store.base_url = ""
113-
geode_store.is_running = true
114-
registerEndpoint(back_schemas.opengeodeweb_back.ping.$id, {
115-
method: "POST",
116-
handler: () => ({}),
117-
})
103+
getFakeCall.mockImplementation(() => ({}))
118104
await geode_store.do_ping()
119105
expect(geode_store.is_running).toBe(true)
120106
expect(feedback_store.server_error).toBe(false)
121107
})
108+
test("response_error", async () => {
109+
geode_store.base_url = ""
110+
getFakeCall.mockImplementation(() => {
111+
throw createError({
112+
status: 500,
113+
})
114+
})
115+
116+
await geode_store.do_ping()
117+
expect(geode_store.is_running).toBe(false)
118+
expect(feedback_store.server_error).toBe(true)
119+
})
122120
})
123121

124122
describe("start_request", () => {

test/stores/Infra.nuxt.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ describe("Infra Store", () => {
105105
})
106106

107107
describe("actions", () => {
108-
describe("create_connexion", async () => {
108+
describe("create_connexion", () => {
109109
test("test without end-point", async () => {
110110
await infra_store.create_connexion()
111111
expect(infra_store.is_connexion_launched).toBe(true)
112112
expect(feedback_store.server_error).toBe(true)
113113
})
114114
})
115-
describe("create_backend", async () => {
115+
describe("create_backend", () => {
116116
test("test without end-point", async () => {
117117
await infra_store.create_backend()
118118
expect(geode_store.is_running).toBe(false)

test/stores/Viewer.nuxt.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe("Viewer Store", () => {
6464
expect(viewer_store.base_url).toBe("ws://localhost:1234/ws")
6565
})
6666

67-
test("test is_cloud true", async () => {
67+
test("test is_cloud true", () => {
6868
infra_store.is_cloud = true
6969
infra_store.ID = "123456"
7070
infra_store.domain_name = "example.com"
@@ -73,7 +73,7 @@ describe("Viewer Store", () => {
7373
)
7474
})
7575

76-
test("test is_cloud true, ID empty", async () => {
76+
test("test is_cloud true, ID empty", () => {
7777
infra_store.is_cloud = true
7878
infra_store.ID = ""
7979
infra_store.domain_name = "example.com"
@@ -95,7 +95,7 @@ describe("Viewer Store", () => {
9595
})
9696
describe("actions", () => {
9797
// MISSING TEST ws_connect()
98-
describe("toggle_picking_mode", async () => {
98+
describe("toggle_picking_mode", () => {
9999
test("test true", async () => {
100100
await viewer_store.toggle_picking_mode(true)
101101
expect(viewer_store.picking_mode).toBe(true)

0 commit comments

Comments
 (0)