@geode/opengeodeweb-front 9.7.0-rc.2 → 9.7.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -1
- package/components/FeedBack/Snackers.vue +1 -1
- package/components/Launcher.vue +13 -8
- package/components/Loading.vue +3 -3
- package/components/PackagesVersions.vue +6 -3
- package/components/Recaptcha.vue +2 -4
- package/components/RemoteRenderingView.vue +31 -24
- package/package.json +3 -2
- package/stores/feedback.js +17 -2
- package/test/stores/Feedback.nuxt.test.js +21 -0
package/.eslintrc.cjs
CHANGED
package/components/Launcher.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-container class="justify">
|
|
3
3
|
<v-row align-content="center" align="center">
|
|
4
4
|
<v-col
|
|
5
|
-
v-if="!is_captcha_validated"
|
|
5
|
+
v-if="!infra_store.is_captcha_validated"
|
|
6
6
|
class="align"
|
|
7
7
|
cols="12"
|
|
8
8
|
align-self="center"
|
|
@@ -21,16 +21,21 @@
|
|
|
21
21
|
<script setup>
|
|
22
22
|
import Status from "@/utils/status.js"
|
|
23
23
|
|
|
24
|
-
const viewer_store = use_viewer_store()
|
|
25
24
|
const infra_store = use_infra_store()
|
|
26
|
-
const { is_captcha_validated } = storeToRefs(infra_store)
|
|
27
|
-
|
|
28
25
|
const site_key = useRuntimeConfig().public.RECAPTCHA_SITE_KEY
|
|
29
26
|
|
|
30
|
-
watch(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
watch(
|
|
28
|
+
() => infra_store.is_captcha_validated,
|
|
29
|
+
(value, oldValue) => {
|
|
30
|
+
if (value && !oldValue && process.client) {
|
|
31
|
+
infra_store.create_backend()
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
onMounted(() => {
|
|
37
|
+
if (infra_store.is_captcha_validated) {
|
|
38
|
+
infra_store.create_backend()
|
|
34
39
|
}
|
|
35
40
|
})
|
|
36
41
|
</script>
|
package/components/Loading.vue
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
<v-col cols="12" class="ma-3">
|
|
4
4
|
<v-card loading>
|
|
5
5
|
<v-card-title class="text-center">
|
|
6
|
-
|
|
6
|
+
Microservices are starting...
|
|
7
7
|
</v-card-title>
|
|
8
8
|
<v-card-subtitle class="text-center">
|
|
9
9
|
Why do you have to wait?
|
|
10
10
|
</v-card-subtitle>
|
|
11
11
|
<v-card-text class="text-center">
|
|
12
|
-
We start our
|
|
13
|
-
before you can use our free app.
|
|
12
|
+
We start our microservices only on demand... and this takes a few
|
|
13
|
+
minutes before you can use our free app.
|
|
14
14
|
<br />
|
|
15
15
|
This is aligned with our energy sobriety policy. So be patient
|
|
16
16
|
<v-icon color="primary" size="20">
|
|
@@ -52,9 +52,12 @@
|
|
|
52
52
|
await Promise.all(array_promise)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
watch(
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
watch(
|
|
56
|
+
() => geode_store.status,
|
|
57
|
+
(value) => {
|
|
58
|
+
if (value == Status.CONNECTED) get_packages_versions()
|
|
59
|
+
},
|
|
60
|
+
)
|
|
58
61
|
|
|
59
62
|
await get_packages_versions()
|
|
60
63
|
</script>
|
package/components/Recaptcha.vue
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
<ClientOnly>
|
|
3
3
|
<vue-recaptcha
|
|
4
4
|
ref="recaptcha"
|
|
5
|
-
:sitekey="site_key"
|
|
5
|
+
:sitekey="props.site_key"
|
|
6
6
|
:load-recaptcha-script="true"
|
|
7
7
|
align-self="center"
|
|
8
|
-
@expired="is_captcha_validated = false"
|
|
8
|
+
@expired="infra_store.is_captcha_validated = false"
|
|
9
9
|
@verify="submit_recaptcha"
|
|
10
10
|
/>
|
|
11
11
|
</ClientOnly>
|
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
<script setup>
|
|
15
15
|
import { VueRecaptcha } from "vue-recaptcha"
|
|
16
16
|
const infra_store = use_infra_store()
|
|
17
|
-
const { is_captcha_validated } = storeToRefs(infra_store)
|
|
18
17
|
|
|
19
18
|
const props = defineProps({
|
|
20
19
|
site_key: { type: String, required: true },
|
|
21
20
|
})
|
|
22
|
-
const { site_key } = props
|
|
23
21
|
|
|
24
22
|
onMounted(() => {
|
|
25
23
|
if (process.client) {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"
|
|
15
15
|
class="pa-0"
|
|
16
16
|
@click="get_x_y"
|
|
17
|
-
@keydown.esc="
|
|
17
|
+
@keydown.esc="viewer_store.toggle_picking_mode(false)"
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
20
20
|
</ClientOnly>
|
|
@@ -26,8 +26,12 @@
|
|
|
26
26
|
import viewer_schemas from "@geode/opengeodeweb-viewer/schemas.json"
|
|
27
27
|
import Status from "@/utils/status.js"
|
|
28
28
|
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
viewId: { type: String, default: "-1" },
|
|
31
|
+
})
|
|
32
|
+
|
|
29
33
|
const viewer_store = use_viewer_store()
|
|
30
|
-
const viewer =
|
|
34
|
+
const viewer = useTemplateRef("viewer")
|
|
31
35
|
const { width, height } = useElementSize(viewer)
|
|
32
36
|
|
|
33
37
|
const { width: windowWidth, height: windowHeight } = useWindowSize()
|
|
@@ -43,13 +47,7 @@
|
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
const props = defineProps({
|
|
47
|
-
viewId: { type: String, default: "-1" },
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const { viewId } = toRefs(props)
|
|
51
50
|
const connected = ref(false)
|
|
52
|
-
|
|
53
51
|
const view = vtkRemoteView.newInstance({
|
|
54
52
|
rpcWheelEvent: "viewport.mouse.zoom.wheel",
|
|
55
53
|
})
|
|
@@ -69,33 +67,42 @@
|
|
|
69
67
|
resize()
|
|
70
68
|
})
|
|
71
69
|
|
|
72
|
-
watch(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
watch(
|
|
71
|
+
() => viewer_store.picking_mode,
|
|
72
|
+
(value) => {
|
|
73
|
+
const cursor = value ? "crosshair" : "pointer"
|
|
74
|
+
view.getCanvasView().setCursor(cursor)
|
|
75
|
+
},
|
|
76
|
+
)
|
|
76
77
|
|
|
77
78
|
watch([width, height], () => {
|
|
78
79
|
resize()
|
|
79
80
|
})
|
|
80
81
|
|
|
81
|
-
watch(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
watch(
|
|
83
|
+
() => viewer_store.client,
|
|
84
|
+
() => {
|
|
85
|
+
connect()
|
|
86
|
+
},
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
watch(
|
|
90
|
+
() => props.viewId,
|
|
91
|
+
(id) => {
|
|
92
|
+
if (connected.value) {
|
|
93
|
+
view.setViewId(id)
|
|
94
|
+
view.render()
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
)
|
|
91
98
|
|
|
92
99
|
function connect() {
|
|
93
|
-
if (
|
|
100
|
+
if (viewer_store.status !== Status.CONNECTED) {
|
|
94
101
|
return
|
|
95
102
|
}
|
|
96
103
|
const session = viewer_store.client.value.getConnection().getSession()
|
|
97
104
|
view.setSession(session)
|
|
98
|
-
view.setViewId(viewId
|
|
105
|
+
view.setViewId(props.viewId)
|
|
99
106
|
connected.value = true
|
|
100
107
|
view.render()
|
|
101
108
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"eslint-plugin-nuxt": "^4.0.0",
|
|
18
18
|
"eslint-plugin-prettier": "^5.1.3",
|
|
19
19
|
"eslint-plugin-prettier-vue": "^5.0.0",
|
|
20
|
-
"eslint-plugin-vue": "^9.
|
|
20
|
+
"eslint-plugin-vue": "^9.33.0",
|
|
21
21
|
"eslint-plugin-vuetify": "^2.4.0",
|
|
22
22
|
"happy-dom": "^15.11.7",
|
|
23
23
|
"jsdom": "^24.1.3",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"description": "OpenSource Vue/Vuetify framework for web applications",
|
|
39
39
|
"type": "module",
|
|
40
|
-
"version": "9.7.0-rc.
|
|
40
|
+
"version": "9.7.0-rc.4",
|
|
41
41
|
"main": "./nuxt.config.js",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@geode/opengeodeweb-back": "5.6.3",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"pinia": "^2.2.2",
|
|
55
55
|
"sass": "^1.77.8",
|
|
56
56
|
"semver": "^7.6.3",
|
|
57
|
+
"uuid": "^11.1.0",
|
|
57
58
|
"vue-recaptcha": "^2.0.3",
|
|
58
59
|
"vue3-carousel": "^0.3.3"
|
|
59
60
|
},
|
package/stores/feedback.js
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from "uuid"
|
|
2
|
+
|
|
1
3
|
export const use_feedback_store = defineStore("feedback", {
|
|
2
4
|
state: () => ({
|
|
3
5
|
feedbacks: [],
|
|
4
6
|
server_error: false,
|
|
7
|
+
feedbacks_timeout_miliseconds: 5000,
|
|
5
8
|
}),
|
|
6
9
|
actions: {
|
|
7
10
|
async add_error(code, route, name, description) {
|
|
11
|
+
const feedbackId = uuidv4()
|
|
8
12
|
await this.feedbacks.push({
|
|
13
|
+
id: feedbackId,
|
|
9
14
|
type: "error",
|
|
10
15
|
code,
|
|
11
16
|
route,
|
|
12
17
|
name,
|
|
13
18
|
description,
|
|
14
19
|
})
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
this.delete_feedback(feedbackId)
|
|
22
|
+
}, this.feedbacks_timeout_miliseconds)
|
|
15
23
|
},
|
|
16
24
|
async add_success(description) {
|
|
25
|
+
const feedbackId = uuidv4()
|
|
17
26
|
await this.feedbacks.push({
|
|
27
|
+
id: feedbackId,
|
|
18
28
|
type: "success",
|
|
19
29
|
description,
|
|
20
30
|
})
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
this.delete_feedback(feedbackId)
|
|
33
|
+
}, this.feedbacks_timeout_miliseconds)
|
|
21
34
|
},
|
|
22
|
-
async delete_feedback(
|
|
23
|
-
|
|
35
|
+
async delete_feedback(feedbackId) {
|
|
36
|
+
this.feedbacks = this.feedbacks.filter(
|
|
37
|
+
(feedback) => feedback.id !== feedbackId,
|
|
38
|
+
)
|
|
24
39
|
},
|
|
25
40
|
async delete_server_error() {
|
|
26
41
|
this.server_error = false
|
|
@@ -34,11 +34,32 @@ describe("Feedback Store", () => {
|
|
|
34
34
|
})
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
+
describe("add_error", () => {
|
|
38
|
+
test("test feedbacks_timeout", () => {
|
|
39
|
+
feedback_store.feedbacks_timeout_miliseconds = 500
|
|
40
|
+
feedback_store.add_error(
|
|
41
|
+
500,
|
|
42
|
+
"/test",
|
|
43
|
+
"test message",
|
|
44
|
+
"test description",
|
|
45
|
+
)
|
|
46
|
+
expect(feedback_store.feedbacks.length).toBe(1)
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
expect(feedback_store.feedbacks.length).toBe(0)
|
|
49
|
+
}, 1000)
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
|
|
37
53
|
describe("add_success", () => {
|
|
38
54
|
test("test add_success", () => {
|
|
55
|
+
feedback_store.feedbacks_timeout_miliseconds = 500
|
|
39
56
|
feedback_store.add_success("test description")
|
|
40
57
|
expect(feedback_store.feedbacks.length).toBe(1)
|
|
41
58
|
expect(feedback_store.feedbacks[0].type).toBe("success")
|
|
59
|
+
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
expect(feedback_store.feedbacks.length).toBe(0)
|
|
62
|
+
}, 1000)
|
|
42
63
|
})
|
|
43
64
|
})
|
|
44
65
|
describe("delete_feedback", () => {
|