@rentman/rm-core 6.0.2 → 6.1.2

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