@sankhyalabs/core 5.20.0-dev.55 → 5.20.0-dev.56

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.
@@ -1,171 +1,171 @@
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="12"/>
5
- </file>
6
- <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
7
- <testCase name="HttpProvider Metodo POST" duration="16"/>
8
- </file>
9
- <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
10
- <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the constructor" duration="3"/>
11
- <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the setters methods" duration="0"/>
12
- <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
13
- </file>
14
3
  <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
15
- <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="6"/>
4
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="5"/>
16
5
  <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="1"/>
17
- <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="1"/>
18
- <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="190"/>
6
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="73"/>
7
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
19
8
  <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="1"/>
20
9
  <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
21
10
  <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
22
- <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
23
- <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
11
+ <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="1"/>
12
+ <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="0"/>
24
13
  <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="1"/>
14
+ <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
25
15
  <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
26
- <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
27
- <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="1"/>
16
+ <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="0"/>
28
17
  </file>
29
18
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
30
- <testCase name="Mask Formatter mask:CPF complete valid" duration="84"/>
31
- <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
19
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="21"/>
20
+ <testCase name="Mask Formatter mask:CPF complete valid literals" duration="93"/>
32
21
  <testCase name="Mask Formatter mask:CPF incomplete valid" duration="0"/>
33
22
  <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
34
23
  <testCase name="Mask Formatter mask:CPF too long valid" duration="0"/>
35
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="112"/>
24
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="197"/>
36
25
  <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="0"/>
37
26
  <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
38
27
  <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
39
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="78"/>
28
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="5"/>
40
29
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
41
30
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
42
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="3"/>
31
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="4"/>
32
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
33
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
34
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
43
35
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
44
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
36
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
45
37
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
46
38
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
47
39
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
48
40
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
49
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
50
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
51
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
52
41
  </file>
53
42
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
54
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="14"/>
55
- <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="2"/>
56
- <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="2"/>
57
- <testCase name="StringUtils it should return a Criteria class with &quot;expression&quot; and &quot;parameters&quot; as needed setted through &quot;append&quot; method" duration="87"/>
43
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="75"/>
44
+ <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
45
+ <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
46
+ <testCase name="StringUtils it should return a Criteria class with &quot;expression&quot; and &quot;parameters&quot; as needed setted through &quot;append&quot; method" duration="1"/>
58
47
  <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;append&quot; method" duration="1"/>
59
48
  <testCase name="StringUtils it should return undefined as &quot;expression&quot; and &quot;[]&quot; as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
60
49
  <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
61
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="0"/>
62
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="0"/>
63
- <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="91"/>
64
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
50
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
51
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
52
+ <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="82"/>
65
53
  <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="2"/>
66
- <testCase name="StringUtils it should return a toJSON object with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
54
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
55
+ <testCase name="StringUtils it should return a toJSON object with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="15"/>
67
56
  <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="1"/>
68
57
  </file>
69
- <file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
70
- <testCase name="RecordsSlice should return newlines at the end" duration="3"/>
58
+ <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
59
+ <testCase name="HttpProvider Metodo GET" duration="0"/>
60
+ </file>
61
+ <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
62
+ <testCase name="StringUtils stringToNumber" duration="88"/>
63
+ <testCase name="StringUtils format" duration="92"/>
64
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
65
+ <testCase name="StringUtils format without formatnumber parameter" duration="2"/>
66
+ <testCase name="StringUtils format round number" duration="2"/>
67
+ </file>
68
+ <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
69
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="9"/>
70
+ <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
71
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="289"/>
72
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="18"/>
73
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="83"/>
74
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="7"/>
75
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="99"/>
76
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="103"/>
77
+ <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
71
78
  </file>
72
79
  <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
73
- <testCase name="StringUtils valor vazio" duration="24"/>
80
+ <testCase name="StringUtils valor vazio" duration="1"/>
74
81
  <testCase name="StringUtils valor em branco" duration="1"/>
75
82
  <testCase name="StringUtils valor null" duration="0"/>
76
83
  <testCase name="StringUtils valor undefined" duration="0"/>
77
84
  <testCase name="StringUtils valor 0" duration="1"/>
78
85
  <testCase name="StringUtils com valor" duration="0"/>
79
- <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="3"/>
80
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="70"/>
81
- <testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
86
+ <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
87
+ <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="1"/>
88
+ <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
82
89
  </file>
83
- <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
84
- <testCase name="StringUtils stringToNumber" duration="102"/>
85
- <testCase name="StringUtils format" duration="199"/>
86
- <testCase name="StringUtils format without formatnumber parameter" duration="2"/>
87
- <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
88
- <testCase name="StringUtils format round number" duration="3"/>
90
+ <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
91
+ <testCase name="HttpProvider Metodo POST" duration="0"/>
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 &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the constructor" duration="2"/>
95
+ <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; 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="1"/>
89
97
  </file>
90
98
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
91
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="1"/>
92
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
99
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
100
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
93
101
  <testCase name="TimeFormatter Case: validateTime" duration="1"/>
94
102
  </file>
95
- <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
96
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="9"/>
97
- <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
98
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="292"/>
99
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="26"/>
100
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="99"/>
101
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="78"/>
102
- <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
103
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="97"/>
104
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
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="2"/>
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="2"/>
108
+ <testCase name="DataUnit should set waitingToReload to true" duration="1"/>
109
+ <testCase name="DataUnit should set waitingToReload to false" duration="0"/>
110
+ <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="1"/>
105
111
  </file>
106
112
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
107
- <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="72"/>
113
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="2"/>
108
114
  <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
109
- <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="0"/>
115
+ <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
110
116
  <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
111
117
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
112
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="0"/>
113
119
  </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="0"/>
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="4"/>
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 &quot;movFinanceira_snkApplication&quot;" duration="13"/>
122
122
  <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
123
123
  <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
124
124
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
125
125
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
126
- <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
127
- <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
128
- <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
126
+ <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
127
+ <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="2"/>
128
+ <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="69"/>
129
129
  <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
130
- <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="62"/>
131
- <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
132
- <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="2"/>
130
+ <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
131
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
132
+ <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
133
133
  <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
134
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="1"/>
134
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="3"/>
135
135
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
136
- <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="8"/>
136
+ <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
137
137
  <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
138
138
  <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
139
139
  <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
140
- <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
141
- <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="2"/>
140
+ <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
141
+ <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
142
142
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" 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="53"/>
145
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="28"/>
146
146
  <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
147
147
  <testCase name="calcMarginSize should threat values defined as zero" duration="3"/>
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="5"/>
150
+ <testCase name="getFormattedValue should return empty string when value is null" duration="4"/>
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
153
  <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
154
154
  <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
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="0"/>
156
+ <testCase name="getFormattedValue should handle OBJECT type with value field" duration="3"/>
157
157
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
158
- <testCase name="getFormattedValue should return value as string when value is not an object" 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="0"/>
160
- <testCase name="getFormattedValue should handle BOOLEAN type" duration="1"/>
161
- <testCase name="getFormattedValue should format numbers correctly" duration="15"/>
160
+ <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
161
+ <testCase name="getFormattedValue should format numbers correctly" duration="11"/>
162
162
  <testCase name="getFormattedValue should format dates correctly" duration="4"/>
163
- <testCase name="getFormattedValue should format times correctly" duration="0"/>
163
+ <testCase name="getFormattedValue should format times correctly" duration="1"/>
164
164
  <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
165
165
  <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
166
- <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
166
+ <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="37"/>
167
167
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
168
- <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
168
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="1"/>
169
169
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
170
170
  <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
171
171
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
@@ -28,6 +28,7 @@ import { getInvalidFieldMessage, InvalidFieldsReducer } from "./state/slice/Inva
28
28
  import { getLoadingProperties, LoadingPropertiesReducer } from "./state/slice/LoadingProperties.js";
29
29
  import SortingUtils from "../utils/SortingUtils.js";
30
30
  import ServiceCanceledException from "../exceptions/ServiceCanceledException.js";
31
+ import SilentException from "../exceptions/SilentException.js";
31
32
 
32
33
  /***
33
34
  * `DataUnit`: Atua como uma camada de abstração entre o back-end e a interface do usuário.
@@ -503,11 +504,13 @@ export default class DataUnit {
503
504
  this.dispatchAction(Action.SAVING_ERROR);
504
505
  this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
505
506
  if(cause instanceof ServiceCanceledException){
506
- console.debug("Service canceled: " + cause.message)
507
- resolve()
508
- } else{
509
- fail(new ErrorException("Erro ao salvar alterações", cause, errorCode))
507
+ console.debug("Service canceled: " + cause.message);
508
+ resolve();
509
+ }
510
+ if(cause instanceof SilentException){
511
+ fail();
510
512
  }
513
+ fail(new ErrorException("Erro ao salvar alterações", cause, errorCode));
511
514
  });
512
515
  } else {
513
516
  this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `SilentException`: Exceção lançada quando uma exception silenciosa é.
3
+ */
4
+ export default class SilentException 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 = "SilentException";
21
+ this.title = title;
22
+ this.message = message;
23
+ this.errorCode = errorCode;
24
+ }
25
+ }
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ import WarningException from "./exceptions/WarningException.js";
20
20
  import WaitingChangeException from "./exceptions/WaitingChangeException.js";
21
21
  import ErrorException from "./exceptions/ErrorException.js";
22
22
  import ServiceCanceledException from "./exceptions/ServiceCanceledException.js";
23
+ import SilentException from "./exceptions/SilentException.js";
23
24
  import { ErrorTracking } from "./traking/ErrorTraking.js";
24
25
  import { PaginationInfo } from "./dataunit/loading/PaginationInfo.js";
25
26
  import { LoadDataRequest } from "./dataunit/loading/LoadDataRequest.js";
@@ -43,9 +44,12 @@ import { SearchUtils } from "./utils/SearchUtils.js";
43
44
  import { ServiceUtils } from "./utils/ServiceUtils.js";
44
45
  import { StorageType } from "./utils/CacheManager/index.js";
45
46
  import OverflowWatcher, { OnOverflowCallBack, OverflowDirection, OverFlowWatcherParams, OVERFLOWED_CLASS_NAME } from "./utils/OverflowWatcher/index.js";
47
+ import {LockManager, LockManagerOperation} from "./utils/LockManager.js";
46
48
 
47
49
  /*Classes públicas no pacote*/
48
50
  export {
51
+ LockManager,
52
+ LockManagerOperation,
49
53
  StringUtils,
50
54
  MaskFormatter,
51
55
  NumberUtils,
@@ -118,5 +122,6 @@ export {
118
122
  OverFlowWatcherParams,
119
123
  OVERFLOWED_CLASS_NAME,
120
124
  DataUnitEventOptions,
121
- ServiceCanceledException
125
+ ServiceCanceledException,
126
+ SilentException,
122
127
  };
@@ -0,0 +1,157 @@
1
+ import { StringUtils } from "./StringUtils.js";
2
+ /**
3
+ * Define os tipos de operação que o locker pode controlar
4
+ */
5
+ export enum LockManagerOperation {
6
+ /**
7
+ Operação de lock utilizada para controlar cliques nos botoes da taskbar.
8
+ */
9
+ TASKBAR_CLICK = "taskbar_click"
10
+ }
11
+
12
+ type Lock = {
13
+ promise?: Promise<unknown>,
14
+ resolve?: () => void,
15
+ done: boolean
16
+ }
17
+
18
+ export class LockManager{
19
+ private static _locks = new Map<string, Array<Lock>>();
20
+
21
+ /**
22
+ * Nome do atributo que será utilizado para controlar contexto de locks nos elementos da DOM.
23
+ */
24
+ public static ATTRIBUTE_NAME = "data-locker-manger-context-id";
25
+
26
+ private static buildContextID(): string{
27
+ return StringUtils.generateUUID();
28
+ }
29
+
30
+ private static buildLockerID(ctxId:string|HTMLElement, operation: LockManagerOperation): string | undefined{
31
+ if(ctxId == undefined) return undefined;
32
+
33
+ let resolvedID:any = ctxId;
34
+
35
+ if(resolvedID instanceof HTMLElement){
36
+ resolvedID = (ctxId as HTMLElement).getAttribute(LockManager.ATTRIBUTE_NAME);
37
+ if(!resolvedID) return undefined;
38
+ }
39
+
40
+ return `${resolvedID}_${operation}`;
41
+ }
42
+
43
+ private static findExistingCtxId = (element: HTMLElement): string | null => {
44
+ let currentElement: HTMLElement | null = element;
45
+
46
+ while (currentElement) {
47
+ if (currentElement.hasAttribute(LockManager.ATTRIBUTE_NAME)) {
48
+ return currentElement.getAttribute(LockManager.ATTRIBUTE_NAME);
49
+ }
50
+
51
+ const childWithCtxId = Array.from(currentElement.children).find(child =>
52
+ (child instanceof HTMLElement) && child.hasAttribute(LockManager.ATTRIBUTE_NAME)
53
+ ) as HTMLElement | undefined;
54
+
55
+ if (childWithCtxId) {
56
+ return childWithCtxId.getAttribute(LockManager.ATTRIBUTE_NAME);
57
+ }
58
+
59
+ currentElement = currentElement.parentElement;
60
+ }
61
+
62
+ return null;
63
+ }
64
+
65
+ private static traverseAndAddAttr = (element: HTMLElement, ctxId: string): void => {
66
+ if (element.tagName.startsWith('EZ-') || element.tagName.startsWith('SNK-')) {
67
+ element.setAttribute(LockManager.ATTRIBUTE_NAME, ctxId);
68
+ }
69
+ Array.from(element.children).forEach((child) => {
70
+ if (child instanceof HTMLElement) {
71
+ LockManager.traverseAndAddAttr(child, ctxId);
72
+ }
73
+ });
74
+ };
75
+
76
+ /**
77
+ * Cria um contexto de locker, caso nao exista, para todos elementos pais iniciados com ez- ou snk-.
78
+ *
79
+ * @param startElement - Elemento de de onde o lock deve começar.
80
+ *
81
+ * @returns - O id do locker, que pode ser usado para iniciar ou aguardar um lock do contexto.
82
+ */
83
+ public static addLockManagerCtxId(startElement: HTMLElement): string {
84
+ try{
85
+ if (!startElement) {
86
+ console.error("Elemento inicial não fornecido.");
87
+ return "";
88
+ }
89
+
90
+ const ctxId = LockManager.findExistingCtxId(startElement) ?? LockManager.buildContextID();
91
+
92
+ let currentElement: HTMLElement | null = startElement;
93
+
94
+ while (currentElement && currentElement.tagName != 'BODY') {
95
+ LockManager.traverseAndAddAttr(currentElement, ctxId);
96
+ currentElement = currentElement.parentElement;
97
+ }
98
+
99
+ return ctxId;
100
+ }catch(err){
101
+ console.warn(`Erro ao registrar locks para o elemento: ${startElement?.tagName}`, err);
102
+ return "";
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Inicia um locker baseado em um contexto e uma operação.
108
+ *
109
+ * @param id - Pode ser um ID do contexto de locker, ou, o elemento contendo um contexto de locker.
110
+ * @param operation - Operação do contexto que o lock deve ser feito.
111
+ *
112
+ * @returns - Uma função que fara a liberação do lock.
113
+ */
114
+ public static lock(id:string|HTMLElement, operation:LockManagerOperation): any{
115
+ const lockerId = LockManager.buildLockerID(id, operation);
116
+
117
+ if(!lockerId) return () => {};
118
+
119
+ const lock:Lock = { done: false };
120
+ const promise = new Promise<void>(resolve => lock.resolve = resolve);
121
+ lock.promise = promise;
122
+
123
+ const currentLocks = LockManager._locks.get(lockerId) ?? [];
124
+ currentLocks.push(lock);
125
+
126
+ LockManager._locks.set(lockerId, currentLocks);
127
+
128
+ return () => {
129
+ lock.done = true;
130
+ lock.resolve?.();
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Aguarda todos os lockers de um contexto e operação serem resolvidos.
136
+ *
137
+ * @param id - Pode ser um ID do contexto de locker, ou, o elemento contendo um contexto de locker.
138
+ * @param operation - Operação do contexto que devera aguardar.
139
+ *
140
+ * @returns - Promise que será resolvida quando todos lockers forem finalizados.
141
+ */
142
+ public static async whenResolve(id:string|HTMLElement, operation:LockManagerOperation): Promise<void> {
143
+ const lockerId = LockManager.buildLockerID(id, operation);
144
+
145
+ if(!lockerId) return;
146
+
147
+ while (LockManager._locks.get(lockerId)?.length) {
148
+ const locks:Array<Lock> = LockManager._locks.get(lockerId) ?? [];
149
+ await Promise.all(locks.map(lock => lock.promise));
150
+
151
+ //Aguarda listeners da tela reagirem as mudancas de estado do dataunit
152
+ await new Promise(resolve => setTimeout(resolve, 200));
153
+
154
+ LockManager._locks.set(lockerId, locks.filter(lock => !lock.done));
155
+ }
156
+ }
157
+ }