@rentman/rm-core 12.0.5-8 → 12.0.5

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