@geode/opengeodeweb-front 10.34.0-rc.17 → 10.34.0-rc.19
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.
|
@@ -31,6 +31,7 @@ interface LabeledItem {
|
|
|
31
31
|
id: string;
|
|
32
32
|
title?: string;
|
|
33
33
|
is_active?: boolean;
|
|
34
|
+
category?: string;
|
|
34
35
|
children?: unknown[];
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -52,6 +53,9 @@ const tooltipTitle = computed<string>(() =>
|
|
|
52
53
|
);
|
|
53
54
|
|
|
54
55
|
const tooltipDisabled = computed<boolean>(() => {
|
|
56
|
+
if (actualItem.value.category !== undefined) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
55
59
|
if (isLeaf !== undefined) {
|
|
56
60
|
return !isLeaf;
|
|
57
61
|
}
|
package/app/stores/back.ts
CHANGED
|
@@ -9,6 +9,10 @@ interface UploadFileParams {
|
|
|
9
9
|
schema: JsonRpcSchema & { methods: string[] };
|
|
10
10
|
file: File;
|
|
11
11
|
params?: Record<string, string | Blob>;
|
|
12
|
+
// When true, the file is sent as the raw request body instead of multipart
|
|
13
|
+
// FormData, with `params`/filename moved into the query string. See
|
|
14
|
+
// OpenGeodeWeb-Back's upload_file route, which supports both request shapes.
|
|
15
|
+
raw?: boolean;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
// Loosely-typed shapes for the dynamic error/response values reported by fetchRaw.
|
|
@@ -34,7 +38,7 @@ function isFetchErrorResponseLike(value: unknown): value is FetchErrorResponseLi
|
|
|
34
38
|
|
|
35
39
|
async function upload_file(
|
|
36
40
|
microservice: Microservice,
|
|
37
|
-
{ schema, file, params = {} }: UploadFileParams,
|
|
41
|
+
{ schema, file, params = {}, raw = false }: UploadFileParams,
|
|
38
42
|
{ request_error_function, response_function, response_error_function }: RequestHandlers = {},
|
|
39
43
|
): Promise<unknown> {
|
|
40
44
|
console.log("[UPLOAD_FILE] Uploading file", { schema, file });
|
|
@@ -44,14 +48,25 @@ async function upload_file(
|
|
|
44
48
|
throw new Error("file must be an instance of File");
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
let route = schema.$id;
|
|
52
|
+
let body: FormData | File = file;
|
|
53
|
+
|
|
54
|
+
if (raw) {
|
|
55
|
+
const queryEntries = Object.entries(params).filter(
|
|
56
|
+
(entry): entry is [string, string] => typeof entry[1] === "string",
|
|
57
|
+
);
|
|
58
|
+
const query = new URLSearchParams([...queryEntries, ["filename", file.name]]);
|
|
59
|
+
route = `${route}?${query.toString()}`;
|
|
60
|
+
} else {
|
|
61
|
+
const formData = new FormData();
|
|
62
|
+
for (const [key, value] of Object.entries(params)) {
|
|
63
|
+
formData.append(key, value);
|
|
64
|
+
}
|
|
65
|
+
formData.append("file", file);
|
|
66
|
+
body = formData;
|
|
50
67
|
}
|
|
51
|
-
body.append("file", file);
|
|
52
68
|
|
|
53
69
|
microservice.start_request();
|
|
54
|
-
const route = schema.$id;
|
|
55
70
|
|
|
56
71
|
const result = await fetchRaw(
|
|
57
72
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.34.0-rc.
|
|
3
|
+
"version": "10.34.0-rc.19",
|
|
4
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
5
|
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
6
|
"bugs": {
|