@nocobase/plugin-data-visualization 0.14.0-alpha.6 → 0.14.0-alpha.7
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/dist/client/DataVisualization.d.ts +2 -0
- package/dist/client/chart/chart.d.ts +9 -23
- package/dist/client/chart/configs.d.ts +3 -0
- package/dist/client/chart/group.d.ts +32 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +37 -37
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/server/actions/query.js +1 -1
- package/dist/server/migrations/20230926211750-rename-charttype.d.ts +4 -0
- package/dist/server/migrations/20230926211750-rename-charttype.js +50 -0
- package/dist/server/plugin.js +8 -0
- package/package.json +2 -2
- package/dist/client/Settings.d.ts +0 -2
- package/dist/client/chart/library.d.ts +0 -28
package/dist/externalVersion.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@
|
|
3
|
-
"@formily/antd-v5": "1.1.0",
|
|
4
|
-
"@nocobase/client": "0.14.0-alpha.6",
|
|
5
|
-
"antd": "5.8.6",
|
|
2
|
+
"@nocobase/client": "0.14.0-alpha.7",
|
|
6
3
|
"react": "18.2.0",
|
|
7
4
|
"@formily/react": "2.2.27",
|
|
8
5
|
"@formily/shared": "2.2.27",
|
|
9
|
-
"@nocobase/cache": "0.14.0-alpha.
|
|
10
|
-
"@nocobase/server": "0.14.0-alpha.
|
|
6
|
+
"@nocobase/cache": "0.14.0-alpha.7",
|
|
7
|
+
"@nocobase/server": "0.14.0-alpha.7",
|
|
8
|
+
"@ant-design/icons": "5.1.4",
|
|
11
9
|
"dayjs": "1.11.9",
|
|
10
|
+
"@formily/antd-v5": "1.1.0",
|
|
12
11
|
"@formily/core": "2.2.27",
|
|
12
|
+
"antd": "5.8.6",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"ahooks": "3.7.8",
|
|
16
16
|
"@emotion/css": "11.11.2",
|
|
17
|
-
"@nocobase/actions": "0.14.0-alpha.
|
|
18
|
-
"@nocobase/database": "0.14.0-alpha.
|
|
19
|
-
"@nocobase/utils": "0.14.0-alpha.
|
|
17
|
+
"@nocobase/actions": "0.14.0-alpha.7",
|
|
18
|
+
"@nocobase/database": "0.14.0-alpha.7",
|
|
19
|
+
"@nocobase/utils": "0.14.0-alpha.7"
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2023-
|
|
1
|
+
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2023-10-07T08:28:55.867Z"}
|
|
@@ -144,7 +144,7 @@ const parseFieldAndAssociations = async (ctx, next) => {
|
|
|
144
144
|
const { collection: collectionName, measures, dimensions, orders, filter } = ctx.action.params.values;
|
|
145
145
|
const collection = ctx.db.getCollection(collectionName);
|
|
146
146
|
const fields = collection.fields;
|
|
147
|
-
const underscored =
|
|
147
|
+
const underscored = collection.options.underscored;
|
|
148
148
|
const models = {};
|
|
149
149
|
const parseField = (selected) => {
|
|
150
150
|
var _a, _b, _c;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var rename_charttype_exports = {};
|
|
19
|
+
__export(rename_charttype_exports, {
|
|
20
|
+
default: () => RenameChartTypeMigration
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(rename_charttype_exports);
|
|
23
|
+
var import_server = require("@nocobase/server");
|
|
24
|
+
class RenameChartTypeMigration extends import_server.Migration {
|
|
25
|
+
async up() {
|
|
26
|
+
const result = await this.app.version.satisfies("<=0.14.0-alpha.7");
|
|
27
|
+
if (!result) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const r = this.db.getRepository("uiSchemas");
|
|
31
|
+
const items = await r.find({
|
|
32
|
+
filter: {
|
|
33
|
+
"schema.x-decorator": "ChartRendererProvider"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
await this.db.sequelize.transaction(async (transaction) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
for (const item of items) {
|
|
39
|
+
const schema = item.schema;
|
|
40
|
+
const chartType = (_b = (_a = schema["x-decorator-props"]) == null ? void 0 : _a.config) == null ? void 0 : _b.chartType;
|
|
41
|
+
if (!chartType || chartType.startsWith("Built-in.")) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
schema["x-decorator-props"].config.chartType = `Built-in.${chartType}`;
|
|
45
|
+
item.set("schema", schema);
|
|
46
|
+
await item.save({ transaction });
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/server/plugin.js
CHANGED
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(plugin_exports);
|
|
|
24
24
|
var import_cache = require("@nocobase/cache");
|
|
25
25
|
var import_server = require("@nocobase/server");
|
|
26
26
|
var import_query = require("./actions/query");
|
|
27
|
+
var import_path = require("path");
|
|
27
28
|
class DataVisualizationPlugin extends import_server.Plugin {
|
|
28
29
|
cache;
|
|
29
30
|
afterAdd() {
|
|
@@ -38,6 +39,13 @@ class DataVisualizationPlugin extends import_server.Plugin {
|
|
|
38
39
|
this.app.acl.allow("charts", "query", "loggedIn");
|
|
39
40
|
}
|
|
40
41
|
async load() {
|
|
42
|
+
this.db.addMigrations({
|
|
43
|
+
namespace: "data-visulization",
|
|
44
|
+
directory: (0, import_path.resolve)(__dirname, "migrations"),
|
|
45
|
+
context: {
|
|
46
|
+
plugin: this
|
|
47
|
+
}
|
|
48
|
+
});
|
|
41
49
|
this.cache = (0, import_cache.createCache)({
|
|
42
50
|
ttl: 30,
|
|
43
51
|
// seconds
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-visualization",
|
|
3
|
-
"version": "0.14.0-alpha.
|
|
3
|
+
"version": "0.14.0-alpha.7",
|
|
4
4
|
"displayName": "Data Visualization",
|
|
5
5
|
"displayName.zh-CN": "数据可视化",
|
|
6
6
|
"description": "Provides business intelligence and data visualization features",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"@nocobase/test": "0.x",
|
|
34
34
|
"@nocobase/utils": "0.x"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "dc958417d27ed0753439bcef192be91a03dfc30f"
|
|
37
37
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChartType } from './chart';
|
|
3
|
-
export type ChartLibraries = {
|
|
4
|
-
[library: string]: {
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
charts: ChartType[];
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export declare const ChartLibraryContext: React.Context<ChartLibraries>;
|
|
10
|
-
export declare const useCharts: () => {
|
|
11
|
-
[name: string]: ChartType;
|
|
12
|
-
};
|
|
13
|
-
export declare const useChartTypes: () => {
|
|
14
|
-
label: string;
|
|
15
|
-
children: {
|
|
16
|
-
key: string;
|
|
17
|
-
label: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}[];
|
|
20
|
-
}[];
|
|
21
|
-
export declare const useDefaultChartType: () => string;
|
|
22
|
-
export declare const useToggleChartLibrary: () => {
|
|
23
|
-
toggle: (library: string) => void;
|
|
24
|
-
};
|
|
25
|
-
export declare const ChartLibraryProvider: React.FC<{
|
|
26
|
-
name: string;
|
|
27
|
-
charts: ChartType[];
|
|
28
|
-
}>;
|