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