@sankhyalabs/core 5.20.0-dev.65 → 5.20.0-dev.66
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.
|
@@ -12,6 +12,8 @@ class LoadingControlReducerImpl {
|
|
|
12
12
|
return Object.assign(Object.assign({}, currentState), { paginationInfo: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.paginationInfo });
|
|
13
13
|
case Action.PAGINATION_UPDATED:
|
|
14
14
|
return Object.assign(Object.assign({}, currentState), { paginationInfo: action.payload });
|
|
15
|
+
case Action.DATA_SAVED:
|
|
16
|
+
return Object.assign(Object.assign({}, currentState), { paginationInfo: updatePaginationInfo(stateManager, action.payload) });
|
|
15
17
|
}
|
|
16
18
|
return currentState;
|
|
17
19
|
}
|
|
@@ -44,4 +46,18 @@ export const hasPreviousPages = (stateManager) => {
|
|
|
44
46
|
const paginationInfo = getPaginationInfo(stateManager);
|
|
45
47
|
return paginationInfo ? paginationInfo.currentPage > 0 : false;
|
|
46
48
|
};
|
|
49
|
+
const updatePaginationInfo = (stateManager, payload) => {
|
|
50
|
+
const paginationInfo = getPaginationInfo(stateManager);
|
|
51
|
+
let { records, changes } = payload;
|
|
52
|
+
if (!records || !changes || !paginationInfo || !validateNewRecordOperation(changes))
|
|
53
|
+
return paginationInfo;
|
|
54
|
+
const { count, firstRecord, lastRecord, total } = paginationInfo;
|
|
55
|
+
return Object.assign(Object.assign({}, paginationInfo), { count: (count !== null && count !== void 0 ? count : 0) + records.length, firstRecord: firstRecord === 0 && records.length > 0 ? 1 : firstRecord, lastRecord: lastRecord + records.length, total: (total !== null && total !== void 0 ? total : 0) + records.length });
|
|
56
|
+
};
|
|
57
|
+
const validateNewRecordOperation = (changes) => {
|
|
58
|
+
return changes.every(change => isNewRecordOperation(change._operation));
|
|
59
|
+
};
|
|
60
|
+
const isNewRecordOperation = (operation) => {
|
|
61
|
+
return ["INSERT", "COPY"].includes(operation);
|
|
62
|
+
};
|
|
47
63
|
//# sourceMappingURL=LoadingControlSlice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingControlSlice.js","sourceRoot":"","sources":["../../../../src/dataunit/state/slice/LoadingControlSlice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoadingControlSlice.js","sourceRoot":"","sources":["../../../../src/dataunit/state/slice/LoadingControlSlice.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,MAAM,yBAAyB;IAA/B;QAEW,cAAS,GAAW,gBAAgB,CAAC;IAgBhD,CAAC;IAdU,MAAM,CAAC,YAA0B,EAAE,YAAiC,EAAE,MAAmB;;QAC5F,QAAQ,MAAM,CAAC,IAAI,EAAE;YACjB,KAAK,MAAM,CAAC,YAAY;gBACpB,uCAAW,YAAY,KAAE,WAAW,EAAE,MAAM,CAAC,OAAO,IAAE;YAC1D,KAAK,MAAM,CAAC,WAAW;gBACnB,uCAAW,YAAY,KAAE,cAAc,EAAE,MAAA,MAAM,CAAC,OAAO,0CAAE,cAAc,IAAE;YAC7E,KAAK,MAAM,CAAC,kBAAkB;gBAC1B,uCAAW,YAAY,KAAE,cAAc,EAAE,MAAM,CAAC,OAAO,IAAE;YAC7D,KAAK,MAAM,CAAC,UAAU;gBAClB,uCAAW,YAAY,KAAE,cAAc,EAAE,oBAAoB,CAAC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,IAAE;SAEpG;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,yBAAyB,EAAE,CAAC;AAErE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA0B,EAA4B,EAAE;IACtF,MAAM,KAAK,GAAwB,YAAY,CAAC,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,CAAC,KAA0B,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IAC/H,OAAO,KAAK,C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AC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC,CAAC"}
|
package/package.json
CHANGED
package/reports/test-report.xml
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<unitTest version="1">
|
|
3
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
4
|
+
<testCase name="HttpProvider Metodo GET" duration="71"/>
|
|
5
|
+
</file>
|
|
6
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
7
|
+
<testCase name="HttpProvider Metodo POST" duration="79"/>
|
|
8
|
+
</file>
|
|
3
9
|
<file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
|
|
4
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="
|
|
5
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="
|
|
10
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="5"/>
|
|
11
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="0"/>
|
|
6
12
|
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
|
|
7
13
|
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="0"/>
|
|
8
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="
|
|
14
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
|
|
9
15
|
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
|
|
10
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="
|
|
16
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
|
|
11
17
|
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
|
|
12
18
|
<testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
|
|
13
19
|
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
|
|
14
20
|
<testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
|
|
15
21
|
<testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
|
|
16
|
-
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="
|
|
22
|
+
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="88"/>
|
|
17
23
|
</file>
|
|
18
24
|
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
|
|
19
|
-
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="
|
|
25
|
+
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="103"/>
|
|
20
26
|
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="1"/>
|
|
21
27
|
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="1"/>
|
|
22
|
-
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="
|
|
23
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="
|
|
28
|
+
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="2"/>
|
|
29
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="1"/>
|
|
24
30
|
<testCase name="StringUtils it should return undefined as "expression" and "[]" as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
|
|
25
31
|
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
26
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="0"/>
|
|
27
32
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
33
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="24"/>
|
|
28
34
|
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
29
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
35
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
30
36
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
31
37
|
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
32
38
|
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
33
39
|
</file>
|
|
34
40
|
<file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
|
|
35
|
-
<testCase name="Mask Formatter mask:CPF complete valid" duration="
|
|
41
|
+
<testCase name="Mask Formatter mask:CPF complete valid" duration="96"/>
|
|
36
42
|
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
|
|
37
43
|
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
|
|
38
44
|
<testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
|
|
39
|
-
<testCase name="Mask Formatter mask:CPF too long valid" duration="
|
|
40
|
-
<testCase name="Mask Formatter mask:CPF invalid for string" duration="
|
|
45
|
+
<testCase name="Mask Formatter mask:CPF too long valid" duration="20"/>
|
|
46
|
+
<testCase name="Mask Formatter mask:CPF invalid for string" duration="279"/>
|
|
41
47
|
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
|
|
42
48
|
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
|
|
43
|
-
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="
|
|
44
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
49
|
+
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
|
|
50
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="66"/>
|
|
45
51
|
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
|
|
46
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="
|
|
47
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
52
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="0"/>
|
|
53
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="13"/>
|
|
48
54
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
49
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="
|
|
50
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
55
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
56
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
51
57
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
52
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="
|
|
58
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="2"/>
|
|
59
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="4"/>
|
|
60
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
|
|
61
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
53
62
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
54
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
55
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
56
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="76"/>
|
|
57
63
|
</file>
|
|
58
|
-
<file path="/builds/dti/design-system/sankhyacore/test/
|
|
59
|
-
<testCase name="
|
|
64
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
|
|
65
|
+
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the constructor" duration="11"/>
|
|
66
|
+
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the setters methods" duration="1"/>
|
|
67
|
+
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
|
|
68
|
+
</file>
|
|
69
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
|
|
70
|
+
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="3"/>
|
|
71
|
+
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
|
|
72
|
+
<testCase name="TimeFormatter Case: validateTime" duration="1"/>
|
|
73
|
+
</file>
|
|
74
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
|
|
75
|
+
<testCase name="RecordsSlice should return newlines at the end" duration="80"/>
|
|
60
76
|
</file>
|
|
61
77
|
<file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
|
|
62
|
-
<testCase name="StringUtils valor vazio" duration="
|
|
78
|
+
<testCase name="StringUtils valor vazio" duration="7"/>
|
|
63
79
|
<testCase name="StringUtils valor em branco" duration="1"/>
|
|
64
80
|
<testCase name="StringUtils valor null" duration="0"/>
|
|
65
81
|
<testCase name="StringUtils valor undefined" duration="1"/>
|
|
66
|
-
<testCase name="StringUtils valor 0" duration="
|
|
67
|
-
<testCase name="StringUtils com valor" duration="
|
|
82
|
+
<testCase name="StringUtils valor 0" duration="1"/>
|
|
83
|
+
<testCase name="StringUtils com valor" duration="9"/>
|
|
68
84
|
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
|
|
69
|
-
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="
|
|
70
|
-
<testCase name="StringUtils should return the original value when called with undefined" duration="
|
|
85
|
+
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="6"/>
|
|
86
|
+
<testCase name="StringUtils should return the original value when called with undefined" duration="71"/>
|
|
71
87
|
</file>
|
|
72
|
-
<file path="/builds/dti/design-system/sankhyacore/test/
|
|
73
|
-
<testCase name="
|
|
88
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
|
|
89
|
+
<testCase name="OverflowWatcher should initialize with provided parameters" duration="28"/>
|
|
90
|
+
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
|
|
91
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="293"/>
|
|
92
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="12"/>
|
|
93
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="19"/>
|
|
94
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="21"/>
|
|
95
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="8"/>
|
|
96
|
+
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="193"/>
|
|
97
|
+
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="2"/>
|
|
74
98
|
</file>
|
|
75
99
|
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
76
|
-
<testCase name="StringUtils stringToNumber" duration="
|
|
77
|
-
<testCase name="StringUtils format" duration="
|
|
78
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
100
|
+
<testCase name="StringUtils stringToNumber" duration="100"/>
|
|
101
|
+
<testCase name="StringUtils format" duration="510"/>
|
|
79
102
|
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
80
|
-
<testCase name="StringUtils format
|
|
81
|
-
|
|
82
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
|
|
83
|
-
<testCase name="OverflowWatcher should initialize with provided parameters" duration="87"/>
|
|
84
|
-
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="10"/>
|
|
85
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="285"/>
|
|
86
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="108"/>
|
|
87
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="12"/>
|
|
88
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="84"/>
|
|
89
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="7"/>
|
|
90
|
-
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="93"/>
|
|
91
|
-
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
|
|
92
|
-
</file>
|
|
93
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
|
|
94
|
-
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the constructor" duration="1"/>
|
|
95
|
-
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the setters methods" duration="0"/>
|
|
96
|
-
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
|
|
97
|
-
</file>
|
|
98
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
|
|
99
|
-
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
|
|
100
|
-
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
|
|
101
|
-
<testCase name="TimeFormatter Case: validateTime" duration="1"/>
|
|
102
|
-
</file>
|
|
103
|
-
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
|
|
104
|
-
<testCase name="RecordsSlice should return newlines at the end" duration="3"/>
|
|
105
|
-
</file>
|
|
106
|
-
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
|
|
107
|
-
<testCase name="DataUnit should return false when not waiting to reload" duration="3"/>
|
|
108
|
-
<testCase name="DataUnit should set waitingToReload to true" duration="0"/>
|
|
109
|
-
<testCase name="DataUnit should set waitingToReload to false" duration="1"/>
|
|
110
|
-
<testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="2"/>
|
|
103
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="105"/>
|
|
104
|
+
<testCase name="StringUtils format round number" duration="2"/>
|
|
111
105
|
</file>
|
|
112
106
|
<file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
|
|
113
|
-
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="
|
|
114
|
-
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="
|
|
107
|
+
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="56"/>
|
|
108
|
+
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
115
109
|
<testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
|
|
116
110
|
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
117
111
|
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
|
|
118
|
-
<testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="
|
|
112
|
+
<testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="1"/>
|
|
113
|
+
</file>
|
|
114
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
|
|
115
|
+
<testCase name="DataUnit should return false when not waiting to reload" duration="4"/>
|
|
116
|
+
<testCase name="DataUnit should set waitingToReload to true" duration="1"/>
|
|
117
|
+
<testCase name="DataUnit should set waitingToReload to false" duration="1"/>
|
|
118
|
+
<testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="10"/>
|
|
119
119
|
</file>
|
|
120
120
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
|
|
121
121
|
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="20"/>
|
|
122
122
|
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="2"/>
|
|
123
123
|
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
124
124
|
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="1"/>
|
|
125
|
-
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
126
|
-
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
127
|
-
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="
|
|
125
|
+
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
126
|
+
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="2"/>
|
|
127
|
+
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="1"/>
|
|
128
128
|
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="1"/>
|
|
129
|
-
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
130
|
-
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
131
|
-
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
132
|
-
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="
|
|
133
|
-
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
134
|
-
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="
|
|
135
|
-
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="
|
|
136
|
-
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="
|
|
137
|
-
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
138
|
-
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
129
|
+
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="62"/>
|
|
130
|
+
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
131
|
+
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
132
|
+
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="2"/>
|
|
133
|
+
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
134
|
+
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="8"/>
|
|
135
|
+
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="5"/>
|
|
136
|
+
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
137
|
+
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
138
|
+
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="5"/>
|
|
139
139
|
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
140
|
-
<testCase name="addIDInfo 20 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
140
|
+
<testCase name="addIDInfo 20 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
141
141
|
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
142
142
|
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="1"/>
|
|
143
143
|
</file>
|
|
144
144
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
145
|
-
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="
|
|
145
|
+
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="33"/>
|
|
146
146
|
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
|
|
147
|
-
<testCase name="calcMarginSize should threat values defined as zero" duration="
|
|
147
|
+
<testCase name="calcMarginSize should threat values defined as zero" duration="5"/>
|
|
148
148
|
</file>
|
|
149
149
|
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
|
|
150
|
-
<testCase name="getFormattedValue should return empty string when value is null" duration="
|
|
150
|
+
<testCase name="getFormattedValue should return empty string when value is null" duration="7"/>
|
|
151
151
|
<testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
|
|
152
152
|
<testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
|
|
153
|
-
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="
|
|
154
|
-
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="
|
|
153
|
+
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="2"/>
|
|
154
|
+
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
|
|
155
155
|
<testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
|
|
156
|
-
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="
|
|
157
|
-
<testCase name="getFormattedValue should return empty string when value is undefined" duration="
|
|
158
|
-
<testCase name="getFormattedValue should return value as string when value is not an object" duration="
|
|
156
|
+
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
|
|
157
|
+
<testCase name="getFormattedValue should return empty string when value is undefined" duration="1"/>
|
|
158
|
+
<testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
|
|
159
159
|
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="1"/>
|
|
160
160
|
<testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
|
|
161
|
-
<testCase name="getFormattedValue should format numbers correctly" duration="
|
|
162
|
-
<testCase name="getFormattedValue should format dates correctly" duration="
|
|
163
|
-
<testCase name="getFormattedValue should format times correctly" duration="
|
|
161
|
+
<testCase name="getFormattedValue should format numbers correctly" duration="27"/>
|
|
162
|
+
<testCase name="getFormattedValue should format dates correctly" duration="7"/>
|
|
163
|
+
<testCase name="getFormattedValue should format times correctly" duration="1"/>
|
|
164
164
|
<testCase name="getFormattedValue should format datetime correctly" duration="1"/>
|
|
165
165
|
<testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
|
|
166
166
|
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
|
|
167
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="
|
|
167
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
|
|
168
168
|
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
|
|
169
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="
|
|
170
|
-
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="
|
|
169
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
|
|
170
|
+
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="1"/>
|
|
171
171
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
|
|
172
|
-
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="
|
|
173
|
-
<testCase name="getFormattedValue should format masked values correctly" duration="
|
|
172
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
|
|
173
|
+
<testCase name="getFormattedValue should format masked values correctly" duration="1"/>
|
|
174
174
|
</file>
|
|
175
175
|
</unitTest>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { ChangeOperation } from "../../DataUnit.js";
|
|
2
3
|
import { LoadDataRequest } from "../../loading/LoadDataRequest.js";
|
|
3
4
|
import { PaginationInfo } from "../../loading/PaginationInfo.js";
|
|
4
5
|
import { Action } from "../action/DataUnitAction.js";
|
|
@@ -16,6 +17,9 @@ class LoadingControlReducerImpl implements ActionReducer {
|
|
|
16
17
|
return {...currentState, paginationInfo: action.payload?.paginationInfo};
|
|
17
18
|
case Action.PAGINATION_UPDATED:
|
|
18
19
|
return {...currentState, paginationInfo: action.payload};
|
|
20
|
+
case Action.DATA_SAVED:
|
|
21
|
+
return {...currentState, paginationInfo: updatePaginationInfo(stateManager, action.payload)};
|
|
22
|
+
|
|
19
23
|
}
|
|
20
24
|
return currentState;
|
|
21
25
|
}
|
|
@@ -56,7 +60,45 @@ export const hasPreviousPages = (stateManager: StateManager): boolean => {
|
|
|
56
60
|
return paginationInfo ? paginationInfo.currentPage > 0 : false;
|
|
57
61
|
}
|
|
58
62
|
|
|
63
|
+
const updatePaginationInfo = (stateManager: StateManager, payload: Payload): PaginationInfo =>{
|
|
64
|
+
const paginationInfo = getPaginationInfo(stateManager);
|
|
65
|
+
let { records, changes } = payload;
|
|
66
|
+
|
|
67
|
+
if(!records || !changes || !paginationInfo || !validateNewRecordOperation(changes)) return paginationInfo as PaginationInfo;
|
|
68
|
+
|
|
69
|
+
const { count, firstRecord, lastRecord, total } = paginationInfo;
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
...paginationInfo,
|
|
73
|
+
count: (count ?? 0) + records.length,
|
|
74
|
+
firstRecord: firstRecord === 0 && records.length > 0 ? 1 : firstRecord,
|
|
75
|
+
lastRecord: lastRecord + records.length,
|
|
76
|
+
total: (total ?? 0) + records.length
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const validateNewRecordOperation = (changes: Array<Change>): boolean => {
|
|
82
|
+
return changes.every(change => isNewRecordOperation(change._operation));
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const isNewRecordOperation = (operation: string): operation is ChangeOperation => {
|
|
86
|
+
return ["INSERT", "COPY"].includes(operation);
|
|
87
|
+
};
|
|
88
|
+
|
|
59
89
|
interface LoadingControlState{
|
|
60
90
|
lastRequest: LoadDataRequest;
|
|
61
91
|
paginationInfo: PaginationInfo;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface Change {
|
|
95
|
+
dataUnit: string;
|
|
96
|
+
record: Record<string, any>;
|
|
97
|
+
updatingFields: Record<string, any>;
|
|
98
|
+
_operation: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface Payload {
|
|
102
|
+
changes: Change[];
|
|
103
|
+
records: Record<string, any>[];
|
|
62
104
|
}
|