@rentman/rm-core 12.1.0 → 12.1.2

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