@rentman/rm-core 8.2.5 → 8.2.7

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