@nocobase/plugin-data-visualization 1.7.0-beta.3 → 1.7.0-beta.31

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.
@@ -148,9 +148,6 @@ export declare const getSelectedFields: (fields: FieldOption[], query: QueryProp
148
148
  target?: string;
149
149
  targetFields?: FieldOption[];
150
150
  }[];
151
- export declare const processData: (selectedFields: (FieldOption & {
152
- query?: any;
153
- })[], data: any[], scope: any) => {}[];
154
151
  export declare const removeUnparsableFilter: (filter: any) => any;
155
152
  export declare const getValuesByPath: (values: any, path: string) => any;
156
153
  export declare const getFormulaComponent: (type: string) => string;
@@ -8,24 +8,24 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.7.0-beta.3",
12
- "dayjs": "1.11.10",
11
+ "@nocobase/client": "1.7.0-beta.31",
13
12
  "@formily/react": "2.3.0",
13
+ "dayjs": "1.11.13",
14
14
  "@formily/shared": "2.3.2",
15
15
  "lodash": "4.17.21",
16
- "@nocobase/cache": "1.7.0-beta.3",
17
- "@nocobase/server": "1.7.0-beta.3",
18
- "@nocobase/test": "1.7.0-beta.3",
16
+ "@nocobase/cache": "1.7.0-beta.31",
17
+ "@nocobase/server": "1.7.0-beta.31",
18
+ "@nocobase/test": "1.7.0-beta.31",
19
+ "@nocobase/utils": "1.7.0-beta.31",
19
20
  "react": "18.2.0",
20
21
  "@emotion/css": "11.13.0",
21
22
  "@ant-design/icons": "5.6.1",
22
23
  "ahooks": "3.7.8",
23
- "antd": "5.12.8",
24
- "@formily/antd-v5": "1.1.9",
24
+ "antd": "5.24.2",
25
+ "@formily/antd-v5": "1.2.3",
25
26
  "@formily/core": "2.3.0",
26
- "@nocobase/utils": "1.7.0-beta.3",
27
27
  "react-i18next": "11.18.6",
28
- "@nocobase/actions": "1.7.0-beta.3",
29
- "@nocobase/database": "1.7.0-beta.3",
28
+ "@nocobase/actions": "1.7.0-beta.31",
29
+ "@nocobase/database": "1.7.0-beta.31",
30
30
  "sequelize": "6.35.2"
31
31
  };
@@ -3,7 +3,7 @@
3
3
  "Delete": "Elimina",
4
4
  "Cancel": "Annulla",
5
5
  "Submit": "Invia",
6
- "Actions": "Operazioni",
6
+ "Actions": "Azioni",
7
7
  "Title": "Titolo",
8
8
  "Enable": "Abilita",
9
9
  "Chart": "Grafico",
@@ -76,7 +76,7 @@
76
76
  "Expand": "Espandi",
77
77
  "Current filter": "Filtro corrente",
78
78
  "Add custom field": "Aggiungi campo personalizzato",
79
- "To filter with custom fields, use \"Current filter\" variables in the chart configuration.": "Per filtrare con campi personalizzati, utilizza le variabili \"Current filter\" nella configurazione del grafico.",
79
+ "To filter with custom fields, use \"Current filter\" variables in the chart configuration.": "Per filtrare con campi personalizzati, utilizza le variabili \"Filtro corrente\" nella configurazione del grafico.",
80
80
  "Input": "Input",
81
81
  "Date range": "Intervallo date",
82
82
  "Time range": "Intervallo tempo",
@@ -5,97 +5,97 @@
5
5
  "Submit": "Indienen",
6
6
  "Actions": "Acties",
7
7
  "Title": "Titel",
8
- "Enable": "Enable",
9
- "Chart": "Chart",
10
- "ChartV2": "ChartV2",
11
- "Charts": "Charts",
8
+ "Enable": "Inschakelen",
9
+ "Chart": "Grafiek",
10
+ "ChartV2": "GrafiekV2",
11
+ "Charts": "Grafieken",
12
12
  "Configure": "Configureren",
13
13
  "Duplicate": "Dupliceren",
14
- "Configure chart": "Configure chart",
15
- "Transform": "Transform",
14
+ "Configure chart": "Configureer grafiek",
15
+ "Transform": "Transformeer",
16
16
  "Chart type": "Grafiektype",
17
- "JSON config": "JSON config",
17
+ "JSON config": "JSON configuratie",
18
18
  "Query": "Query",
19
19
  "Data": "Data",
20
- "Run query": "Run query",
21
- "Measures": "Measures",
22
- "Dimensions": "Dimensions",
20
+ "Run query": "Query uitvoeren",
21
+ "Measures": "Afmetingen",
22
+ "Dimensions": "Dimensies",
23
23
  "Filter": "Filter",
24
24
  "Sort": "Sorteren",
25
- "Limit": "Limit",
25
+ "Limit": "Limiet",
26
26
  "Offset": "Offset",
27
- "Enable cache": "Enable cache",
28
- "TTL (second)": "TTL (second)",
29
- "Field": "Veld",
30
- "Aggregation": "Aggregation",
27
+ "Enable cache": "Cache inschakelen",
28
+ "TTL (second)": "TTL (seconde)",
29
+ "veld": "Veld",
30
+ "Aggregation": "Aggregatie",
31
31
  "Alias": "Alias",
32
32
  "Format": "Formaat",
33
- "The first 10 records of the query result:": "The first 10 records of the query result:",
34
- "Please run query to retrive data.": "Please run query to retrive data.",
33
+ "The first 10 records of the query result:": "De eerste 10 records van het queryresultaat:",
34
+ "Please run query to retrive data.": "Voer query uit om gegevens op te halen.",
35
35
  "Type": "Type",
36
- "Add field": "Voeg veld toe",
37
- "Add chart": "Add chart",
38
- "xField": "X field",
39
- "yField": "Y field",
40
- "seriesField": "Series field",
41
- "angleField": "Angle field",
42
- "colorField": "Color field",
43
- "Line": "Line",
36
+ "Add veld": "Voeg veld toe",
37
+ "Add chart": "Voeg grafiek toe",
38
+ "xField": "X veld",
39
+ "yField": "Y veld",
40
+ "seriesField": "Serie veld",
41
+ "angleField": "Hoek veld",
42
+ "colorField": "Kleur veld",
43
+ "Line": "Lijn",
44
44
  "Area": "Gebied",
45
45
  "Column": "Kolom",
46
46
  "Bar": "Bar",
47
- "Pie": "Pie",
48
- "Dual axes": "Dual axes",
47
+ "Pie": "Taart",
48
+ "Dual axes": "Dubbele assen",
49
49
  "Scatter": "Scatter",
50
50
  "Gauge": "Gauge",
51
- "Statistic": "Statistic",
52
- "Currency": "Currency",
51
+ "Statistic": "Statistiek",
52
+ "Currency": "Munteenheid",
53
53
  "Percent": "Percentage",
54
54
  "Exponential": "Exponential",
55
- "Abbreviation": "Abbreviation",
56
- "Please configure and run query": "Please configure and run query",
57
- "Please configure chart": "Please configure chart",
58
- "Are you sure to cancel?": "Are you sure to cancel?",
59
- "You changes are not saved. If you click OK, your changes will be lost.": "You changes are not saved. If you click OK, your changes will be lost.",
60
- "Same properties set in the form above will be overwritten by this JSON config.": "Same properties set in the form above will be overwritten by this JSON config.",
55
+ "Abbreviation": "Afkorting",
56
+ "Please configure and run query": "Configureer en voer de query uit",
57
+ "Please configure chart": "Configureer grafiek",
58
+ "Are you sure to cancel?": "Ben je zeker dat je wil annuleren?",
59
+ "You changes are not saved. If you click OK, your changes will be lost.": "Je wijzigingen worden niet opgeslagen. Als je op OK klikt, gaan je wijzigingen verloren.",
60
+ "Same properties set in the form above will be overwritten by this JSON config.": "Sommige eigenschappen die in het bovenstaande formulier zijn ingesteld, worden overschreven door deze JSON-configuratie.",
61
61
  "Built-in": "Ingebouwd",
62
- "Config reference: ": "Config reference: ",
62
+ "Config reference: ": "Configuratie referentie: ",
63
63
  "Table": "Tabel",
64
- "Sum": "Sum",
65
- "Avg": "Avg",
66
- "Count": "Count",
64
+ "Sum": "Som",
65
+ "Avg": "Gem",
66
+ "Count": "Aantal",
67
67
  "Min": "Min",
68
68
  "Max": "Max",
69
- "Please select a chart type.": "Please select a chart type.",
69
+ "Please select a chart type.": "Kies een grafiektype.",
70
70
  "Collection": "Collectie",
71
- "isStack": "isStack",
72
- "isPercent": "isPercent",
73
- "isGroup": "isGroup",
74
- "smooth": "smooth",
75
- "Expand": "Expand",
76
- "Current filter": "Current filter",
77
- "Add custom field": "Add custom field",
78
- "To filter with custom fields, use \"Current filter\" variables in the chart configuration.": "To filter with custom fields, use \"Current filter\" variables in the chart configuration.",
79
- "Input": "Input",
80
- "Date range": "Date range",
81
- "Time range": "Time range",
82
- "Edit field properties": "Edit field properties",
83
- "Select a source field to use metadata of the field": "Select a source field to use metadata of the field",
84
- "Original field": "Original field",
85
- "Transformation": "Transformation",
86
- "Add transformation": "Add transformation",
71
+ "isStack": "isStapel",
72
+ "isPercent": "isPercentage",
73
+ "isGroup": "isGroep",
74
+ "smooth": "glad",
75
+ "Expand": "Uitbreiden",
76
+ "Current filter": "Huidige filter",
77
+ "Add custom veld": "Aangepast veld toevoegen",
78
+ "To filter with custom fields, use \"Current filter\" variables in the chart configuration.": "Als je wil filteren met aangepaste velden, gebruik je de variabelen \"Current filter\" in de grafiekconfiguratie.",
79
+ "Input": "Invoer",
80
+ "Date range": "Datumbereik",
81
+ "Time range": "Tijdsbereik",
82
+ "Edit veld properties": "Bewerk veld eigenschappen",
83
+ "Select a source veld to use metadata of the veld": "Selecteer een bronveld om metagegevens van het veld te gebruiken",
84
+ "Original veld": "Origineel veld",
85
+ "Transformation": "Transformatie",
86
+ "Add transformation": "Transformatie toevoegen",
87
87
  "Container": "Container",
88
- "Show border": "Show border",
89
- "Transformation tip": "Fields allow multiple transformations, applied sequentially. Pay attention to data type changes after each transformation. Drag-and-drop functionality enables adjustment of transformation order.",
90
- "Type conversion": "Type conversion",
91
- "Transformer": "Transformer",
88
+ "Show border": "Toon rand",
89
+ "Transformation tip": "Velden staan ​​meerdere transformaties toe, die sequentieel worden toegepast. Let op wijzigingen in het gegevenstype na elke transformatie. Drag-and-drop-functionaliteit maakt aanpassing van de transformatievolgorde mogelijk.",
90
+ "Type conversion": "Type conversie",
91
+ "Transformer": "Transformeer",
92
92
  "Size": "Grootte",
93
- "Width": "Width",
94
- "Height": "Height",
93
+ "Width": "Breedte",
94
+ "Height": "Hoogte",
95
95
  "Aspect ratio": "Aspect ratio",
96
- "Fixed height": "Fixed height",
97
- "Show background": "Show background",
98
- "Show padding": "Show padding",
99
- "Distinct": "Distinct",
100
- "Auto refresh": "Auto refresh"
96
+ "Fixed height": "Vaste hoogte",
97
+ "Show background": "Toon achtergrond",
98
+ "Show padding": "Toon opvulling",
99
+ "Distinct": "Onderscheiden",
100
+ "Auto refresh": "Auto vernieuwing"
101
101
  }
@@ -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":"2025-03-13T23:28:46.405Z"}
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":"2025-05-15T09:25:18.207Z"}
@@ -1 +1 @@
1
- {"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2025-03-13T23:28:47.069Z"}
1
+ {"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2025-05-15T09:25:18.832Z"}
@@ -170,11 +170,16 @@ const parseFieldAndAssociations = async (ctx, next) => {
170
170
  const stack = [...filterInclude];
171
171
  while (stack.length) {
172
172
  const item = stack.pop();
173
- if (((_a = fields.get(item.association)) == null ? void 0 : _a.type) === "belongsToMany") {
173
+ const parentCollection = db.getCollection(item.parentCollection || collectionName);
174
+ const field = parentCollection.fields.get(item.association);
175
+ if ((field == null ? void 0 : field.type) === "belongsToMany") {
174
176
  item.through = { attributes: [] };
175
177
  }
176
- if (item.include) {
177
- stack.push(...item.include);
178
+ if ((field == null ? void 0 : field.target) && ((_a = item.include) == null ? void 0 : _a.length)) {
179
+ for (const child of item.include) {
180
+ child.parentCollection = field.target;
181
+ stack.push(child);
182
+ }
178
183
  }
179
184
  }
180
185
  }
@@ -215,10 +220,10 @@ const cacheMiddleware = async (ctx, next) => {
215
220
  const checkPermission = (ctx, next) => {
216
221
  var _a;
217
222
  const { collection, dataSource } = ctx.action.params.values;
218
- const roleName = ctx.state.currentRole || "anonymous";
223
+ const roleNames = ctx.state.currentRoles || ["anonymous"];
219
224
  const acl = ((_a = ctx.app.dataSourceManager.get(dataSource)) == null ? void 0 : _a.acl) || ctx.app.acl;
220
- const can = acl.can({ role: roleName, resource: collection, action: "list" });
221
- if (!can && roleName !== "root") {
225
+ const can = acl.can({ roles: roleNames, resource: collection, action: "list" });
226
+ if (!can && !roleNames.includes("root")) {
222
227
  ctx.throw(403, "No permissions");
223
228
  }
224
229
  return next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-visualization",
3
- "version": "1.7.0-beta.3",
3
+ "version": "1.7.0-beta.31",
4
4
  "displayName": "Data visualization",
5
5
  "displayName.zh-CN": "数据可视化",
6
6
  "description": "Provides data visualization feature, including chart block and chart filter block, support line charts, area charts, bar charts and more than a dozen kinds of charts, you can also extend more chart types.",
@@ -34,7 +34,7 @@
34
34
  "@nocobase/test": "1.x",
35
35
  "@nocobase/utils": "1.x"
36
36
  },
37
- "gitHead": "8d52cb1d366a968f87c1cd3f98f55f24be3056a5",
37
+ "gitHead": "84bf8bcfeeaf3a05086e24cef00507ca209ac3c5",
38
38
  "keywords": [
39
39
  "Blocks"
40
40
  ]