@rentman/rm-core 8.2.10 → 8.2.11

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