glib-web 4.32.0 → 4.33.1

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.
@@ -1,4 +1,7 @@
1
1
  import jsonLogic from 'json-logic-js';
2
+ // Method "closest" return nothing, so use getAllFormData instead
3
+ // One page can consist of many forms
4
+ // so please use carefully
2
5
  import { getAllFormData } from "../../components/composable/form";
3
6
 
4
7
  export default class {
@@ -140,6 +140,22 @@ function useChart({ dataSeries, spec, multiple = true }) {
140
140
  plugins: {}
141
141
  };
142
142
  }
143
+ if (spec.indexAxis) {
144
+ const allLabels = Object.keys(dataSeries?.[0]?.points || {});
145
+
146
+ options.indexAxis = 'y';
147
+ options.scales = {
148
+ y: {
149
+ type: 'category',
150
+ stacked: spec.horizontalStacked,
151
+ ticks: {
152
+ callback: function (_, index) {
153
+ return allLabels[index];
154
+ }
155
+ }
156
+ }
157
+ };
158
+ }
143
159
 
144
160
 
145
161
  options.plugins = {};
@@ -38,9 +38,9 @@ export default {
38
38
  'bottom': 'align-end'
39
39
  };
40
40
 
41
- const alignClass = configs[this.spec.align] || 'align-start';
41
+ const alignClass = configs[this.spec.align];
42
42
 
43
- classes.push(alignClass);
43
+ if (alignClass) classes.push(alignClass);
44
44
 
45
45
  return classes;
46
46
  },
@@ -43,7 +43,7 @@
43
43
 
44
44
  <script>
45
45
  import { vueApp } from "../../store";
46
- import draggable from "vuedraggable";
46
+ import * as draggable from "vuedraggable";
47
47
 
48
48
  export default {
49
49
  components: {
package/index.js CHANGED
@@ -169,6 +169,11 @@ function useGlibErrorReporter(endpointUrl = '/glib/errors') {
169
169
  // See https://stackoverflow.com/questions/52071212/how-to-implement-global-error-handling-in-vue
170
170
  Vue.config.errorHandler = (error, vm, info) => {
171
171
  console.error("Vue error:", error);
172
+
173
+ if (error instanceof TypeError && error.message.startsWith('Failed to fetch dynamically imported module')) {
174
+ window.alert('New version detected, please refresh the browser.');
175
+ }
176
+
172
177
  reportError(error);
173
178
  };
174
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "4.32.0",
3
+ "version": "4.33.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -51,17 +51,18 @@ export default class {
51
51
  }
52
52
 
53
53
  static vueName(component) {
54
+ let name;
54
55
  // _componentTag not found
55
56
  // return component.$options._componentTag;
56
57
  if (!component.name && component.spec) {
57
58
  if (component.spec.view == 'panels/fullPageForm') {
58
- component.name = 'panels-form';
59
+ name = 'panels-form';
59
60
  } else {
60
- component.name = (component.spec.view || '').replace('/', '-').replace('-v1', '');
61
+ name = (component.spec.view || '').replace('/', '-').replace('-v1', '');
61
62
  }
62
63
  }
63
64
 
64
- return component.name;
65
+ return name;
65
66
  }
66
67
 
67
68
  static async preserveScroll(promise) {
package/utils/http.js CHANGED
@@ -183,7 +183,8 @@ export default class {
183
183
  GLib.action.execute(page.onResponse, component);
184
184
 
185
185
  Utils.http.forceComponentUpdate(() => {
186
- page.key = strandom();
186
+ if (!properties.skipUpdateKey) page.key = strandom();
187
+
187
188
  jsonView.page = page;
188
189
  jsonView.source = 'server';
189
190
  const redirectUrl = Utils.url.htmlUrl(response.url);