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