@gisce/react-ooui 2.0.0-rc.0 → 2.0.0-rc.11
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/actionbar/TreeActionBar.d.ts.map +1 -1
- package/dist/common/SelectAllRecordsRow.d.ts +10 -0
- package/dist/common/SelectAllRecordsRow.d.ts.map +1 -0
- package/dist/context/ContentRootContext.d.ts.map +1 -1
- package/dist/helpers/dynamicColumnsHelper.d.ts +9 -1
- package/dist/helpers/dynamicColumnsHelper.d.ts.map +1 -1
- package/dist/helpers/formHelper.d.ts +1 -0
- package/dist/helpers/formHelper.d.ts.map +1 -1
- package/dist/helpers/treeHelper.d.ts +2 -1
- package/dist/helpers/treeHelper.d.ts.map +1 -1
- package/dist/hooks/useSearch.d.ts +1 -0
- package/dist/hooks/useSearch.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/ca_ES.d.ts +4 -0
- package/dist/locales/ca_ES.d.ts.map +1 -1
- package/dist/locales/en_US.d.ts +4 -0
- package/dist/locales/en_US.d.ts.map +1 -1
- package/dist/locales/es_ES.d.ts +4 -0
- package/dist/locales/es_ES.d.ts.map +1 -1
- package/dist/react-ooui.es.js +5621 -5204
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +19 -14
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/types/index.d.ts +30 -29
- package/dist/types/index.d.ts.map +1 -1
- package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
- package/dist/widgets/WidgetFactory.d.ts.map +1 -1
- package/dist/widgets/base/Integer.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
- package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
- package/dist/widgets/custom/Avatar.d.ts.map +1 -1
- package/dist/widgets/custom/Comments.d.ts +35 -0
- package/dist/widgets/custom/Comments.d.ts.map +1 -0
- package/dist/widgets/views/Form.d.ts +2 -2
- package/dist/widgets/views/Form.d.ts.map +1 -1
- package/dist/widgets/views/SearchTree.d.ts.map +1 -1
- package/dist/widgets/views/Tree.d.ts +1 -0
- package/dist/widgets/views/Tree.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +0 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/actionbar/FormActionBar.tsx +1 -1
- package/src/actionbar/TreeActionBar.tsx +84 -82
- package/src/common/SelectAllRecordsRow.tsx +95 -0
- package/src/context/ContentRootContext.tsx +5 -3
- package/src/helpers/dynamicColumnsHelper.ts +1 -1
- package/src/helpers/formHelper.ts +5 -0
- package/src/helpers/iconMapper.ts +1 -2
- package/src/helpers/treeHelper.ts +14 -3
- package/src/hooks/useExport.ts +2 -3
- package/src/hooks/useSearch.ts +16 -3
- package/src/index.ts +2 -0
- package/src/locales/ca_ES.tsx +5 -0
- package/src/locales/en_US.tsx +5 -0
- package/src/locales/es_ES.tsx +5 -0
- package/src/stories/custom/Comments.stories.tsx +190 -0
- package/src/stories/dashboard/DashboardGrid.stories.tsx +13 -0
- package/src/stories/mocks/models/cups.ts +16 -3
- package/src/types/index.ts +92 -41
- package/src/views/actionViews/GraphActionView.tsx +0 -1
- package/src/widgets/WidgetFactory.tsx +3 -0
- package/src/widgets/base/Integer.tsx +14 -1
- package/src/widgets/base/many2one/Many2oneSuffix.tsx +24 -12
- package/src/widgets/base/one2many/One2manyInput.tsx +11 -3
- package/src/widgets/custom/Avatar.tsx +0 -1
- package/src/widgets/custom/Comments.tsx +144 -0
- package/src/widgets/views/Form.tsx +83 -9
- package/src/widgets/views/Graph/GraphIndicator.tsx +3 -3
- package/src/widgets/views/SearchTree.tsx +12 -8
- package/src/widgets/views/Tree.tsx +62 -48
- package/src/widgets/views/searchFilter/SearchFilter.tsx +1 -3
|
@@ -295,3 +295,8 @@ export const colorTextFromBackground = (color: string) => {
|
|
|
295
295
|
return getTextColor(color);
|
|
296
296
|
|
|
297
297
|
}
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
export const stringFormat = (text: string, values: any): string => {
|
|
301
|
+
return text.replace(/\{([^}]+)\}/g, (match, key) => values[key] !== undefined ? values[key] : match);
|
|
302
|
+
}
|
|
@@ -150,8 +150,7 @@ function getIconForKey(
|
|
|
150
150
|
const TablerIcon = () =>
|
|
151
151
|
React.createElement(TablerIcons[tablerKey] as any, {
|
|
152
152
|
fill: "transparent",
|
|
153
|
-
|
|
154
|
-
width: 17,
|
|
153
|
+
size: props?.style?.fontSize || 17
|
|
155
154
|
});
|
|
156
155
|
const CustomIcon = () =>
|
|
157
156
|
React.createElement(Icon, {
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
Reference,
|
|
7
7
|
} from "@gisce/ooui";
|
|
8
8
|
import { TreeView, Column } from "@/types";
|
|
9
|
-
import {object} from "@storybook/addon-knobs";
|
|
10
9
|
|
|
11
10
|
const getTree = (treeView: TreeView): TreeOoui => {
|
|
12
11
|
const xml = treeView.arch;
|
|
@@ -125,13 +124,13 @@ function getColorMap(colorsValue: any) {
|
|
|
125
124
|
return getItemsAttributes(colorsValue, "colors");
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
function getStatusMap(values: any){
|
|
127
|
+
function getStatusMap(values: any) {
|
|
129
128
|
return getItemsAttributes(values, "status");
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
function getItemsAttributes(attributes: object[], attribute: string) {
|
|
133
132
|
if (!attributes) {
|
|
134
|
-
return undefined
|
|
133
|
+
return undefined;
|
|
135
134
|
}
|
|
136
135
|
const map: any = {};
|
|
137
136
|
attributes.forEach((entry: any) => {
|
|
@@ -181,6 +180,17 @@ function sortResults({
|
|
|
181
180
|
return resultsToSort.sort(sortFn);
|
|
182
181
|
}
|
|
183
182
|
|
|
183
|
+
function hasActualValues(obj: Record<string, any>): boolean {
|
|
184
|
+
for (const key in obj) {
|
|
185
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
186
|
+
if (obj[key] !== undefined) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
|
|
184
194
|
export {
|
|
185
195
|
getTableColumns,
|
|
186
196
|
getTableItems,
|
|
@@ -190,4 +200,5 @@ export {
|
|
|
190
200
|
getColorMap,
|
|
191
201
|
getStatusMap,
|
|
192
202
|
sortResults,
|
|
203
|
+
hasActualValues,
|
|
193
204
|
};
|
package/src/hooks/useExport.ts
CHANGED
|
@@ -181,7 +181,7 @@ export const useExport = ({
|
|
|
181
181
|
|
|
182
182
|
const onRemovePredefinedExport = useCallback(
|
|
183
183
|
async (pExport: PredefinedExport) => {
|
|
184
|
-
await ConnectionProvider.getHandler().
|
|
184
|
+
await ConnectionProvider.getHandler().deleteObjects({
|
|
185
185
|
model: "ir.exports",
|
|
186
186
|
ids: [pExport.id!],
|
|
187
187
|
});
|
|
@@ -367,8 +367,7 @@ const retrieveKeyFieldsForPredefinedExports = async ({
|
|
|
367
367
|
onGetFieldChilds: (key: string) => Promise<ExportField[]>;
|
|
368
368
|
}) => {
|
|
369
369
|
const allPredefinedExportKeys = predefinedExports.flatMap(
|
|
370
|
-
(exp: PredefinedExport) =>
|
|
371
|
-
exp.fields.map((field: any) => field.key)
|
|
370
|
+
(exp: PredefinedExport) => exp.fields.map((field: any) => field.key)
|
|
372
371
|
);
|
|
373
372
|
|
|
374
373
|
const keysWithoutChildsInFields = getKeysWithoutChildsInFields({
|
package/src/hooks/useSearch.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mergeParams } from "@/helpers/searchHelper";
|
|
2
2
|
import {
|
|
3
|
-
getColorMap,
|
|
3
|
+
getColorMap,
|
|
4
|
+
getStatusMap,
|
|
4
5
|
getTableItems,
|
|
5
6
|
getTree,
|
|
6
7
|
sortResults,
|
|
@@ -176,7 +177,8 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
176
177
|
const { params, newOffset } = opts || {};
|
|
177
178
|
|
|
178
179
|
const mergedParams = mergeParams(params || searchParams, domain);
|
|
179
|
-
const { colors, status } = getTree(treeView!);
|
|
180
|
+
const { colors, status } = getTree(treeView!);
|
|
181
|
+
const attrs: any = {};
|
|
180
182
|
if (colors) {
|
|
181
183
|
attrs.colors = colors;
|
|
182
184
|
}
|
|
@@ -184,7 +186,6 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
184
186
|
attrs.status = status;
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
|
|
188
189
|
const { totalItems, results, attrsEvaluated } =
|
|
189
190
|
await ConnectionProvider.getHandler().searchForTree({
|
|
190
191
|
params: mergedParams,
|
|
@@ -264,6 +265,7 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
264
265
|
} catch (error) {
|
|
265
266
|
setSearchError(error.message);
|
|
266
267
|
} finally {
|
|
268
|
+
setSelectedRowItems?.([]);
|
|
267
269
|
setSearchFilterLoading(false);
|
|
268
270
|
setTreeIsLoading?.(false);
|
|
269
271
|
}
|
|
@@ -293,6 +295,7 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
293
295
|
|
|
294
296
|
const changeSort = useCallback(
|
|
295
297
|
(newSorter: any) => {
|
|
298
|
+
if (JSON.stringify(newSorter) === JSON.stringify(sorter)) return;
|
|
296
299
|
setSorter?.(newSorter);
|
|
297
300
|
const sortedResults =
|
|
298
301
|
newSorter !== undefined
|
|
@@ -400,6 +403,15 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
400
403
|
[treeView, model, context, getResults, setResults]
|
|
401
404
|
);
|
|
402
405
|
|
|
406
|
+
const getAllIds = useCallback(async () => {
|
|
407
|
+
return await ConnectionProvider.getHandler().searchAllIds({
|
|
408
|
+
params: mergeParams(searchParams, domain),
|
|
409
|
+
model,
|
|
410
|
+
context,
|
|
411
|
+
totalItems,
|
|
412
|
+
});
|
|
413
|
+
}, [model, context, totalItems, searchParams, domain]);
|
|
414
|
+
|
|
403
415
|
return {
|
|
404
416
|
submit,
|
|
405
417
|
clear,
|
|
@@ -417,5 +429,6 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
417
429
|
colorsForResults,
|
|
418
430
|
statusForResults,
|
|
419
431
|
totalItems,
|
|
432
|
+
getAllIds,
|
|
420
433
|
};
|
|
421
434
|
};
|
package/src/index.ts
CHANGED
|
@@ -45,6 +45,7 @@ import { Radio } from "@/widgets/custom/Radio";
|
|
|
45
45
|
import { Switch } from "@/widgets/custom/Switch";
|
|
46
46
|
import { Steps } from "@/widgets/custom/Steps";
|
|
47
47
|
import { CodeEditor } from "@/widgets/custom/CodeEditor";
|
|
48
|
+
import { CommentsTimelineField } from "@/widgets/custom/Comments";
|
|
48
49
|
import {
|
|
49
50
|
DashboardGridItem,
|
|
50
51
|
DashboardGrid,
|
|
@@ -159,6 +160,7 @@ export {
|
|
|
159
160
|
Switch,
|
|
160
161
|
Steps,
|
|
161
162
|
CodeEditor,
|
|
163
|
+
CommentsTimelineField,
|
|
162
164
|
ExportModal,
|
|
163
165
|
ConfigContext,
|
|
164
166
|
Tab,
|
package/src/locales/ca_ES.tsx
CHANGED
|
@@ -90,4 +90,9 @@ export default {
|
|
|
90
90
|
advancedExport: "Exportació avançada",
|
|
91
91
|
savedRegisters: "Registre guardat correctament",
|
|
92
92
|
errorWhileSavingForm: "Error en guardar el formulari",
|
|
93
|
+
autor: "Autor",
|
|
94
|
+
recordsSelected:
|
|
95
|
+
"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta pàgina.",
|
|
96
|
+
selectAllRecords: "Seleccionar tots els {totalRecords} registres.",
|
|
97
|
+
allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
|
|
93
98
|
};
|
package/src/locales/en_US.tsx
CHANGED
|
@@ -87,4 +87,9 @@ export default {
|
|
|
87
87
|
advancedExport: "Advanced export",
|
|
88
88
|
savedRegisters: "Record successfully saved",
|
|
89
89
|
errorWhileSavingForm: "Error while saving form",
|
|
90
|
+
author: "Author",
|
|
91
|
+
recordsSelected:
|
|
92
|
+
"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta pàgina.",
|
|
93
|
+
selectAllRecords: "Seleccionar tots els {totalRecords} registres.",
|
|
94
|
+
allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
|
|
90
95
|
};
|
package/src/locales/es_ES.tsx
CHANGED
|
@@ -91,4 +91,9 @@ export default {
|
|
|
91
91
|
advancedExport: "Exportación avanzada",
|
|
92
92
|
savedRegisters: "Registro guardado correctamente",
|
|
93
93
|
errorWhileSavingForm: "Error al guardar el formulario",
|
|
94
|
+
author: "Autor",
|
|
95
|
+
recordsSelected:
|
|
96
|
+
"Hay {numberOfSelectedRows} registros seleccionados en ésta página.",
|
|
97
|
+
selectAllRecords: "Seleccionar todos los {totalRecords} registros.",
|
|
98
|
+
allRecordsSelected: "Hay {totalRecords} registros seleccionados.",
|
|
94
99
|
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
import LocaleProvider from "../../context/LocaleContext";
|
|
4
|
+
import { Comments, CommentsTimeline, EventsType } from "../../widgets/custom/Comments";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/Widgets/Custom/Comments",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Default = (): React.ReactElement => {
|
|
12
|
+
|
|
13
|
+
const data = [
|
|
14
|
+
{
|
|
15
|
+
id: 1,
|
|
16
|
+
text: "Totam odit eum distinctio tempore. Numquam illo dolorum laboriosam vel illum. Sunt saepe ab nihil soluta placeat ullam.\n" +
|
|
17
|
+
"Eius ea enim ut. Unde consequatur ducimus esse ullam. Odio fugit reprehenderit sunt.\n" +
|
|
18
|
+
"Recusandae a aliquid. Iusto quisquam temporibus a assumenda aut fuga. Tenetur cum quis saepe et alias delectus quos.\n" +
|
|
19
|
+
"Corporis adipisci eaque quod. Aperiam voluptatum doloribus accusamus suscipit.\n" +
|
|
20
|
+
"Iste corporis non quisquam adipisci fuga. Aperiam possimus est ratione modi dicta. Cum consequatur eius harum ea eius omnis.\n" +
|
|
21
|
+
"Eveniet sit iste sed commodi cumque. Quis ipsam maxime quam eveniet.\n" +
|
|
22
|
+
"Repellat officia praesentium adipisci aspernatur impedit. Voluptas architecto autem vero et praesentium dignissimos.\n" +
|
|
23
|
+
"Nisi ex sapiente incidunt eveniet mollitia. Iure libero natus perferendis voluptate iure fuga.\n" +
|
|
24
|
+
"Vel voluptate cumque laudantium. Reiciendis sapiente eaque neque exercitationem inventore nam.",
|
|
25
|
+
author: "Ciríaco Pelayo Camps",
|
|
26
|
+
email: "ciraco@example.com",
|
|
27
|
+
date: "2023-04-01 10:00:00",
|
|
28
|
+
isSender: true,
|
|
29
|
+
isAuthor: false,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 2,
|
|
33
|
+
text: "Dicta eligendi pariatur ratione ipsam accusantium. Ad minus nesciunt optio id ipsum.\n" +
|
|
34
|
+
"Incidunt eligendi doloremque molestias. Voluptate sapiente nulla veritatis.\n" +
|
|
35
|
+
"Nostrum minima ad repudiandae optio laborum.\n" +
|
|
36
|
+
"Adipisci sint quasi laudantium explicabo ab nostrum. Rerum nemo itaque officia. Velit accusamus itaque accusantium ducimus quidem quae cum.\n" +
|
|
37
|
+
"Sequi possimus harum maxime. Qui laboriosam voluptate pariatur laudantium nam quo. Vel dolorum magni nam iusto sapiente animi quaerat. Debitis minus temporibus molestias quae accusamus.\n" +
|
|
38
|
+
"Nobis ab adipisci laborum doloremque impedit quo. Tempore cumque accusamus voluptates. In non facere in.\n" +
|
|
39
|
+
"Laboriosam exercitationem possimus quo sequi. Aspernatur quia consequuntur aspernatur repudiandae molestiae modi. Vero esse nisi dicta nihil accusantium nesciunt.\n" +
|
|
40
|
+
"Modi voluptatem excepturi. Architecto sapiente nobis quis ipsam. Doloremque ipsum pariatur dicta at.",
|
|
41
|
+
author: "Plácido Baeza Vaquero",
|
|
42
|
+
email: "placido@example.com",
|
|
43
|
+
date: "2023-04-01 11:00:00",
|
|
44
|
+
isSender: false,
|
|
45
|
+
isAuthor: true,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 3,
|
|
49
|
+
text: "Amet tempora ipsum ipsum delectus.\n" +
|
|
50
|
+
"Autem minus magnam in eveniet. Veniam voluptas deleniti eaque sequi autem.\n" +
|
|
51
|
+
"Occaecati laborum ut voluptatum maxime iure cupiditate. Facere vitae aliquid.\n" +
|
|
52
|
+
"Nemo nihil enim quia exercitationem. Quisquam aut autem magni occaecati velit.\n" +
|
|
53
|
+
"Perferendis impedit iure nostrum ratione nemo distinctio.\n" +
|
|
54
|
+
"Facilis deserunt amet officia accusantium qui. Non corporis rerum deleniti harum optio ipsa ducimus. Veniam saepe illo aspernatur id quae omnis.\n" +
|
|
55
|
+
"Distinctio dolor sequi odio officia amet natus. Quidem quidem quibusdam animi alias quia distinctio.\n" +
|
|
56
|
+
"Eum placeat expedita possimus eveniet. Fugit earum corrupti itaque. Ab expedita officiis numquam.\n" +
|
|
57
|
+
"Quos optio iure quos minima deserunt assumenda beatae. Illo quod non aliquid.\n" +
|
|
58
|
+
"Nobis odio reprehenderit ullam numquam. Beatae molestiae aperiam ratione.\n" +
|
|
59
|
+
"Quidem perferendis minima animi ipsa natus aliquam. Exercitationem perferendis sequi assumenda. Eaque ducimus saepe deleniti eum iure itaque.",
|
|
60
|
+
author: "Jorge Acosta Valverde",
|
|
61
|
+
email: "jorge@example.com",
|
|
62
|
+
date: "2023-04-01 11:30:00",
|
|
63
|
+
isSender: false,
|
|
64
|
+
isAuthor: false,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 4,
|
|
68
|
+
text: "Esse tempora amet consectetur asperiores dicta. Quidem est harum tempora voluptatum mollitia.\n" +
|
|
69
|
+
"Voluptate reprehenderit sint vitae laborum animi placeat nihil. Maxime iure porro delectus voluptate. Molestiae dolorem natus alias ipsam consequuntur. Nisi nam exercitationem voluptas saepe occaecati.\n" +
|
|
70
|
+
"Reprehenderit quam ex est vel.\n" +
|
|
71
|
+
"Magnam quidem laudantium reprehenderit rerum nam ducimus perspiciatis. Vero omnis sed ducimus quidem dolores dolor illum.\n" +
|
|
72
|
+
"Corrupti a iste praesentium. Exercitationem cum id neque.\n" +
|
|
73
|
+
"Optio repellat excepturi sapiente alias iusto quaerat. Explicabo fuga cupiditate atque porro. Qui fuga ea quis porro id.\n" +
|
|
74
|
+
"Natus optio ab reiciendis quae aperiam tempore. Voluptatem asperiores adipisci ullam nobis. Saepe quas odit rem ad autem cum consequatur.\n" +
|
|
75
|
+
"Numquam deleniti veniam rem. Enim doloremque consectetur quas reprehenderit. Numquam unde a animi odio sequi.\n" +
|
|
76
|
+
"Cum at eos fuga.\n" +
|
|
77
|
+
"Vel exercitationem excepturi placeat. Quisquam neque quasi impedit at.",
|
|
78
|
+
author: "Ciríaco Pelayo Camps",
|
|
79
|
+
email: "ciraco@example.com",
|
|
80
|
+
date: "2023-04-01 13:00:00",
|
|
81
|
+
isSender: true,
|
|
82
|
+
isAuthor: false,
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
return (
|
|
86
|
+
<LocaleProvider lang="es_ES">
|
|
87
|
+
<Comments data={data} />
|
|
88
|
+
</LocaleProvider>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Timeline = () => {
|
|
93
|
+
const data = [
|
|
94
|
+
{
|
|
95
|
+
type: "action",
|
|
96
|
+
event: {
|
|
97
|
+
date: "2023-04-01 10:00",
|
|
98
|
+
action: "Draft",
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "comment",
|
|
103
|
+
event: {
|
|
104
|
+
id: 1,
|
|
105
|
+
text: "Totam odit eum distinctio tempore. Numquam illo dolorum laboriosam vel illum. Sunt saepe ab nihil soluta placeat ullam.\n" +
|
|
106
|
+
"Eius ea enim ut. Unde consequatur ducimus esse ullam. Odio fugit reprehenderit sunt.\n" +
|
|
107
|
+
"Recusandae a aliquid. Iusto quisquam temporibus a assumenda aut fuga. Tenetur cum quis saepe et alias delectus quos.\n" +
|
|
108
|
+
"Corporis adipisci eaque quod. Aperiam voluptatum doloribus accusamus suscipit.\n" +
|
|
109
|
+
"Iste corporis non quisquam adipisci fuga. Aperiam possimus est ratione modi dicta. Cum consequatur eius harum ea eius omnis.\n" +
|
|
110
|
+
"Eveniet sit iste sed commodi cumque. Quis ipsam maxime quam eveniet.\n" +
|
|
111
|
+
"Repellat officia praesentium adipisci aspernatur impedit. Voluptas architecto autem vero et praesentium dignissimos.\n" +
|
|
112
|
+
"Nisi ex sapiente incidunt eveniet mollitia. Iure libero natus perferendis voluptate iure fuga.\n" +
|
|
113
|
+
"Vel voluptate cumque laudantium. Reiciendis sapiente eaque neque exercitationem inventore nam.",
|
|
114
|
+
author: "Ciríaco Pelayo Camps",
|
|
115
|
+
email: "ciraco@example.com",
|
|
116
|
+
date: "2023-04-01 10:00:00",
|
|
117
|
+
isSender: true,
|
|
118
|
+
isAuthor: true,
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: "action",
|
|
123
|
+
event: {
|
|
124
|
+
date: "2023-04-01 10:10",
|
|
125
|
+
action: "Open",
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: "comment",
|
|
130
|
+
event: {
|
|
131
|
+
id: 2,
|
|
132
|
+
text: "Dicta eligendi pariatur ratione ipsam accusantium. Ad minus nesciunt optio id ipsum.\n" +
|
|
133
|
+
"Incidunt eligendi doloremque molestias. Voluptate sapiente nulla veritatis.\n" +
|
|
134
|
+
"Nostrum minima ad repudiandae optio laborum.\n" +
|
|
135
|
+
"Adipisci sint quasi laudantium explicabo ab nostrum. Rerum nemo itaque officia. Velit accusamus itaque accusantium ducimus quidem quae cum.\n" +
|
|
136
|
+
"Sequi possimus harum maxime. Qui laboriosam voluptate pariatur laudantium nam quo. Vel dolorum magni nam iusto sapiente animi quaerat. Debitis minus temporibus molestias quae accusamus.\n" +
|
|
137
|
+
"Nobis ab adipisci laborum doloremque impedit quo. Tempore cumque accusamus voluptates. In non facere in.\n" +
|
|
138
|
+
"Laboriosam exercitationem possimus quo sequi. Aspernatur quia consequuntur aspernatur repudiandae molestiae modi. Vero esse nisi dicta nihil accusantium nesciunt.\n" +
|
|
139
|
+
"Modi voluptatem excepturi. Architecto sapiente nobis quis ipsam. Doloremque ipsum pariatur dicta at.",
|
|
140
|
+
author: "Plácido Baeza Vaquero",
|
|
141
|
+
email: "placido@example.com",
|
|
142
|
+
date: "2023-04-01 11:00:00",
|
|
143
|
+
isSender: false,
|
|
144
|
+
isAuthor: false,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: "comment",
|
|
149
|
+
event: {
|
|
150
|
+
id: 4,
|
|
151
|
+
text: "Esse tempora amet consectetur asperiores dicta. Quidem est harum tempora voluptatum mollitia.\n" +
|
|
152
|
+
"Voluptate reprehenderit sint vitae laborum animi placeat nihil. Maxime iure porro delectus voluptate. Molestiae dolorem natus alias ipsam consequuntur. Nisi nam exercitationem voluptas saepe occaecati.\n" +
|
|
153
|
+
"Reprehenderit quam ex est vel.\n" +
|
|
154
|
+
"Magnam quidem laudantium reprehenderit rerum nam ducimus perspiciatis. Vero omnis sed ducimus quidem dolores dolor illum.\n" +
|
|
155
|
+
"Corrupti a iste praesentium. Exercitationem cum id neque.\n" +
|
|
156
|
+
"Optio repellat excepturi sapiente alias iusto quaerat. Explicabo fuga cupiditate atque porro. Qui fuga ea quis porro id.\n" +
|
|
157
|
+
"Natus optio ab reiciendis quae aperiam tempore. Voluptatem asperiores adipisci ullam nobis. Saepe quas odit rem ad autem cum consequatur.\n" +
|
|
158
|
+
"Numquam deleniti veniam rem. Enim doloremque consectetur quas reprehenderit. Numquam unde a animi odio sequi.\n" +
|
|
159
|
+
"Cum at eos fuga.\n" +
|
|
160
|
+
"Vel exercitationem excepturi placeat. Quisquam neque quasi impedit at.",
|
|
161
|
+
author: "Ciríaco Pelayo Camps",
|
|
162
|
+
email: "ciraco@example.com",
|
|
163
|
+
date: "2023-04-01 13:00:00",
|
|
164
|
+
isSender: true,
|
|
165
|
+
isAuthor: false,
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: "action",
|
|
170
|
+
event: {
|
|
171
|
+
action: "Pendent",
|
|
172
|
+
date: "2023-04-01 13:05:00"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: "action",
|
|
177
|
+
event: {
|
|
178
|
+
action: "Close",
|
|
179
|
+
date: "2023-04-01 13:35:00"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
] as EventsType[]
|
|
183
|
+
return (
|
|
184
|
+
<LocaleProvider lang="es_ES">
|
|
185
|
+
<CommentsTimeline value={data} />
|
|
186
|
+
</LocaleProvider>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
@@ -24,6 +24,19 @@ export function Default(): React.ReactElement {
|
|
|
24
24
|
// suffix={"€"}
|
|
25
25
|
/>
|
|
26
26
|
</DashboardGridItem>
|
|
27
|
+
<DashboardGridItem
|
|
28
|
+
title="test"
|
|
29
|
+
parms={{ w: 3, h: 9, x: 0, y: 0, id: 10 }}
|
|
30
|
+
>
|
|
31
|
+
<GraphIndicator
|
|
32
|
+
model="res.partner"
|
|
33
|
+
context={{}}
|
|
34
|
+
domain={{}}
|
|
35
|
+
icon={"bolt"}
|
|
36
|
+
showPercent={true}
|
|
37
|
+
// suffix={"€"}
|
|
38
|
+
/>
|
|
39
|
+
</DashboardGridItem>
|
|
27
40
|
</DashboardGrid>
|
|
28
41
|
</LocaleProvider>
|
|
29
42
|
);
|
|
@@ -4,7 +4,8 @@ export default {
|
|
|
4
4
|
aclarador: "aclaridor",
|
|
5
5
|
active: true,
|
|
6
6
|
autoconsum_id: false,
|
|
7
|
-
|
|
7
|
+
ax: 347.21,
|
|
8
|
+
bq: 347.21,
|
|
8
9
|
butlletins: [],
|
|
9
10
|
catas_bq: false,
|
|
10
11
|
catas_cpa: false,
|
|
@@ -49,7 +50,7 @@ export default {
|
|
|
49
50
|
tv: false,
|
|
50
51
|
},
|
|
51
52
|
form: {
|
|
52
|
-
arch: '<form string="CUPS">\n <notebook colspan="4">\n <page string="Corbes"> <group colspan="4"> <group string="Validada" colspan="2"> <field name="
|
|
53
|
+
arch: '<form string="CUPS">\n <notebook colspan="4">\n <page string="Corbes"> <group colspan="4"> <group string="Validada" colspan="2"> <field name="ax" string="AX"/> <field name="bq" string="Format"/> </group> <group string="Facturada" colspan="2"> <field name="bq" string="Última corba"/> <field name="bq" string="Format"/> </group> <group string="Autoconsumida" colspan="2"> <field name="bq" string="Última corba"/> <field name="bq" string="Format"/> </group> <group string="Generada Neta" colspan="2"> <field name="bq" string="Última corba"/> <field name="bq" string="Format"/> </group> <group string="Quart-Horària" colspan="2"> <field name="bq1" string="Última corba"/> <field name="bq" string="Format"/> </group> </group> </page> <page string="General">\n <field name="name" select="1" size="25"/>\n <field name="active" select="1"/>\n <field name="distribuidora_id" domain="[(\'supplier\',\'=\',True)]" context="{\'task\': \'test\'}" required="1" select="1"/>\n <field name="id_municipi" select="1"/>\n <field name="id_provincia"/>\n <field name="id_poblacio" select="1" domain="[(\'municipi_id.id\', \'=\', id_municipi)]"/>\n <field name="dp"/>\n <field name="direccio" select="1" colspan="4"/>\n <field name="polissa_polissa" select="1"/>\n <field name="polissa_comptador" select="1"/>\n <field name="polissa_potencia"/>\n <field name="potencia_adscrita" attrs="{\'readonly\':[(\'force_potencia_adscrita\',\'=\',0)]}"/>\n <field name="force_potencia_adscrita"/>\n <group colspan="4" string="Adreces">\n <notebook colspan="4">\n <page string="Principal">\n <separator string="Zona urbana" colspan="4"/>\n <field name="tv"/>\n <field name="nv" select="1"/>\n <field name="pnp" select="1"/>\n <field name="bq" select="1"/>\n <field name="es" select="1"/>\n <field name="pt" select="1"/>\n <field name="pu" select="1"/>\n <field name="aclarador" colspan="4" select="1"/>\n <separator string="Zona industrial" colspan="4"/>\n <field name="cpo" select="1"/>\n <field name="cpa" select="1"/>\n </page>\n <page string="Cadastre">\n <separator string="Zona urbana" colspan="4"/>\n <field name="catas_np"/>\n <field name="catas_nm"/>\n <field name="ref_catastral" select="1"/>\n <button type="object" name="update_dir_from_ref" string="Obtenir del Cadastre"/>\n <button type="object" name="delete_dir_ref" string="Eliminar dades del Cadastre" confirm="Està segur que vol eliminar les dades que s\'han obtingut del cadastre?"/>\n <field name="catas_ldt" colspan="4"/>\n <field name="catas_tv"/>\n <field name="catas_nv"/>\n <field name="catas_pnp"/>\n <field name="catas_bq"/>\n <field name="catas_es"/>\n <field name="catas_pt"/>\n <field name="catas_pu"/>\n <field name="catas_dp"/>\n <separator string="Zona industrial" colspan="4"/>\n <field name="catas_cpo"/>\n <field name="catas_cpa"/>\n <separator string="Sincronització amb el cadastre" colspan="4"/>\n <label colspan="2" string="Si disposa de la referencia cadastral pot copiar les dades del cadastre a l\'adreça principal mitjançant aquest botó"/>\n <button type="object" name="copy_to_alternative" string="Copiar a la principal"/>\n </page>\n <page string="Notes">\n <field name="notes" colspan="4" nolabel="1"/>\n </page>\n </notebook>\n </group>\n </page>\n <page string="Autoconsum">\n <field name="autoconsum_id" readonly="1" colspan="4"/>\n <field name="coef_repartiment" readonly="1" colspan="4"/>\n </page>\n <page string="Butlletins">\n <field name="butlletins" colspan="4" nolabel="1" context="{\'cups_id\': active_id}"/>\n </page>\n <page string="Històric d\'autoconsums">\n <field name="hist_autoconsum" nolabel="1" context="{\'default_cups_id\': active_id}" readonly="1"/>\n </page>\n <page string="Històric de pòlisses">\n <field name="polisses" nolabel="1" colspan="4">\n </field>\n </page>\n </notebook>\n </form>',
|
|
53
54
|
field_parent: false,
|
|
54
55
|
fields: {
|
|
55
56
|
aclarador: {
|
|
@@ -72,10 +73,22 @@ export default {
|
|
|
72
73
|
type: "many2one",
|
|
73
74
|
views: {},
|
|
74
75
|
},
|
|
76
|
+
ax: {
|
|
77
|
+
size: 4,
|
|
78
|
+
string: "Bloc",
|
|
79
|
+
type: "integer",
|
|
80
|
+
views: {},
|
|
81
|
+
},
|
|
75
82
|
bq: {
|
|
76
83
|
size: 4,
|
|
77
84
|
string: "Bloc",
|
|
78
|
-
type: "
|
|
85
|
+
type: "integer",
|
|
86
|
+
views: {},
|
|
87
|
+
},
|
|
88
|
+
bq1: {
|
|
89
|
+
size: 4,
|
|
90
|
+
string: "Bloc",
|
|
91
|
+
type: "integer",
|
|
79
92
|
views: {},
|
|
80
93
|
},
|
|
81
94
|
butlletins: {
|
package/src/types/index.ts
CHANGED
|
@@ -84,6 +84,7 @@ type SearchRequest = {
|
|
|
84
84
|
context?: any;
|
|
85
85
|
attrs?: any;
|
|
86
86
|
order?: number | string | null;
|
|
87
|
+
fieldsToRetrieve?: string[];
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
type SearchAllIdsRequest = SearchCountRequest & {
|
|
@@ -251,52 +252,102 @@ type ExportDataOptions = {
|
|
|
251
252
|
};
|
|
252
253
|
|
|
253
254
|
type ConnectionProviderType = {
|
|
254
|
-
getActionStringForModel: (
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
255
|
+
getActionStringForModel: (
|
|
256
|
+
model: string,
|
|
257
|
+
requestConfig?: any
|
|
258
|
+
) => Promise<string>;
|
|
259
|
+
getViewsForAction: (
|
|
260
|
+
{
|
|
261
|
+
action,
|
|
262
|
+
context,
|
|
263
|
+
}: {
|
|
264
|
+
action: string;
|
|
265
|
+
context?: any;
|
|
266
|
+
},
|
|
267
|
+
requestConfig?: any
|
|
268
|
+
) => Promise<ViewData>;
|
|
262
269
|
getView: (
|
|
263
|
-
options: GetViewRequest
|
|
270
|
+
options: GetViewRequest,
|
|
271
|
+
requestConfig?: any
|
|
264
272
|
) => Promise<FormView | TreeView | GraphView>;
|
|
265
|
-
getFields: (options: GetFieldsRequest) => Promise<any>;
|
|
266
|
-
searchAllIds: (
|
|
267
|
-
|
|
273
|
+
getFields: (options: GetFieldsRequest, requestConfig?: any) => Promise<any>;
|
|
274
|
+
searchAllIds: (
|
|
275
|
+
options: SearchAllIdsRequest,
|
|
276
|
+
requestConfig?: any
|
|
277
|
+
) => Promise<number[]>;
|
|
278
|
+
searchCount: (
|
|
279
|
+
options: SearchCountRequest,
|
|
280
|
+
requestConfig?: any
|
|
281
|
+
) => Promise<number>;
|
|
268
282
|
search: (options: SearchRequest) => Promise<any[]>;
|
|
269
|
-
searchForTree: (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
283
|
+
searchForTree: (
|
|
284
|
+
options: SearchRequest,
|
|
285
|
+
requestConfig?: any
|
|
286
|
+
) => Promise<SearchResponse>;
|
|
287
|
+
update: (options: UpdateObjectRequest, requestConfig?: any) => Promise<any>;
|
|
288
|
+
create: (options: CreateObjectRequest, requestConfig?: any) => Promise<any>;
|
|
289
|
+
deleteObjects: (
|
|
290
|
+
options: DeleteObjectsRequest,
|
|
291
|
+
requestConfig?: any
|
|
292
|
+
) => Promise<any>;
|
|
293
|
+
execute: (options: ExecuteRequest, requestConfig?: any) => Promise<any>;
|
|
294
|
+
readObjects: (
|
|
295
|
+
options: ReadObjectsRequest,
|
|
296
|
+
requestConfig?: any
|
|
297
|
+
) => Promise<any>;
|
|
298
|
+
readEvalUiObjects: (
|
|
299
|
+
options: ReadEvalUiObjectsRequest,
|
|
300
|
+
requestConfig?: any
|
|
301
|
+
) => Promise<any>;
|
|
302
|
+
parseCondition: (
|
|
303
|
+
options: ParseConditionRequest,
|
|
304
|
+
requestConfig?: any
|
|
305
|
+
) => Promise<any>;
|
|
306
|
+
executeWorkflow: (
|
|
307
|
+
options: ExecuteRequest,
|
|
308
|
+
requestConfig?: any
|
|
309
|
+
) => Promise<any>;
|
|
310
|
+
createReport: (
|
|
311
|
+
options: CreateReportRequest,
|
|
312
|
+
requestConfig?: any
|
|
313
|
+
) => Promise<any>;
|
|
314
|
+
getReport: (options: GetReportRequest, requestConfig?: any) => Promise<any>;
|
|
315
|
+
executeOnChange: (
|
|
316
|
+
options: ExecuteOnChangeRequest,
|
|
317
|
+
requestConfig?: any
|
|
318
|
+
) => Promise<any>;
|
|
319
|
+
defaultGet: (options: DefaultGetRequest, requestConfig?: any) => Promise<any>;
|
|
320
|
+
getActionData: (
|
|
321
|
+
{
|
|
322
|
+
action,
|
|
323
|
+
context,
|
|
324
|
+
}: {
|
|
325
|
+
action: string;
|
|
326
|
+
context?: any;
|
|
327
|
+
},
|
|
328
|
+
requestConfig?: any
|
|
329
|
+
) => Promise<any>;
|
|
330
|
+
nameSearch: (options: NameSearchRequest, requestConfig?: any) => Promise<any>;
|
|
331
|
+
duplicate: (options: DuplicateRequest, requestConfig?: any) => Promise<any>;
|
|
332
|
+
evalDomain: (options: EvalDomainRequest, requestConfig?: any) => Promise<any>;
|
|
333
|
+
getLogInfo: (options: GetLogInfoRequest, requestConfig?: any) => Promise<any>;
|
|
293
334
|
isShortcutFavorite: (
|
|
294
|
-
options: IsShortcutFavoriteOptions
|
|
335
|
+
options: IsShortcutFavoriteOptions,
|
|
336
|
+
requestConfig?: any
|
|
295
337
|
) => Promise<number | boolean>;
|
|
296
|
-
removeFavourite: (
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
338
|
+
removeFavourite: (
|
|
339
|
+
{ shortcut_id }: { shortcut_id: number },
|
|
340
|
+
requestConfig?: any
|
|
341
|
+
) => Promise<void>;
|
|
342
|
+
addFavourite: (
|
|
343
|
+
options: IsShortcutFavoriteOptions,
|
|
344
|
+
requestConfig?: any
|
|
345
|
+
) => Promise<void>;
|
|
346
|
+
treeButOpen: (
|
|
347
|
+
options: TreeButOpenOptions,
|
|
348
|
+
requestConfig?: any
|
|
349
|
+
) => Promise<any>;
|
|
350
|
+
exportData: (options: ExportDataOptions, requestConfig?: any) => Promise<any>;
|
|
300
351
|
};
|
|
301
352
|
|
|
302
353
|
type ViewType = "tree" | "form" | "dashboard" | "graph" | "calendar";
|