@rentman/rm-core 8.2.9 → 8.2.10

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 (106) hide show
  1. package/changelog.md +964 -960
  2. package/dist/rm-core.js +1514 -1544
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/types/classes/ApiFormatter.d.ts +73 -73
  5. package/dist/types/classes/ApiRequestService.d.ts +18 -18
  6. package/dist/types/classes/ApiResponseProcessor.d.ts +29 -29
  7. package/dist/types/classes/CacheSyncer.d.ts +44 -44
  8. package/dist/types/classes/ChangesCompilation.d.ts +33 -33
  9. package/dist/types/classes/ChangesDelta.d.ts +61 -61
  10. package/dist/types/classes/ChangesDeltaBase.d.ts +76 -76
  11. package/dist/types/classes/ChangesProcessor.d.ts +40 -40
  12. package/dist/types/classes/CollectionEntryService.d.ts +23 -23
  13. package/dist/types/classes/CollectionResourceService.d.ts +6 -6
  14. package/dist/types/classes/ColumnCache.d.ts +21 -21
  15. package/dist/types/classes/ColumnExpansion.d.ts +21 -21
  16. package/dist/types/classes/ColumnHandler.d.ts +20 -20
  17. package/dist/types/classes/ColumnInfo.d.ts +14 -14
  18. package/dist/types/classes/ColumnSet.d.ts +37 -37
  19. package/dist/types/classes/ColumnSubsetCache.d.ts +14 -14
  20. package/dist/types/classes/ColumnUtil.d.ts +100 -100
  21. package/dist/types/classes/ConversionMapService.d.ts +25 -25
  22. package/dist/types/classes/CreateRequest.d.ts +17 -17
  23. package/dist/types/classes/CreatedChangesDelta.d.ts +17 -17
  24. package/dist/types/classes/InternalChangesDelta.d.ts +47 -47
  25. package/dist/types/classes/ItemCache.d.ts +27 -27
  26. package/dist/types/classes/ItemCreateService.d.ts +18 -18
  27. package/dist/types/classes/ItemEntryService.d.ts +32 -32
  28. package/dist/types/classes/KeyService.d.ts +18 -18
  29. package/dist/types/classes/LockService.d.ts +29 -29
  30. package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
  31. package/dist/types/classes/ParentChangesDelta.d.ts +39 -39
  32. package/dist/types/classes/QueryColumnExtractor.d.ts +18 -18
  33. package/dist/types/classes/QueryContainsLocalIdParser.d.ts +15 -15
  34. package/dist/types/classes/QueryLinkedToParser.d.ts +15 -15
  35. package/dist/types/classes/QueryLocallyMatchableParser.d.ts +18 -18
  36. package/dist/types/classes/QueryMatcher.d.ts +18 -18
  37. package/dist/types/classes/QueryParser.d.ts +25 -25
  38. package/dist/types/classes/QueryParserBase.d.ts +20 -20
  39. package/dist/types/classes/QueryParserIdUpdater.d.ts +15 -15
  40. package/dist/types/classes/QueryService.d.ts +12 -12
  41. package/dist/types/classes/RequestBuffer.d.ts +24 -24
  42. package/dist/types/classes/RequestBufferManager.d.ts +20 -20
  43. package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
  44. package/dist/types/classes/SocketMessageHandler.d.ts +34 -34
  45. package/dist/types/classes/TemplateCache.d.ts +62 -62
  46. package/dist/types/classes/Util.d.ts +28 -28
  47. package/dist/types/classes/cache/AbstractCache.d.ts +95 -95
  48. package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +68 -68
  49. package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -95
  50. package/dist/types/classes/cache/server/ServerCache.d.ts +82 -82
  51. package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +25 -25
  52. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +44 -44
  53. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +319 -319
  54. package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +34 -34
  55. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
  56. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
  57. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +89 -89
  58. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +33 -33
  59. package/dist/types/constants.d.ts +7 -7
  60. package/dist/types/core.d.ts +45 -45
  61. package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
  62. package/dist/types/factories/CacheSyncerFactory.d.ts +10 -10
  63. package/dist/types/factories/ChangesCompilationFactory.d.ts +5 -5
  64. package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -13
  65. package/dist/types/factories/ChangesProcessorFactory.d.ts +13 -13
  66. package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
  67. package/dist/types/factories/CollectionResourceFactory.d.ts +18 -18
  68. package/dist/types/factories/ColumnExpansionFactory.d.ts +7 -7
  69. package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
  70. package/dist/types/factories/ColumnSetFactory.d.ts +18 -18
  71. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +8 -8
  72. package/dist/types/factories/CreateRequestFactory.d.ts +9 -9
  73. package/dist/types/factories/ItemCacheFactory.d.ts +6 -6
  74. package/dist/types/factories/ItemEntryFactory.d.ts +12 -12
  75. package/dist/types/factories/ItemResourceFactory.d.ts +11 -11
  76. package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +4 -4
  77. package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
  78. package/dist/types/factories/QueryParserFactory.d.ts +5 -5
  79. package/dist/types/factories/RequestColumnExpansionFactory.d.ts +8 -8
  80. package/dist/types/factories/TemplateFactory.d.ts +8 -8
  81. package/dist/types/factories/TransactionCacheFactory.d.ts +13 -13
  82. package/dist/types/index.d.ts +1 -1
  83. package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +36 -36
  84. package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  85. package/dist/types/interfaces/AuthInterface.d.ts +10 -10
  86. package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
  87. package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  88. package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  89. package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
  90. package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
  91. package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
  92. package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
  93. package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
  94. package/dist/types/internal.d.ts +104 -104
  95. package/dist/types/models/CachedQueryItem.d.ts +19 -19
  96. package/dist/types/models/CollectionEntry.d.ts +21 -21
  97. package/dist/types/models/CollectionOptions.d.ts +42 -42
  98. package/dist/types/models/CollectionResource.d.ts +87 -87
  99. package/dist/types/models/ItemEntry.d.ts +18 -18
  100. package/dist/types/models/ItemEntryOptions.d.ts +8 -8
  101. package/dist/types/models/ItemResource.d.ts +90 -90
  102. package/dist/types/models/Template.d.ts +11 -11
  103. package/dist/types/types/ItemTypesCollection.d.ts +343 -343
  104. package/dist/types/types/PromiseInterface.d.ts +2 -2
  105. package/package.json +48 -48
  106. package/readme.md +15 -15
package/changelog.md CHANGED
@@ -1,960 +1,964 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ## 8.2.9
5
- - Fixes a bug in which items on the ServerCache would not properly be added to collections
6
-
7
- ## 8.2.8
8
- - Fixes a bug in which newly created items do not appear in collections caused in 8.2.6
9
-
10
- ## 8.2.7
11
- - Merge tabRequestParameters when saving a TransactionCache into another TransactionCache
12
-
13
- ## 8.2.6
14
- - Fixed issue where deleted equipment re-appear
15
-
16
- ## 8.2.5
17
- - Skipped
18
-
19
- ## 8.2.4
20
- - Fixed issue where non-local items were expanded locally.
21
- - Fixed hypothetical situation where an item entry in a local cached query could have an incomplete column set.
22
-
23
- ## 8.2.3
24
- - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
25
-
26
- ## 8.2.2
27
- - Fixed a bug where derived values would not be fetched for newly created local items
28
- - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
29
-
30
- ## 8.2.1
31
- - Skipped
32
-
33
- ## 8.2.0
34
- - Added support for collection trees. Now, when requesting a collection you can add the `children` property, which is
35
- a map of collection options. The collection resources will be available in the item resources of the resulting
36
- collection resource. For more information, see [Confluence](https://rentman.atlassian.net/wiki/spaces/~652789241/pages/948404231/Child+collections).
37
-
38
- ## 8.1.9
39
- - RM4-16796 Fixed a bug where loading the same query in quick succession would cause columns/data to be missing
40
-
41
- ## 8.1.8
42
- - Reorganize imports: move all exports to `internal.ts`. This is the only place where things should be exported. All files should import from this file. Resolve duplicate declaration of `InternalCreateDelta` type.
43
- - Improve performance of copying over values in `ChangesDelta`s and `CollectionMatcherBase`
44
- - Merge all `CollectionMatcher` classes into one `CacheSyncer`, so that `processDelta` only has to be done once
45
- - Increase performance of the ApiFormatter on large datasets
46
-
47
- ## 8.1.7
48
- - Fixed a bug where copied over CachedQueryItems weren't resolved (causing them to hang forever)
49
-
50
- ## 8.1.6
51
- - Add missing return statement in ServerCache.applyChangesDelta
52
-
53
- ## 8.1.5
54
- - Only extend missing derived values while resolving local items in `TransactionCachedQueryHandler.__fetchItemEntriesByQueryData`
55
-
56
- ## 8.1.4
57
- - Remove non-created items if they are not returned in the response of a Create request
58
- > If a create would fail, the whole request would fail. So we can assume that if an item isn't returned from a create
59
- > request, the backend has left it out on purpose
60
- - Move cached queries to parent transactions only when saving a child transaction
61
- > Only then you know for sure that items that matched on the child transaction will also match in the parent transaction,
62
- > since you're taking over the changes, this behaviour was changed somewhere in a refactor but was incorrect
63
- - No longer move cached queries to the ServerCache when saving a root transaction
64
- > 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)
65
- - No longer wait for child transactions to sync when applying changes in a parent
66
- > A child transaction can only influence a parent transaction by calling `TransactionCache.save`, which doens't happen whilst applying changes,
67
- > so you don't have to wait for child transactions when applying changes in a parent
68
-
69
- ## 8.1.3
70
- - Allow passing TransactionOptions to TransactionCacheFactory.construct
71
-
72
- ## 8.1.2
73
- - Fixed a bug in which derived values for local items wouldn't be properly be fetched
74
-
75
- ## 8.1.1
76
- - Fixed a bug in which a `Template` request's columns weren't processed
77
-
78
- ## 8.1.0
79
- - Add `cloneCreatedChanges` function to `ChangesDeltaFactory`. This function clone the `created` component of a changes
80
- delta into a destination changes delta.
81
- - Add `TransactionOptions`, implement `transparent` transaction option
82
- - Allow core-mapped TS types instead of backend-mapped TS types in `ApiFormatter.compareFields`
83
- - Fixed a bug where empty update requests where sometimes done
84
- - Fixed a bug where derived values of items returned in a Template request weren't properly resolved
85
-
86
- ## 8.0.3
87
- - Changed the flow of a create request so that it includes all the required columns for all transactions and also processes additionally returned (derived) items
88
- - Fixed a bug where fields referencing local items would already be updated in the `previous` before the `onChange` callbacks were called
89
- - Moved logic of updating IDs in cached queries/collections to TransactionCachedQueryHandler and TransactionCollectionHandler
90
-
91
- ## 8.0.2
92
- - Fixed a bug where deleted entries on a child transaction where not handled properly
93
- - Fixed a bug where saving a child transaction, and then undoing those changes and saving again would not update the parent transaction
94
-
95
- ## 8.0.1
96
- - Uppercase operators and comparators in QueryMatcher, QueryParser and QueryService
97
- - Fix parsing short-hand `IN` queryies
98
-
99
- ## 8.0.0
100
- - Implement `@rentman/backend-types`
101
- > You will now have autocomplete and typing checking on all columns/fields 🥳
102
- - Remove `ChangesDeltaResult.rollback`
103
- > It was never really used/implemented
104
-
105
- ## 7.2.0
106
- - Add the `preventCaching` option to `CollectionOptions`
107
- > 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)
108
-
109
- ## 7.1.1
110
- - Properly handle moved items in ServerCache.applyChangesFromParent (technically the backend won't ever generate a linkTo (only updates)) but it can happen when manually syncing the server cache (by doing `InternalChangesDelta.setItemMoved`)
111
-
112
- ## 7.1.0
113
- - Automatically keep aggregated values up-to-date by always refetching them
114
-
115
- ## 7.0.15
116
- - Remove an accidentally left in place debugger
117
-
118
- ## 7.0.14
119
- - Take into account collections with a 'limit' (of which the query result isn't cached) when matching socket items
120
-
121
- ## 7.0.13
122
- - Only overwrite the displayname if the required columns are present, instead of defaulting to an empty string
123
-
124
- ## 7.0.12
125
- - Fixed a bug where the core would try to update the cache key (ID) of `fieldChangeCallbacks` even when there were no callbacks for the given itemType
126
-
127
- ## 7.0.11
128
- - Fixed a bug where date values would not be compared if the descriptor was uncalled, this could lead to problems when applying changes from a parent transaction
129
-
130
- ## 7.0.10
131
- - Update references to local IDs in other items when a local ID gets updated
132
-
133
- ## 7.0.9
134
- - Take over `tabRequestParameters` when saving TransactionCache -> TransactionCache
135
-
136
- ## 7.0.8
137
- - Fixed a race condition and loop iteration error which in very rare cases caused itemEntries to be `undefined` and erroring
138
- - Add missing error handling in transaction functions
139
-
140
- ## 7.0.7
141
- - Properly handle `reverse` linkedTo's in QueryColumnExtractor and QueryLocallyMatchableParser
142
- - Implement refreshing of cached queries/collections
143
-
144
- ## 7.0.6
145
- Move fetching of lock from `TransactionItemHandler.processItemEntryChanges` to `TransactionCache.appyChangesDelta` to also capture creates and deletes.
146
-
147
- ## 7.0.5
148
- - Remove automatic fetching of derived values for not-yet-created items
149
-
150
- ## 7.0.4
151
- - Automatically resolve derived values when a new item is created
152
- - Fixed a bug where `AbstractCache.getParentFromFields` would still return `null` incorrectly
153
-
154
- ## 7.0.3
155
- - Fixed a bug where `AbstractCache.getParentFromFields` would still return `undefined` parent values
156
-
157
- ## 7.0.2
158
- - Check if any of the parent fields (`itemtype`, `item`) is `null`, in which case it won't be treated as a valid parent in `AbstractCache.getParentFromFields`
159
-
160
- ## 7.0.1
161
- - Ignore columns in ApiFormatter::hasChanges if the `modified` object does not contain a value for it.
162
-
163
- ## 7.0.0
164
- - **Breaking**: Remove `enableChangesWatcher` and `disableChangesWatcher` in `TransactionCache`.
165
- - Fetch lock token in `TransactionItemHandler.processItemEntryChanges`.
166
-
167
- ## 6.3.10
168
- - Only call `onRemove` of a collection if there are actually any items removed
169
- - Expand cached columns anyways if there are no items to expand in `TransactionCachedQueryHandler.__expandCachedQuery`
170
-
171
- ## 6.3.9
172
- - Fixed a bug where deleted local items would still appear as unsaved changes
173
-
174
- ## 6.3.8
175
- - Always fetch 'id' and 'permissions' columns so that they are always available
176
-
177
- ## 6.3.7
178
- - Fixed a bug where items in a socket message that _might_ fit (`MAYBE`) in a collection would not be checked/added.
179
-
180
- ## 6.3.6
181
- - Fixed a bug where `AbstractCache.fetchUpdatedDerivedValuesFromDelta` would attempt to use ItemChanges not cached on the transaction
182
- resulting in an error
183
-
184
- ## 6.3.5
185
- - Fixed a bug where after creating items derived values would needlessly be refetched
186
- > 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
187
- - Fixed a bug where ItemEntry's would not be re-cached under their new ItemIds
188
-
189
- ## 6.3.4
190
- - Fixed a bug where already cached itemEntries would not properly be detected when calling `ServerCache.processResponse`
191
- - Fixed a bug where calling `CreatedChangesDelta.remove` would add `empty` values in the array instead of removing the entry
192
-
193
- ## 6.3.3
194
- - Fixed a bug where local ItemEntries were not properly updated after saving
195
-
196
- ## 6.3.2
197
- - Fixed updating item entry itemId field after processing changes
198
-
199
- ## 6.3.1
200
-
201
- - Fixed a bug where query with a local ID would do a request to the server
202
- ```
203
- // This example should now no longer do a request
204
- transaction.getItemsByQuery(
205
- 'Tijd',
206
- {
207
- project: -11,
208
- }
209
- );
210
- ```
211
-
212
- ## 6.3.0
213
- - Allow strict typing of `FieldMap`
214
-
215
- ## 6.2.5
216
- - Remove overwriting itemType with itemType of rootItem during create
217
-
218
- ## 6.2.4
219
- - Fixed a bug where items would not appear in a collection after changes propagated from a parent transaction
220
-
221
- ## 6.2.3
222
- - Fixed a bug where `previous` would actually contain new values because the `previous` object was made after the values were already synced
223
-
224
- ## 6.2.2
225
- - Fixed a bug in syncing of initial values after saving an item causing the item to still be marked having changes
226
-
227
- ## 6.2.1
228
- - Fixed a bug where `ItemEntry`s created on the `ServerCache` where not matched on child `TransactionCache`s
229
-
230
- ## 6.2.0
231
- - Fixed a bug where synchronous validators would leave the validator in `pending` state
232
- - Only re-match items when values are actually changed
233
- - Removed `defered` from `CachedQueryItem` and added `resolve` and `reject`
234
- - Check if ItemEntries are already created before creating new ones, if that is the case treat it like an update
235
- > What could happen was that a faster request created an ItemEntry for the same item as another request
236
- > which caused the double creation of an ItemEntry
237
-
238
- ## 6.1.3
239
- - Add `isPending` function to `TransactionValidator`
240
- - `TransactionCache`s will now be invalid until all pending transaction validators are done
241
-
242
- ## 6.1.2
243
- - Check if an error key exists before deleting it in `TransactionCache.clearItemError`
244
-
245
- ## 6.1.1
246
- - Correctly pass `ErrorHandlerInterface` to `ChangesDeltaFactory`.
247
-
248
- ## 6.1.0
249
- - Return `ChangesDelta` instance in `setItemUpdated`, `setItemDeleted`, `setItemsDeleted` methods, and a promise that resolves to the instance in `setItemCreated` and `setItemsCreated`.
250
-
251
- ## 6.0.2
252
- - Update `query` parameter of `getByQuery`, `getLocalByQuery`, `batchGetLocalByParent`, and `matchQuery` in `ItemCache`.
253
-
254
- ## 6.0.1
255
- - Fixed a bug where a local item wouldn't be found when using `TransactionCache.getItemByState` on a child transaction
256
-
257
- ## 6.0.0
258
- - Refactored query caching structure
259
- - Properly implemented `limit` in collections
260
- - Removed extending of collections
261
-
262
- ## 5.0.1
263
- - Add 'icon' column type to non-selectable column types
264
-
265
- ## 5.0.0
266
- - Fixed a bug where created, creator and permissions was always set to default values
267
- - **Breaking:** Remove `onItemsCreated` collection callback.
268
-
269
- ## 4.0.4
270
- - Fixed a bug where ModuleChangesCompilation wouldn't include all changes
271
-
272
- ## 4.0.3
273
- - Local collections are now correctly identified when using a local ID in a linkTo request instead of the `parent` option
274
- - Fix issue where local collection entries were not moved to server cache after save.
275
-
276
- ## 4.0.2
277
- - Fixed a bug where clearing collections would error after saving a transaction
278
-
279
- ## 4.0.1
280
- - Remove thrown error in `ItemResource.callOnChange`
281
- > The frontend still relied on this and we won't refactor that at this point
282
-
283
- ## 4.0.0
284
- - Removed `ItemResourceOptions.onChange`, this is replaced by `TransactionCache.registerFieldChangeCallback`
285
- > Because the `onChange` is no longer stored on the ItemResource, the ItemResource doesn't have to be cached.
286
- > This way you don't have to call `ItemResource.clearResource` anymore (you do need to deregister the fieldChange callbacks)
287
-
288
- ## 3.1.0
289
- - **Breaking:** Remove `fields` property, add `getFields` method in `Template` class.
290
- - **Breaking:** Add `ConversionMapService`. Update `updateItemValues` to take a `source` and `destination` parameter.
291
- - Update `entry.itemId` for items created items in `TransactionCache.getDelta`.
292
- > This fixes an issue with updating IDs of local items.
293
- - Add dependency interfaces for `AbstractCache`, `ServerCache`, `TransactionCache`, `TransactionCollectionHandler`, `TransactionItemHandler`.
294
- - Add `CreatedChangesDelta` class, which replaces the `created` component of the `ChangesDelta` and includes some query methods. Add `isEmpty` method to `ChangesDelta`.
295
-
296
- ## 3.0.1
297
- - Fixed a bug where the `StateKeyType` enum couldn't be used when imported
298
-
299
- ## 3.0.0
300
- - Remove ViewResource, EditResource, CollectionViewResource and CollectionEditResource
301
- > There was no real distinction between them anymore since the core 2.0 update.
302
- > You can now use the base ItemResource and CollectionResource types instead
303
-
304
- ## 2.4.0
305
- - Update Typescript version to `3.7.2`, also update other plugins
306
-
307
- ## 2.3.0
308
- - Add callbacks when errors are set/cleared to `TransactionEventHandler`
309
- - Added the possibility to differentiate between errors to display below a field and on the save button in `TransactionValidator`
310
- - Changed the format of the error translations from `string` to `() => string` in `TransactionValidator`
311
- > Now the translation function will only be called when the error is actually set, not when it's cleared
312
-
313
- ## 2.2.1
314
- - Fixed a bug where resolving derived values for new items (in `TransactionCache.applyChangesDelta`) would sometimes error
315
-
316
- ## 2.2.0
317
- - `ChangesDelta.setItem(s)Created` will now accept incomplete input values
318
- > It will now fetch a template for you and process the items, so you no longer need to do that yourself
319
-
320
- ## 2.1.2
321
- - Fixed a bug where deleted ItemEntries weren't picked up when detecting transaction changes
322
-
323
- ## 2.1.1
324
- - Fixed a bug where an ItemEntry's errors wouldn't be deleted when the ItemEntry was deleted on a transaction
325
-
326
- ## 2.1.0
327
- - Refactor `TransactionCache.getItemsByQuery` to check cached entries (just like a collection)
328
- - Add `TransactionValidator`, allow passing of a `TransactionValidatorFactory` to a transaction
329
- > You can use these validators to set errors using `setItemError` and `setGlobalError`
330
- - Fixed a bug where `TransactionItemHandler.cloneItemEntry` could only clone entry with changes on the target transaction.
331
- > It will not look for changes recursively on the transaction change
332
-
333
- ## 2.0.19
334
- - Ensure all requestColumns for newly created ItemEntries from a template are available
335
- - Ensure derived values for newly created ItemEntries from a template are available
336
-
337
- ## 2.0.18
338
- - Include read-only columns when detecting changes in TransactionItemHandler.processItemEntryChanges
339
- > 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`
340
-
341
- ## 2.0.17
342
- - Fixed a bug where deleting an item that isn't in the transaction's item entry cache would result in an error
343
- - Fixed a bug where response columns weren't set for newly created local CollectionEntries
344
- - Fixed a bug where items weren't matched for newly created local CollectionEntries
345
-
346
- ## 2.0.16
347
- - Fixed a bug where queries with a link to a local parent item weren't updated on save
348
-
349
- ## 2.0.15
350
- - Cache ItemEntries that fit collections on the CollectionEntry's query instead of the CollectionEntry's id
351
- - Add a 'hint' to ChangesDeltas which allows skipping the extra request to validate `maybe` query matches
352
- - Create transaction changes for ItemEntry updates in the changesDelta if non exist yet when calling `TransactionCache.applyChangesDelta`
353
- > This allows you to update values on a transaction without having to fetch a resource for it by calling
354
- > `ChangesDelta.setItemUpdated()`
355
-
356
- ## 2.0.14
357
- - Fixed reading of derived values in `getItemIdByColumn` when a ChangesDelta is passed
358
-
359
- ## 2.0.13
360
- - Fixed a bug where the incorrect fields where applied to the ChangesDelta in `TransactionItemHandler.cloneItemEntry`
361
- - A RequestBuffer's promise will now resolve after the ServerCache.processResponse promise is done, ensuring all values are present before continuing
362
- - Request columns for the request ItemType will now properly be taken into account in ServerCache.processResponse ensuring root columns are always properly set. (This is used to update derived values)
363
-
364
- ## 2.0.12
365
- - Fixed a bug where created changes weren't copied to the itemchanges
366
- - Only take readonly parent columns instead of all readonly columns in `ApiFormatter.hasChanges`
367
- - Fixed a bug where ItemEntry's where still in `ItemCache.entriesByEntryId` after clearing them
368
-
369
- ## 2.0.11
370
- - Fixed a bug where changes weren't copied to the itemchanges
371
- - Fixed correct isCalledAfterApiSave values on calls to ServerCache.processResponse
372
-
373
- ## 2.0.10
374
- - Construct `ColumnSet` with proper `requestColumns` when creating a `Template` with additional columns
375
-
376
- ## 2.0.9
377
- - Properly process linked items from the template request in `TransactionItemHandler.createItems`
378
-
379
- ## 2.0.8
380
- - Fixed a bug where not all fields where available even tough an ItemResource with specific columns was created
381
-
382
- ## 2.0.7
383
- - Define abstract copyTransactionItemEntryChanges on ItemHandlerBase
384
- - Implement copyTransactionItemEntryChanges on TransactionItemHandler and ServerItemHandler
385
- - Fix AbstractCache/ServerCache/TransactionCache `getParent` function arguments
386
- > With the newly added arguments the function definitions didn't align anymore causing typescript errors
387
- > Even though the arguments aren't used in the `ServerCache` they're added in there
388
-
389
- ## 2.0.6
390
- - Remove `ApiFormatter.lazyClone`
391
- > 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
392
-
393
- - Create a copy of the child transaction's field instead of copying the object reference in `TransactionCache.applyChangeFromChild` and `ChangesProcessor.executeCreateRequest`
394
- > When writing to the object references you're changing multiple transactions at once, while this should be handled by applyCHangesFromParent
395
-
396
- ## 2.0.5
397
- - Add `callOnAddWithInitialItems` option to `CollectionResourceOptions`
398
- > If `true` the `onAdd` callback will be called with the initial set of items
399
-
400
-
401
- ## 2.0.4
402
- - Add `isCalledAfterSocketUpdate` to `onAdd`, `onRemove` and `onChange` callbacks
403
- > You can use this if a data change should only trigger an action when the user caused it himself
404
-
405
- ## 2.0.3
406
- - Fix `CollectionEditResource.removeItems`
407
- - Move `getCurrentCollectionEntryCache` and `getCurrentItemEntryCache` from `TransactionCache` to `AbstractCache`
408
-
409
- ## 2.0.2
410
- - Fix marking entries as deleted and compiling this into a request
411
-
412
- ## 2.0.1
413
- - Expand CollectionEntry's columns in `ServerCollectionHandler.fetchCollectionData`
414
-
415
- ## 2.0.0 - Major caching refactor
416
- - Completely reworked internal caching structure, see [this Confluence page](https://rentman.atlassian.net/wiki/spaces/DEV/pages/704872456/) for the motivations behind it.
417
-
418
-
419
- ## 1.9.0
420
- - Don't create ItemResources when not returning links in `ItemAdministrator.getNewResourceWithId` and in `ItemAdministrator.constructOnItemsExpanded`
421
-
422
- ## 1.8.0
423
- - Remove `ResourceCache` and `resourceLevel`
424
- > You should now manually call `resource.clearResource` when you no longer need a resource
425
- - Add `onConstruct` function to `ItemResource` and `CollectionResource`
426
- > This is overwritten by the frontend to track resource creation
427
-
428
- ## 1.7.6
429
- - Add priority parameter to local cache callbacks. The callback condition (`always` / `onClose` / `skipOnClose`) no longer has any effect on the order in which the callbacks get executed.
430
- - **Breaking:** Remove `LocalCacheCallbackCondition` enum.
431
- - Add `itemId` parameter to `ItemHandler.fetchNewItem`. An error is thrown when an ID already exists. Add `getNewResourceWithId` to ItemAdministrator. Deprecate `getItemByState`.
432
-
433
- ## 1.7.5
434
- - For template column sets it is no longer assumed all columns are present. This fixes an issue with incomplete column
435
- sets in the front-end.
436
- - Fix issue where `changesProcessor` instance was undefined in `itemResourceFactory` and `collectionResourceFactory`.
437
- Create variables for each core service in order to get a TypeScript error when a dependency hasn't been initialized yet.
438
-
439
- ## 1.7.4
440
- - Add support for strict ItemType type checking in `FieldMap`
441
-
442
- ## 1.7.3
443
- - Add support for strict ItemType type checking
444
- > This is temporarily defaulted to `any` to prevent compile errors in the frontend
445
-
446
- ## 1.7.2
447
- - Fix some typing issues in:
448
- - ApiResponseProcessor
449
- - ItemCache
450
- - KeyService
451
-
452
- ## 1.7.1
453
- - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
454
-
455
- ## 1.7.0
456
- - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
457
-
458
- ### Resource caching
459
- - **Breaking:** the following properties are removed:
460
- - On `ItemEntry`: `clearResources`, `deactivateResources`.
461
- - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
462
- - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
463
- - An additional `level` parameter has been added to all methods that return resources.
464
- - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
465
- A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
466
- - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection
467
- and collection resources with a level of `level` or higher will be removed.
468
- - The `clearResources` method has been removed from `LocalCache`.
469
- - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
470
-
471
- ## 1.6.13
472
- - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
473
- promise has been resolved.
474
-
475
- > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
476
-
477
- ## 1.6.12
478
- - Fix error that occurs when trying to resolve a non-deferred collection entry.
479
-
480
- ## 1.6.11
481
- - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
482
-
483
- ## 1.6.10
484
- - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
485
- `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
486
-
487
- ## 1.6.9
488
- - Redeploy of `1.6.8`
489
-
490
- ## 1.6.8
491
- - Add support for `not` in queries
492
-
493
- ## 1.6.7
494
- - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
495
-
496
- ## 1.6.6
497
- - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial` parameter in `CollectionEntry.extend`, as it should always be true.
498
- > The `extend` function only concerns itself with remote items, so no local changes should be generated.
499
-
500
- ## 1.6.5
501
- - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
502
- > This could lead to instances where a different column would be set to the value of the parent.
503
-
504
- ## 1.6.4
505
- - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
506
- - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for the `resultCollectionResource`.
507
-
508
- ## 1.6.3
509
- - Properly type ApiResponseProcessor - fetchObjectArray
510
-
511
- ## 1.6.2
512
- - Fix issue where the collection handler would return collection entries before they were resolved when calling `batchFetch`.
513
-
514
- ## 1.6.1-3
515
- - Check for linkedTo before checking for subqueries in QueryMatcher
516
- > Linkedto also has `.query` and was incorrectly marked as a subquery
517
-
518
- ## 1.6.1-2
519
- - Fixed shorthand query with null values
520
- > The QueryParser would incorrectly identify subqueries when using null in a shorthand
521
-
522
- ## 1.6.1-1
523
- - Fixed shorthand query with Moment values
524
- > The QueryParser would incorrectly identify Moment objects as a subquery
525
-
526
- ## 1.6.1
527
- - Added support for subqueries in QueryParser and QueryMatcher
528
- > Collections using subqueries will always return 'maybe' in the QueryMatcher
529
-
530
- ## 1.6.0
531
- - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core functionality.
532
- - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
533
-
534
- ## 1.5.9
535
- - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column.
536
- Catch exceptions that might occur when resolving an `ItemEntry`.
537
- - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a collection, add them to the collection.
538
-
539
- ## 1.5.8
540
- - Introduce `RemoteViewResource` and `LocalViewResource`.
541
- > The `fields` property of a `RemoteViewResource` represents
542
- server values, while the `fields` property of a `LocalViewResource` represents local values.
543
- - The `fields` property of a `ViewResource` is now read only.
544
-
545
- ## 1.5.7-1
546
- - Make ItemResource/CollectionResource base class abstract
547
- - Add missing overload functions in some places
548
- - Fix default comparator `QueryMatcher.parseSimpleQuery`
549
- - Fix `ExtendedCollectionMatchResult` `collection` property type
550
-
551
- ## 1.5.7
552
- - Properly type Collections & ItemResources (and return values) in the whole core.
553
- > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
554
- > You can now also type the expected collection type
555
-
556
- ```
557
- // Expects a collection with editCollection and editItems both `true`
558
- // Will properly return EditResources for all collection functions
559
- const collection: CollectionEditResource<EditResource>;
560
-
561
- // other variations are:
562
- // CollectionViewResource<ViewResource>
563
- // CollectionViewResource<EditResource>
564
- // CollectionEditResource<ViewResource>
565
-
566
- this.core.itemAdministrator.getCollection(
567
- 'Notitie',
568
- {
569
- editCollection: true, // Will return a CollectionEditResource
570
- editItems: true // Will return EditResources instead of ViewResources in `.items`
571
- }
572
- )
573
- ```
574
-
575
- ## 1.5.6
576
- - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
577
-
578
- ## 1.5.5
579
- - Add 'order' column type handling to ApiFormatter functions
580
-
581
- ## 1.5.4
582
- - Fix issue where parent would be incorrectly set when cloning a single item.
583
- - Type functions related to expansion maps in `ItemEntryService`.
584
-
585
- ## 1.5.3
586
- - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
587
- calling `save` on a collection resource where this option was not explicitly set.
588
-
589
- ## 1.5.2
590
- - Type functions in `ColumnUtil` class.
591
- - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
592
- > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
593
- - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
594
- - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
595
-
596
- ## 1.5.1
597
- - Properly remove item entry stub from (local) cache when request fails.
598
- - Fix issue where item or collection options could be set to undefined.
599
-
600
- ## 1.5.0
601
- - Add `SocketMessage` type and add types to `SocketMessageHandler`
602
- - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
603
- (`fetchItem` or `fetchItems` in `ItemHandler`.)
604
- - Implement expanding of local collections. This no longer leads to invalid requests.
605
- - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
606
- - **Warning:** This version contains major changes.
607
-
608
- ### Introduce typing of item and collection options
609
- - **Breaking:** Removed `QueryItemType` collection entry option.
610
- - **Breaking:** Removed `ItemResourceService`.
611
- - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
612
- `addCollection`.
613
- - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
614
- collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
615
- still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
616
-
617
- ## v1.4.0
618
- - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
619
- `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
620
- They have a slightly different type signature.
621
- - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
622
- necessary.
623
- - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
624
- - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
625
-
626
- ## v1.3.8
627
- - Add `isSaving` to `LocalCache`
628
- > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
629
-
630
- ## v1.3.7
631
- - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the parent.
632
- - Remove slip workarounds
633
- - Add api request types
634
- - Add types to `ModuleChangesCompilation`
635
-
636
- ## v1.3.6
637
- - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
638
-
639
- ## v1.3.5
640
- - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
641
-
642
- ## v1.3.4
643
- - Add country to isFilteredColumn in ColumnUtil
644
-
645
- ## v1.3.3
646
- - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
647
- > These functions are specifically used for rendering ui-grid in the frontend, so there's
648
- no reason to have them in the core
649
-
650
- ## v1.3.2
651
- - Fix types path in package.json
652
-
653
- ## v1.3.1
654
- - Fix types path in package.json
655
-
656
- ## v1.3.0
657
- - Rename PromiseInterface to PromiseLibraryInterface
658
- > PromiseInterface is now used for the internal promise type
659
-
660
- - Use PromiseInterface instead of Promise as internal promise type
661
- > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
662
-
663
- ## v1.2.9
664
- - Call processOptions in fetchDerivedValuesByColumn
665
- > Bug was introduced earlier but got enabled in v1.2.7
666
-
667
- ## v1.2.8
668
- - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
669
-
670
- ## v1.2.7
671
- - Set itemEntry parent when generating a stub
672
-
673
- ## v1.2.6
674
- - Fix an issue introduced in v1.2.5.
675
-
676
- ## v1.2.5
677
- - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
678
- solves an issue with refreshing on a local edit view.
679
-
680
- ## v1.2.4
681
- - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
682
- is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
683
- - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
684
- - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
685
- `TemplateLinkedItemEntryMap`.
686
- - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
687
-
688
- ## v1.2.3
689
- - Fixed issue where derived values deeper than one layer couldn't be resolved.
690
-
691
- ## v1.2.2
692
- - Fixed issue where in derived values weren't set after create request.
693
-
694
- ## v1.2.1
695
- - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
696
- function of the `EditResource` class.
697
- - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
698
- - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`) when `modInstant` is set to true.
699
-
700
- ## v1.2.0
701
- - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
702
- resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
703
- `{key: 'value'}` should now be used as argument when calling these functions.
704
- - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
705
-
706
- ## v1.1.20
707
- - Fixed minor issue where collection wouldn't be deferred properly before expanding.
708
- - `onChange` is now called automatically when when calling `commit` on an edit resource.
709
-
710
- ## v1.1.19
711
- - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
712
- `localCache` parameter.
713
-
714
- ### Local cache callback refactoring
715
- - Removed `onSaveWithoutClosing` event.
716
- - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
717
- `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
718
- callbacks.
719
- - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
720
- to `onSaveSuccess` callback functions.
721
-
722
- ## v1.1.18
723
- - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
724
- - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
725
- collection entries.
726
-
727
- ## v1.1.17
728
- - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
729
- - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
730
- of `getByParent`.
731
-
732
- ### Cache invalidation
733
- - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
734
- collection entry containing the item is requested.
735
- - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
736
- - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
737
- and collection entries.
738
-
739
- ### Item entry refactoring
740
- - Renamed `process` to `setFields`.
741
- - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
742
- - `setModified` now also sets local default values.
743
- - Removed `setCreator`. This function was called twice in some instances.
744
- - **Breaking:** Added `derived` parameter to `updateFields`
745
-
746
- ##v1.16
747
- - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
748
- project financial values in the front-end. [RM4-9577]
749
- - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
750
- from being added to the local cache.
751
-
752
- ##v1.15
753
- - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
754
- - Fix type definition of `PromiseInterface.all`.
755
-
756
- ##v1.14
757
- - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
758
- issue with recurring appointments in the front-end.
759
-
760
- ##v1.13
761
- - Add option to exclude itemTypes during createLocalEntries.
762
-
763
- ##v1.12
764
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
765
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
766
- from the local cache inadvertently.
767
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
768
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
769
- are now respected. This fixes an issue where items where *not* removed from the local cache.
770
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
771
- issue where changes were being detected continuously.
772
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
773
- except when updating documents. This fixes several issues.
774
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
775
- collection was added multiple times.
776
- - Updated all models to use dependency objects. This increases ease of debugging.
777
-
778
- ##v.1.11
779
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
780
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
781
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
782
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
783
- completed transactions.
784
-
785
- ##v.1.10
786
- - Fixed issue where changes on different subtabs were not detected.
787
-
788
- ##v1.1.9
789
- - Exposed `noop` function on `RmCore` class.
790
- > This is used in order to check whether a callback has a default value.
791
- - Added `copyRequestColumns` function to `ColumnUtil` class.
792
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
793
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
794
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
795
- `breakUpByParent` - `onAfterCreateCallback`.
796
-
797
- ##v1.1.8
798
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
799
-
800
- ##v1.1.7
801
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
802
-
803
- ##v1.1.6
804
- - Fixed issue with deferred item entries.
805
- - Re-enable changes watcher after save.
806
- - Added optional `id` parameter to `LocalCache` constructor.
807
-
808
- ##v1.1.5
809
- - Added `clearItem` function to `LocalCache` class.
810
-
811
- ##v.1.1.4
812
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
813
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
814
- the items to the local cache.
815
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
816
- doing it however can definitely be harmful.
817
-
818
- ##v.1.1.3
819
- - Fixed an issue where all collections in a local cache would be cleared.
820
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
821
- `LocalCacheManagerInterface`.
822
-
823
- ##v1.1.2
824
- - Fixed an issue concerning derived values.
825
-
826
- ## v1.1.1
827
- - Fixed an issue where changes wouldn't be detected.
828
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
829
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
830
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
831
- `disableChangesWatcher` instead.
832
-
833
- ## v1.1.0
834
- ### Development
835
-
836
- #### Strict TypeScript compilation
837
- Added the following TypeScript compiler options:
838
- - noImplicitThis
839
- - noImplicitReturns
840
- - strictNullChecks
841
- - noUnusedLocals
842
- - noUnusedParameters
843
-
844
- I would advise enabling these for all TypeScript projects from now on.
845
-
846
- #### Ordered imports and dependencies
847
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
848
- Please note that this also applies for imports from the folder the file is currently in.
849
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
850
- `import { ItemEntry } from '../models';`
851
-
852
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
853
- remove dependencies in the future.
854
-
855
- ### Breaking changes
856
-
857
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
858
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
859
- `moduleChangesCompilationFactory`.
860
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
861
- no longer supported in the back-end.
862
-
863
- #### Item and collection entries
864
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
865
- - Added the following functions to `ItemEntryService`:
866
- - `createLocalConversionMap`;
867
- - `expandLocalConversionMap`;
868
- - `expandConversionMap`;
869
- - `batchExpandConversionMap`;
870
- - `batchClone`.
871
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
872
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
873
-
874
- #### Rework item caching
875
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
876
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
877
- using the item administrator or when resources are created when adding the items to a collection.
878
-
879
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
880
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
881
- > pasting of items.
882
-
883
- Other changes:
884
-
885
- - Moved `saveLocal` to `ItemAdministrator`;
886
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
887
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
888
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
889
- already on the backend. (Use `getCollectionMatcher`.)
890
-
891
-
892
- ##v1.0.33
893
- - Really fix types path
894
-
895
- ##v1.0.33
896
- - Fix types path
897
-
898
- ##v1.0.32
899
- - Update `tsconfig.json` to put definitions in the root folder
900
- > The app had an issue with AOT compilation because of this
901
-
902
- ##v1.0.31
903
- - Fix `columnHandler.fetchItemTypeTranslations`
904
- > It incorrectly looped over the response map, it should now work again
905
-
906
- ##v1.0.30
907
- - Remove `updateTabParams` from LocalCacheManagerInterface
908
- > The function wasn't used
909
-
910
- - Reworked class export
911
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
912
-
913
- ##v1.0.29
914
- - Fix inverted inArray check in CollectionEntry.removeItems
915
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
916
-
917
- ##v1.0.28
918
- Bug fixes only
919
-
920
- ##v1.0.27
921
- - `ItemEntry.initial` is now undefined by default
922
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
923
-
924
- ##v1.0.26
925
- Bundle both minified and unminified code, include sourcemaps from dev build
926
-
927
- ##v1.0.24, v1.0.25
928
- ! Use version `v1.0.26` !
929
-
930
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
931
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
932
-
933
- - Rename `ItemEntry.entryId` to `ItemEntry.id
934
- > It used to be called `id`, but it was changed in the seperation of the core.
935
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
936
-
937
- - Rename ItemResource `startTransaction` to `start`
938
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
939
-
940
- - `SocketMessageHandler.onMessageReceived` now returns a promise
941
- > You can now use the updated items or hook into the result to update the ui for example
942
-
943
-
944
- ##v1.0.23
945
- - Rename ResourceCache to LocalCache
946
- > LocalCache only caches local items (name better reflects functionality)
947
-
948
- - Remove getter/setter for hasChanges
949
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
950
-
951
- - Remove `_getCollection` from ItemAdministrator
952
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
953
- > options and should not be given as a separate argument. This was included to support the frontend
954
-
955
- - Remove `saveCurrentTab` from ItemAdministrator
956
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
957
-
958
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
959
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
960
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ## 8.2.10
5
+ - Fix displayname for 'CustomfieldGroup'
6
+ - Also set displayname when creating ItemEntries
7
+
8
+ ## 8.2.9
9
+ - Fixes a bug in which items on the ServerCache would not properly be added to collections
10
+
11
+ ## 8.2.8
12
+ - Fixes a bug in which newly created items do not appear in collections caused in 8.2.6
13
+
14
+ ## 8.2.7
15
+ - Merge tabRequestParameters when saving a TransactionCache into another TransactionCache
16
+
17
+ ## 8.2.6
18
+ - Fixed issue where deleted equipment re-appear
19
+
20
+ ## 8.2.5
21
+ - Skipped
22
+
23
+ ## 8.2.4
24
+ - Fixed issue where non-local items were expanded locally.
25
+ - Fixed hypothetical situation where an item entry in a local cached query could have an incomplete column set.
26
+
27
+ ## 8.2.3
28
+ - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
29
+
30
+ ## 8.2.2
31
+ - Fixed a bug where derived values would not be fetched for newly created local items
32
+ - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
33
+
34
+ ## 8.2.1
35
+ - Skipped
36
+
37
+ ## 8.2.0
38
+ - Added support for collection trees. Now, when requesting a collection you can add the `children` property, which is
39
+ a map of collection options. The collection resources will be available in the item resources of the resulting
40
+ collection resource. For more information, see [Confluence](https://rentman.atlassian.net/wiki/spaces/~652789241/pages/948404231/Child+collections).
41
+
42
+ ## 8.1.9
43
+ - RM4-16796 Fixed a bug where loading the same query in quick succession would cause columns/data to be missing
44
+
45
+ ## 8.1.8
46
+ - Reorganize imports: move all exports to `internal.ts`. This is the only place where things should be exported. All files should import from this file. Resolve duplicate declaration of `InternalCreateDelta` type.
47
+ - Improve performance of copying over values in `ChangesDelta`s and `CollectionMatcherBase`
48
+ - Merge all `CollectionMatcher` classes into one `CacheSyncer`, so that `processDelta` only has to be done once
49
+ - Increase performance of the ApiFormatter on large datasets
50
+
51
+ ## 8.1.7
52
+ - Fixed a bug where copied over CachedQueryItems weren't resolved (causing them to hang forever)
53
+
54
+ ## 8.1.6
55
+ - Add missing return statement in ServerCache.applyChangesDelta
56
+
57
+ ## 8.1.5
58
+ - Only extend missing derived values while resolving local items in `TransactionCachedQueryHandler.__fetchItemEntriesByQueryData`
59
+
60
+ ## 8.1.4
61
+ - Remove non-created items if they are not returned in the response of a Create request
62
+ > If a create would fail, the whole request would fail. So we can assume that if an item isn't returned from a create
63
+ > request, the backend has left it out on purpose
64
+ - Move cached queries to parent transactions only when saving a child transaction
65
+ > Only then you know for sure that items that matched on the child transaction will also match in the parent transaction,
66
+ > since you're taking over the changes, this behaviour was changed somewhere in a refactor but was incorrect
67
+ - No longer move cached queries to the ServerCache when saving a root transaction
68
+ > 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)
69
+ - No longer wait for child transactions to sync when applying changes in a parent
70
+ > A child transaction can only influence a parent transaction by calling `TransactionCache.save`, which doens't happen whilst applying changes,
71
+ > so you don't have to wait for child transactions when applying changes in a parent
72
+
73
+ ## 8.1.3
74
+ - Allow passing TransactionOptions to TransactionCacheFactory.construct
75
+
76
+ ## 8.1.2
77
+ - Fixed a bug in which derived values for local items wouldn't be properly be fetched
78
+
79
+ ## 8.1.1
80
+ - Fixed a bug in which a `Template` request's columns weren't processed
81
+
82
+ ## 8.1.0
83
+ - Add `cloneCreatedChanges` function to `ChangesDeltaFactory`. This function clone the `created` component of a changes
84
+ delta into a destination changes delta.
85
+ - Add `TransactionOptions`, implement `transparent` transaction option
86
+ - Allow core-mapped TS types instead of backend-mapped TS types in `ApiFormatter.compareFields`
87
+ - Fixed a bug where empty update requests where sometimes done
88
+ - Fixed a bug where derived values of items returned in a Template request weren't properly resolved
89
+
90
+ ## 8.0.3
91
+ - Changed the flow of a create request so that it includes all the required columns for all transactions and also processes additionally returned (derived) items
92
+ - Fixed a bug where fields referencing local items would already be updated in the `previous` before the `onChange` callbacks were called
93
+ - Moved logic of updating IDs in cached queries/collections to TransactionCachedQueryHandler and TransactionCollectionHandler
94
+
95
+ ## 8.0.2
96
+ - Fixed a bug where deleted entries on a child transaction where not handled properly
97
+ - Fixed a bug where saving a child transaction, and then undoing those changes and saving again would not update the parent transaction
98
+
99
+ ## 8.0.1
100
+ - Uppercase operators and comparators in QueryMatcher, QueryParser and QueryService
101
+ - Fix parsing short-hand `IN` queryies
102
+
103
+ ## 8.0.0
104
+ - Implement `@rentman/backend-types`
105
+ > You will now have autocomplete and typing checking on all columns/fields 🥳
106
+ - Remove `ChangesDeltaResult.rollback`
107
+ > It was never really used/implemented
108
+
109
+ ## 7.2.0
110
+ - Add the `preventCaching` option to `CollectionOptions`
111
+ > 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)
112
+
113
+ ## 7.1.1
114
+ - Properly handle moved items in ServerCache.applyChangesFromParent (technically the backend won't ever generate a linkTo (only updates)) but it can happen when manually syncing the server cache (by doing `InternalChangesDelta.setItemMoved`)
115
+
116
+ ## 7.1.0
117
+ - Automatically keep aggregated values up-to-date by always refetching them
118
+
119
+ ## 7.0.15
120
+ - Remove an accidentally left in place debugger
121
+
122
+ ## 7.0.14
123
+ - Take into account collections with a 'limit' (of which the query result isn't cached) when matching socket items
124
+
125
+ ## 7.0.13
126
+ - Only overwrite the displayname if the required columns are present, instead of defaulting to an empty string
127
+
128
+ ## 7.0.12
129
+ - Fixed a bug where the core would try to update the cache key (ID) of `fieldChangeCallbacks` even when there were no callbacks for the given itemType
130
+
131
+ ## 7.0.11
132
+ - Fixed a bug where date values would not be compared if the descriptor was uncalled, this could lead to problems when applying changes from a parent transaction
133
+
134
+ ## 7.0.10
135
+ - Update references to local IDs in other items when a local ID gets updated
136
+
137
+ ## 7.0.9
138
+ - Take over `tabRequestParameters` when saving TransactionCache -> TransactionCache
139
+
140
+ ## 7.0.8
141
+ - Fixed a race condition and loop iteration error which in very rare cases caused itemEntries to be `undefined` and erroring
142
+ - Add missing error handling in transaction functions
143
+
144
+ ## 7.0.7
145
+ - Properly handle `reverse` linkedTo's in QueryColumnExtractor and QueryLocallyMatchableParser
146
+ - Implement refreshing of cached queries/collections
147
+
148
+ ## 7.0.6
149
+ Move fetching of lock from `TransactionItemHandler.processItemEntryChanges` to `TransactionCache.appyChangesDelta` to also capture creates and deletes.
150
+
151
+ ## 7.0.5
152
+ - Remove automatic fetching of derived values for not-yet-created items
153
+
154
+ ## 7.0.4
155
+ - Automatically resolve derived values when a new item is created
156
+ - Fixed a bug where `AbstractCache.getParentFromFields` would still return `null` incorrectly
157
+
158
+ ## 7.0.3
159
+ - Fixed a bug where `AbstractCache.getParentFromFields` would still return `undefined` parent values
160
+
161
+ ## 7.0.2
162
+ - Check if any of the parent fields (`itemtype`, `item`) is `null`, in which case it won't be treated as a valid parent in `AbstractCache.getParentFromFields`
163
+
164
+ ## 7.0.1
165
+ - Ignore columns in ApiFormatter::hasChanges if the `modified` object does not contain a value for it.
166
+
167
+ ## 7.0.0
168
+ - **Breaking**: Remove `enableChangesWatcher` and `disableChangesWatcher` in `TransactionCache`.
169
+ - Fetch lock token in `TransactionItemHandler.processItemEntryChanges`.
170
+
171
+ ## 6.3.10
172
+ - Only call `onRemove` of a collection if there are actually any items removed
173
+ - Expand cached columns anyways if there are no items to expand in `TransactionCachedQueryHandler.__expandCachedQuery`
174
+
175
+ ## 6.3.9
176
+ - Fixed a bug where deleted local items would still appear as unsaved changes
177
+
178
+ ## 6.3.8
179
+ - Always fetch 'id' and 'permissions' columns so that they are always available
180
+
181
+ ## 6.3.7
182
+ - Fixed a bug where items in a socket message that _might_ fit (`MAYBE`) in a collection would not be checked/added.
183
+
184
+ ## 6.3.6
185
+ - Fixed a bug where `AbstractCache.fetchUpdatedDerivedValuesFromDelta` would attempt to use ItemChanges not cached on the transaction
186
+ resulting in an error
187
+
188
+ ## 6.3.5
189
+ - Fixed a bug where after creating items derived values would needlessly be refetched
190
+ > 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
191
+ - Fixed a bug where ItemEntry's would not be re-cached under their new ItemIds
192
+
193
+ ## 6.3.4
194
+ - Fixed a bug where already cached itemEntries would not properly be detected when calling `ServerCache.processResponse`
195
+ - Fixed a bug where calling `CreatedChangesDelta.remove` would add `empty` values in the array instead of removing the entry
196
+
197
+ ## 6.3.3
198
+ - Fixed a bug where local ItemEntries were not properly updated after saving
199
+
200
+ ## 6.3.2
201
+ - Fixed updating item entry itemId field after processing changes
202
+
203
+ ## 6.3.1
204
+
205
+ - Fixed a bug where query with a local ID would do a request to the server
206
+ ```
207
+ // This example should now no longer do a request
208
+ transaction.getItemsByQuery(
209
+ 'Tijd',
210
+ {
211
+ project: -11,
212
+ }
213
+ );
214
+ ```
215
+
216
+ ## 6.3.0
217
+ - Allow strict typing of `FieldMap`
218
+
219
+ ## 6.2.5
220
+ - Remove overwriting itemType with itemType of rootItem during create
221
+
222
+ ## 6.2.4
223
+ - Fixed a bug where items would not appear in a collection after changes propagated from a parent transaction
224
+
225
+ ## 6.2.3
226
+ - Fixed a bug where `previous` would actually contain new values because the `previous` object was made after the values were already synced
227
+
228
+ ## 6.2.2
229
+ - Fixed a bug in syncing of initial values after saving an item causing the item to still be marked having changes
230
+
231
+ ## 6.2.1
232
+ - Fixed a bug where `ItemEntry`s created on the `ServerCache` where not matched on child `TransactionCache`s
233
+
234
+ ## 6.2.0
235
+ - Fixed a bug where synchronous validators would leave the validator in `pending` state
236
+ - Only re-match items when values are actually changed
237
+ - Removed `defered` from `CachedQueryItem` and added `resolve` and `reject`
238
+ - Check if ItemEntries are already created before creating new ones, if that is the case treat it like an update
239
+ > What could happen was that a faster request created an ItemEntry for the same item as another request
240
+ > which caused the double creation of an ItemEntry
241
+
242
+ ## 6.1.3
243
+ - Add `isPending` function to `TransactionValidator`
244
+ - `TransactionCache`s will now be invalid until all pending transaction validators are done
245
+
246
+ ## 6.1.2
247
+ - Check if an error key exists before deleting it in `TransactionCache.clearItemError`
248
+
249
+ ## 6.1.1
250
+ - Correctly pass `ErrorHandlerInterface` to `ChangesDeltaFactory`.
251
+
252
+ ## 6.1.0
253
+ - Return `ChangesDelta` instance in `setItemUpdated`, `setItemDeleted`, `setItemsDeleted` methods, and a promise that resolves to the instance in `setItemCreated` and `setItemsCreated`.
254
+
255
+ ## 6.0.2
256
+ - Update `query` parameter of `getByQuery`, `getLocalByQuery`, `batchGetLocalByParent`, and `matchQuery` in `ItemCache`.
257
+
258
+ ## 6.0.1
259
+ - Fixed a bug where a local item wouldn't be found when using `TransactionCache.getItemByState` on a child transaction
260
+
261
+ ## 6.0.0
262
+ - Refactored query caching structure
263
+ - Properly implemented `limit` in collections
264
+ - Removed extending of collections
265
+
266
+ ## 5.0.1
267
+ - Add 'icon' column type to non-selectable column types
268
+
269
+ ## 5.0.0
270
+ - Fixed a bug where created, creator and permissions was always set to default values
271
+ - **Breaking:** Remove `onItemsCreated` collection callback.
272
+
273
+ ## 4.0.4
274
+ - Fixed a bug where ModuleChangesCompilation wouldn't include all changes
275
+
276
+ ## 4.0.3
277
+ - Local collections are now correctly identified when using a local ID in a linkTo request instead of the `parent` option
278
+ - Fix issue where local collection entries were not moved to server cache after save.
279
+
280
+ ## 4.0.2
281
+ - Fixed a bug where clearing collections would error after saving a transaction
282
+
283
+ ## 4.0.1
284
+ - Remove thrown error in `ItemResource.callOnChange`
285
+ > The frontend still relied on this and we won't refactor that at this point
286
+
287
+ ## 4.0.0
288
+ - Removed `ItemResourceOptions.onChange`, this is replaced by `TransactionCache.registerFieldChangeCallback`
289
+ > Because the `onChange` is no longer stored on the ItemResource, the ItemResource doesn't have to be cached.
290
+ > This way you don't have to call `ItemResource.clearResource` anymore (you do need to deregister the fieldChange callbacks)
291
+
292
+ ## 3.1.0
293
+ - **Breaking:** Remove `fields` property, add `getFields` method in `Template` class.
294
+ - **Breaking:** Add `ConversionMapService`. Update `updateItemValues` to take a `source` and `destination` parameter.
295
+ - Update `entry.itemId` for items created items in `TransactionCache.getDelta`.
296
+ > This fixes an issue with updating IDs of local items.
297
+ - Add dependency interfaces for `AbstractCache`, `ServerCache`, `TransactionCache`, `TransactionCollectionHandler`, `TransactionItemHandler`.
298
+ - Add `CreatedChangesDelta` class, which replaces the `created` component of the `ChangesDelta` and includes some query methods. Add `isEmpty` method to `ChangesDelta`.
299
+
300
+ ## 3.0.1
301
+ - Fixed a bug where the `StateKeyType` enum couldn't be used when imported
302
+
303
+ ## 3.0.0
304
+ - Remove ViewResource, EditResource, CollectionViewResource and CollectionEditResource
305
+ > There was no real distinction between them anymore since the core 2.0 update.
306
+ > You can now use the base ItemResource and CollectionResource types instead
307
+
308
+ ## 2.4.0
309
+ - Update Typescript version to `3.7.2`, also update other plugins
310
+
311
+ ## 2.3.0
312
+ - Add callbacks when errors are set/cleared to `TransactionEventHandler`
313
+ - Added the possibility to differentiate between errors to display below a field and on the save button in `TransactionValidator`
314
+ - Changed the format of the error translations from `string` to `() => string` in `TransactionValidator`
315
+ > Now the translation function will only be called when the error is actually set, not when it's cleared
316
+
317
+ ## 2.2.1
318
+ - Fixed a bug where resolving derived values for new items (in `TransactionCache.applyChangesDelta`) would sometimes error
319
+
320
+ ## 2.2.0
321
+ - `ChangesDelta.setItem(s)Created` will now accept incomplete input values
322
+ > It will now fetch a template for you and process the items, so you no longer need to do that yourself
323
+
324
+ ## 2.1.2
325
+ - Fixed a bug where deleted ItemEntries weren't picked up when detecting transaction changes
326
+
327
+ ## 2.1.1
328
+ - Fixed a bug where an ItemEntry's errors wouldn't be deleted when the ItemEntry was deleted on a transaction
329
+
330
+ ## 2.1.0
331
+ - Refactor `TransactionCache.getItemsByQuery` to check cached entries (just like a collection)
332
+ - Add `TransactionValidator`, allow passing of a `TransactionValidatorFactory` to a transaction
333
+ > You can use these validators to set errors using `setItemError` and `setGlobalError`
334
+ - Fixed a bug where `TransactionItemHandler.cloneItemEntry` could only clone entry with changes on the target transaction.
335
+ > It will not look for changes recursively on the transaction change
336
+
337
+ ## 2.0.19
338
+ - Ensure all requestColumns for newly created ItemEntries from a template are available
339
+ - Ensure derived values for newly created ItemEntries from a template are available
340
+
341
+ ## 2.0.18
342
+ - Include read-only columns when detecting changes in TransactionItemHandler.processItemEntryChanges
343
+ > 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`
344
+
345
+ ## 2.0.17
346
+ - Fixed a bug where deleting an item that isn't in the transaction's item entry cache would result in an error
347
+ - Fixed a bug where response columns weren't set for newly created local CollectionEntries
348
+ - Fixed a bug where items weren't matched for newly created local CollectionEntries
349
+
350
+ ## 2.0.16
351
+ - Fixed a bug where queries with a link to a local parent item weren't updated on save
352
+
353
+ ## 2.0.15
354
+ - Cache ItemEntries that fit collections on the CollectionEntry's query instead of the CollectionEntry's id
355
+ - Add a 'hint' to ChangesDeltas which allows skipping the extra request to validate `maybe` query matches
356
+ - Create transaction changes for ItemEntry updates in the changesDelta if non exist yet when calling `TransactionCache.applyChangesDelta`
357
+ > This allows you to update values on a transaction without having to fetch a resource for it by calling
358
+ > `ChangesDelta.setItemUpdated()`
359
+
360
+ ## 2.0.14
361
+ - Fixed reading of derived values in `getItemIdByColumn` when a ChangesDelta is passed
362
+
363
+ ## 2.0.13
364
+ - Fixed a bug where the incorrect fields where applied to the ChangesDelta in `TransactionItemHandler.cloneItemEntry`
365
+ - A RequestBuffer's promise will now resolve after the ServerCache.processResponse promise is done, ensuring all values are present before continuing
366
+ - Request columns for the request ItemType will now properly be taken into account in ServerCache.processResponse ensuring root columns are always properly set. (This is used to update derived values)
367
+
368
+ ## 2.0.12
369
+ - Fixed a bug where created changes weren't copied to the itemchanges
370
+ - Only take readonly parent columns instead of all readonly columns in `ApiFormatter.hasChanges`
371
+ - Fixed a bug where ItemEntry's where still in `ItemCache.entriesByEntryId` after clearing them
372
+
373
+ ## 2.0.11
374
+ - Fixed a bug where changes weren't copied to the itemchanges
375
+ - Fixed correct isCalledAfterApiSave values on calls to ServerCache.processResponse
376
+
377
+ ## 2.0.10
378
+ - Construct `ColumnSet` with proper `requestColumns` when creating a `Template` with additional columns
379
+
380
+ ## 2.0.9
381
+ - Properly process linked items from the template request in `TransactionItemHandler.createItems`
382
+
383
+ ## 2.0.8
384
+ - Fixed a bug where not all fields where available even tough an ItemResource with specific columns was created
385
+
386
+ ## 2.0.7
387
+ - Define abstract copyTransactionItemEntryChanges on ItemHandlerBase
388
+ - Implement copyTransactionItemEntryChanges on TransactionItemHandler and ServerItemHandler
389
+ - Fix AbstractCache/ServerCache/TransactionCache `getParent` function arguments
390
+ > With the newly added arguments the function definitions didn't align anymore causing typescript errors
391
+ > Even though the arguments aren't used in the `ServerCache` they're added in there
392
+
393
+ ## 2.0.6
394
+ - Remove `ApiFormatter.lazyClone`
395
+ > 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
396
+
397
+ - Create a copy of the child transaction's field instead of copying the object reference in `TransactionCache.applyChangeFromChild` and `ChangesProcessor.executeCreateRequest`
398
+ > When writing to the object references you're changing multiple transactions at once, while this should be handled by applyCHangesFromParent
399
+
400
+ ## 2.0.5
401
+ - Add `callOnAddWithInitialItems` option to `CollectionResourceOptions`
402
+ > If `true` the `onAdd` callback will be called with the initial set of items
403
+
404
+
405
+ ## 2.0.4
406
+ - Add `isCalledAfterSocketUpdate` to `onAdd`, `onRemove` and `onChange` callbacks
407
+ > You can use this if a data change should only trigger an action when the user caused it himself
408
+
409
+ ## 2.0.3
410
+ - Fix `CollectionEditResource.removeItems`
411
+ - Move `getCurrentCollectionEntryCache` and `getCurrentItemEntryCache` from `TransactionCache` to `AbstractCache`
412
+
413
+ ## 2.0.2
414
+ - Fix marking entries as deleted and compiling this into a request
415
+
416
+ ## 2.0.1
417
+ - Expand CollectionEntry's columns in `ServerCollectionHandler.fetchCollectionData`
418
+
419
+ ## 2.0.0 - Major caching refactor
420
+ - Completely reworked internal caching structure, see [this Confluence page](https://rentman.atlassian.net/wiki/spaces/DEV/pages/704872456/) for the motivations behind it.
421
+
422
+
423
+ ## 1.9.0
424
+ - Don't create ItemResources when not returning links in `ItemAdministrator.getNewResourceWithId` and in `ItemAdministrator.constructOnItemsExpanded`
425
+
426
+ ## 1.8.0
427
+ - Remove `ResourceCache` and `resourceLevel`
428
+ > You should now manually call `resource.clearResource` when you no longer need a resource
429
+ - Add `onConstruct` function to `ItemResource` and `CollectionResource`
430
+ > This is overwritten by the frontend to track resource creation
431
+
432
+ ## 1.7.6
433
+ - Add priority parameter to local cache callbacks. The callback condition (`always` / `onClose` / `skipOnClose`) no longer has any effect on the order in which the callbacks get executed.
434
+ - **Breaking:** Remove `LocalCacheCallbackCondition` enum.
435
+ - Add `itemId` parameter to `ItemHandler.fetchNewItem`. An error is thrown when an ID already exists. Add `getNewResourceWithId` to ItemAdministrator. Deprecate `getItemByState`.
436
+
437
+ ## 1.7.5
438
+ - For template column sets it is no longer assumed all columns are present. This fixes an issue with incomplete column
439
+ sets in the front-end.
440
+ - Fix issue where `changesProcessor` instance was undefined in `itemResourceFactory` and `collectionResourceFactory`.
441
+ Create variables for each core service in order to get a TypeScript error when a dependency hasn't been initialized yet.
442
+
443
+ ## 1.7.4
444
+ - Add support for strict ItemType type checking in `FieldMap`
445
+
446
+ ## 1.7.3
447
+ - Add support for strict ItemType type checking
448
+ > This is temporarily defaulted to `any` to prevent compile errors in the frontend
449
+
450
+ ## 1.7.2
451
+ - Fix some typing issues in:
452
+ - ApiResponseProcessor
453
+ - ItemCache
454
+ - KeyService
455
+
456
+ ## 1.7.1
457
+ - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
458
+
459
+ ## 1.7.0
460
+ - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
461
+
462
+ ### Resource caching
463
+ - **Breaking:** the following properties are removed:
464
+ - On `ItemEntry`: `clearResources`, `deactivateResources`.
465
+ - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
466
+ - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
467
+ - An additional `level` parameter has been added to all methods that return resources.
468
+ - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
469
+ A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
470
+ - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection
471
+ and collection resources with a level of `level` or higher will be removed.
472
+ - The `clearResources` method has been removed from `LocalCache`.
473
+ - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
474
+
475
+ ## 1.6.13
476
+ - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
477
+ promise has been resolved.
478
+
479
+ > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
480
+
481
+ ## 1.6.12
482
+ - Fix error that occurs when trying to resolve a non-deferred collection entry.
483
+
484
+ ## 1.6.11
485
+ - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
486
+
487
+ ## 1.6.10
488
+ - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
489
+ `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
490
+
491
+ ## 1.6.9
492
+ - Redeploy of `1.6.8`
493
+
494
+ ## 1.6.8
495
+ - Add support for `not` in queries
496
+
497
+ ## 1.6.7
498
+ - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
499
+
500
+ ## 1.6.6
501
+ - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial` parameter in `CollectionEntry.extend`, as it should always be true.
502
+ > The `extend` function only concerns itself with remote items, so no local changes should be generated.
503
+
504
+ ## 1.6.5
505
+ - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
506
+ > This could lead to instances where a different column would be set to the value of the parent.
507
+
508
+ ## 1.6.4
509
+ - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
510
+ - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for the `resultCollectionResource`.
511
+
512
+ ## 1.6.3
513
+ - Properly type ApiResponseProcessor - fetchObjectArray
514
+
515
+ ## 1.6.2
516
+ - Fix issue where the collection handler would return collection entries before they were resolved when calling `batchFetch`.
517
+
518
+ ## 1.6.1-3
519
+ - Check for linkedTo before checking for subqueries in QueryMatcher
520
+ > Linkedto also has `.query` and was incorrectly marked as a subquery
521
+
522
+ ## 1.6.1-2
523
+ - Fixed shorthand query with null values
524
+ > The QueryParser would incorrectly identify subqueries when using null in a shorthand
525
+
526
+ ## 1.6.1-1
527
+ - Fixed shorthand query with Moment values
528
+ > The QueryParser would incorrectly identify Moment objects as a subquery
529
+
530
+ ## 1.6.1
531
+ - Added support for subqueries in QueryParser and QueryMatcher
532
+ > Collections using subqueries will always return 'maybe' in the QueryMatcher
533
+
534
+ ## 1.6.0
535
+ - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core functionality.
536
+ - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
537
+
538
+ ## 1.5.9
539
+ - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column.
540
+ Catch exceptions that might occur when resolving an `ItemEntry`.
541
+ - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a collection, add them to the collection.
542
+
543
+ ## 1.5.8
544
+ - Introduce `RemoteViewResource` and `LocalViewResource`.
545
+ > The `fields` property of a `RemoteViewResource` represents
546
+ server values, while the `fields` property of a `LocalViewResource` represents local values.
547
+ - The `fields` property of a `ViewResource` is now read only.
548
+
549
+ ## 1.5.7-1
550
+ - Make ItemResource/CollectionResource base class abstract
551
+ - Add missing overload functions in some places
552
+ - Fix default comparator `QueryMatcher.parseSimpleQuery`
553
+ - Fix `ExtendedCollectionMatchResult` `collection` property type
554
+
555
+ ## 1.5.7
556
+ - Properly type Collections & ItemResources (and return values) in the whole core.
557
+ > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
558
+ > You can now also type the expected collection type
559
+
560
+ ```
561
+ // Expects a collection with editCollection and editItems both `true`
562
+ // Will properly return EditResources for all collection functions
563
+ const collection: CollectionEditResource<EditResource>;
564
+
565
+ // other variations are:
566
+ // CollectionViewResource<ViewResource>
567
+ // CollectionViewResource<EditResource>
568
+ // CollectionEditResource<ViewResource>
569
+
570
+ this.core.itemAdministrator.getCollection(
571
+ 'Notitie',
572
+ {
573
+ editCollection: true, // Will return a CollectionEditResource
574
+ editItems: true // Will return EditResources instead of ViewResources in `.items`
575
+ }
576
+ )
577
+ ```
578
+
579
+ ## 1.5.6
580
+ - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
581
+
582
+ ## 1.5.5
583
+ - Add 'order' column type handling to ApiFormatter functions
584
+
585
+ ## 1.5.4
586
+ - Fix issue where parent would be incorrectly set when cloning a single item.
587
+ - Type functions related to expansion maps in `ItemEntryService`.
588
+
589
+ ## 1.5.3
590
+ - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
591
+ calling `save` on a collection resource where this option was not explicitly set.
592
+
593
+ ## 1.5.2
594
+ - Type functions in `ColumnUtil` class.
595
+ - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
596
+ > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
597
+ - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
598
+ - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
599
+
600
+ ## 1.5.1
601
+ - Properly remove item entry stub from (local) cache when request fails.
602
+ - Fix issue where item or collection options could be set to undefined.
603
+
604
+ ## 1.5.0
605
+ - Add `SocketMessage` type and add types to `SocketMessageHandler`
606
+ - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
607
+ (`fetchItem` or `fetchItems` in `ItemHandler`.)
608
+ - Implement expanding of local collections. This no longer leads to invalid requests.
609
+ - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
610
+ - **Warning:** This version contains major changes.
611
+
612
+ ### Introduce typing of item and collection options
613
+ - **Breaking:** Removed `QueryItemType` collection entry option.
614
+ - **Breaking:** Removed `ItemResourceService`.
615
+ - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
616
+ `addCollection`.
617
+ - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
618
+ collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
619
+ still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
620
+
621
+ ## v1.4.0
622
+ - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
623
+ `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
624
+ They have a slightly different type signature.
625
+ - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
626
+ necessary.
627
+ - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
628
+ - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
629
+
630
+ ## v1.3.8
631
+ - Add `isSaving` to `LocalCache`
632
+ > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
633
+
634
+ ## v1.3.7
635
+ - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the parent.
636
+ - Remove slip workarounds
637
+ - Add api request types
638
+ - Add types to `ModuleChangesCompilation`
639
+
640
+ ## v1.3.6
641
+ - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
642
+
643
+ ## v1.3.5
644
+ - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
645
+
646
+ ## v1.3.4
647
+ - Add country to isFilteredColumn in ColumnUtil
648
+
649
+ ## v1.3.3
650
+ - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
651
+ > These functions are specifically used for rendering ui-grid in the frontend, so there's
652
+ no reason to have them in the core
653
+
654
+ ## v1.3.2
655
+ - Fix types path in package.json
656
+
657
+ ## v1.3.1
658
+ - Fix types path in package.json
659
+
660
+ ## v1.3.0
661
+ - Rename PromiseInterface to PromiseLibraryInterface
662
+ > PromiseInterface is now used for the internal promise type
663
+
664
+ - Use PromiseInterface instead of Promise as internal promise type
665
+ > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
666
+
667
+ ## v1.2.9
668
+ - Call processOptions in fetchDerivedValuesByColumn
669
+ > Bug was introduced earlier but got enabled in v1.2.7
670
+
671
+ ## v1.2.8
672
+ - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
673
+
674
+ ## v1.2.7
675
+ - Set itemEntry parent when generating a stub
676
+
677
+ ## v1.2.6
678
+ - Fix an issue introduced in v1.2.5.
679
+
680
+ ## v1.2.5
681
+ - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
682
+ solves an issue with refreshing on a local edit view.
683
+
684
+ ## v1.2.4
685
+ - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
686
+ is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
687
+ - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
688
+ - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
689
+ `TemplateLinkedItemEntryMap`.
690
+ - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
691
+
692
+ ## v1.2.3
693
+ - Fixed issue where derived values deeper than one layer couldn't be resolved.
694
+
695
+ ## v1.2.2
696
+ - Fixed issue where in derived values weren't set after create request.
697
+
698
+ ## v1.2.1
699
+ - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
700
+ function of the `EditResource` class.
701
+ - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
702
+ - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`) when `modInstant` is set to true.
703
+
704
+ ## v1.2.0
705
+ - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
706
+ resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
707
+ `{key: 'value'}` should now be used as argument when calling these functions.
708
+ - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
709
+
710
+ ## v1.1.20
711
+ - Fixed minor issue where collection wouldn't be deferred properly before expanding.
712
+ - `onChange` is now called automatically when when calling `commit` on an edit resource.
713
+
714
+ ## v1.1.19
715
+ - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
716
+ `localCache` parameter.
717
+
718
+ ### Local cache callback refactoring
719
+ - Removed `onSaveWithoutClosing` event.
720
+ - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
721
+ `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
722
+ callbacks.
723
+ - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
724
+ to `onSaveSuccess` callback functions.
725
+
726
+ ## v1.1.18
727
+ - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
728
+ - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
729
+ collection entries.
730
+
731
+ ## v1.1.17
732
+ - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
733
+ - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
734
+ of `getByParent`.
735
+
736
+ ### Cache invalidation
737
+ - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
738
+ collection entry containing the item is requested.
739
+ - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
740
+ - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
741
+ and collection entries.
742
+
743
+ ### Item entry refactoring
744
+ - Renamed `process` to `setFields`.
745
+ - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
746
+ - `setModified` now also sets local default values.
747
+ - Removed `setCreator`. This function was called twice in some instances.
748
+ - **Breaking:** Added `derived` parameter to `updateFields`
749
+
750
+ ##v1.16
751
+ - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
752
+ project financial values in the front-end. [RM4-9577]
753
+ - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
754
+ from being added to the local cache.
755
+
756
+ ##v1.15
757
+ - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
758
+ - Fix type definition of `PromiseInterface.all`.
759
+
760
+ ##v1.14
761
+ - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
762
+ issue with recurring appointments in the front-end.
763
+
764
+ ##v1.13
765
+ - Add option to exclude itemTypes during createLocalEntries.
766
+
767
+ ##v1.12
768
+ - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
769
+ `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
770
+ from the local cache inadvertently.
771
+ - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
772
+ - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
773
+ are now respected. This fixes an issue where items where *not* removed from the local cache.
774
+ - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
775
+ issue where changes were being detected continuously.
776
+ - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
777
+ except when updating documents. This fixes several issues.
778
+ - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
779
+ collection was added multiple times.
780
+ - Updated all models to use dependency objects. This increases ease of debugging.
781
+
782
+ ##v.1.11
783
+ - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
784
+ - **Breaking:** Removed `ItemResourceService.isNewResource`.
785
+ - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
786
+ - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
787
+ completed transactions.
788
+
789
+ ##v.1.10
790
+ - Fixed issue where changes on different subtabs were not detected.
791
+
792
+ ##v1.1.9
793
+ - Exposed `noop` function on `RmCore` class.
794
+ > This is used in order to check whether a callback has a default value.
795
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
796
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
797
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
798
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
799
+ `breakUpByParent` - `onAfterCreateCallback`.
800
+
801
+ ##v1.1.8
802
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
803
+
804
+ ##v1.1.7
805
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
806
+
807
+ ##v1.1.6
808
+ - Fixed issue with deferred item entries.
809
+ - Re-enable changes watcher after save.
810
+ - Added optional `id` parameter to `LocalCache` constructor.
811
+
812
+ ##v1.1.5
813
+ - Added `clearItem` function to `LocalCache` class.
814
+
815
+ ##v.1.1.4
816
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
817
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
818
+ the items to the local cache.
819
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
820
+ doing it however can definitely be harmful.
821
+
822
+ ##v.1.1.3
823
+ - Fixed an issue where all collections in a local cache would be cleared.
824
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
825
+ `LocalCacheManagerInterface`.
826
+
827
+ ##v1.1.2
828
+ - Fixed an issue concerning derived values.
829
+
830
+ ## v1.1.1
831
+ - Fixed an issue where changes wouldn't be detected.
832
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
833
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
834
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
835
+ `disableChangesWatcher` instead.
836
+
837
+ ## v1.1.0
838
+ ### Development
839
+
840
+ #### Strict TypeScript compilation
841
+ Added the following TypeScript compiler options:
842
+ - noImplicitThis
843
+ - noImplicitReturns
844
+ - strictNullChecks
845
+ - noUnusedLocals
846
+ - noUnusedParameters
847
+
848
+ I would advise enabling these for all TypeScript projects from now on.
849
+
850
+ #### Ordered imports and dependencies
851
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
852
+ Please note that this also applies for imports from the folder the file is currently in.
853
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
854
+ `import { ItemEntry } from '../models';`
855
+
856
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
857
+ remove dependencies in the future.
858
+
859
+ ### Breaking changes
860
+
861
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
862
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
863
+ `moduleChangesCompilationFactory`.
864
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
865
+ no longer supported in the back-end.
866
+
867
+ #### Item and collection entries
868
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
869
+ - Added the following functions to `ItemEntryService`:
870
+ - `createLocalConversionMap`;
871
+ - `expandLocalConversionMap`;
872
+ - `expandConversionMap`;
873
+ - `batchExpandConversionMap`;
874
+ - `batchClone`.
875
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
876
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
877
+
878
+ #### Rework item caching
879
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
880
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
881
+ using the item administrator or when resources are created when adding the items to a collection.
882
+
883
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
884
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
885
+ > pasting of items.
886
+
887
+ Other changes:
888
+
889
+ - Moved `saveLocal` to `ItemAdministrator`;
890
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
891
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
892
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
893
+ already on the backend. (Use `getCollectionMatcher`.)
894
+
895
+
896
+ ##v1.0.33
897
+ - Really fix types path
898
+
899
+ ##v1.0.33
900
+ - Fix types path
901
+
902
+ ##v1.0.32
903
+ - Update `tsconfig.json` to put definitions in the root folder
904
+ > The app had an issue with AOT compilation because of this
905
+
906
+ ##v1.0.31
907
+ - Fix `columnHandler.fetchItemTypeTranslations`
908
+ > It incorrectly looped over the response map, it should now work again
909
+
910
+ ##v1.0.30
911
+ - Remove `updateTabParams` from LocalCacheManagerInterface
912
+ > The function wasn't used
913
+
914
+ - Reworked class export
915
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
916
+
917
+ ##v1.0.29
918
+ - Fix inverted inArray check in CollectionEntry.removeItems
919
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
920
+
921
+ ##v1.0.28
922
+ Bug fixes only
923
+
924
+ ##v1.0.27
925
+ - `ItemEntry.initial` is now undefined by default
926
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
927
+
928
+ ##v1.0.26
929
+ Bundle both minified and unminified code, include sourcemaps from dev build
930
+
931
+ ##v1.0.24, v1.0.25
932
+ ! Use version `v1.0.26` !
933
+
934
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
935
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
936
+
937
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
938
+ > It used to be called `id`, but it was changed in the seperation of the core.
939
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
940
+
941
+ - Rename ItemResource `startTransaction` to `start`
942
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
943
+
944
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
945
+ > You can now use the updated items or hook into the result to update the ui for example
946
+
947
+
948
+ ##v1.0.23
949
+ - Rename ResourceCache to LocalCache
950
+ > LocalCache only caches local items (name better reflects functionality)
951
+
952
+ - Remove getter/setter for hasChanges
953
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
954
+
955
+ - Remove `_getCollection` from ItemAdministrator
956
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
957
+ > options and should not be given as a separate argument. This was included to support the frontend
958
+
959
+ - Remove `saveCurrentTab` from ItemAdministrator
960
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
961
+
962
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
963
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
964
+