@rentman/rm-core 6.2.5 → 6.3.1

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