@geode/opengeodeweb-front 9.0.2-rc.2 → 9.0.2

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.
@@ -9,6 +9,7 @@
9
9
  transition="slide-x-reverse-transition"
10
10
  max-width="200px"
11
11
  height="20px"
12
+ timeout="10000"
12
13
  >
13
14
  <v-row dense class="flex-nowrap">
14
15
  <v-col cols="auto">
package/package.json CHANGED
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "description": "OpenSource Vue/Vuetify framework for web applications",
39
39
  "type": "module",
40
- "version": "9.0.2-rc.2",
40
+ "version": "9.0.2",
41
41
  "main": "./nuxt.config.js",
42
42
  "dependencies": {
43
- "@geode/opengeodeweb-back": "5.0.0",
43
+ "@geode/opengeodeweb-back": "5.1.0",
44
44
  "@geode/opengeodeweb-viewer": "0.2.0",
45
45
  "@kitware/vtk.js": "30.3.1",
46
46
  "@mdi/font": "^7.4.47",
package/stores/geode.js CHANGED
@@ -32,32 +32,39 @@ export const use_geode_store = defineStore("geode", {
32
32
  }
33
33
  return geode_url
34
34
  },
35
- is_busy(state) {
36
- return state.request_counter > 0
35
+ is_busy() {
36
+ return this.request_counter > 0
37
37
  },
38
38
  },
39
39
  actions: {
40
40
  ping_task() {
41
- setInterval(() => this.do_ping(), 10 * 1000)
41
+ setInterval(() => {
42
+ if (this.is_running) {
43
+ this.do_ping()
44
+ }
45
+ }, 10 * 1000)
42
46
  },
43
47
  async do_ping() {
44
48
  const feedback_store = use_feedback_store()
45
- await api_fetch(
46
- { schema: back_schemas.opengeodeweb_back.ping, params: {} },
47
- {
48
- request_error_function: async () => {
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() {
49
54
  await feedback_store.$patch({ server_error: true })
50
55
  this.is_running = false
56
+ reject()
51
57
  },
52
- response_function: async () => {
53
- this.is_running = true
58
+ async onResponse() {
59
+ resolve()
54
60
  },
55
- response_error_function: async () => {
61
+ async onResponseError() {
56
62
  await feedback_store.$patch({ server_error: true })
57
63
  this.is_running = false
64
+ reject()
58
65
  },
59
- },
60
- )
66
+ })
67
+ })
61
68
  },
62
69
  start_request() {
63
70
  this.request_counter++
package/stores/infra.js CHANGED
@@ -43,21 +43,11 @@ export const use_infra_store = defineStore("infra", {
43
43
  },
44
44
  actions: {
45
45
  async create_connexion() {
46
- const geode_store = use_geode_store()
47
46
  if (this.is_connexion_launched) {
48
47
  return
49
48
  }
50
49
  this.is_connexion_launched = true
51
- if (["", null].includes(this.ID) || typeof this.ID === "undefined") {
52
- return this.create_backend()
53
- } else {
54
- try {
55
- await geode_store.do_ping()
56
- return geode_store.ping_task()
57
- } catch (e) {
58
- return this.create_backend()
59
- }
60
- }
50
+ return this.create_backend()
61
51
  },
62
52
  async create_backend() {
63
53
  const geode_store = use_geode_store()
package/stores/viewer.js CHANGED
@@ -40,8 +40,8 @@ export const use_viewer_store = defineStore("viewer", {
40
40
  viewer_url += "/ws"
41
41
  return viewer_url
42
42
  },
43
- is_busy(state) {
44
- return state.request_counter > 0
43
+ is_busy() {
44
+ return this.request_counter > 0
45
45
  },
46
46
  },
47
47
  actions: {
@@ -99,20 +99,18 @@ describe("Geode Store", () => {
99
99
  describe("do_ping", () => {
100
100
  test("request_error", async () => {
101
101
  geode_store.base_url = ""
102
- geode_store.is_running = true
103
102
  try {
104
103
  await geode_store.do_ping()
105
104
  } catch (e) {
106
- console.log(e)
105
+ console.log("e", e)
107
106
  }
108
-
109
107
  expect(geode_store.is_running).toBe(false)
110
108
  expect(feedback_store.server_error).toBe(true)
111
- expect(feedback_store.feedbacks.length).toBe(1)
112
109
  })
113
110
 
114
111
  test("response", async () => {
115
112
  geode_store.base_url = ""
113
+ geode_store.is_running = true
116
114
  registerEndpoint(back_schemas.opengeodeweb_back.ping.$id, {
117
115
  method: "POST",
118
116
  handler: () => ({}),