@rentman/rm-core 6.0.0 → 6.0.2

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