@sankhyalabs/core 0.0.0-bugfix-dev-KB-68936.0 → 0.0.0-bugfix-dev-KB-65214.0
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/.docs/classes/Change.md +11 -11
- package/.docs/classes/DataUnit.md +119 -165
- package/.docs/classes/DateUtils.md +8 -8
- package/.docs/classes/SelectionInfo.md +12 -12
- package/.docs/classes/ServiceCanceledException.md +193 -0
- package/.docs/enumerations/ChangeOperation.md +4 -4
- package/.docs/enumerations/SelectionMode.md +2 -2
- package/.docs/globals.md +1 -0
- package/.docs/interfaces/DUActionInterceptor.md +1 -1
- package/.docs/interfaces/PageRequest.md +3 -3
- package/.docs/interfaces/QuickFilter.md +3 -3
- package/.docs/interfaces/Record.md +4 -4
- package/.docs/interfaces/SavedRecord.md +5 -5
- package/.docs/interfaces/WaitingChange.md +3 -3
- package/.docs/type-aliases/DataUnitEventOptions.md +1 -1
- package/dist/dataunit/DataUnit.d.ts +0 -10
- package/dist/dataunit/DataUnit.js +10 -17
- package/dist/dataunit/DataUnit.js.map +1 -1
- package/dist/exceptions/ServiceCanceledException.d.ts +14 -0
- package/dist/exceptions/ServiceCanceledException.js +13 -0
- package/dist/exceptions/ServiceCanceledException.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/DateUtils.js +3 -0
- package/dist/utils/DateUtils.js.map +1 -1
- package/package.json +1 -1
- package/reports/test-report.xml +105 -105
- package/src/dataunit/DataUnit.ts +12 -21
- package/src/exceptions/ServiceCanceledException.ts +25 -0
- package/src/index.ts +3 -1
- package/src/utils/DateUtils.ts +3 -0
package/reports/test-report.xml
CHANGED
|
@@ -1,129 +1,121 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<unitTest version="1">
|
|
3
|
-
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
4
|
-
<testCase name="HttpProvider Metodo POST" duration="4"/>
|
|
5
|
-
</file>
|
|
6
|
-
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
7
|
-
<testCase name="HttpProvider Metodo GET" duration="4"/>
|
|
8
|
-
</file>
|
|
9
3
|
<file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
|
|
10
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="
|
|
11
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="
|
|
4
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="86"/>
|
|
5
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="3"/>
|
|
12
6
|
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
|
|
13
7
|
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
|
|
14
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="
|
|
15
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="
|
|
8
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="14"/>
|
|
9
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
|
|
16
10
|
<testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
|
|
17
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="
|
|
18
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="
|
|
19
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="
|
|
11
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
|
|
12
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="61"/>
|
|
13
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="1"/>
|
|
20
14
|
<testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
|
|
21
|
-
<testCase name="ObjectUtils should get an object value based on its path" duration="
|
|
22
|
-
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="
|
|
15
|
+
<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="0"/>
|
|
23
17
|
</file>
|
|
24
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/
|
|
25
|
-
<testCase name="StringUtils it should return the
|
|
26
|
-
<testCase name="StringUtils it should
|
|
27
|
-
<testCase name="StringUtils it should return
|
|
18
|
+
<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="95"/>
|
|
20
|
+
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="3"/>
|
|
21
|
+
<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="1"/>
|
|
23
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="1"/>
|
|
24
|
+
<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="0"/>
|
|
25
|
+
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="0"/>
|
|
26
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
27
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
28
|
+
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="64"/>
|
|
29
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
30
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
31
|
+
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
32
|
+
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
28
33
|
</file>
|
|
29
34
|
<file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
|
|
30
|
-
<testCase name="Mask Formatter mask:CPF complete valid" duration="
|
|
35
|
+
<testCase name="Mask Formatter mask:CPF complete valid" duration="84"/>
|
|
31
36
|
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="2"/>
|
|
32
37
|
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
|
|
33
38
|
<testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
|
|
34
39
|
<testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
|
|
35
|
-
<testCase name="Mask Formatter mask:CPF invalid for string" duration="
|
|
40
|
+
<testCase name="Mask Formatter mask:CPF invalid for string" duration="130"/>
|
|
36
41
|
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
|
|
37
42
|
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
|
|
38
|
-
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="
|
|
39
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
40
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="74"/>
|
|
41
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
|
|
43
|
+
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
|
|
42
44
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
43
|
-
<testCase name="Mask Formatter mask:Licence plate
|
|
44
|
-
<testCase name="Mask Formatter mask:Licence plate
|
|
45
|
+
<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="1"/>
|
|
45
47
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="5"/>
|
|
46
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="
|
|
48
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
47
49
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
48
50
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
49
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="
|
|
50
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="
|
|
51
|
+
<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="1"/>
|
|
51
53
|
<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="0"/>
|
|
56
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
52
57
|
</file>
|
|
53
|
-
<file path="/builds/dti/design-system/sankhyacore/test/
|
|
54
|
-
<testCase name="
|
|
55
|
-
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="1"/>
|
|
56
|
-
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="0"/>
|
|
57
|
-
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="1"/>
|
|
58
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="2"/>
|
|
59
|
-
<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"/>
|
|
60
|
-
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
61
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
62
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
63
|
-
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="3"/>
|
|
64
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
65
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="107"/>
|
|
66
|
-
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
67
|
-
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
58
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
59
|
+
<testCase name="HttpProvider Metodo GET" duration="2"/>
|
|
68
60
|
</file>
|
|
69
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/
|
|
70
|
-
<testCase name="
|
|
71
|
-
<testCase name="
|
|
72
|
-
<testCase name="
|
|
61
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
62
|
+
<testCase name="StringUtils stringToNumber" duration="82"/>
|
|
63
|
+
<testCase name="StringUtils format" duration="109"/>
|
|
64
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
65
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
66
|
+
<testCase name="StringUtils format round number" duration="20"/>
|
|
73
67
|
</file>
|
|
74
68
|
<file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
|
|
75
|
-
<testCase name="StringUtils valor vazio" duration="
|
|
76
|
-
<testCase name="StringUtils valor em branco" duration="
|
|
77
|
-
<testCase name="StringUtils valor null" duration="
|
|
78
|
-
<testCase name="StringUtils valor undefined" duration="
|
|
69
|
+
<testCase name="StringUtils valor vazio" duration="3"/>
|
|
70
|
+
<testCase name="StringUtils valor em branco" duration="1"/>
|
|
71
|
+
<testCase name="StringUtils valor null" duration="0"/>
|
|
72
|
+
<testCase name="StringUtils valor undefined" duration="1"/>
|
|
79
73
|
<testCase name="StringUtils valor 0" duration="0"/>
|
|
80
|
-
<testCase name="StringUtils com valor" duration="
|
|
81
|
-
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="
|
|
82
|
-
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="
|
|
83
|
-
<testCase name="StringUtils should return the original value when called with undefined" duration="
|
|
74
|
+
<testCase name="StringUtils com valor" duration="0"/>
|
|
75
|
+
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
|
|
76
|
+
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="4"/>
|
|
77
|
+
<testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
|
|
84
78
|
</file>
|
|
85
|
-
<file path="/builds/dti/design-system/sankhyacore/test/
|
|
86
|
-
<testCase name="
|
|
87
|
-
<testCase name="StringUtils format" duration="304"/>
|
|
88
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
89
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="3"/>
|
|
90
|
-
<testCase name="StringUtils format round number" duration="2"/>
|
|
79
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
80
|
+
<testCase name="HttpProvider Metodo POST" duration="14"/>
|
|
91
81
|
</file>
|
|
92
82
|
<file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
|
|
93
|
-
<testCase name="OverflowWatcher should initialize with provided parameters" duration="
|
|
83
|
+
<testCase name="OverflowWatcher should initialize with provided parameters" duration="66"/>
|
|
94
84
|
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
|
|
95
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="
|
|
96
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="
|
|
97
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="
|
|
85
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="283"/>
|
|
86
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="135"/>
|
|
87
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="64"/>
|
|
98
88
|
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="11"/>
|
|
99
89
|
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="5"/>
|
|
100
|
-
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="
|
|
101
|
-
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="
|
|
90
|
+
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="102"/>
|
|
91
|
+
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
|
|
102
92
|
</file>
|
|
103
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/
|
|
104
|
-
<testCase name="
|
|
105
|
-
<testCase name="
|
|
106
|
-
<testCase name="
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<testCase name="
|
|
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="2"/>
|
|
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="1"/>
|
|
96
|
+
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="0"/>
|
|
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="2"/>
|
|
110
102
|
</file>
|
|
111
103
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
|
|
112
|
-
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
104
|
+
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="12"/>
|
|
113
105
|
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="2"/>
|
|
114
|
-
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
115
|
-
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="
|
|
116
|
-
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
106
|
+
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
107
|
+
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="2"/>
|
|
108
|
+
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="2"/>
|
|
117
109
|
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
118
110
|
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="2"/>
|
|
119
|
-
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="
|
|
120
|
-
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
121
|
-
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
122
|
-
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
123
|
-
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="
|
|
111
|
+
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="2"/>
|
|
112
|
+
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
113
|
+
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
114
|
+
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
115
|
+
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="70"/>
|
|
124
116
|
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
125
|
-
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="
|
|
126
|
-
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="
|
|
117
|
+
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="3"/>
|
|
118
|
+
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
127
119
|
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
128
120
|
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
129
121
|
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
@@ -132,35 +124,43 @@
|
|
|
132
124
|
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
133
125
|
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="1"/>
|
|
134
126
|
</file>
|
|
127
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
|
|
128
|
+
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="3"/>
|
|
129
|
+
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
|
|
130
|
+
<testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
|
|
131
|
+
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
132
|
+
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
|
|
133
|
+
<testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="0"/>
|
|
134
|
+
</file>
|
|
135
135
|
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
|
|
136
|
-
<testCase name="getFormattedValue should return empty string when value is null" duration="
|
|
136
|
+
<testCase name="getFormattedValue should return empty string when value is null" duration="9"/>
|
|
137
137
|
<testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
|
|
138
138
|
<testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
|
|
139
139
|
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
|
|
140
|
-
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="
|
|
141
|
-
<testCase name="getFormattedValue should return empty string for undefined file" duration="
|
|
142
|
-
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="
|
|
143
|
-
<testCase name="getFormattedValue should return empty string when value is undefined" duration="
|
|
144
|
-
<testCase name="getFormattedValue should return value as string when value is not an object" duration="
|
|
140
|
+
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
|
|
141
|
+
<testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
|
|
142
|
+
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
|
|
143
|
+
<testCase name="getFormattedValue should return empty string when value is undefined" duration="2"/>
|
|
144
|
+
<testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
|
|
145
145
|
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="1"/>
|
|
146
146
|
<testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
|
|
147
|
-
<testCase name="getFormattedValue should format numbers correctly" duration="
|
|
148
|
-
<testCase name="getFormattedValue should format dates correctly" duration="
|
|
149
|
-
<testCase name="getFormattedValue should format times correctly" duration="
|
|
147
|
+
<testCase name="getFormattedValue should format numbers correctly" duration="71"/>
|
|
148
|
+
<testCase name="getFormattedValue should format dates correctly" duration="15"/>
|
|
149
|
+
<testCase name="getFormattedValue should format times correctly" duration="1"/>
|
|
150
150
|
<testCase name="getFormattedValue should format datetime correctly" duration="1"/>
|
|
151
|
-
<testCase name="getFormattedValue should call toString with correct parameters" duration="
|
|
152
|
-
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="
|
|
153
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="
|
|
154
|
-
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="
|
|
151
|
+
<testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
|
|
152
|
+
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
|
|
153
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
|
|
154
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="1"/>
|
|
155
155
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
|
|
156
156
|
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
|
|
157
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="
|
|
157
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="1"/>
|
|
158
158
|
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
|
|
159
|
-
<testCase name="getFormattedValue should format masked values correctly" duration="
|
|
159
|
+
<testCase name="getFormattedValue should format masked values correctly" duration="3"/>
|
|
160
160
|
</file>
|
|
161
161
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
162
|
-
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="
|
|
163
|
-
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="
|
|
164
|
-
<testCase name="calcMarginSize should threat values defined as zero" duration="
|
|
162
|
+
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="202"/>
|
|
163
|
+
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="4"/>
|
|
164
|
+
<testCase name="calcMarginSize should threat values defined as zero" duration="4"/>
|
|
165
165
|
</file>
|
|
166
166
|
</unitTest>
|
package/src/dataunit/DataUnit.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { DataUnitStorage } from "./DataUnitStorage.js";
|
|
|
27
27
|
import { getInvalidFieldMessage, InvalidFieldsReducer } from "./state/slice/InvalidFieldsSlice.js";
|
|
28
28
|
import { getLoadingProperties, LoadingPropertiesReducer } from "./state/slice/LoadingProperties.js";
|
|
29
29
|
import SortingUtils from "../utils/SortingUtils.js";
|
|
30
|
+
import ServiceCanceledException from "../exceptions/ServiceCanceledException.js";
|
|
30
31
|
|
|
31
32
|
/***
|
|
32
33
|
* `DataUnit`: Atua como uma camada de abstração entre o back-end e a interface do usuário.
|
|
@@ -51,7 +52,6 @@ export default class DataUnit {
|
|
|
51
52
|
private _savingLockers: Promise<any>[] = [];
|
|
52
53
|
private _defaultSorting: Array<Sort>;
|
|
53
54
|
private _allowReleaseCallbacks: boolean;
|
|
54
|
-
private _waitingToReload: boolean = false;
|
|
55
55
|
|
|
56
56
|
public metadataLoader?: (dataUnit: DataUnit) => Promise<UnitMetadata>;
|
|
57
57
|
public dataLoader?: (dataUnit: DataUnit, request: LoadDataRequest) => Promise<LoadDataResponse>;
|
|
@@ -150,21 +150,6 @@ export default class DataUnit {
|
|
|
150
150
|
return this._uuid;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
/**
|
|
154
|
-
* Retorna se o dataUnit está com recarregamento pendente.
|
|
155
|
-
*/
|
|
156
|
-
public isWaitingToReload(): boolean {
|
|
157
|
-
return this._waitingToReload;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Define se o dataUnit tem um recarregamento pendente.
|
|
162
|
-
* @param isWaiting
|
|
163
|
-
*/
|
|
164
|
-
public setWaitingToReload(isWaiting: boolean){
|
|
165
|
-
this._waitingToReload = isWaiting;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
153
|
/**
|
|
169
154
|
*
|
|
170
155
|
* Obtém o nome de identificação do DataUnit (geralmente em formato de URI - Uniform Resource Identifier).
|
|
@@ -501,7 +486,12 @@ export default class DataUnit {
|
|
|
501
486
|
const {errorCode} = cause;
|
|
502
487
|
this.dispatchAction(Action.SAVING_ERROR);
|
|
503
488
|
this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
|
|
504
|
-
|
|
489
|
+
if(cause instanceof ServiceCanceledException){
|
|
490
|
+
console.debug("Service canceled: " + cause.message)
|
|
491
|
+
resolve()
|
|
492
|
+
} else{
|
|
493
|
+
fail(new ErrorException("Erro ao salvar alterações", cause, errorCode))
|
|
494
|
+
}
|
|
505
495
|
});
|
|
506
496
|
} else {
|
|
507
497
|
this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
|
|
@@ -606,7 +596,7 @@ export default class DataUnit {
|
|
|
606
596
|
const removedIndex: Array<number> = recordIds
|
|
607
597
|
.map(id => currentRecordsKeys.indexOf(id))
|
|
608
598
|
.filter(index => index > -1)
|
|
609
|
-
.sort();
|
|
599
|
+
.sort((a, b) => a - b);
|
|
610
600
|
|
|
611
601
|
const nextIndex = Math.min(removedIndex.slice(-1)[0] + 1, currentRecordsKeys.length);
|
|
612
602
|
const selectionAfterRemove = currentRecordsKeys[nextIndex] ? [currentRecordsKeys[nextIndex]] : [];
|
|
@@ -983,15 +973,16 @@ export default class DataUnit {
|
|
|
983
973
|
*
|
|
984
974
|
*/
|
|
985
975
|
public async setFieldValue(fieldName: string, newValue: any, records?: Array<string>, options?:DataUnitEventOptions): Promise<boolean> {
|
|
986
|
-
if(!this.hasNewRecord() && !this.getSelectedRecord()) await this.addRecord();
|
|
987
976
|
|
|
977
|
+
if(!this.hasNewRecord() && !this.getSelectedRecord()) await this.addRecord();
|
|
978
|
+
|
|
988
979
|
const typedValue = this.validateAndTypeValue(fieldName, newValue);
|
|
989
980
|
const currentValue = this.getFieldValue(fieldName);
|
|
990
981
|
|
|
991
|
-
if(
|
|
982
|
+
if(ObjectUtils.hasEquivalentProps(currentValue, typedValue)){
|
|
992
983
|
return Promise.resolve(false);
|
|
993
984
|
}
|
|
994
|
-
|
|
985
|
+
|
|
995
986
|
if(newValue instanceof Promise){
|
|
996
987
|
const promise:Promise<boolean> = new Promise(accept => {
|
|
997
988
|
newValue.then(resolvedValue => {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ServiceCanceledException`: Exceção lançada quando ocorre o cancelamento de um serviço.
|
|
3
|
+
*/
|
|
4
|
+
export default class ServiceCanceledException extends Error {
|
|
5
|
+
|
|
6
|
+
/** Nome da exceção. */
|
|
7
|
+
public name: string;
|
|
8
|
+
|
|
9
|
+
/** Titulo do erro. */
|
|
10
|
+
public title: string;
|
|
11
|
+
|
|
12
|
+
/** Descrição do erro. */
|
|
13
|
+
public message: string;
|
|
14
|
+
|
|
15
|
+
/** Código do erro, indica o erro disparado pelo backend. */
|
|
16
|
+
public errorCode: string;
|
|
17
|
+
|
|
18
|
+
constructor(title: string, message: string, errorCode: string = "") {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = "Service Canceled";
|
|
21
|
+
this.title = title;
|
|
22
|
+
this.message = message;
|
|
23
|
+
this.errorCode = errorCode;
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import ObjectUtils from "./utils/ObjectUtils.js";
|
|
|
19
19
|
import WarningException from "./exceptions/WarningException.js";
|
|
20
20
|
import WaitingChangeException from "./exceptions/WaitingChangeException.js";
|
|
21
21
|
import ErrorException from "./exceptions/ErrorException.js";
|
|
22
|
+
import ServiceCanceledException from "./exceptions/ServiceCanceledException.js";
|
|
22
23
|
import { ErrorTracking } from "./traking/ErrorTraking.js";
|
|
23
24
|
import { PaginationInfo } from "./dataunit/loading/PaginationInfo.js";
|
|
24
25
|
import { LoadDataRequest } from "./dataunit/loading/LoadDataRequest.js";
|
|
@@ -112,5 +113,6 @@ export {
|
|
|
112
113
|
OverflowDirection,
|
|
113
114
|
OverFlowWatcherParams,
|
|
114
115
|
OVERFLOWED_CLASS_NAME,
|
|
115
|
-
DataUnitEventOptions
|
|
116
|
+
DataUnitEventOptions,
|
|
117
|
+
ServiceCanceledException
|
|
116
118
|
};
|
package/src/utils/DateUtils.ts
CHANGED
|
@@ -39,6 +39,9 @@ export default class DateUtils{
|
|
|
39
39
|
* @returns - Uma string com as horas no formato HH:MM ou HH:MM:SS.
|
|
40
40
|
*/
|
|
41
41
|
public static formatTime(date: Date, showSeconds: boolean = false): string{
|
|
42
|
+
if (date == null){
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
42
45
|
const timeOptions:Intl.DateTimeFormatOptions = {hour: "2-digit", minute: "2-digit", second: showSeconds ? "2-digit" : undefined};
|
|
43
46
|
return new Intl.DateTimeFormat("pt-BR", timeOptions).format(date);
|
|
44
47
|
}
|