@rentman/rm-core 9.0.0 → 9.0.1

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