@rentman/rm-core 7.0.5 → 7.0.6

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