@rentman/rm-core 12.0.5-8 → 12.1.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.
Files changed (147) hide show
  1. package/changelog.md +1487 -1519
  2. package/dist/rm-core.js +1054 -1125
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/types/src/FieldLookupProxy.d.ts +4 -4
  5. package/dist/types/src/classes/ApiFormatter.d.ts +76 -76
  6. package/dist/types/src/classes/ApiRequestService.d.ts +18 -18
  7. package/dist/types/src/classes/ApiResponseProcessor.d.ts +29 -29
  8. package/dist/types/src/classes/BusinessLogicManager/BusinessLogicManager.d.ts +100 -100
  9. package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +93 -93
  10. package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldTypeBusinessLogicRule.d.ts +17 -17
  11. package/dist/types/src/classes/BusinessLogicManager/Documents/DocumentTemplateBusinessLogicRule.d.ts +24 -24
  12. package/dist/types/src/classes/BusinessLogicManager/Exemplaar/ExemplaarAanschafdatumBusinessLogicRule.d.ts +13 -13
  13. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurBetalingsconditieBusinessLogicRule.d.ts +19 -19
  14. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurDatumBusinessLogicRule.d.ts +18 -18
  15. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurNumberseriesBusinessLogicRule.d.ts +13 -13
  16. package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieNaaminternBusinessLogicRule.d.ts +17 -17
  17. package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogicRule.d.ts +13 -13
  18. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTelexemplarenBusinessLogicRule.d.ts +15 -15
  19. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTypeBusinessLogicRule.d.ts +17 -17
  20. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule.d.ts +17 -17
  21. package/dist/types/src/classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule.d.ts +18 -18
  22. package/dist/types/src/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +25 -25
  23. package/dist/types/src/classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule.d.ts +28 -28
  24. package/dist/types/src/classes/BusinessLogicManager/Project/ProjectClientNoteBusinessLogicRule.d.ts +22 -22
  25. package/dist/types/src/classes/BusinessLogicManager/Reparatie/{ReparatieExemplaarBusinessLogicRule.d.ts → ReparatieExemplaarAantalBusinessLogicRule.d.ts} +13 -13
  26. package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarLocationBusinessLogicRule.d.ts +23 -0
  27. package/dist/types/src/classes/BusinessLogicManager/Rol/RolDocumentAccessBusinessLogicRule.d.ts +17 -17
  28. package/dist/types/src/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts +17 -17
  29. package/dist/types/src/classes/BusinessLogicManager/Rol/RolFileAccessBusinessLogicRule.d.ts +17 -17
  30. package/dist/types/src/classes/BusinessLogicManager/Rol/RolPersoneelsplannerToegangBusinessLogicRule.d.ts +17 -17
  31. package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts +17 -17
  32. package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts +17 -17
  33. package/dist/types/src/classes/CacheSyncer.d.ts +71 -71
  34. package/dist/types/src/classes/ChangesCompilation.d.ts +33 -33
  35. package/dist/types/src/classes/ChangesDelta.d.ts +65 -65
  36. package/dist/types/src/classes/ChangesDeltaBase.d.ts +88 -103
  37. package/dist/types/src/classes/ChangesProcessor.d.ts +40 -40
  38. package/dist/types/src/classes/CollectionEntryService.d.ts +24 -24
  39. package/dist/types/src/classes/CollectionResourceService.d.ts +6 -6
  40. package/dist/types/src/classes/ColumnCache.d.ts +19 -19
  41. package/dist/types/src/classes/ColumnExpansion.d.ts +19 -19
  42. package/dist/types/src/classes/ColumnHandler.d.ts +20 -20
  43. package/dist/types/src/classes/ColumnInfo.d.ts +15 -15
  44. package/dist/types/src/classes/ColumnSet.d.ts +37 -37
  45. package/dist/types/src/classes/ColumnUtil.d.ts +108 -108
  46. package/dist/types/src/classes/ConversionMapService.d.ts +25 -25
  47. package/dist/types/src/classes/CreateRequest.d.ts +17 -17
  48. package/dist/types/src/classes/CreatedChangesDelta.d.ts +17 -17
  49. package/dist/types/src/classes/InternalChangesDelta.d.ts +44 -44
  50. package/dist/types/src/classes/ItemCache.d.ts +27 -27
  51. package/dist/types/src/classes/ItemCreateService.d.ts +18 -18
  52. package/dist/types/src/classes/ItemEntryService.d.ts +32 -32
  53. package/dist/types/src/classes/KeyService.d.ts +18 -18
  54. package/dist/types/src/classes/LockService.d.ts +28 -28
  55. package/dist/types/src/classes/ModuleChangesCompilation.d.ts +17 -17
  56. package/dist/types/src/classes/ParentChangesDelta.d.ts +41 -41
  57. package/dist/types/src/classes/QueryColumnExtractor.d.ts +18 -18
  58. package/dist/types/src/classes/QueryContainsLocalIdParser.d.ts +17 -17
  59. package/dist/types/src/classes/QueryLinkedToParser.d.ts +17 -17
  60. package/dist/types/src/classes/QueryLocallyMatchableParser.d.ts +20 -20
  61. package/dist/types/src/classes/QueryMatcher.d.ts +25 -25
  62. package/dist/types/src/classes/QueryParser.d.ts +25 -25
  63. package/dist/types/src/classes/QueryParserBase.d.ts +20 -20
  64. package/dist/types/src/classes/QueryParserIdUpdater.d.ts +17 -17
  65. package/dist/types/src/classes/QueryService.d.ts +12 -12
  66. package/dist/types/src/classes/RequestBuffer.d.ts +26 -26
  67. package/dist/types/src/classes/RequestBufferManager.d.ts +21 -21
  68. package/dist/types/src/classes/RequestColumnExpansion.d.ts +13 -13
  69. package/dist/types/src/classes/RequestColumnsOperationsCache.d.ts +46 -46
  70. package/dist/types/src/classes/SocketMessageHandler.d.ts +34 -34
  71. package/dist/types/src/classes/TemplateCache.d.ts +64 -64
  72. package/dist/types/src/classes/Util.d.ts +28 -28
  73. package/dist/types/src/classes/cache/AbstractCache.d.ts +92 -85
  74. package/dist/types/src/classes/cache/CachedQueryHandlerBase.d.ts +70 -70
  75. package/dist/types/src/classes/cache/ItemHandlerBase.d.ts +107 -107
  76. package/dist/types/src/classes/cache/server/ServerCache.d.ts +77 -65
  77. package/dist/types/src/classes/cache/server/ServerCachedQueryHandler.d.ts +27 -27
  78. package/dist/types/src/classes/cache/server/ServerItemHandler.d.ts +39 -39
  79. package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +310 -298
  80. package/dist/types/src/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +50 -50
  81. package/dist/types/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
  82. package/dist/types/src/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
  83. package/dist/types/src/classes/cache/transaction/TransactionItemHandler.d.ts +80 -80
  84. package/dist/types/src/classes/cache/transaction/TransactionValidator.d.ts +33 -33
  85. package/dist/types/src/constants.d.ts +7 -7
  86. package/dist/types/src/core.d.ts +48 -48
  87. package/dist/types/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
  88. package/dist/types/src/factories/CacheSyncerFactory.d.ts +14 -14
  89. package/dist/types/src/factories/ChangesCompilationFactory.d.ts +5 -5
  90. package/dist/types/src/factories/ChangesDeltaFactory.d.ts +13 -13
  91. package/dist/types/src/factories/ChangesProcessorFactory.d.ts +13 -13
  92. package/dist/types/src/factories/CollectionEntryFactory.d.ts +11 -11
  93. package/dist/types/src/factories/CollectionResourceFactory.d.ts +18 -18
  94. package/dist/types/src/factories/ColumnExpansionFactory.d.ts +7 -7
  95. package/dist/types/src/factories/ColumnInfoFactory.d.ts +7 -7
  96. package/dist/types/src/factories/ColumnSetFactory.d.ts +18 -18
  97. package/dist/types/src/factories/CreateRequestFactory.d.ts +9 -9
  98. package/dist/types/src/factories/ItemCacheFactory.d.ts +6 -6
  99. package/dist/types/src/factories/ItemEntryFactory.d.ts +12 -12
  100. package/dist/types/src/factories/ItemResourceFactory.d.ts +11 -11
  101. package/dist/types/src/factories/ModuleChangesCompilationFactory.d.ts +6 -6
  102. package/dist/types/src/factories/QueryMatcherFactory.d.ts +8 -8
  103. package/dist/types/src/factories/QueryParserFactory.d.ts +5 -5
  104. package/dist/types/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
  105. package/dist/types/src/factories/RequestColumnsOperationsCacheFactory.d.ts +8 -8
  106. package/dist/types/src/factories/TemplateFactory.d.ts +8 -8
  107. package/dist/types/src/factories/TransactionCacheFactory.d.ts +13 -13
  108. package/dist/types/src/index.d.ts +1 -1
  109. package/dist/types/src/interfaces/AbstractCacheDependencyInterface.d.ts +38 -38
  110. package/dist/types/src/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  111. package/dist/types/src/interfaces/AuthInterface.d.ts +10 -10
  112. package/dist/types/src/interfaces/ErrorHandlerInterface.d.ts +6 -6
  113. package/dist/types/src/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  114. package/dist/types/src/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  115. package/dist/types/src/interfaces/PromiseLibraryInterface.d.ts +33 -33
  116. package/dist/types/src/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
  117. package/dist/types/src/interfaces/SocketMessageInterface.d.ts +3 -3
  118. package/dist/types/src/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
  119. package/dist/types/src/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
  120. package/dist/types/src/internal.d.ts +128 -128
  121. package/dist/types/src/models/CachedQueryItem.d.ts +40 -40
  122. package/dist/types/src/models/CollectionEntry.d.ts +22 -22
  123. package/dist/types/src/models/CollectionOptions.d.ts +44 -44
  124. package/dist/types/src/models/CollectionResource.d.ts +87 -87
  125. package/dist/types/src/models/ItemEntry.d.ts +19 -19
  126. package/dist/types/src/models/ItemEntryOptions.d.ts +8 -8
  127. package/dist/types/src/models/ItemResource.d.ts +90 -95
  128. package/dist/types/src/models/Template.d.ts +11 -11
  129. package/dist/types/src/types/ItemTypesCollection.d.ts +361 -361
  130. package/dist/types/src/types/PromiseInterface.d.ts +2 -2
  131. package/dist/types/tests/integration/core.test.d.ts +1 -1
  132. package/dist/types/tests/integration/helpers/helpers.d.ts +32 -32
  133. package/dist/types/tests/integration/transactions/field_lookup.test.d.ts +1 -1
  134. package/dist/types/tests/integration/transactions/get_by.test.d.ts +1 -1
  135. package/dist/types/tests/integration/transactions/updates.test.d.ts +1 -1
  136. package/dist/types/tests/mocks/ApiMocked.d.ts +19 -19
  137. package/dist/types/tests/mocks/PromiseLibrary.mocked.d.ts +2 -2
  138. package/dist/types/tests/regression/RM4_17754.test.d.ts +1 -1
  139. package/dist/types/tests/regression/RM4_18216.test.d.ts +1 -1
  140. package/dist/types/tests/unit/query_contains_local_id_parser.test.d.ts +1 -1
  141. package/dist/types/tests/unit/query_linked_to_parser.test.d.ts +1 -1
  142. package/dist/types/tests/unit/query_matcher.test.d.ts +1 -1
  143. package/dist/types/tests/unit/query_parser_id_updater.test.d.ts +1 -1
  144. package/dist/types/tests/unit/query_service.test.d.ts +1 -1
  145. package/package.json +57 -57
  146. package/readme.md +16 -16
  147. package/dist/types/src/classes/BusinessLogicManager/Contact/ContactAddressBusinessLogicRule.d.ts +0 -14
package/changelog.md CHANGED
@@ -1,1519 +1,1487 @@
1
- # Changelog
2
-
3
- Contains new features, breaking changes and their reasoning
4
-
5
- ## 12.0.5-8
6
- - Fix issue where changes deltas with deleted items are not processed properly.
7
- - Fix issue where transaction validators run on item expansion.
8
-
9
- ## 12.0.5-7
10
- - Fix an issue where updating an item relation of a remote item to link to a local item would cause the ID reference not
11
- to be updated after saving the local item
12
-
13
- ## 12.0.5-6
14
-
15
- - Fixed an issue with fetching derived values. When a request was done with columns: true before that would overwrite
16
- column expansion and prevent the derived columns from being fetched.
17
-
18
- ## 12.0.5-5
19
-
20
- - Add new business logic rule `ContactAddressBusinessLogicRule`
21
-
22
- ## 12.0.5-4
23
-
24
- - Add a check to take into account if an `itemEntry` was deleted in any transaction when trying to process it in
25
- ModuleChangesCompilation
26
- - Fix an issue where `fieldChangeDeregFns` in CollectionResource could be undefined because it is possible they are
27
- deleted between the making of the CacheSyncer map and calling of `removeItemResources`
28
-
29
- ## 12.0.5-3
30
-
31
- - Fix an issue where updated items (which came from a query/derived values) would not trigger onChange hooks properly
32
-
33
- ## 12.0.5-2
34
-
35
- - Fix issue where link columns where not included in `TransactionCachedQueryHandler.__fetchLinkedCachedQueryItems`.
36
-
37
- ## 12.0.5-1
38
-
39
- - Remove `getParentFast`, refactor `getParent` to use the (correct) logic from `getParentFast`
40
- - Add `ItemResource.collectFields` which is an alias for `ItemResource.transaction.itemHandler.collectFields`
41
-
42
- ## 12.0.5
43
-
44
- - Rename ChangesDeltaItemUpdateMode modes
45
- - Treat socket messages as `CLEAR_WHEN_SAME` update type
46
- - Properly propagate server changes as updates by setting `didChangeAnyField`
47
-
48
- ## 12.0.4
49
-
50
- - Fix incorrect changes processing for local items in `TransactionItemHandler.processItemEntryChanges` which could cause
51
- infinite loops with `onChange` hooks
52
-
53
- ## 12.0.3
54
-
55
- - Remove setting of locally created `displayname`s on the transaction changes and construct it when looking up
56
- `displayname` in the fields proxy instead
57
-
58
- > The `displayname` is a readonly column so it does not belong on the transaction, it was also causing issues because it
59
- > was incorrectly marking the transaction as having changes
60
-
61
- - Speed up `ItemEntryService.getDisplayname` by only looking up the required fields instead of calling `collectFields`
62
-
63
- ## 12.0.2
64
-
65
- - Fix `ModuleChangesCompilation` result and improve speed of it
66
-
67
- ## 12.0.1
68
-
69
- - Bugfixes for item changes caching
70
-
71
- ## 12.0.0
72
-
73
- - Replace `ColumnSubSetCache` with `RequestColumnsOperationCache`, implement `RequestColumnsOperationCache` to reduce
74
- calls to `mergeRequestColumns`.
75
-
76
- > This should improve performance when batch requesting collections.
77
-
78
- - **Breaking:** Make request columns read only by default. Introduce `ApiRequestColumnsArray` (which is read-only) and
79
- `MutableApiRequestColumnsArray` (which is not) convenience types to facilitate this.
80
- - When handling responses of query and update requests, only match the items of the request item type. This prevents
81
- items being used for derived values (with incomplete column sets) being matched.
82
-
83
- - Completely rewrite how item changes are stored on transactions so that it now only tracks the actual changes this
84
- should reduce memory footprint and increase performance
85
-
86
- ## 11.0.4
87
-
88
- - Fixed a bug where the QueryContainsLocalIdParser could break queries with an `IN` query with a mix of local and
89
- non-local IDs.
90
- - Fixed a bug in QueryContainsLocalIdParser that would not correctly find local IDs in subqueries of a linkedTo query.
91
-
92
- ## 11.0.3
93
-
94
- - Fixed a bug where the QueryParserIdUpdater could break queries with an `IN` with a single ID in it causing everything
95
- that used that query afterwards (QueryMatcher etc) to fail
96
-
97
- ## 11.0.2
98
-
99
- - Copy cached queries to server cache in `TransactionCache.updateLocalItemIdReferences`. This ensures that remote cached
100
- queries are present on the server cache after saving.
101
-
102
- ## 11.0.1
103
-
104
- - Include item type and query in 'non-existing query' error in `__expandCachedQuery`.
105
-
106
- ## 11.0.0
107
-
108
- - **Breaking:** Remove `priorityBufferSettings` collection option, replace with `usePrivateBuffer`.
109
-
110
- > This option forces the use of a buffer just for the collection query. This allows for optimized matching and keeps
111
- > the requested columns in check, because no other items will be added to the buffer.
112
-
113
- - Fix issue where cached queries were expanded on the current transaction only. This would lead to data being requested
114
- unnecessarily.
115
- - Fix issue where columns needed for the query matcher weren't included when requesting cached queries.
116
- - Add tracking of match attempts on CachedQueryItems
117
- - Add tracking of cache hits on CachedQueryItems
118
- - Add `custom` collection option back in. This was removed in the testing branch, but is still being used by the
119
- front-end.
120
-
121
- ## 10.1.0
122
-
123
- - Performance: Removed caching of non-matchable queries, we now lose the ability to automatically add new items to these
124
- collections (they still update upon re-requesting them)
125
- but this saves a ton of matching requests.
126
-
127
- ## 10.0.6
128
-
129
- - Fixed issue where multiple locktockens could be requested when multiple calls to `fetchLocktoken` were made in quick
130
- succession.
131
-
132
- ## 10.0.5
133
-
134
- - Refactor mapping of deleted entries in ChangesDeltas to be a map instead of an array
135
- - Prevent setting items as updated on ChangesDeltas if it's also in deleted entries
136
- - Remove updated and restored entries in ChangesDeltas if it's also in deleted entries
137
-
138
- ## 10.0.4
139
-
140
- - Fixed a bug introduced in 10.0.3 when trying to load a local item
141
-
142
- ## 10.0.3
143
-
144
- - Fixed a bug in which remotely fetched changes could overwrite changes of a parent transaction if there was a child
145
- transaction
146
-
147
- ## 10.0.2
148
-
149
- - Use the promise library instead of native promises in BusinessLogicManager
150
-
151
- ## 10.0.1
152
-
153
- - Add the `MateriaalTelexemplarenBusinessLogicRule` to the core
154
-
155
- ## 10.0.0
156
-
157
- - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
158
-
159
- ## 10.0.0-alpha.3
160
-
161
- - Only set invoice module permissions when project permissions change if 'projecten_facturen_maken' is enabled
162
-
163
- ## 10.0.0-alpha.2
164
-
165
- - Fix infinite loop in Rol business logic
166
-
167
- ## 10.0.0-alpha.1
168
-
169
- - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
170
-
171
- ## 9.3.1
172
-
173
- - Fixed a bug where items that were both moved and updated could end up in a collection twice
174
-
175
- ## 9.3.0
176
-
177
- - Added order to the CacheSyncer functions ensuring that it's always in order of 1. removing 2. adding
178
-
179
- ## 9.2.4
180
-
181
- - Fixed a bug where incorrect request columns where added because of the query (in reverse linkedTo queries)
182
-
183
- ## 9.2.3
184
-
185
- - Fixed a bug in which multiple requests for the same item could result in incorrect expanded columns
186
- - Increased performance of ColumnUtil by using string comparison over enums
187
- - Increased performance of caching new items (in ChangesDelta._setItemCreated) by not creating default local values for
188
- items from API responses
189
-
190
- ## 9.2.2
191
-
192
- - Optimize requests for collection trees with three levels. (E.g. MateriaalCat -> Planningmateriaal -> Missing)
193
-
194
- ## 9.2.1
195
-
196
- - Fix bug in 9.2.0 that caused updates of date fields not to be processed.
197
-
198
- ## 9.2.0
199
-
200
- - Greatly speed up core processing on large datasets
201
- - Refactor the way ChangesDeltaBase.setItemUpdated processes fields to reduce `Object.getOwnPropertyDescriptor`
202
- calls
203
- - Refactor the way CacheSyncer.processDelta processes updated values to prevent unneeded field copying
204
- and `Object.getOwnPropertyDescriptor` calls
205
- - Add `RequestBufferManagerPrioritySettings` to give finer control over request buffering to the caller
206
-
207
- ## 9.1.2
208
-
209
- - Delete item lock when transaction is destroyed
210
-
211
- > We never deleted item locks causing the items to be locked forever, even though a user wasn't editing them anymore
212
-
213
- ## 9.1.1
214
-
215
- - Fix handling of multiple create requests in one transaction
216
-
217
- ## 9.1.0
218
-
219
- - Implement cascading deletes based on backend delete relations
220
-
221
- ## 9.0.5
222
-
223
- - Prevent an error occurring when `fetchItemEntryData` did not return an itemEntry
224
-
225
- ## 9.0.4
226
-
227
- - Remove `MAYBE` matches that did not get returned after the API query from cached queries and collections
228
- in `CacheSyncer`
229
-
230
- ## 9.0.3
231
-
232
- - Check for empty changesDeltas in `TransactionCache.applyChangesFromParent` to prevent unnecessary calls
233
-
234
- ## 9.0.2
235
-
236
- - Improve the way `getLinkCollections` fetches its data to greatly improve performance
237
-
238
- ## 9.0.1
239
-
240
- - Accept any version (apposed to `latest`) for @rentman/backend-types
241
-
242
- ## 9.0.0
243
-
244
- - **Breaking:** Align item changes in server cache and transaction cache: add `fields` property in server item changes,
245
- rename `changes` in transaction item changes to fields. Remove `getChangesFromItemChanges`.
246
-
247
- ## 8.2.11
248
-
249
- - Only copy over cachedQueries when saving child transactions if the parent transaction doesn't have one with the query
250
- yet
251
-
252
- ## 8.2.10
253
-
254
- - Fix displayname for 'CustomfieldGroup'
255
- - Also set displayname when creating ItemEntries
256
-
257
- ## 8.2.9
258
-
259
- - Fixes a bug in which items on the ServerCache would not properly be added to collections
260
-
261
- ## 8.2.8
262
-
263
- - Fixes a bug in which newly created items do not appear in collections caused in 8.2.6
264
-
265
- ## 8.2.7
266
-
267
- - Merge tabRequestParameters when saving a TransactionCache into another TransactionCache
268
-
269
- ## 8.2.6
270
-
271
- - Fixed issue where deleted equipment re-appear
272
-
273
- ## 8.2.5
274
-
275
- - Skipped
276
-
277
- ## 8.2.4
278
-
279
- - Fixed issue where non-local items were expanded locally.
280
- - Fixed hypothetical situation where an item entry in a local cached query could have an incomplete column set.
281
-
282
- ## 8.2.3
283
-
284
- - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
285
-
286
- ## 8.2.2
287
-
288
- - Fixed a bug where derived values would not be fetched for newly created local items
289
- - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
290
-
291
- ## 8.2.1
292
-
293
- - Skipped
294
-
295
- ## 8.2.0
296
-
297
- - Added support for collection trees. Now, when requesting a collection you can add the `children` property, which is a
298
- map of collection options. The collection resources will be available in the item resources of the resulting
299
- collection resource. For more information,
300
- see [Confluence](https://rentman.atlassian.net/wiki/spaces/~652789241/pages/948404231/Child+collections).
301
-
302
- ## 8.1.9
303
-
304
- - RM4-16796 Fixed a bug where loading the same query in quick succession would cause columns/data to be missing
305
-
306
- ## 8.1.8
307
-
308
- - Reorganize imports: move all exports to `internal.ts`. This is the only place where things should be exported. All
309
- files should import from this file. Resolve duplicate declaration of `InternalCreateDelta` type.
310
- - Improve performance of copying over values in `ChangesDelta`s and `CollectionMatcherBase`
311
- - Merge all `CollectionMatcher` classes into one `CacheSyncer`, so that `processDelta` only has to be done once
312
- - Increase performance of the ApiFormatter on large datasets
313
-
314
- ## 8.1.7
315
-
316
- - Fixed a bug where copied over CachedQueryItems weren't resolved (causing them to hang forever)
317
-
318
- ## 8.1.6
319
-
320
- - Add missing return statement in ServerCache.applyChangesDelta
321
-
322
- ## 8.1.5
323
-
324
- - Only extend missing derived values while resolving local items
325
- in `TransactionCachedQueryHandler.__fetchItemEntriesByQueryData`
326
-
327
- ## 8.1.4
328
-
329
- - Remove non-created items if they are not returned in the response of a Create request
330
-
331
- > If a create would fail, the whole request would fail. So we can assume that if an item isn't returned from a create
332
- > request, the backend has left it out on purpose
333
-
334
- - Move cached queries to parent transactions only when saving a child transaction
335
-
336
- > Only then you know for sure that items that matched on the child transaction will also match in the parent transaction,
337
- > since you're taking over the changes, this behaviour was changed somewhere in a refactor but was incorrect
338
-
339
- - No longer move cached queries to the ServerCache when saving a root transaction
340
-
341
- > You probably don't need the result of *all* those cached queries anymore (and it's also inefficient to keep them because the matcher keeps the up-to-date)
342
-
343
- - No longer wait for child transactions to sync when applying changes in a parent
344
-
345
- > A child transaction can only influence a parent transaction by calling `TransactionCache.save`, which doens't happen whilst applying changes,
346
- > so you don't have to wait for child transactions when applying changes in a parent
347
-
348
- ## 8.1.3
349
-
350
- - Allow passing TransactionOptions to TransactionCacheFactory.construct
351
-
352
- ## 8.1.2
353
-
354
- - Fixed a bug in which derived values for local items wouldn't be properly be fetched
355
-
356
- ## 8.1.1
357
-
358
- - Fixed a bug in which a `Template` request's columns weren't processed
359
-
360
- ## 8.1.0
361
-
362
- - Add `cloneCreatedChanges` function to `ChangesDeltaFactory`. This function clone the `created` component of a changes
363
- delta into a destination changes delta.
364
- - Add `TransactionOptions`, implement `transparent` transaction option
365
- - Allow core-mapped TS types instead of backend-mapped TS types in `ApiFormatter.compareFields`
366
- - Fixed a bug where empty update requests where sometimes done
367
- - Fixed a bug where derived values of items returned in a Template request weren't properly resolved
368
-
369
- ## 8.0.3
370
-
371
- - Changed the flow of a create request so that it includes all the required columns for all transactions and also
372
- processes additionally returned (derived) items
373
- - Fixed a bug where fields referencing local items would already be updated in the `previous` before the `onChange`
374
- callbacks were called
375
- - Moved logic of updating IDs in cached queries/collections to TransactionCachedQueryHandler and
376
- TransactionCollectionHandler
377
-
378
- ## 8.0.2
379
-
380
- - Fixed a bug where deleted entries on a child transaction where not handled properly
381
- - Fixed a bug where saving a child transaction, and then undoing those changes and saving again would not update the
382
- parent transaction
383
-
384
- ## 8.0.1
385
-
386
- - Uppercase operators and comparators in QueryMatcher, QueryParser and QueryService
387
- - Fix parsing short-hand `IN` queryies
388
-
389
- ## 8.0.0
390
-
391
- - Implement `@rentman/backend-types`
392
-
393
- > You will now have autocomplete and typing checking on all columns/fields 🥳
394
-
395
- - Remove `ChangesDeltaResult.rollback`
396
-
397
- > It was never really used/implemented
398
-
399
- ## 7.2.0
400
-
401
- - Add the `preventCaching` option to `CollectionOptions`
402
-
403
- > Prevents a CachedQueryItem from being cached (the CollectionResource will still be cached), you can use this when you fetch an Itemtype for which the backend doesn't send socket messages (so it never automatically updates)
404
-
405
- ## 7.1.1
406
-
407
- - Properly handle moved items in ServerCache.applyChangesFromParent (technically the backend won't ever generate a
408
- linkTo (only updates)) but it can happen when manually syncing the server cache (by
409
- doing `InternalChangesDelta.setItemMoved`)
410
-
411
- ## 7.1.0
412
-
413
- - Automatically keep aggregated values up-to-date by always refetching them
414
-
415
- ## 7.0.15
416
-
417
- - Remove an accidentally left in place debugger
418
-
419
- ## 7.0.14
420
-
421
- - Take into account collections with a 'limit' (of which the query result isn't cached) when matching socket items
422
-
423
- ## 7.0.13
424
-
425
- - Only overwrite the displayname if the required columns are present, instead of defaulting to an empty string
426
-
427
- ## 7.0.12
428
-
429
- - Fixed a bug where the core would try to update the cache key (ID) of `fieldChangeCallbacks` even when there were no
430
- callbacks for the given itemType
431
-
432
- ## 7.0.11
433
-
434
- - Fixed a bug where date values would not be compared if the descriptor was uncalled, this could lead to problems when
435
- applying changes from a parent transaction
436
-
437
- ## 7.0.10
438
-
439
- - Update references to local IDs in other items when a local ID gets updated
440
-
441
- ## 7.0.9
442
-
443
- - Take over `tabRequestParameters` when saving TransactionCache -> TransactionCache
444
-
445
- ## 7.0.8
446
-
447
- - Fixed a race condition and loop iteration error which in very rare cases caused itemEntries to be `undefined` and
448
- erroring
449
- - Add missing error handling in transaction functions
450
-
451
- ## 7.0.7
452
-
453
- - Properly handle `reverse` linkedTo's in QueryColumnExtractor and QueryLocallyMatchableParser
454
- - Implement refreshing of cached queries/collections
455
-
456
- ## 7.0.6
457
-
458
- Move fetching of lock from `TransactionItemHandler.processItemEntryChanges` to `TransactionCache.appyChangesDelta` to
459
- also capture creates and deletes.
460
-
461
- ## 7.0.5
462
-
463
- - Remove automatic fetching of derived values for not-yet-created items
464
-
465
- ## 7.0.4
466
-
467
- - Automatically resolve derived values when a new item is created
468
- - Fixed a bug where `AbstractCache.getParentFromFields` would still return `null` incorrectly
469
-
470
- ## 7.0.3
471
-
472
- - Fixed a bug where `AbstractCache.getParentFromFields` would still return `undefined` parent values
473
-
474
- ## 7.0.2
475
-
476
- - Check if any of the parent fields (`itemtype`, `item`) is `null`, in which case it won't be treated as a valid parent
477
- in `AbstractCache.getParentFromFields`
478
-
479
- ## 7.0.1
480
-
481
- - Ignore columns in ApiFormatter::hasChanges if the `modified` object does not contain a value for it.
482
-
483
- ## 7.0.0
484
-
485
- - **Breaking**: Remove `enableChangesWatcher` and `disableChangesWatcher` in `TransactionCache`.
486
- - Fetch lock token in `TransactionItemHandler.processItemEntryChanges`.
487
-
488
- ## 6.3.10
489
-
490
- - Only call `onRemove` of a collection if there are actually any items removed
491
- - Expand cached columns anyways if there are no items to expand in `TransactionCachedQueryHandler.__expandCachedQuery`
492
-
493
- ## 6.3.9
494
-
495
- - Fixed a bug where deleted local items would still appear as unsaved changes
496
-
497
- ## 6.3.8
498
-
499
- - Always fetch 'id' and 'permissions' columns so that they are always available
500
-
501
- ## 6.3.7
502
-
503
- - Fixed a bug where items in a socket message that _might_ fit (`MAYBE`) in a collection would not be checked/added.
504
-
505
- ## 6.3.6
506
-
507
- - Fixed a bug where `AbstractCache.fetchUpdatedDerivedValuesFromDelta` would attempt to use ItemChanges not cached on
508
- the transaction resulting in an error
509
-
510
- ## 6.3.5
511
-
512
- - Fixed a bug where after creating items derived values would needlessly be refetched
513
-
514
- > The core now properly detect that even though an ItemId is updated (after a create) it's still the same item so no request has to be done
515
-
516
- - Fixed a bug where ItemEntry's would not be re-cached under their new ItemIds
517
-
518
- ## 6.3.4
519
-
520
- - Fixed a bug where already cached itemEntries would not properly be detected when calling `ServerCache.processResponse`
521
- - Fixed a bug where calling `CreatedChangesDelta.remove` would add `empty` values in the array instead of removing the
522
- entry
523
-
524
- ## 6.3.3
525
-
526
- - Fixed a bug where local ItemEntries were not properly updated after saving
527
-
528
- ## 6.3.2
529
-
530
- - Fixed updating item entry itemId field after processing changes
531
-
532
- ## 6.3.1
533
-
534
- - Fixed a bug where query with a local ID would do a request to the server
535
-
536
- ```
537
- // This example should now no longer do a request
538
- transaction.getItemsByQuery(
539
- 'Tijd',
540
- {
541
- project: -11,
542
- }
543
- );
544
- ```
545
-
546
- ## 6.3.0
547
-
548
- - Allow strict typing of `FieldMap`
549
-
550
- ## 6.2.5
551
-
552
- - Remove overwriting itemType with itemType of rootItem during create
553
-
554
- ## 6.2.4
555
-
556
- - Fixed a bug where items would not appear in a collection after changes propagated from a parent transaction
557
-
558
- ## 6.2.3
559
-
560
- - Fixed a bug where `previous` would actually contain new values because the `previous` object was made after the values
561
- were already synced
562
-
563
- ## 6.2.2
564
-
565
- - Fixed a bug in syncing of initial values after saving an item causing the item to still be marked having changes
566
-
567
- ## 6.2.1
568
-
569
- - Fixed a bug where `ItemEntry`s created on the `ServerCache` where not matched on child `TransactionCache`s
570
-
571
- ## 6.2.0
572
-
573
- - Fixed a bug where synchronous validators would leave the validator in `pending` state
574
- - Only re-match items when values are actually changed
575
- - Removed `defered` from `CachedQueryItem` and added `resolve` and `reject`
576
- - Check if ItemEntries are already created before creating new ones, if that is the case treat it like an update
577
-
578
- > What could happen was that a faster request created an ItemEntry for the same item as another request
579
- > which caused the double creation of an ItemEntry
580
-
581
- ## 6.1.3
582
-
583
- - Add `isPending` function to `TransactionValidator`
584
- - `TransactionCache`s will now be invalid until all pending transaction validators are done
585
-
586
- ## 6.1.2
587
-
588
- - Check if an error key exists before deleting it in `TransactionCache.clearItemError`
589
-
590
- ## 6.1.1
591
-
592
- - Correctly pass `ErrorHandlerInterface` to `ChangesDeltaFactory`.
593
-
594
- ## 6.1.0
595
-
596
- - Return `ChangesDelta` instance in `setItemUpdated`, `setItemDeleted`, `setItemsDeleted` methods, and a promise that
597
- resolves to the instance in `setItemCreated` and `setItemsCreated`.
598
-
599
- ## 6.0.2
600
-
601
- - Update `query` parameter of `getByQuery`, `getLocalByQuery`, `batchGetLocalByParent`, and `matchQuery` in `ItemCache`.
602
-
603
- ## 6.0.1
604
-
605
- - Fixed a bug where a local item wouldn't be found when using `TransactionCache.getItemByState` on a child transaction
606
-
607
- ## 6.0.0
608
-
609
- - Refactored query caching structure
610
- - Properly implemented `limit` in collections
611
- - Removed extending of collections
612
-
613
- ## 5.0.1
614
-
615
- - Add 'icon' column type to non-selectable column types
616
-
617
- ## 5.0.0
618
-
619
- - Fixed a bug where created, creator and permissions was always set to default values
620
- - **Breaking:** Remove `onItemsCreated` collection callback.
621
-
622
- ## 4.0.4
623
-
624
- - Fixed a bug where ModuleChangesCompilation wouldn't include all changes
625
-
626
- ## 4.0.3
627
-
628
- - Local collections are now correctly identified when using a local ID in a linkTo request instead of the `parent`
629
- option
630
- - Fix issue where local collection entries were not moved to server cache after save.
631
-
632
- ## 4.0.2
633
-
634
- - Fixed a bug where clearing collections would error after saving a transaction
635
-
636
- ## 4.0.1
637
-
638
- - Remove thrown error in `ItemResource.callOnChange`
639
-
640
- > The frontend still relied on this and we won't refactor that at this point
641
-
642
- ## 4.0.0
643
-
644
- - Removed `ItemResourceOptions.onChange`, this is replaced by `TransactionCache.registerFieldChangeCallback`
645
-
646
- > Because the `onChange` is no longer stored on the ItemResource, the ItemResource doesn't have to be cached.
647
- > This way you don't have to call `ItemResource.clearResource` anymore (you do need to deregister the fieldChange callbacks)
648
-
649
- ## 3.1.0
650
-
651
- - **Breaking:** Remove `fields` property, add `getFields` method in `Template` class.
652
- - **Breaking:** Add `ConversionMapService`. Update `updateItemValues` to take a `source` and `destination` parameter.
653
- - Update `entry.itemId` for items created items in `TransactionCache.getDelta`.
654
-
655
- > This fixes an issue with updating IDs of local items.
656
-
657
- - Add dependency interfaces for `AbstractCache`, `ServerCache`, `TransactionCache`, `TransactionCollectionHandler`
658
- , `TransactionItemHandler`.
659
- - Add `CreatedChangesDelta` class, which replaces the `created` component of the `ChangesDelta` and includes some query
660
- methods. Add `isEmpty` method to `ChangesDelta`.
661
-
662
- ## 3.0.1
663
-
664
- - Fixed a bug where the `StateKeyType` enum couldn't be used when imported
665
-
666
- ## 3.0.0
667
-
668
- - Remove ViewResource, EditResource, CollectionViewResource and CollectionEditResource
669
-
670
- > There was no real distinction between them anymore since the core 2.0 update.
671
- > You can now use the base ItemResource and CollectionResource types instead
672
-
673
- ## 2.4.0
674
-
675
- - Update Typescript version to `3.7.2`, also update other plugins
676
-
677
- ## 2.3.0
678
-
679
- - Add callbacks when errors are set/cleared to `TransactionEventHandler`
680
- - Added the possibility to differentiate between errors to display below a field and on the save button
681
- in `TransactionValidator`
682
- - Changed the format of the error translations from `string` to `() => string` in `TransactionValidator`
683
-
684
- > Now the translation function will only be called when the error is actually set, not when it's cleared
685
-
686
- ## 2.2.1
687
-
688
- - Fixed a bug where resolving derived values for new items (in `TransactionCache.applyChangesDelta`) would sometimes
689
- error
690
-
691
- ## 2.2.0
692
-
693
- - `ChangesDelta.setItem(s)Created` will now accept incomplete input values
694
-
695
- > It will now fetch a template for you and process the items, so you no longer need to do that yourself
696
-
697
- ## 2.1.2
698
-
699
- - Fixed a bug where deleted ItemEntries weren't picked up when detecting transaction changes
700
-
701
- ## 2.1.1
702
-
703
- - Fixed a bug where an ItemEntry's errors wouldn't be deleted when the ItemEntry was deleted on a transaction
704
-
705
- ## 2.1.0
706
-
707
- - Refactor `TransactionCache.getItemsByQuery` to check cached entries (just like a collection)
708
- - Add `TransactionValidator`, allow passing of a `TransactionValidatorFactory` to a transaction
709
-
710
- > You can use these validators to set errors using `setItemError` and `setGlobalError`
711
-
712
- - Fixed a bug where `TransactionItemHandler.cloneItemEntry` could only clone entry with changes on the target
713
- transaction.
714
-
715
- > It will not look for changes recursively on the transaction change
716
-
717
- ## 2.0.19
718
-
719
- - Ensure all requestColumns for newly created ItemEntries from a template are available
720
- - Ensure derived values for newly created ItemEntries from a template are available
721
-
722
- ## 2.0.18
723
-
724
- - Include read-only columns when detecting changes in TransactionItemHandler.processItemEntryChanges
725
-
726
- > Read-only columns shouldn't count as changes on the tab, but they should be taking into account when deciding whether or not to call `onChange`
727
-
728
- ## 2.0.17
729
-
730
- - Fixed a bug where deleting an item that isn't in the transaction's item entry cache would result in an error
731
- - Fixed a bug where response columns weren't set for newly created local CollectionEntries
732
- - Fixed a bug where items weren't matched for newly created local CollectionEntries
733
-
734
- ## 2.0.16
735
-
736
- - Fixed a bug where queries with a link to a local parent item weren't updated on save
737
-
738
- ## 2.0.15
739
-
740
- - Cache ItemEntries that fit collections on the CollectionEntry's query instead of the CollectionEntry's id
741
- - Add a 'hint' to ChangesDeltas which allows skipping the extra request to validate `maybe` query matches
742
- - Create transaction changes for ItemEntry updates in the changesDelta if non exist yet when
743
- calling `TransactionCache.applyChangesDelta`
744
-
745
- > This allows you to update values on a transaction without having to fetch a resource for it by calling
746
- > `ChangesDelta.setItemUpdated()`
747
-
748
- ## 2.0.14
749
-
750
- - Fixed reading of derived values in `getItemIdByColumn` when a ChangesDelta is passed
751
-
752
- ## 2.0.13
753
-
754
- - Fixed a bug where the incorrect fields where applied to the ChangesDelta in `TransactionItemHandler.cloneItemEntry`
755
- - A RequestBuffer's promise will now resolve after the ServerCache.processResponse promise is done, ensuring all values
756
- are present before continuing
757
- - Request columns for the request ItemType will now properly be taken into account in ServerCache.processResponse
758
- ensuring root columns are always properly set. (This is used to update derived values)
759
-
760
- ## 2.0.12
761
-
762
- - Fixed a bug where created changes weren't copied to the itemchanges
763
- - Only take readonly parent columns instead of all readonly columns in `ApiFormatter.hasChanges`
764
- - Fixed a bug where ItemEntry's where still in `ItemCache.entriesByEntryId` after clearing them
765
-
766
- ## 2.0.11
767
-
768
- - Fixed a bug where changes weren't copied to the itemchanges
769
- - Fixed correct isCalledAfterApiSave values on calls to ServerCache.processResponse
770
-
771
- ## 2.0.10
772
-
773
- - Construct `ColumnSet` with proper `requestColumns` when creating a `Template` with additional columns
774
-
775
- ## 2.0.9
776
-
777
- - Properly process linked items from the template request in `TransactionItemHandler.createItems`
778
-
779
- ## 2.0.8
780
-
781
- - Fixed a bug where not all fields where available even tough an ItemResource with specific columns was created
782
-
783
- ## 2.0.7
784
-
785
- - Define abstract copyTransactionItemEntryChanges on ItemHandlerBase
786
- - Implement copyTransactionItemEntryChanges on TransactionItemHandler and ServerItemHandler
787
- - Fix AbstractCache/ServerCache/TransactionCache `getParent` function arguments
788
-
789
- > With the newly added arguments the function definitions didn't align anymore causing typescript errors
790
- > Even though the arguments aren't used in the `ServerCache` they're added in there
791
-
792
- ## 2.0.6
793
-
794
- - Remove `ApiFormatter.lazyClone`
795
-
796
- > You can't lazily clone moment objects because the moment you wanted to clone could be changed in the time the getter isn't invoked, resulting in a different value
797
-
798
- - Create a copy of the child transaction's field instead of copying the object reference
799
- in `TransactionCache.applyChangeFromChild` and `ChangesProcessor.executeCreateRequest`
800
-
801
- > When writing to the object references you're changing multiple transactions at once, while this should be handled by applyCHangesFromParent
802
-
803
- ## 2.0.5
804
-
805
- - Add `callOnAddWithInitialItems` option to `CollectionResourceOptions`
806
-
807
- > If `true` the `onAdd` callback will be called with the initial set of items
808
-
809
- ## 2.0.4
810
-
811
- - Add `isCalledAfterSocketUpdate` to `onAdd`, `onRemove` and `onChange` callbacks
812
-
813
- > You can use this if a data change should only trigger an action when the user caused it himself
814
-
815
- ## 2.0.3
816
-
817
- - Fix `CollectionEditResource.removeItems`
818
- - Move `getCurrentCollectionEntryCache` and `getCurrentItemEntryCache` from `TransactionCache` to `AbstractCache`
819
-
820
- ## 2.0.2
821
-
822
- - Fix marking entries as deleted and compiling this into a request
823
-
824
- ## 2.0.1
825
-
826
- - Expand CollectionEntry's columns in `ServerCollectionHandler.fetchCollectionData`
827
-
828
- ## 2.0.0 - Major caching refactor
829
-
830
- - Completely reworked internal caching structure,
831
- see [this Confluence page](https://rentman.atlassian.net/wiki/spaces/DEV/pages/704872456/) for the motivations behind
832
- it.
833
-
834
- ## 1.9.0
835
-
836
- - Don't create ItemResources when not returning links in `ItemAdministrator.getNewResourceWithId` and
837
- in `ItemAdministrator.constructOnItemsExpanded`
838
-
839
- ## 1.8.0
840
-
841
- - Remove `ResourceCache` and `resourceLevel`
842
-
843
- > You should now manually call `resource.clearResource` when you no longer need a resource
844
-
845
- - Add `onConstruct` function to `ItemResource` and `CollectionResource`
846
-
847
- > This is overwritten by the frontend to track resource creation
848
-
849
- ## 1.7.6
850
-
851
- - Add priority parameter to local cache callbacks. The callback condition (`always` / `onClose` / `skipOnClose`) no
852
- longer has any effect on the order in which the callbacks get executed.
853
- - **Breaking:** Remove `LocalCacheCallbackCondition` enum.
854
- - Add `itemId` parameter to `ItemHandler.fetchNewItem`. An error is thrown when an ID already exists.
855
- Add `getNewResourceWithId` to ItemAdministrator. Deprecate `getItemByState`.
856
-
857
- ## 1.7.5
858
-
859
- - For template column sets it is no longer assumed all columns are present. This fixes an issue with incomplete column
860
- sets in the front-end.
861
- - Fix issue where `changesProcessor` instance was undefined in `itemResourceFactory` and `collectionResourceFactory`.
862
- Create variables for each core service in order to get a TypeScript error when a dependency hasn't been initialized
863
- yet.
864
-
865
- ## 1.7.4
866
-
867
- - Add support for strict ItemType type checking in `FieldMap`
868
-
869
- ## 1.7.3
870
-
871
- - Add support for strict ItemType type checking
872
-
873
- > This is temporarily defaulted to `any` to prevent compile errors in the frontend
874
-
875
- ## 1.7.2
876
-
877
- - Fix some typing issues in:
878
- - ApiResponseProcessor
879
- - ItemCache
880
- - KeyService
881
-
882
- ## 1.7.1
883
-
884
- - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
885
-
886
- ## 1.7.0
887
-
888
- - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
889
-
890
- ### Resource caching
891
-
892
- - **Breaking:** the following properties are removed:
893
- - On `ItemEntry`: `clearResources`, `deactivateResources`.
894
- - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
895
- - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
896
- - An additional `level` parameter has been added to all methods that return resources.
897
- - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
898
- A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
899
- - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection and
900
- collection resources with a level of `level` or higher will be removed.
901
- - The `clearResources` method has been removed from `LocalCache`.
902
- - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
903
-
904
- ## 1.6.13
905
-
906
- - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
907
- promise has been resolved.
908
-
909
- > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
910
-
911
- ## 1.6.12
912
-
913
- - Fix error that occurs when trying to resolve a non-deferred collection entry.
914
-
915
- ## 1.6.11
916
-
917
- - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
918
-
919
- ## 1.6.10
920
-
921
- - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
922
- `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
923
-
924
- ## 1.6.9
925
-
926
- - Redeploy of `1.6.8`
927
-
928
- ## 1.6.8
929
-
930
- - Add support for `not` in queries
931
-
932
- ## 1.6.7
933
-
934
- - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
935
-
936
- ## 1.6.6
937
-
938
- - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial`
939
- parameter in `CollectionEntry.extend`, as it should always be true.
940
-
941
- > The `extend` function only concerns itself with remote items, so no local changes should be generated.
942
-
943
- ## 1.6.5
944
-
945
- - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
946
-
947
- > This could lead to instances where a different column would be set to the value of the parent.
948
-
949
- ## 1.6.4
950
-
951
- - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
952
- - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for
953
- the `resultCollectionResource`.
954
-
955
- ## 1.6.3
956
-
957
- - Properly type ApiResponseProcessor - fetchObjectArray
958
-
959
- ## 1.6.2
960
-
961
- - Fix issue where the collection handler would return collection entries before they were resolved when
962
- calling `batchFetch`.
963
-
964
- ## 1.6.1-3
965
-
966
- - Check for linkedTo before checking for subqueries in QueryMatcher
967
-
968
- > Linkedto also has `.query` and was incorrectly marked as a subquery
969
-
970
- ## 1.6.1-2
971
-
972
- - Fixed shorthand query with null values
973
-
974
- > The QueryParser would incorrectly identify subqueries when using null in a shorthand
975
-
976
- ## 1.6.1-1
977
-
978
- - Fixed shorthand query with Moment values
979
-
980
- > The QueryParser would incorrectly identify Moment objects as a subquery
981
-
982
- ## 1.6.1
983
-
984
- - Added support for subqueries in QueryParser and QueryMatcher
985
-
986
- > Collections using subqueries will always return 'maybe' in the QueryMatcher
987
-
988
- ## 1.6.0
989
-
990
- - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core
991
- functionality.
992
- - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
993
-
994
- ## 1.5.9
995
-
996
- - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column. Catch exceptions that
997
- might occur when resolving an `ItemEntry`.
998
- - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a
999
- collection, add them to the collection.
1000
-
1001
- ## 1.5.8
1002
-
1003
- - Introduce `RemoteViewResource` and `LocalViewResource`.
1004
-
1005
- > The `fields` property of a `RemoteViewResource` represents server values, while the `fields` property of a `LocalViewResource` represents local values.
1006
-
1007
- - The `fields` property of a `ViewResource` is now read only.
1008
-
1009
- ## 1.5.7-1
1010
-
1011
- - Make ItemResource/CollectionResource base class abstract
1012
- - Add missing overload functions in some places
1013
- - Fix default comparator `QueryMatcher.parseSimpleQuery`
1014
- - Fix `ExtendedCollectionMatchResult` `collection` property type
1015
-
1016
- ## 1.5.7
1017
-
1018
- - Properly type Collections & ItemResources (and return values) in the whole core.
1019
-
1020
- > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
1021
- > You can now also type the expected collection type
1022
-
1023
- ```
1024
- // Expects a collection with editCollection and editItems both `true`
1025
- // Will properly return EditResources for all collection functions
1026
- const collection: CollectionEditResource<EditResource>;
1027
-
1028
- // other variations are:
1029
- // CollectionViewResource<ViewResource>
1030
- // CollectionViewResource<EditResource>
1031
- // CollectionEditResource<ViewResource>
1032
-
1033
- this.core.itemAdministrator.getCollection(
1034
- 'Notitie',
1035
- {
1036
- editCollection: true, // Will return a CollectionEditResource
1037
- editItems: true // Will return EditResources instead of ViewResources in `.items`
1038
- }
1039
- )
1040
- ```
1041
-
1042
- ## 1.5.6
1043
-
1044
- - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
1045
-
1046
- ## 1.5.5
1047
-
1048
- - Add 'order' column type handling to ApiFormatter functions
1049
-
1050
- ## 1.5.4
1051
-
1052
- - Fix issue where parent would be incorrectly set when cloning a single item.
1053
- - Type functions related to expansion maps in `ItemEntryService`.
1054
-
1055
- ## 1.5.3
1056
-
1057
- - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
1058
- calling `save` on a collection resource where this option was not explicitly set.
1059
-
1060
- ## 1.5.2
1061
-
1062
- - Type functions in `ColumnUtil` class.
1063
- - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
1064
-
1065
- > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
1066
-
1067
- - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
1068
- - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
1069
-
1070
- ## 1.5.1
1071
-
1072
- - Properly remove item entry stub from (local) cache when request fails.
1073
- - Fix issue where item or collection options could be set to undefined.
1074
-
1075
- ## 1.5.0
1076
-
1077
- - Add `SocketMessage` type and add types to `SocketMessageHandler`
1078
- - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
1079
- (`fetchItem` or `fetchItems` in `ItemHandler`.)
1080
- - Implement expanding of local collections. This no longer leads to invalid requests.
1081
- - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
1082
- - **Warning:** This version contains major changes.
1083
-
1084
- ### Introduce typing of item and collection options
1085
-
1086
- - **Breaking:** Removed `QueryItemType` collection entry option.
1087
- - **Breaking:** Removed `ItemResourceService`.
1088
- - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
1089
- `addCollection`.
1090
- - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
1091
- collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
1092
- still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
1093
-
1094
- ## v1.4.0
1095
-
1096
- - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
1097
- `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
1098
- They have a slightly different type signature.
1099
- - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
1100
- necessary.
1101
- - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
1102
- - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
1103
-
1104
- ## v1.3.8
1105
-
1106
- - Add `isSaving` to `LocalCache`
1107
-
1108
- > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
1109
-
1110
- ## v1.3.7
1111
-
1112
- - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the
1113
- parent.
1114
- - Remove slip workarounds
1115
- - Add api request types
1116
- - Add types to `ModuleChangesCompilation`
1117
-
1118
- ## v1.3.6
1119
-
1120
- - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
1121
-
1122
- ## v1.3.5
1123
-
1124
- - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
1125
-
1126
- ## v1.3.4
1127
-
1128
- - Add country to isFilteredColumn in ColumnUtil
1129
-
1130
- ## v1.3.3
1131
-
1132
- - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
1133
-
1134
- > These functions are specifically used for rendering ui-grid in the frontend, so there's no reason to have them in the core
1135
-
1136
- ## v1.3.2
1137
-
1138
- - Fix types path in package.json
1139
-
1140
- ## v1.3.1
1141
-
1142
- - Fix types path in package.json
1143
-
1144
- ## v1.3.0
1145
-
1146
- - Rename PromiseInterface to PromiseLibraryInterface
1147
-
1148
- > PromiseInterface is now used for the internal promise type
1149
-
1150
- - Use PromiseInterface instead of Promise as internal promise type
1151
-
1152
- > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
1153
-
1154
- ## v1.2.9
1155
-
1156
- - Call processOptions in fetchDerivedValuesByColumn
1157
-
1158
- > Bug was introduced earlier but got enabled in v1.2.7
1159
-
1160
- ## v1.2.8
1161
-
1162
- - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
1163
-
1164
- ## v1.2.7
1165
-
1166
- - Set itemEntry parent when generating a stub
1167
-
1168
- ## v1.2.6
1169
-
1170
- - Fix an issue introduced in v1.2.5.
1171
-
1172
- ## v1.2.5
1173
-
1174
- - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
1175
- solves an issue with refreshing on a local edit view.
1176
-
1177
- ## v1.2.4
1178
-
1179
- - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
1180
- is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
1181
- - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
1182
- - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
1183
- `TemplateLinkedItemEntryMap`.
1184
- - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
1185
-
1186
- ## v1.2.3
1187
-
1188
- - Fixed issue where derived values deeper than one layer couldn't be resolved.
1189
-
1190
- ## v1.2.2
1191
-
1192
- - Fixed issue where in derived values weren't set after create request.
1193
-
1194
- ## v1.2.1
1195
-
1196
- - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
1197
- function of the `EditResource` class.
1198
- - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
1199
- - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`)
1200
- when `modInstant` is set to true.
1201
-
1202
- ## v1.2.0
1203
-
1204
- - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
1205
- resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
1206
- `{key: 'value'}` should now be used as argument when calling these functions.
1207
- - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
1208
-
1209
- ## v1.1.20
1210
-
1211
- - Fixed minor issue where collection wouldn't be deferred properly before expanding.
1212
- - `onChange` is now called automatically when when calling `commit` on an edit resource.
1213
-
1214
- ## v1.1.19
1215
-
1216
- - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
1217
- `localCache` parameter.
1218
-
1219
- ### Local cache callback refactoring
1220
-
1221
- - Removed `onSaveWithoutClosing` event.
1222
- - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
1223
- `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
1224
- callbacks.
1225
- - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
1226
- to `onSaveSuccess` callback functions.
1227
-
1228
- ## v1.1.18
1229
-
1230
- - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
1231
- - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
1232
- collection entries.
1233
-
1234
- ## v1.1.17
1235
-
1236
- - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
1237
- - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
1238
- of `getByParent`.
1239
-
1240
- ### Cache invalidation
1241
-
1242
- - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
1243
- collection entry containing the item is requested.
1244
- - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
1245
- - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
1246
- and collection entries.
1247
-
1248
- ### Item entry refactoring
1249
-
1250
- - Renamed `process` to `setFields`.
1251
- - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
1252
- - `setModified` now also sets local default values.
1253
- - Removed `setCreator`. This function was called twice in some instances.
1254
- - **Breaking:** Added `derived` parameter to `updateFields`
1255
-
1256
- ## v1.16
1257
-
1258
- - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
1259
- project financial values in the front-end. [RM4-9577]
1260
- - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
1261
- from being added to the local cache.
1262
-
1263
- ## v1.15
1264
-
1265
- - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
1266
- - Fix type definition of `PromiseInterface.all`.
1267
-
1268
- ## v1.14
1269
-
1270
- - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
1271
- issue with recurring appointments in the front-end.
1272
-
1273
- ## v1.13
1274
-
1275
- - Add option to exclude itemTypes during createLocalEntries.
1276
-
1277
- ## v1.12
1278
-
1279
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
1280
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
1281
- from the local cache inadvertently.
1282
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate
1283
- chaining.
1284
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
1285
- are now respected. This fixes an issue where items where *not* removed from the local cache.
1286
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
1287
- issue where changes were being detected continuously.
1288
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
1289
- except when updating documents. This fixes several issues.
1290
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
1291
- collection was added multiple times.
1292
- - Updated all models to use dependency objects. This increases ease of debugging.
1293
-
1294
- ## v.1.11
1295
-
1296
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
1297
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
1298
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
1299
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
1300
- completed transactions.
1301
-
1302
- ## v.1.10
1303
-
1304
- - Fixed issue where changes on different subtabs were not detected.
1305
-
1306
- ## v1.1.9
1307
-
1308
- - Exposed `noop` function on `RmCore` class.
1309
-
1310
- > This is used in order to check whether a callback has a default value.
1311
-
1312
- - Added `copyRequestColumns` function to `ColumnUtil` class.
1313
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
1314
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
1315
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
1316
- `breakUpByParent` - `onAfterCreateCallback`.
1317
-
1318
- ## v1.1.8
1319
-
1320
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
1321
-
1322
- ## v1.1.7
1323
-
1324
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
1325
-
1326
- ## v1.1.6
1327
-
1328
- - Fixed issue with deferred item entries.
1329
- - Re-enable changes watcher after save.
1330
- - Added optional `id` parameter to `LocalCache` constructor.
1331
-
1332
- ## v1.1.5
1333
-
1334
- - Added `clearItem` function to `LocalCache` class.
1335
-
1336
- ## v.1.1.4
1337
-
1338
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
1339
-
1340
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add the items to the local cache.
1341
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
1342
- doing it however can definitely be harmful.
1343
-
1344
- ## v.1.1.3
1345
-
1346
- - Fixed an issue where all collections in a local cache would be cleared.
1347
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
1348
- `LocalCacheManagerInterface`.
1349
-
1350
- ## v1.1.2
1351
-
1352
- - Fixed an issue concerning derived values.
1353
-
1354
- ## v1.1.1
1355
-
1356
- - Fixed an issue where changes wouldn't be detected.
1357
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
1358
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
1359
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
1360
- `disableChangesWatcher` instead.
1361
-
1362
- ## v1.1.0
1363
-
1364
- ### Development
1365
-
1366
- #### Strict TypeScript compilation
1367
-
1368
- Added the following TypeScript compiler options:
1369
-
1370
- - noImplicitThis
1371
- - noImplicitReturns
1372
- - strictNullChecks
1373
- - noUnusedLocals
1374
- - noUnusedParameters
1375
-
1376
- I would advise enabling these for all TypeScript projects from now on.
1377
-
1378
- #### Ordered imports and dependencies
1379
-
1380
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this. Please note that
1381
- this also applies for imports from the folder the file is currently in. For example, in `models/ItemResource.ts`
1382
- , `itemEntry` should be imported like so:
1383
- `import { ItemEntry } from '../models';`
1384
-
1385
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
1386
- remove dependencies in the future.
1387
-
1388
- ### Breaking changes
1389
-
1390
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
1391
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
1392
- `moduleChangesCompilationFactory`.
1393
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is no
1394
- longer supported in the back-end.
1395
-
1396
- #### Item and collection entries
1397
-
1398
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
1399
- - Added the following functions to `ItemEntryService`:
1400
- - `createLocalConversionMap`;
1401
- - `expandLocalConversionMap`;
1402
- - `expandConversionMap`;
1403
- - `batchExpandConversionMap`;
1404
- - `batchClone`.
1405
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new item ID, and
1406
- update the conversion map accordingly, but will respect the item ID that is already there.
1407
-
1408
- #### Rework item caching
1409
-
1410
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default. All
1411
- entries are added to the global cache on save. Item entries are added to the local cache when resources are created
1412
- using the item administrator or when resources are created when adding the items to a collection.
1413
-
1414
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
1415
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
1416
- > pasting of items.
1417
-
1418
- Other changes:
1419
-
1420
- - Moved `saveLocal` to `ItemAdministrator`;
1421
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
1422
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
1423
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
1424
- already on the backend. (Use `getCollectionMatcher`.)
1425
-
1426
- ## v1.0.33
1427
-
1428
- - Really fix types path
1429
-
1430
- ## v1.0.33
1431
-
1432
- - Fix types path
1433
-
1434
- ## v1.0.32
1435
-
1436
- - Update `tsconfig.json` to put definitions in the root folder
1437
-
1438
- > The app had an issue with AOT compilation because of this
1439
-
1440
- ## v1.0.31
1441
-
1442
- - Fix `columnHandler.fetchItemTypeTranslations`
1443
-
1444
- > It incorrectly looped over the response map, it should now work again
1445
-
1446
- ## v1.0.30
1447
-
1448
- - Remove `updateTabParams` from LocalCacheManagerInterface
1449
-
1450
- > The function wasn't used
1451
-
1452
- - Reworked class export
1453
-
1454
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
1455
-
1456
- ## v1.0.29
1457
-
1458
- - Fix inverted inArray check in CollectionEntry.removeItems
1459
-
1460
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
1461
-
1462
- ## v1.0.28
1463
-
1464
- Bug fixes only
1465
-
1466
- ## v1.0.27
1467
-
1468
- - `ItemEntry.initial` is now undefined by default
1469
-
1470
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
1471
-
1472
- ## v1.0.26
1473
-
1474
- Bundle both minified and unminified code, include sourcemaps from dev build
1475
-
1476
- ## v1.0.24, v1.0.25
1477
-
1478
- ! Use version `v1.0.26` !
1479
-
1480
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
1481
-
1482
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
1483
-
1484
- - Rename `ItemEntry.entryId` to `ItemEntry.id
1485
-
1486
- > It used to be called `id`, but it was changed in the seperation of the core.
1487
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
1488
-
1489
- - Rename ItemResource `startTransaction` to `start`
1490
-
1491
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
1492
-
1493
- - `SocketMessageHandler.onMessageReceived` now returns a promise
1494
-
1495
- > You can now use the updated items or hook into the result to update the ui for example
1496
-
1497
- ## v1.0.23
1498
-
1499
- - Rename ResourceCache to LocalCache
1500
-
1501
- > LocalCache only caches local items (name better reflects functionality)
1502
-
1503
- - Remove getter/setter for hasChanges
1504
-
1505
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
1506
-
1507
- - Remove `_getCollection` from ItemAdministrator
1508
-
1509
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
1510
- > options and should not be given as a separate argument. This was included to support the frontend
1511
-
1512
- - Remove `saveCurrentTab` from ItemAdministrator
1513
-
1514
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
1515
-
1516
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
1517
-
1518
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
1519
-
1
+ # Changelog
2
+
3
+ Contains new features, breaking changes and their reasoning
4
+
5
+ ## 12.1.0
6
+
7
+ - Added business logic rule to automatically sync `asset_location` field between
8
+ Reparatie items and the selected Exemplaar.
9
+
10
+ ## 12.0.5
11
+
12
+ - Rename ChangesDeltaItemUpdateMode modes
13
+ - Treat socket messages as `CLEAR_WHEN_SAME` update type
14
+ - Properly propagate server changes as updates by setting `didChangeAnyField`
15
+
16
+ ## 12.0.4
17
+
18
+ - Fix incorrect changes processing for local items in `TransactionItemHandler.processItemEntryChanges` which could cause
19
+ infinite loops with `onChange` hooks
20
+
21
+ ## 12.0.3
22
+
23
+ - Remove setting of locally created `displayname`s on the transaction changes and construct it when looking up
24
+ `displayname` in the fields proxy instead
25
+
26
+ > The `displayname` is a readonly column so it does not belong on the transaction, it was also causing issues because it
27
+ > was incorrectly marking the transaction as having changes
28
+
29
+ - Speed up `ItemEntryService.getDisplayname` by only looking up the required fields instead of calling `collectFields`
30
+
31
+ ## 12.0.2
32
+
33
+ - Fix `ModuleChangesCompilation` result and improve speed of it
34
+
35
+ ## 12.0.1
36
+
37
+ - Bugfixes for item changes caching
38
+
39
+ ## 12.0.0
40
+
41
+ - Replace `ColumnSubSetCache` with `RequestColumnsOperationCache`, implement `RequestColumnsOperationCache` to reduce
42
+ calls to `mergeRequestColumns`.
43
+
44
+ > This should improve performance when batch requesting collections.
45
+
46
+ - **Breaking:** Make request columns read only by default. Introduce `ApiRequestColumnsArray` (which is read-only) and
47
+ `MutableApiRequestColumnsArray` (which is not) convenience types to facilitate this.
48
+ - When handling responses of query and update requests, only match the items of the request item type. This prevents
49
+ items being used for derived values (with incomplete column sets) being matched.
50
+
51
+ - Completely rewrite how item changes are stored on transactions so that it now only tracks the actual changes this
52
+ should reduce memory footprint and increase performance
53
+
54
+ ## 11.0.4
55
+
56
+ - Fixed a bug where the QueryContainsLocalIdParser could break queries with an `IN` query with a mix of local and
57
+ non-local IDs.
58
+ - Fixed a bug in QueryContainsLocalIdParser that would not correctly find local IDs in subqueries of a linkedTo query.
59
+
60
+ ## 11.0.3
61
+
62
+ - Fixed a bug where the QueryParserIdUpdater could break queries with an `IN` with a single ID in it causing everything
63
+ that used that query afterwards (QueryMatcher etc) to fail
64
+
65
+ ## 11.0.2
66
+
67
+ - Copy cached queries to server cache in `TransactionCache.updateLocalItemIdReferences`. This ensures that remote cached
68
+ queries are present on the server cache after saving.
69
+
70
+ ## 11.0.1
71
+
72
+ - Include item type and query in 'non-existing query' error in `__expandCachedQuery`.
73
+
74
+ ## 11.0.0
75
+
76
+ - **Breaking:** Remove `priorityBufferSettings` collection option, replace with `usePrivateBuffer`.
77
+
78
+ > This option forces the use of a buffer just for the collection query. This allows for optimized matching and keeps
79
+ > the requested columns in check, because no other items will be added to the buffer.
80
+
81
+ - Fix issue where cached queries were expanded on the current transaction only. This would lead to data being requested
82
+ unnecessarily.
83
+ - Fix issue where columns needed for the query matcher weren't included when requesting cached queries.
84
+ - Add tracking of match attempts on CachedQueryItems
85
+ - Add tracking of cache hits on CachedQueryItems
86
+ - Add `custom` collection option back in. This was removed in the testing branch, but is still being used by the
87
+ front-end.
88
+
89
+ ## 10.1.0
90
+
91
+ - Performance: Removed caching of non-matchable queries, we now lose the ability to automatically add new items to these
92
+ collections (they still update upon re-requesting them)
93
+ but this saves a ton of matching requests.
94
+
95
+ ## 10.0.6
96
+
97
+ - Fixed issue where multiple locktockens could be requested when multiple calls to `fetchLocktoken` were made in quick
98
+ succession.
99
+
100
+ ## 10.0.5
101
+
102
+ - Refactor mapping of deleted entries in ChangesDeltas to be a map instead of an array
103
+ - Prevent setting items as updated on ChangesDeltas if it's also in deleted entries
104
+ - Remove updated and restored entries in ChangesDeltas if it's also in deleted entries
105
+
106
+ ## 10.0.4
107
+
108
+ - Fixed a bug introduced in 10.0.3 when trying to load a local item
109
+
110
+ ## 10.0.3
111
+
112
+ - Fixed a bug in which remotely fetched changes could overwrite changes of a parent transaction if there was a child
113
+ transaction
114
+
115
+ ## 10.0.2
116
+
117
+ - Use the promise library instead of native promises in BusinessLogicManager
118
+
119
+ ## 10.0.1
120
+
121
+ - Add the `MateriaalTelexemplarenBusinessLogicRule` to the core
122
+
123
+ ## 10.0.0
124
+
125
+ - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
126
+
127
+ ## 10.0.0-alpha.3
128
+
129
+ - Only set invoice module permissions when project permissions change if 'projecten_facturen_maken' is enabled
130
+
131
+ ## 10.0.0-alpha.2
132
+
133
+ - Fix infinite loop in Rol business logic
134
+
135
+ ## 10.0.0-alpha.1
136
+
137
+ - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
138
+
139
+ ## 9.3.1
140
+
141
+ - Fixed a bug where items that were both moved and updated could end up in a collection twice
142
+
143
+ ## 9.3.0
144
+
145
+ - Added order to the CacheSyncer functions ensuring that it's always in order of 1. removing 2. adding
146
+
147
+ ## 9.2.4
148
+
149
+ - Fixed a bug where incorrect request columns where added because of the query (in reverse linkedTo queries)
150
+
151
+ ## 9.2.3
152
+
153
+ - Fixed a bug in which multiple requests for the same item could result in incorrect expanded columns
154
+ - Increased performance of ColumnUtil by using string comparison over enums
155
+ - Increased performance of caching new items (in ChangesDelta._setItemCreated) by not creating default local values for
156
+ items from API responses
157
+
158
+ ## 9.2.2
159
+
160
+ - Optimize requests for collection trees with three levels. (E.g. MateriaalCat -> Planningmateriaal -> Missing)
161
+
162
+ ## 9.2.1
163
+
164
+ - Fix bug in 9.2.0 that caused updates of date fields not to be processed.
165
+
166
+ ## 9.2.0
167
+
168
+ - Greatly speed up core processing on large datasets
169
+ - Refactor the way ChangesDeltaBase.setItemUpdated processes fields to reduce `Object.getOwnPropertyDescriptor`
170
+ calls
171
+ - Refactor the way CacheSyncer.processDelta processes updated values to prevent unneeded field copying
172
+ and `Object.getOwnPropertyDescriptor` calls
173
+ - Add `RequestBufferManagerPrioritySettings` to give finer control over request buffering to the caller
174
+
175
+ ## 9.1.2
176
+
177
+ - Delete item lock when transaction is destroyed
178
+
179
+ > We never deleted item locks causing the items to be locked forever, even though a user wasn't editing them anymore
180
+
181
+ ## 9.1.1
182
+
183
+ - Fix handling of multiple create requests in one transaction
184
+
185
+ ## 9.1.0
186
+
187
+ - Implement cascading deletes based on backend delete relations
188
+
189
+ ## 9.0.5
190
+
191
+ - Prevent an error occurring when `fetchItemEntryData` did not return an itemEntry
192
+
193
+ ## 9.0.4
194
+
195
+ - Remove `MAYBE` matches that did not get returned after the API query from cached queries and collections
196
+ in `CacheSyncer`
197
+
198
+ ## 9.0.3
199
+
200
+ - Check for empty changesDeltas in `TransactionCache.applyChangesFromParent` to prevent unnecessary calls
201
+
202
+ ## 9.0.2
203
+
204
+ - Improve the way `getLinkCollections` fetches its data to greatly improve performance
205
+
206
+ ## 9.0.1
207
+
208
+ - Accept any version (apposed to `latest`) for @rentman/backend-types
209
+
210
+ ## 9.0.0
211
+
212
+ - **Breaking:** Align item changes in server cache and transaction cache: add `fields` property in server item changes,
213
+ rename `changes` in transaction item changes to fields. Remove `getChangesFromItemChanges`.
214
+
215
+ ## 8.2.11
216
+
217
+ - Only copy over cachedQueries when saving child transactions if the parent transaction doesn't have one with the query
218
+ yet
219
+
220
+ ## 8.2.10
221
+
222
+ - Fix displayname for 'CustomfieldGroup'
223
+ - Also set displayname when creating ItemEntries
224
+
225
+ ## 8.2.9
226
+
227
+ - Fixes a bug in which items on the ServerCache would not properly be added to collections
228
+
229
+ ## 8.2.8
230
+
231
+ - Fixes a bug in which newly created items do not appear in collections caused in 8.2.6
232
+
233
+ ## 8.2.7
234
+
235
+ - Merge tabRequestParameters when saving a TransactionCache into another TransactionCache
236
+
237
+ ## 8.2.6
238
+
239
+ - Fixed issue where deleted equipment re-appear
240
+
241
+ ## 8.2.5
242
+
243
+ - Skipped
244
+
245
+ ## 8.2.4
246
+
247
+ - Fixed issue where non-local items were expanded locally.
248
+ - Fixed hypothetical situation where an item entry in a local cached query could have an incomplete column set.
249
+
250
+ ## 8.2.3
251
+
252
+ - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
253
+
254
+ ## 8.2.2
255
+
256
+ - Fixed a bug where derived values would not be fetched for newly created local items
257
+ - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
258
+
259
+ ## 8.2.1
260
+
261
+ - Skipped
262
+
263
+ ## 8.2.0
264
+
265
+ - Added support for collection trees. Now, when requesting a collection you can add the `children` property, which is a
266
+ map of collection options. The collection resources will be available in the item resources of the resulting
267
+ collection resource. For more information,
268
+ see [Confluence](https://rentman.atlassian.net/wiki/spaces/~652789241/pages/948404231/Child+collections).
269
+
270
+ ## 8.1.9
271
+
272
+ - RM4-16796 Fixed a bug where loading the same query in quick succession would cause columns/data to be missing
273
+
274
+ ## 8.1.8
275
+
276
+ - Reorganize imports: move all exports to `internal.ts`. This is the only place where things should be exported. All
277
+ files should import from this file. Resolve duplicate declaration of `InternalCreateDelta` type.
278
+ - Improve performance of copying over values in `ChangesDelta`s and `CollectionMatcherBase`
279
+ - Merge all `CollectionMatcher` classes into one `CacheSyncer`, so that `processDelta` only has to be done once
280
+ - Increase performance of the ApiFormatter on large datasets
281
+
282
+ ## 8.1.7
283
+
284
+ - Fixed a bug where copied over CachedQueryItems weren't resolved (causing them to hang forever)
285
+
286
+ ## 8.1.6
287
+
288
+ - Add missing return statement in ServerCache.applyChangesDelta
289
+
290
+ ## 8.1.5
291
+
292
+ - Only extend missing derived values while resolving local items
293
+ in `TransactionCachedQueryHandler.__fetchItemEntriesByQueryData`
294
+
295
+ ## 8.1.4
296
+
297
+ - Remove non-created items if they are not returned in the response of a Create request
298
+
299
+ > If a create would fail, the whole request would fail. So we can assume that if an item isn't returned from a create
300
+ > request, the backend has left it out on purpose
301
+
302
+ - Move cached queries to parent transactions only when saving a child transaction
303
+
304
+ > Only then you know for sure that items that matched on the child transaction will also match in the parent transaction,
305
+ > since you're taking over the changes, this behaviour was changed somewhere in a refactor but was incorrect
306
+
307
+ - No longer move cached queries to the ServerCache when saving a root transaction
308
+
309
+ > You probably don't need the result of *all* those cached queries anymore (and it's also inefficient to keep them because the matcher keeps the up-to-date)
310
+
311
+ - No longer wait for child transactions to sync when applying changes in a parent
312
+
313
+ > A child transaction can only influence a parent transaction by calling `TransactionCache.save`, which doens't happen whilst applying changes,
314
+ > so you don't have to wait for child transactions when applying changes in a parent
315
+
316
+ ## 8.1.3
317
+
318
+ - Allow passing TransactionOptions to TransactionCacheFactory.construct
319
+
320
+ ## 8.1.2
321
+
322
+ - Fixed a bug in which derived values for local items wouldn't be properly be fetched
323
+
324
+ ## 8.1.1
325
+
326
+ - Fixed a bug in which a `Template` request's columns weren't processed
327
+
328
+ ## 8.1.0
329
+
330
+ - Add `cloneCreatedChanges` function to `ChangesDeltaFactory`. This function clone the `created` component of a changes
331
+ delta into a destination changes delta.
332
+ - Add `TransactionOptions`, implement `transparent` transaction option
333
+ - Allow core-mapped TS types instead of backend-mapped TS types in `ApiFormatter.compareFields`
334
+ - Fixed a bug where empty update requests where sometimes done
335
+ - Fixed a bug where derived values of items returned in a Template request weren't properly resolved
336
+
337
+ ## 8.0.3
338
+
339
+ - Changed the flow of a create request so that it includes all the required columns for all transactions and also
340
+ processes additionally returned (derived) items
341
+ - Fixed a bug where fields referencing local items would already be updated in the `previous` before the `onChange`
342
+ callbacks were called
343
+ - Moved logic of updating IDs in cached queries/collections to TransactionCachedQueryHandler and
344
+ TransactionCollectionHandler
345
+
346
+ ## 8.0.2
347
+
348
+ - Fixed a bug where deleted entries on a child transaction where not handled properly
349
+ - Fixed a bug where saving a child transaction, and then undoing those changes and saving again would not update the
350
+ parent transaction
351
+
352
+ ## 8.0.1
353
+
354
+ - Uppercase operators and comparators in QueryMatcher, QueryParser and QueryService
355
+ - Fix parsing short-hand `IN` queryies
356
+
357
+ ## 8.0.0
358
+
359
+ - Implement `@rentman/backend-types`
360
+
361
+ > You will now have autocomplete and typing checking on all columns/fields 🥳
362
+
363
+ - Remove `ChangesDeltaResult.rollback`
364
+
365
+ > It was never really used/implemented
366
+
367
+ ## 7.2.0
368
+
369
+ - Add the `preventCaching` option to `CollectionOptions`
370
+
371
+ > Prevents a CachedQueryItem from being cached (the CollectionResource will still be cached), you can use this when you fetch an Itemtype for which the backend doesn't send socket messages (so it never automatically updates)
372
+
373
+ ## 7.1.1
374
+
375
+ - Properly handle moved items in ServerCache.applyChangesFromParent (technically the backend won't ever generate a
376
+ linkTo (only updates)) but it can happen when manually syncing the server cache (by
377
+ doing `InternalChangesDelta.setItemMoved`)
378
+
379
+ ## 7.1.0
380
+
381
+ - Automatically keep aggregated values up-to-date by always refetching them
382
+
383
+ ## 7.0.15
384
+
385
+ - Remove an accidentally left in place debugger
386
+
387
+ ## 7.0.14
388
+
389
+ - Take into account collections with a 'limit' (of which the query result isn't cached) when matching socket items
390
+
391
+ ## 7.0.13
392
+
393
+ - Only overwrite the displayname if the required columns are present, instead of defaulting to an empty string
394
+
395
+ ## 7.0.12
396
+
397
+ - Fixed a bug where the core would try to update the cache key (ID) of `fieldChangeCallbacks` even when there were no
398
+ callbacks for the given itemType
399
+
400
+ ## 7.0.11
401
+
402
+ - Fixed a bug where date values would not be compared if the descriptor was uncalled, this could lead to problems when
403
+ applying changes from a parent transaction
404
+
405
+ ## 7.0.10
406
+
407
+ - Update references to local IDs in other items when a local ID gets updated
408
+
409
+ ## 7.0.9
410
+
411
+ - Take over `tabRequestParameters` when saving TransactionCache -> TransactionCache
412
+
413
+ ## 7.0.8
414
+
415
+ - Fixed a race condition and loop iteration error which in very rare cases caused itemEntries to be `undefined` and
416
+ erroring
417
+ - Add missing error handling in transaction functions
418
+
419
+ ## 7.0.7
420
+
421
+ - Properly handle `reverse` linkedTo's in QueryColumnExtractor and QueryLocallyMatchableParser
422
+ - Implement refreshing of cached queries/collections
423
+
424
+ ## 7.0.6
425
+
426
+ Move fetching of lock from `TransactionItemHandler.processItemEntryChanges` to `TransactionCache.appyChangesDelta` to
427
+ also capture creates and deletes.
428
+
429
+ ## 7.0.5
430
+
431
+ - Remove automatic fetching of derived values for not-yet-created items
432
+
433
+ ## 7.0.4
434
+
435
+ - Automatically resolve derived values when a new item is created
436
+ - Fixed a bug where `AbstractCache.getParentFromFields` would still return `null` incorrectly
437
+
438
+ ## 7.0.3
439
+
440
+ - Fixed a bug where `AbstractCache.getParentFromFields` would still return `undefined` parent values
441
+
442
+ ## 7.0.2
443
+
444
+ - Check if any of the parent fields (`itemtype`, `item`) is `null`, in which case it won't be treated as a valid parent
445
+ in `AbstractCache.getParentFromFields`
446
+
447
+ ## 7.0.1
448
+
449
+ - Ignore columns in ApiFormatter::hasChanges if the `modified` object does not contain a value for it.
450
+
451
+ ## 7.0.0
452
+
453
+ - **Breaking**: Remove `enableChangesWatcher` and `disableChangesWatcher` in `TransactionCache`.
454
+ - Fetch lock token in `TransactionItemHandler.processItemEntryChanges`.
455
+
456
+ ## 6.3.10
457
+
458
+ - Only call `onRemove` of a collection if there are actually any items removed
459
+ - Expand cached columns anyways if there are no items to expand in `TransactionCachedQueryHandler.__expandCachedQuery`
460
+
461
+ ## 6.3.9
462
+
463
+ - Fixed a bug where deleted local items would still appear as unsaved changes
464
+
465
+ ## 6.3.8
466
+
467
+ - Always fetch 'id' and 'permissions' columns so that they are always available
468
+
469
+ ## 6.3.7
470
+
471
+ - Fixed a bug where items in a socket message that _might_ fit (`MAYBE`) in a collection would not be checked/added.
472
+
473
+ ## 6.3.6
474
+
475
+ - Fixed a bug where `AbstractCache.fetchUpdatedDerivedValuesFromDelta` would attempt to use ItemChanges not cached on
476
+ the transaction resulting in an error
477
+
478
+ ## 6.3.5
479
+
480
+ - Fixed a bug where after creating items derived values would needlessly be refetched
481
+
482
+ > The core now properly detect that even though an ItemId is updated (after a create) it's still the same item so no request has to be done
483
+
484
+ - Fixed a bug where ItemEntry's would not be re-cached under their new ItemIds
485
+
486
+ ## 6.3.4
487
+
488
+ - Fixed a bug where already cached itemEntries would not properly be detected when calling `ServerCache.processResponse`
489
+ - Fixed a bug where calling `CreatedChangesDelta.remove` would add `empty` values in the array instead of removing the
490
+ entry
491
+
492
+ ## 6.3.3
493
+
494
+ - Fixed a bug where local ItemEntries were not properly updated after saving
495
+
496
+ ## 6.3.2
497
+
498
+ - Fixed updating item entry itemId field after processing changes
499
+
500
+ ## 6.3.1
501
+
502
+ - Fixed a bug where query with a local ID would do a request to the server
503
+
504
+ ```
505
+ // This example should now no longer do a request
506
+ transaction.getItemsByQuery(
507
+ 'Tijd',
508
+ {
509
+ project: -11,
510
+ }
511
+ );
512
+ ```
513
+
514
+ ## 6.3.0
515
+
516
+ - Allow strict typing of `FieldMap`
517
+
518
+ ## 6.2.5
519
+
520
+ - Remove overwriting itemType with itemType of rootItem during create
521
+
522
+ ## 6.2.4
523
+
524
+ - Fixed a bug where items would not appear in a collection after changes propagated from a parent transaction
525
+
526
+ ## 6.2.3
527
+
528
+ - Fixed a bug where `previous` would actually contain new values because the `previous` object was made after the values
529
+ were already synced
530
+
531
+ ## 6.2.2
532
+
533
+ - Fixed a bug in syncing of initial values after saving an item causing the item to still be marked having changes
534
+
535
+ ## 6.2.1
536
+
537
+ - Fixed a bug where `ItemEntry`s created on the `ServerCache` where not matched on child `TransactionCache`s
538
+
539
+ ## 6.2.0
540
+
541
+ - Fixed a bug where synchronous validators would leave the validator in `pending` state
542
+ - Only re-match items when values are actually changed
543
+ - Removed `defered` from `CachedQueryItem` and added `resolve` and `reject`
544
+ - Check if ItemEntries are already created before creating new ones, if that is the case treat it like an update
545
+
546
+ > What could happen was that a faster request created an ItemEntry for the same item as another request
547
+ > which caused the double creation of an ItemEntry
548
+
549
+ ## 6.1.3
550
+
551
+ - Add `isPending` function to `TransactionValidator`
552
+ - `TransactionCache`s will now be invalid until all pending transaction validators are done
553
+
554
+ ## 6.1.2
555
+
556
+ - Check if an error key exists before deleting it in `TransactionCache.clearItemError`
557
+
558
+ ## 6.1.1
559
+
560
+ - Correctly pass `ErrorHandlerInterface` to `ChangesDeltaFactory`.
561
+
562
+ ## 6.1.0
563
+
564
+ - Return `ChangesDelta` instance in `setItemUpdated`, `setItemDeleted`, `setItemsDeleted` methods, and a promise that
565
+ resolves to the instance in `setItemCreated` and `setItemsCreated`.
566
+
567
+ ## 6.0.2
568
+
569
+ - Update `query` parameter of `getByQuery`, `getLocalByQuery`, `batchGetLocalByParent`, and `matchQuery` in `ItemCache`.
570
+
571
+ ## 6.0.1
572
+
573
+ - Fixed a bug where a local item wouldn't be found when using `TransactionCache.getItemByState` on a child transaction
574
+
575
+ ## 6.0.0
576
+
577
+ - Refactored query caching structure
578
+ - Properly implemented `limit` in collections
579
+ - Removed extending of collections
580
+
581
+ ## 5.0.1
582
+
583
+ - Add 'icon' column type to non-selectable column types
584
+
585
+ ## 5.0.0
586
+
587
+ - Fixed a bug where created, creator and permissions was always set to default values
588
+ - **Breaking:** Remove `onItemsCreated` collection callback.
589
+
590
+ ## 4.0.4
591
+
592
+ - Fixed a bug where ModuleChangesCompilation wouldn't include all changes
593
+
594
+ ## 4.0.3
595
+
596
+ - Local collections are now correctly identified when using a local ID in a linkTo request instead of the `parent`
597
+ option
598
+ - Fix issue where local collection entries were not moved to server cache after save.
599
+
600
+ ## 4.0.2
601
+
602
+ - Fixed a bug where clearing collections would error after saving a transaction
603
+
604
+ ## 4.0.1
605
+
606
+ - Remove thrown error in `ItemResource.callOnChange`
607
+
608
+ > The frontend still relied on this and we won't refactor that at this point
609
+
610
+ ## 4.0.0
611
+
612
+ - Removed `ItemResourceOptions.onChange`, this is replaced by `TransactionCache.registerFieldChangeCallback`
613
+
614
+ > Because the `onChange` is no longer stored on the ItemResource, the ItemResource doesn't have to be cached.
615
+ > This way you don't have to call `ItemResource.clearResource` anymore (you do need to deregister the fieldChange callbacks)
616
+
617
+ ## 3.1.0
618
+
619
+ - **Breaking:** Remove `fields` property, add `getFields` method in `Template` class.
620
+ - **Breaking:** Add `ConversionMapService`. Update `updateItemValues` to take a `source` and `destination` parameter.
621
+ - Update `entry.itemId` for items created items in `TransactionCache.getDelta`.
622
+
623
+ > This fixes an issue with updating IDs of local items.
624
+
625
+ - Add dependency interfaces for `AbstractCache`, `ServerCache`, `TransactionCache`, `TransactionCollectionHandler`
626
+ , `TransactionItemHandler`.
627
+ - Add `CreatedChangesDelta` class, which replaces the `created` component of the `ChangesDelta` and includes some query
628
+ methods. Add `isEmpty` method to `ChangesDelta`.
629
+
630
+ ## 3.0.1
631
+
632
+ - Fixed a bug where the `StateKeyType` enum couldn't be used when imported
633
+
634
+ ## 3.0.0
635
+
636
+ - Remove ViewResource, EditResource, CollectionViewResource and CollectionEditResource
637
+
638
+ > There was no real distinction between them anymore since the core 2.0 update.
639
+ > You can now use the base ItemResource and CollectionResource types instead
640
+
641
+ ## 2.4.0
642
+
643
+ - Update Typescript version to `3.7.2`, also update other plugins
644
+
645
+ ## 2.3.0
646
+
647
+ - Add callbacks when errors are set/cleared to `TransactionEventHandler`
648
+ - Added the possibility to differentiate between errors to display below a field and on the save button
649
+ in `TransactionValidator`
650
+ - Changed the format of the error translations from `string` to `() => string` in `TransactionValidator`
651
+
652
+ > Now the translation function will only be called when the error is actually set, not when it's cleared
653
+
654
+ ## 2.2.1
655
+
656
+ - Fixed a bug where resolving derived values for new items (in `TransactionCache.applyChangesDelta`) would sometimes
657
+ error
658
+
659
+ ## 2.2.0
660
+
661
+ - `ChangesDelta.setItem(s)Created` will now accept incomplete input values
662
+
663
+ > It will now fetch a template for you and process the items, so you no longer need to do that yourself
664
+
665
+ ## 2.1.2
666
+
667
+ - Fixed a bug where deleted ItemEntries weren't picked up when detecting transaction changes
668
+
669
+ ## 2.1.1
670
+
671
+ - Fixed a bug where an ItemEntry's errors wouldn't be deleted when the ItemEntry was deleted on a transaction
672
+
673
+ ## 2.1.0
674
+
675
+ - Refactor `TransactionCache.getItemsByQuery` to check cached entries (just like a collection)
676
+ - Add `TransactionValidator`, allow passing of a `TransactionValidatorFactory` to a transaction
677
+
678
+ > You can use these validators to set errors using `setItemError` and `setGlobalError`
679
+
680
+ - Fixed a bug where `TransactionItemHandler.cloneItemEntry` could only clone entry with changes on the target
681
+ transaction.
682
+
683
+ > It will not look for changes recursively on the transaction change
684
+
685
+ ## 2.0.19
686
+
687
+ - Ensure all requestColumns for newly created ItemEntries from a template are available
688
+ - Ensure derived values for newly created ItemEntries from a template are available
689
+
690
+ ## 2.0.18
691
+
692
+ - Include read-only columns when detecting changes in TransactionItemHandler.processItemEntryChanges
693
+
694
+ > Read-only columns shouldn't count as changes on the tab, but they should be taking into account when deciding whether or not to call `onChange`
695
+
696
+ ## 2.0.17
697
+
698
+ - Fixed a bug where deleting an item that isn't in the transaction's item entry cache would result in an error
699
+ - Fixed a bug where response columns weren't set for newly created local CollectionEntries
700
+ - Fixed a bug where items weren't matched for newly created local CollectionEntries
701
+
702
+ ## 2.0.16
703
+
704
+ - Fixed a bug where queries with a link to a local parent item weren't updated on save
705
+
706
+ ## 2.0.15
707
+
708
+ - Cache ItemEntries that fit collections on the CollectionEntry's query instead of the CollectionEntry's id
709
+ - Add a 'hint' to ChangesDeltas which allows skipping the extra request to validate `maybe` query matches
710
+ - Create transaction changes for ItemEntry updates in the changesDelta if non exist yet when
711
+ calling `TransactionCache.applyChangesDelta`
712
+
713
+ > This allows you to update values on a transaction without having to fetch a resource for it by calling
714
+ > `ChangesDelta.setItemUpdated()`
715
+
716
+ ## 2.0.14
717
+
718
+ - Fixed reading of derived values in `getItemIdByColumn` when a ChangesDelta is passed
719
+
720
+ ## 2.0.13
721
+
722
+ - Fixed a bug where the incorrect fields where applied to the ChangesDelta in `TransactionItemHandler.cloneItemEntry`
723
+ - A RequestBuffer's promise will now resolve after the ServerCache.processResponse promise is done, ensuring all values
724
+ are present before continuing
725
+ - Request columns for the request ItemType will now properly be taken into account in ServerCache.processResponse
726
+ ensuring root columns are always properly set. (This is used to update derived values)
727
+
728
+ ## 2.0.12
729
+
730
+ - Fixed a bug where created changes weren't copied to the itemchanges
731
+ - Only take readonly parent columns instead of all readonly columns in `ApiFormatter.hasChanges`
732
+ - Fixed a bug where ItemEntry's where still in `ItemCache.entriesByEntryId` after clearing them
733
+
734
+ ## 2.0.11
735
+
736
+ - Fixed a bug where changes weren't copied to the itemchanges
737
+ - Fixed correct isCalledAfterApiSave values on calls to ServerCache.processResponse
738
+
739
+ ## 2.0.10
740
+
741
+ - Construct `ColumnSet` with proper `requestColumns` when creating a `Template` with additional columns
742
+
743
+ ## 2.0.9
744
+
745
+ - Properly process linked items from the template request in `TransactionItemHandler.createItems`
746
+
747
+ ## 2.0.8
748
+
749
+ - Fixed a bug where not all fields where available even tough an ItemResource with specific columns was created
750
+
751
+ ## 2.0.7
752
+
753
+ - Define abstract copyTransactionItemEntryChanges on ItemHandlerBase
754
+ - Implement copyTransactionItemEntryChanges on TransactionItemHandler and ServerItemHandler
755
+ - Fix AbstractCache/ServerCache/TransactionCache `getParent` function arguments
756
+
757
+ > With the newly added arguments the function definitions didn't align anymore causing typescript errors
758
+ > Even though the arguments aren't used in the `ServerCache` they're added in there
759
+
760
+ ## 2.0.6
761
+
762
+ - Remove `ApiFormatter.lazyClone`
763
+
764
+ > You can't lazily clone moment objects because the moment you wanted to clone could be changed in the time the getter isn't invoked, resulting in a different value
765
+
766
+ - Create a copy of the child transaction's field instead of copying the object reference
767
+ in `TransactionCache.applyChangeFromChild` and `ChangesProcessor.executeCreateRequest`
768
+
769
+ > When writing to the object references you're changing multiple transactions at once, while this should be handled by applyCHangesFromParent
770
+
771
+ ## 2.0.5
772
+
773
+ - Add `callOnAddWithInitialItems` option to `CollectionResourceOptions`
774
+
775
+ > If `true` the `onAdd` callback will be called with the initial set of items
776
+
777
+ ## 2.0.4
778
+
779
+ - Add `isCalledAfterSocketUpdate` to `onAdd`, `onRemove` and `onChange` callbacks
780
+
781
+ > You can use this if a data change should only trigger an action when the user caused it himself
782
+
783
+ ## 2.0.3
784
+
785
+ - Fix `CollectionEditResource.removeItems`
786
+ - Move `getCurrentCollectionEntryCache` and `getCurrentItemEntryCache` from `TransactionCache` to `AbstractCache`
787
+
788
+ ## 2.0.2
789
+
790
+ - Fix marking entries as deleted and compiling this into a request
791
+
792
+ ## 2.0.1
793
+
794
+ - Expand CollectionEntry's columns in `ServerCollectionHandler.fetchCollectionData`
795
+
796
+ ## 2.0.0 - Major caching refactor
797
+
798
+ - Completely reworked internal caching structure,
799
+ see [this Confluence page](https://rentman.atlassian.net/wiki/spaces/DEV/pages/704872456/) for the motivations behind
800
+ it.
801
+
802
+ ## 1.9.0
803
+
804
+ - Don't create ItemResources when not returning links in `ItemAdministrator.getNewResourceWithId` and
805
+ in `ItemAdministrator.constructOnItemsExpanded`
806
+
807
+ ## 1.8.0
808
+
809
+ - Remove `ResourceCache` and `resourceLevel`
810
+
811
+ > You should now manually call `resource.clearResource` when you no longer need a resource
812
+
813
+ - Add `onConstruct` function to `ItemResource` and `CollectionResource`
814
+
815
+ > This is overwritten by the frontend to track resource creation
816
+
817
+ ## 1.7.6
818
+
819
+ - Add priority parameter to local cache callbacks. The callback condition (`always` / `onClose` / `skipOnClose`) no
820
+ longer has any effect on the order in which the callbacks get executed.
821
+ - **Breaking:** Remove `LocalCacheCallbackCondition` enum.
822
+ - Add `itemId` parameter to `ItemHandler.fetchNewItem`. An error is thrown when an ID already exists.
823
+ Add `getNewResourceWithId` to ItemAdministrator. Deprecate `getItemByState`.
824
+
825
+ ## 1.7.5
826
+
827
+ - For template column sets it is no longer assumed all columns are present. This fixes an issue with incomplete column
828
+ sets in the front-end.
829
+ - Fix issue where `changesProcessor` instance was undefined in `itemResourceFactory` and `collectionResourceFactory`.
830
+ Create variables for each core service in order to get a TypeScript error when a dependency hasn't been initialized
831
+ yet.
832
+
833
+ ## 1.7.4
834
+
835
+ - Add support for strict ItemType type checking in `FieldMap`
836
+
837
+ ## 1.7.3
838
+
839
+ - Add support for strict ItemType type checking
840
+
841
+ > This is temporarily defaulted to `any` to prevent compile errors in the frontend
842
+
843
+ ## 1.7.2
844
+
845
+ - Fix some typing issues in:
846
+ - ApiResponseProcessor
847
+ - ItemCache
848
+ - KeyService
849
+
850
+ ## 1.7.1
851
+
852
+ - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
853
+
854
+ ## 1.7.0
855
+
856
+ - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
857
+
858
+ ### Resource caching
859
+
860
+ - **Breaking:** the following properties are removed:
861
+ - On `ItemEntry`: `clearResources`, `deactivateResources`.
862
+ - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
863
+ - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
864
+ - An additional `level` parameter has been added to all methods that return resources.
865
+ - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
866
+ A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
867
+ - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection and
868
+ collection resources with a level of `level` or higher will be removed.
869
+ - The `clearResources` method has been removed from `LocalCache`.
870
+ - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
871
+
872
+ ## 1.6.13
873
+
874
+ - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
875
+ promise has been resolved.
876
+
877
+ > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
878
+
879
+ ## 1.6.12
880
+
881
+ - Fix error that occurs when trying to resolve a non-deferred collection entry.
882
+
883
+ ## 1.6.11
884
+
885
+ - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
886
+
887
+ ## 1.6.10
888
+
889
+ - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
890
+ `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
891
+
892
+ ## 1.6.9
893
+
894
+ - Redeploy of `1.6.8`
895
+
896
+ ## 1.6.8
897
+
898
+ - Add support for `not` in queries
899
+
900
+ ## 1.6.7
901
+
902
+ - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
903
+
904
+ ## 1.6.6
905
+
906
+ - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial`
907
+ parameter in `CollectionEntry.extend`, as it should always be true.
908
+
909
+ > The `extend` function only concerns itself with remote items, so no local changes should be generated.
910
+
911
+ ## 1.6.5
912
+
913
+ - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
914
+
915
+ > This could lead to instances where a different column would be set to the value of the parent.
916
+
917
+ ## 1.6.4
918
+
919
+ - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
920
+ - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for
921
+ the `resultCollectionResource`.
922
+
923
+ ## 1.6.3
924
+
925
+ - Properly type ApiResponseProcessor - fetchObjectArray
926
+
927
+ ## 1.6.2
928
+
929
+ - Fix issue where the collection handler would return collection entries before they were resolved when
930
+ calling `batchFetch`.
931
+
932
+ ## 1.6.1-3
933
+
934
+ - Check for linkedTo before checking for subqueries in QueryMatcher
935
+
936
+ > Linkedto also has `.query` and was incorrectly marked as a subquery
937
+
938
+ ## 1.6.1-2
939
+
940
+ - Fixed shorthand query with null values
941
+
942
+ > The QueryParser would incorrectly identify subqueries when using null in a shorthand
943
+
944
+ ## 1.6.1-1
945
+
946
+ - Fixed shorthand query with Moment values
947
+
948
+ > The QueryParser would incorrectly identify Moment objects as a subquery
949
+
950
+ ## 1.6.1
951
+
952
+ - Added support for subqueries in QueryParser and QueryMatcher
953
+
954
+ > Collections using subqueries will always return 'maybe' in the QueryMatcher
955
+
956
+ ## 1.6.0
957
+
958
+ - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core
959
+ functionality.
960
+ - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
961
+
962
+ ## 1.5.9
963
+
964
+ - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column. Catch exceptions that
965
+ might occur when resolving an `ItemEntry`.
966
+ - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a
967
+ collection, add them to the collection.
968
+
969
+ ## 1.5.8
970
+
971
+ - Introduce `RemoteViewResource` and `LocalViewResource`.
972
+
973
+ > The `fields` property of a `RemoteViewResource` represents server values, while the `fields` property of a `LocalViewResource` represents local values.
974
+
975
+ - The `fields` property of a `ViewResource` is now read only.
976
+
977
+ ## 1.5.7-1
978
+
979
+ - Make ItemResource/CollectionResource base class abstract
980
+ - Add missing overload functions in some places
981
+ - Fix default comparator `QueryMatcher.parseSimpleQuery`
982
+ - Fix `ExtendedCollectionMatchResult` `collection` property type
983
+
984
+ ## 1.5.7
985
+
986
+ - Properly type Collections & ItemResources (and return values) in the whole core.
987
+
988
+ > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
989
+ > You can now also type the expected collection type
990
+
991
+ ```
992
+ // Expects a collection with editCollection and editItems both `true`
993
+ // Will properly return EditResources for all collection functions
994
+ const collection: CollectionEditResource<EditResource>;
995
+
996
+ // other variations are:
997
+ // CollectionViewResource<ViewResource>
998
+ // CollectionViewResource<EditResource>
999
+ // CollectionEditResource<ViewResource>
1000
+
1001
+ this.core.itemAdministrator.getCollection(
1002
+ 'Notitie',
1003
+ {
1004
+ editCollection: true, // Will return a CollectionEditResource
1005
+ editItems: true // Will return EditResources instead of ViewResources in `.items`
1006
+ }
1007
+ )
1008
+ ```
1009
+
1010
+ ## 1.5.6
1011
+
1012
+ - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
1013
+
1014
+ ## 1.5.5
1015
+
1016
+ - Add 'order' column type handling to ApiFormatter functions
1017
+
1018
+ ## 1.5.4
1019
+
1020
+ - Fix issue where parent would be incorrectly set when cloning a single item.
1021
+ - Type functions related to expansion maps in `ItemEntryService`.
1022
+
1023
+ ## 1.5.3
1024
+
1025
+ - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
1026
+ calling `save` on a collection resource where this option was not explicitly set.
1027
+
1028
+ ## 1.5.2
1029
+
1030
+ - Type functions in `ColumnUtil` class.
1031
+ - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
1032
+
1033
+ > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
1034
+
1035
+ - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
1036
+ - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
1037
+
1038
+ ## 1.5.1
1039
+
1040
+ - Properly remove item entry stub from (local) cache when request fails.
1041
+ - Fix issue where item or collection options could be set to undefined.
1042
+
1043
+ ## 1.5.0
1044
+
1045
+ - Add `SocketMessage` type and add types to `SocketMessageHandler`
1046
+ - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
1047
+ (`fetchItem` or `fetchItems` in `ItemHandler`.)
1048
+ - Implement expanding of local collections. This no longer leads to invalid requests.
1049
+ - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
1050
+ - **Warning:** This version contains major changes.
1051
+
1052
+ ### Introduce typing of item and collection options
1053
+
1054
+ - **Breaking:** Removed `QueryItemType` collection entry option.
1055
+ - **Breaking:** Removed `ItemResourceService`.
1056
+ - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
1057
+ `addCollection`.
1058
+ - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
1059
+ collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
1060
+ still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
1061
+
1062
+ ## v1.4.0
1063
+
1064
+ - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
1065
+ `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
1066
+ They have a slightly different type signature.
1067
+ - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
1068
+ necessary.
1069
+ - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
1070
+ - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
1071
+
1072
+ ## v1.3.8
1073
+
1074
+ - Add `isSaving` to `LocalCache`
1075
+
1076
+ > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
1077
+
1078
+ ## v1.3.7
1079
+
1080
+ - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the
1081
+ parent.
1082
+ - Remove slip workarounds
1083
+ - Add api request types
1084
+ - Add types to `ModuleChangesCompilation`
1085
+
1086
+ ## v1.3.6
1087
+
1088
+ - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
1089
+
1090
+ ## v1.3.5
1091
+
1092
+ - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
1093
+
1094
+ ## v1.3.4
1095
+
1096
+ - Add country to isFilteredColumn in ColumnUtil
1097
+
1098
+ ## v1.3.3
1099
+
1100
+ - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
1101
+
1102
+ > These functions are specifically used for rendering ui-grid in the frontend, so there's no reason to have them in the core
1103
+
1104
+ ## v1.3.2
1105
+
1106
+ - Fix types path in package.json
1107
+
1108
+ ## v1.3.1
1109
+
1110
+ - Fix types path in package.json
1111
+
1112
+ ## v1.3.0
1113
+
1114
+ - Rename PromiseInterface to PromiseLibraryInterface
1115
+
1116
+ > PromiseInterface is now used for the internal promise type
1117
+
1118
+ - Use PromiseInterface instead of Promise as internal promise type
1119
+
1120
+ > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
1121
+
1122
+ ## v1.2.9
1123
+
1124
+ - Call processOptions in fetchDerivedValuesByColumn
1125
+
1126
+ > Bug was introduced earlier but got enabled in v1.2.7
1127
+
1128
+ ## v1.2.8
1129
+
1130
+ - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
1131
+
1132
+ ## v1.2.7
1133
+
1134
+ - Set itemEntry parent when generating a stub
1135
+
1136
+ ## v1.2.6
1137
+
1138
+ - Fix an issue introduced in v1.2.5.
1139
+
1140
+ ## v1.2.5
1141
+
1142
+ - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
1143
+ solves an issue with refreshing on a local edit view.
1144
+
1145
+ ## v1.2.4
1146
+
1147
+ - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
1148
+ is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
1149
+ - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
1150
+ - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
1151
+ `TemplateLinkedItemEntryMap`.
1152
+ - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
1153
+
1154
+ ## v1.2.3
1155
+
1156
+ - Fixed issue where derived values deeper than one layer couldn't be resolved.
1157
+
1158
+ ## v1.2.2
1159
+
1160
+ - Fixed issue where in derived values weren't set after create request.
1161
+
1162
+ ## v1.2.1
1163
+
1164
+ - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
1165
+ function of the `EditResource` class.
1166
+ - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
1167
+ - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`)
1168
+ when `modInstant` is set to true.
1169
+
1170
+ ## v1.2.0
1171
+
1172
+ - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
1173
+ resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
1174
+ `{key: 'value'}` should now be used as argument when calling these functions.
1175
+ - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
1176
+
1177
+ ## v1.1.20
1178
+
1179
+ - Fixed minor issue where collection wouldn't be deferred properly before expanding.
1180
+ - `onChange` is now called automatically when when calling `commit` on an edit resource.
1181
+
1182
+ ## v1.1.19
1183
+
1184
+ - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
1185
+ `localCache` parameter.
1186
+
1187
+ ### Local cache callback refactoring
1188
+
1189
+ - Removed `onSaveWithoutClosing` event.
1190
+ - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
1191
+ `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
1192
+ callbacks.
1193
+ - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
1194
+ to `onSaveSuccess` callback functions.
1195
+
1196
+ ## v1.1.18
1197
+
1198
+ - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
1199
+ - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
1200
+ collection entries.
1201
+
1202
+ ## v1.1.17
1203
+
1204
+ - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
1205
+ - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
1206
+ of `getByParent`.
1207
+
1208
+ ### Cache invalidation
1209
+
1210
+ - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
1211
+ collection entry containing the item is requested.
1212
+ - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
1213
+ - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
1214
+ and collection entries.
1215
+
1216
+ ### Item entry refactoring
1217
+
1218
+ - Renamed `process` to `setFields`.
1219
+ - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
1220
+ - `setModified` now also sets local default values.
1221
+ - Removed `setCreator`. This function was called twice in some instances.
1222
+ - **Breaking:** Added `derived` parameter to `updateFields`
1223
+
1224
+ ## v1.16
1225
+
1226
+ - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
1227
+ project financial values in the front-end. [RM4-9577]
1228
+ - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
1229
+ from being added to the local cache.
1230
+
1231
+ ## v1.15
1232
+
1233
+ - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
1234
+ - Fix type definition of `PromiseInterface.all`.
1235
+
1236
+ ## v1.14
1237
+
1238
+ - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
1239
+ issue with recurring appointments in the front-end.
1240
+
1241
+ ## v1.13
1242
+
1243
+ - Add option to exclude itemTypes during createLocalEntries.
1244
+
1245
+ ## v1.12
1246
+
1247
+ - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
1248
+ `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
1249
+ from the local cache inadvertently.
1250
+ - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate
1251
+ chaining.
1252
+ - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
1253
+ are now respected. This fixes an issue where items where *not* removed from the local cache.
1254
+ - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
1255
+ issue where changes were being detected continuously.
1256
+ - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
1257
+ except when updating documents. This fixes several issues.
1258
+ - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
1259
+ collection was added multiple times.
1260
+ - Updated all models to use dependency objects. This increases ease of debugging.
1261
+
1262
+ ## v.1.11
1263
+
1264
+ - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
1265
+ - **Breaking:** Removed `ItemResourceService.isNewResource`.
1266
+ - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
1267
+ - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
1268
+ completed transactions.
1269
+
1270
+ ## v.1.10
1271
+
1272
+ - Fixed issue where changes on different subtabs were not detected.
1273
+
1274
+ ## v1.1.9
1275
+
1276
+ - Exposed `noop` function on `RmCore` class.
1277
+
1278
+ > This is used in order to check whether a callback has a default value.
1279
+
1280
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
1281
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
1282
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
1283
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
1284
+ `breakUpByParent` - `onAfterCreateCallback`.
1285
+
1286
+ ## v1.1.8
1287
+
1288
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
1289
+
1290
+ ## v1.1.7
1291
+
1292
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
1293
+
1294
+ ## v1.1.6
1295
+
1296
+ - Fixed issue with deferred item entries.
1297
+ - Re-enable changes watcher after save.
1298
+ - Added optional `id` parameter to `LocalCache` constructor.
1299
+
1300
+ ## v1.1.5
1301
+
1302
+ - Added `clearItem` function to `LocalCache` class.
1303
+
1304
+ ## v.1.1.4
1305
+
1306
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
1307
+
1308
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add the items to the local cache.
1309
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
1310
+ doing it however can definitely be harmful.
1311
+
1312
+ ## v.1.1.3
1313
+
1314
+ - Fixed an issue where all collections in a local cache would be cleared.
1315
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
1316
+ `LocalCacheManagerInterface`.
1317
+
1318
+ ## v1.1.2
1319
+
1320
+ - Fixed an issue concerning derived values.
1321
+
1322
+ ## v1.1.1
1323
+
1324
+ - Fixed an issue where changes wouldn't be detected.
1325
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
1326
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
1327
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
1328
+ `disableChangesWatcher` instead.
1329
+
1330
+ ## v1.1.0
1331
+
1332
+ ### Development
1333
+
1334
+ #### Strict TypeScript compilation
1335
+
1336
+ Added the following TypeScript compiler options:
1337
+
1338
+ - noImplicitThis
1339
+ - noImplicitReturns
1340
+ - strictNullChecks
1341
+ - noUnusedLocals
1342
+ - noUnusedParameters
1343
+
1344
+ I would advise enabling these for all TypeScript projects from now on.
1345
+
1346
+ #### Ordered imports and dependencies
1347
+
1348
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this. Please note that
1349
+ this also applies for imports from the folder the file is currently in. For example, in `models/ItemResource.ts`
1350
+ , `itemEntry` should be imported like so:
1351
+ `import { ItemEntry } from '../models';`
1352
+
1353
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
1354
+ remove dependencies in the future.
1355
+
1356
+ ### Breaking changes
1357
+
1358
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
1359
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
1360
+ `moduleChangesCompilationFactory`.
1361
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is no
1362
+ longer supported in the back-end.
1363
+
1364
+ #### Item and collection entries
1365
+
1366
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
1367
+ - Added the following functions to `ItemEntryService`:
1368
+ - `createLocalConversionMap`;
1369
+ - `expandLocalConversionMap`;
1370
+ - `expandConversionMap`;
1371
+ - `batchExpandConversionMap`;
1372
+ - `batchClone`.
1373
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new item ID, and
1374
+ update the conversion map accordingly, but will respect the item ID that is already there.
1375
+
1376
+ #### Rework item caching
1377
+
1378
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default. All
1379
+ entries are added to the global cache on save. Item entries are added to the local cache when resources are created
1380
+ using the item administrator or when resources are created when adding the items to a collection.
1381
+
1382
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
1383
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
1384
+ > pasting of items.
1385
+
1386
+ Other changes:
1387
+
1388
+ - Moved `saveLocal` to `ItemAdministrator`;
1389
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
1390
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
1391
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
1392
+ already on the backend. (Use `getCollectionMatcher`.)
1393
+
1394
+ ## v1.0.33
1395
+
1396
+ - Really fix types path
1397
+
1398
+ ## v1.0.33
1399
+
1400
+ - Fix types path
1401
+
1402
+ ## v1.0.32
1403
+
1404
+ - Update `tsconfig.json` to put definitions in the root folder
1405
+
1406
+ > The app had an issue with AOT compilation because of this
1407
+
1408
+ ## v1.0.31
1409
+
1410
+ - Fix `columnHandler.fetchItemTypeTranslations`
1411
+
1412
+ > It incorrectly looped over the response map, it should now work again
1413
+
1414
+ ## v1.0.30
1415
+
1416
+ - Remove `updateTabParams` from LocalCacheManagerInterface
1417
+
1418
+ > The function wasn't used
1419
+
1420
+ - Reworked class export
1421
+
1422
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
1423
+
1424
+ ## v1.0.29
1425
+
1426
+ - Fix inverted inArray check in CollectionEntry.removeItems
1427
+
1428
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
1429
+
1430
+ ## v1.0.28
1431
+
1432
+ Bug fixes only
1433
+
1434
+ ## v1.0.27
1435
+
1436
+ - `ItemEntry.initial` is now undefined by default
1437
+
1438
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
1439
+
1440
+ ## v1.0.26
1441
+
1442
+ Bundle both minified and unminified code, include sourcemaps from dev build
1443
+
1444
+ ## v1.0.24, v1.0.25
1445
+
1446
+ ! Use version `v1.0.26` !
1447
+
1448
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
1449
+
1450
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
1451
+
1452
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
1453
+
1454
+ > It used to be called `id`, but it was changed in the seperation of the core.
1455
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
1456
+
1457
+ - Rename ItemResource `startTransaction` to `start`
1458
+
1459
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
1460
+
1461
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
1462
+
1463
+ > You can now use the updated items or hook into the result to update the ui for example
1464
+
1465
+ ## v1.0.23
1466
+
1467
+ - Rename ResourceCache to LocalCache
1468
+
1469
+ > LocalCache only caches local items (name better reflects functionality)
1470
+
1471
+ - Remove getter/setter for hasChanges
1472
+
1473
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
1474
+
1475
+ - Remove `_getCollection` from ItemAdministrator
1476
+
1477
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
1478
+ > options and should not be given as a separate argument. This was included to support the frontend
1479
+
1480
+ - Remove `saveCurrentTab` from ItemAdministrator
1481
+
1482
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
1483
+
1484
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
1485
+
1486
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
1487
+