@gisce/ooui 0.6.14 → 0.6.15
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/Graph/Graph.d.ts +2 -0
- package/dist/Graph/Graph.js +9 -0
- package/dist/Graph/Graph.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph/Graph.ts +6 -0
- package/src/spec/Graph.spec.ts +11 -0
- package/src/spec/domainParser.spec.ts +12 -0
package/dist/Graph/Graph.d.ts
CHANGED
package/dist/Graph/Graph.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
var Graph = /** @class */ (function () {
|
|
2
2
|
function Graph(element) {
|
|
3
3
|
this._string = null;
|
|
4
|
+
this._timerange = null;
|
|
4
5
|
this._string = element.getAttribute("string");
|
|
6
|
+
this._timerange = element.getAttribute("timerange");
|
|
5
7
|
}
|
|
6
8
|
Object.defineProperty(Graph.prototype, "string", {
|
|
7
9
|
get: function () {
|
|
@@ -17,6 +19,13 @@ var Graph = /** @class */ (function () {
|
|
|
17
19
|
enumerable: false,
|
|
18
20
|
configurable: true
|
|
19
21
|
});
|
|
22
|
+
Object.defineProperty(Graph.prototype, "timerange", {
|
|
23
|
+
get: function () {
|
|
24
|
+
return this._timerange;
|
|
25
|
+
},
|
|
26
|
+
enumerable: false,
|
|
27
|
+
configurable: true
|
|
28
|
+
});
|
|
20
29
|
return Graph;
|
|
21
30
|
}());
|
|
22
31
|
export { Graph };
|
package/dist/Graph/Graph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graph.js","sourceRoot":"","sources":["../../src/Graph/Graph.ts"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"Graph.js","sourceRoot":"","sources":["../../src/Graph/Graph.ts"],"names":[],"mappings":"AAEA;IAgBE,eAAY,OAAoB;QAfhC,YAAO,GAAkB,IAAI,CAAC;QAU9B,eAAU,GAAkB,IAAI,CAAC;QAM/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAjBD,sBAAI,yBAAM;aAAV;YACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;;;OAAA;IAGD,sBAAI,uBAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;;;OAAA;IAGD,sBAAI,4BAAS;aAAb;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;;;OAAA;IAMH,YAAC;AAAD,CAAC,AApBD,IAoBC"}
|
package/package.json
CHANGED
package/src/Graph/Graph.ts
CHANGED
|
@@ -11,7 +11,13 @@ export class Graph {
|
|
|
11
11
|
return this._type;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
_timerange: string | null = null;
|
|
15
|
+
get timerange(): string | null {
|
|
16
|
+
return this._timerange;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
constructor(element: HTMLElement) {
|
|
15
20
|
this._string = element.getAttribute("string");
|
|
21
|
+
this._timerange = element.getAttribute("timerange");
|
|
16
22
|
}
|
|
17
23
|
}
|
package/src/spec/Graph.spec.ts
CHANGED
|
@@ -54,4 +54,15 @@ describe("A Graph", () => {
|
|
|
54
54
|
expect(graph.field).toBe("potencia");
|
|
55
55
|
expect(graph.operator).toBe("+");
|
|
56
56
|
});
|
|
57
|
+
it("should parse a graph with timerange parameter", () => {
|
|
58
|
+
const xml = `<?xml version="1.0"?>
|
|
59
|
+
<graph type="line" timerange="day">
|
|
60
|
+
<field name="data_alta" axis="x"/>
|
|
61
|
+
<field name="data_alta" operator="count" axis="y"/>
|
|
62
|
+
</graph>
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const graph = parseGraph(xml) as GraphChart;
|
|
66
|
+
expect(graph.timerange).toBe("day");
|
|
67
|
+
});
|
|
57
68
|
});
|
|
@@ -37,4 +37,16 @@ describe("A Domain Parser", () => {
|
|
|
37
37
|
expect(domainForStageId![0][1]).toBe("ilike");
|
|
38
38
|
expect(domainForStageId![0][2]).toBe("backlog");
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
it("should properly transform plain domain", () => {
|
|
42
|
+
const domain = [["partner_id", "=", 3]];
|
|
43
|
+
const test = transformDomainForChildWidget({
|
|
44
|
+
domain: domain,
|
|
45
|
+
widgetFieldName: "bank",
|
|
46
|
+
}) as any;
|
|
47
|
+
expect(test!.length).toBe(1);
|
|
48
|
+
expect(test![0][0]).toBe("partner_id");
|
|
49
|
+
expect(test![0][1]).toBe("=");
|
|
50
|
+
expect(test![0][2]).toBe(3);
|
|
51
|
+
});
|
|
40
52
|
});
|