@rentman/rm-core 9.0.0 → 9.0.2

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