@rentman/rm-core 1.7.1 → 1.7.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 (93) hide show
  1. package/changelog.md +518 -512
  2. package/dist/rm-core.js +7477 -7473
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/src/classes/ApiFormatter.d.ts +39 -39
  5. package/dist/src/classes/ApiRequestService.d.ts +20 -20
  6. package/dist/src/classes/ApiResponseProcessor.d.ts +41 -41
  7. package/dist/src/classes/BatchStatus.d.ts +27 -27
  8. package/dist/src/classes/ChangesCompilation.d.ts +51 -51
  9. package/dist/src/classes/ChangesProcessor.d.ts +33 -33
  10. package/dist/src/classes/CollectionCache.d.ts +34 -34
  11. package/dist/src/classes/CollectionEntryService.d.ts +23 -23
  12. package/dist/src/classes/CollectionHandler.d.ts +54 -54
  13. package/dist/src/classes/CollectionMatcher.d.ts +42 -42
  14. package/dist/src/classes/CollectionResourceService.d.ts +6 -6
  15. package/dist/src/classes/ColumnCache.d.ts +21 -21
  16. package/dist/src/classes/ColumnExpansion.d.ts +18 -18
  17. package/dist/src/classes/ColumnHandler.d.ts +21 -21
  18. package/dist/src/classes/ColumnInfo.d.ts +14 -14
  19. package/dist/src/classes/ColumnSet.d.ts +46 -46
  20. package/dist/src/classes/ColumnSubsetCache.d.ts +8 -8
  21. package/dist/src/classes/ColumnUtil.d.ts +89 -89
  22. package/dist/src/classes/CreateRequest.d.ts +20 -20
  23. package/dist/src/classes/ItemAdministrator.d.ts +238 -238
  24. package/dist/src/classes/ItemCache.d.ts +23 -23
  25. package/dist/src/classes/ItemEntryService.d.ts +24 -24
  26. package/dist/src/classes/ItemHandler.d.ts +60 -60
  27. package/dist/src/classes/ItemRequestService.d.ts +23 -23
  28. package/dist/src/classes/KeyService.d.ts +16 -16
  29. package/dist/src/classes/LocalCache.d.ts +97 -97
  30. package/dist/src/classes/LockService.d.ts +32 -32
  31. package/dist/src/classes/ModuleChangesCompilation.d.ts +21 -21
  32. package/dist/src/classes/QueryMatcher.d.ts +14 -14
  33. package/dist/src/classes/QueryParser.d.ts +34 -34
  34. package/dist/src/classes/QueryService.d.ts +14 -14
  35. package/dist/src/classes/RequestColumnExpansion.d.ts +14 -14
  36. package/dist/src/classes/ResourceCache.d.ts +25 -25
  37. package/dist/src/classes/SocketMessageHandler.d.ts +41 -41
  38. package/dist/src/classes/Util.d.ts +28 -28
  39. package/dist/src/classes/index.d.ts +35 -35
  40. package/dist/src/constants.d.ts +18 -18
  41. package/dist/src/core.d.ts +48 -48
  42. package/dist/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
  43. package/dist/src/factories/BatchStatusFactory.d.ts +8 -8
  44. package/dist/src/factories/ChangesCompilationFactory.d.ts +9 -9
  45. package/dist/src/factories/CollectionCacheFactory.d.ts +8 -8
  46. package/dist/src/factories/CollectionEntryFactory.d.ts +23 -23
  47. package/dist/src/factories/CollectionMatcherFactory.d.ts +7 -7
  48. package/dist/src/factories/CollectionResourceFactory.d.ts +32 -32
  49. package/dist/src/factories/ColumnExpansionFactory.d.ts +8 -8
  50. package/dist/src/factories/ColumnInfoFactory.d.ts +7 -7
  51. package/dist/src/factories/ColumnSetFactory.d.ts +11 -11
  52. package/dist/src/factories/ColumnSubsetCacheFactory.d.ts +6 -6
  53. package/dist/src/factories/CreateRequestFactory.d.ts +11 -11
  54. package/dist/src/factories/ItemCacheFactory.d.ts +7 -7
  55. package/dist/src/factories/ItemEntryFactory.d.ts +21 -21
  56. package/dist/src/factories/ItemResourceFactory.d.ts +29 -29
  57. package/dist/src/factories/LocalCacheFactory.d.ts +16 -16
  58. package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +5 -5
  59. package/dist/src/factories/QueryMatcherFactory.d.ts +7 -7
  60. package/dist/src/factories/QueryParserFactory.d.ts +6 -6
  61. package/dist/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
  62. package/dist/src/factories/TemplateFactory.d.ts +10 -10
  63. package/dist/src/factories/index.d.ts +21 -21
  64. package/dist/src/index.d.ts +7 -7
  65. package/dist/src/interfaces/ApiRequestServiceInterface.d.ts +11 -11
  66. package/dist/src/interfaces/AuthInterface.d.ts +9 -9
  67. package/dist/src/interfaces/ErrorHandlerInterface.d.ts +5 -5
  68. package/dist/src/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  69. package/dist/src/interfaces/LocalCacheManagerInterface.d.ts +5 -5
  70. package/dist/src/interfaces/PromiseLibraryInterface.d.ts +25 -25
  71. package/dist/src/interfaces/SocketMessageInterface.d.ts +3 -3
  72. package/dist/src/interfaces/index.d.ts +7 -7
  73. package/dist/src/models/CollectionEditResource.d.ts +14 -14
  74. package/dist/src/models/CollectionEntry.d.ts +82 -82
  75. package/dist/src/models/CollectionEntryOptions.d.ts +12 -12
  76. package/dist/src/models/CollectionResource.d.ts +41 -41
  77. package/dist/src/models/CollectionResourceOptions.d.ts +22 -22
  78. package/dist/src/models/CollectionViewResource.d.ts +6 -6
  79. package/dist/src/models/EditResource.d.ts +18 -18
  80. package/dist/src/models/ItemEntry.d.ts +70 -70
  81. package/dist/src/models/ItemEntryOptions.d.ts +11 -11
  82. package/dist/src/models/ItemResource.d.ts +27 -27
  83. package/dist/src/models/ItemResourceOptions.d.ts +8 -8
  84. package/dist/src/models/LocalViewResource.d.ts +6 -6
  85. package/dist/src/models/RemoteViewResource.d.ts +6 -6
  86. package/dist/src/models/Template.d.ts +11 -11
  87. package/dist/src/models/ViewResource.d.ts +8 -8
  88. package/dist/src/models/index.d.ts +15 -15
  89. package/dist/src/types/ItemTypesCollection.d.ts +213 -213
  90. package/dist/src/types/PromiseInterface.d.ts +2 -2
  91. package/dist/src/types/index.d.ts +2 -2
  92. package/package.json +1 -1
  93. package/readme.md +15 -15
package/changelog.md CHANGED
@@ -1,512 +1,518 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ## 1.7.1
5
- - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
6
-
7
- ## 1.7.0
8
- - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
9
-
10
- ### Resource caching
11
- - **Breaking:** the following properties are removed:
12
- - On `ItemEntry`: `clearResources`, `deactivateResources`.
13
- - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
14
- - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
15
- - An additional `level` parameter has been added to all methods that return resources.
16
- - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
17
- A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
18
- - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection
19
- and collection resources with a level of `level` or higher will be removed.
20
- - The `clearResources` method has been removed from `LocalCache`.
21
- - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
22
-
23
- ## 1.6.13
24
- - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
25
- promise has been resolved.
26
-
27
- > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
28
-
29
- ## 1.6.12
30
- - Fix error that occurs when trying to resolve a non-deferred collection entry.
31
-
32
- ## 1.6.11
33
- - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
34
-
35
- ## 1.6.10
36
- - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
37
- `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
38
-
39
- ## 1.6.9
40
- - Redeploy of `1.6.8`
41
-
42
- ## 1.6.8
43
- - Add support for `not` in queries
44
-
45
- ## 1.6.7
46
- - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
47
-
48
- ## 1.6.6
49
- - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial` parameter in `CollectionEntry.extend`, as it should always be true.
50
- > The `extend` function only concerns itself with remote items, so no local changes should be generated.
51
-
52
- ## 1.6.5
53
- - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
54
- > This could lead to instances where a different column would be set to the value of the parent.
55
-
56
- ## 1.6.4
57
- - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
58
- - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for the `resultCollectionResource`.
59
-
60
- ## 1.6.3
61
- - Properly type ApiResponseProcessor - fetchObjectArray
62
-
63
- ## 1.6.2
64
- - Fix issue where the collection handler would return collection entries before they were resolved when calling `batchFetch`.
65
-
66
- ## 1.6.1-3
67
- - Check for linkedTo before checking for subqueries in QueryMatcher
68
- > Linkedto also has `.query` and was incorrectly marked as a subquery
69
-
70
- ## 1.6.1-2
71
- - Fixed shorthand query with null values
72
- > The QueryParser would incorrectly identify subqueries when using null in a shorthand
73
-
74
- ## 1.6.1-1
75
- - Fixed shorthand query with Moment values
76
- > The QueryParser would incorrectly identify Moment objects as a subquery
77
-
78
- ## 1.6.1
79
- - Added support for subqueries in QueryParser and QueryMatcher
80
- > Collections using subqueries will always return 'maybe' in the QueryMatcher
81
-
82
- ## 1.6.0
83
- - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core functionality.
84
- - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
85
-
86
- ## 1.5.9
87
- - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column.
88
- Catch exceptions that might occur when resolving an `ItemEntry`.
89
- - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a collection, add them to the collection.
90
-
91
- ## 1.5.8
92
- - Introduce `RemoteViewResource` and `LocalViewResource`.
93
- > The `fields` property of a `RemoteViewResource` represents
94
- server values, while the `fields` property of a `LocalViewResource` represents local values.
95
- - The `fields` property of a `ViewResource` is now read only.
96
-
97
- ## 1.5.7-1
98
- - Make ItemResource/CollectionResource base class abstract
99
- - Add missing overload functions in some places
100
- - Fix default comparator `QueryMatcher.parseSimpleQuery`
101
- - Fix `ExtendedCollectionMatchResult` `collection` property type
102
-
103
- ## 1.5.7
104
- - Properly type Collections & ItemResources (and return values) in the whole core.
105
- > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
106
- > You can now also type the expected collection type
107
-
108
- ```
109
- // Expects a collection with editCollection and editItems both `true`
110
- // Will properly return EditResources for all collection functions
111
- const collection: CollectionEditResource<EditResource>;
112
-
113
- // other variations are:
114
- // CollectionViewResource<ViewResource>
115
- // CollectionViewResource<EditResource>
116
- // CollectionEditResource<ViewResource>
117
-
118
- this.core.itemAdministrator.getCollection(
119
- 'Notitie',
120
- {
121
- editCollection: true, // Will return a CollectionEditResource
122
- editItems: true // Will return EditResources instead of ViewResources in `.items`
123
- }
124
- )
125
- ```
126
-
127
- ## 1.5.6
128
- - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
129
-
130
- ## 1.5.5
131
- - Add 'order' column type handling to ApiFormatter functions
132
-
133
- ## 1.5.4
134
- - Fix issue where parent would be incorrectly set when cloning a single item.
135
- - Type functions related to expansion maps in `ItemEntryService`.
136
-
137
- ## 1.5.3
138
- - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
139
- calling `save` on a collection resource where this option was not explicitly set.
140
-
141
- ## 1.5.2
142
- - Type functions in `ColumnUtil` class.
143
- - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
144
- > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
145
- - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
146
- - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
147
-
148
- ## 1.5.1
149
- - Properly remove item entry stub from (local) cache when request fails.
150
- - Fix issue where item or collection options could be set to undefined.
151
-
152
- ## 1.5.0
153
- - Add `SocketMessage` type and add types to `SocketMessageHandler`
154
- - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
155
- (`fetchItem` or `fetchItems` in `ItemHandler`.)
156
- - Implement expanding of local collections. This no longer leads to invalid requests.
157
- - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
158
- - **Warning:** This version contains major changes.
159
-
160
- ### Introduce typing of item and collection options
161
- - **Breaking:** Removed `QueryItemType` collection entry option.
162
- - **Breaking:** Removed `ItemResourceService`.
163
- - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
164
- `addCollection`.
165
- - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
166
- collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
167
- still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
168
-
169
- ## v1.4.0
170
- - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
171
- `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
172
- They have a slightly different type signature.
173
- - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
174
- necessary.
175
- - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
176
- - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
177
-
178
- ## v1.3.8
179
- - Add `isSaving` to `LocalCache`
180
- > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
181
-
182
- ## v1.3.7
183
- - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the parent.
184
- - Remove slip workarounds
185
- - Add api request types
186
- - Add types to `ModuleChangesCompilation`
187
-
188
- ## v1.3.6
189
- - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
190
-
191
- ## v1.3.5
192
- - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
193
-
194
- ## v1.3.4
195
- - Add country to isFilteredColumn in ColumnUtil
196
-
197
- ## v1.3.3
198
- - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
199
- > These functions are specifically used for rendering ui-grid in the frontend, so there's
200
- no reason to have them in the core
201
-
202
- ## v1.3.2
203
- - Fix types path in package.json
204
-
205
- ## v1.3.1
206
- - Fix types path in package.json
207
-
208
- ## v1.3.0
209
- - Rename PromiseInterface to PromiseLibraryInterface
210
- > PromiseInterface is now used for the internal promise type
211
-
212
- - Use PromiseInterface instead of Promise as internal promise type
213
- > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
214
-
215
- ## v1.2.9
216
- - Call processOptions in fetchDerivedValuesByColumn
217
- > Bug was introduced earlier but got enabled in v1.2.7
218
-
219
- ## v1.2.8
220
- - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
221
-
222
- ## v1.2.7
223
- - Set itemEntry parent when generating a stub
224
-
225
- ## v1.2.6
226
- - Fix an issue introduced in v1.2.5.
227
-
228
- ## v1.2.5
229
- - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
230
- solves an issue with refreshing on a local edit view.
231
-
232
- ## v1.2.4
233
- - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
234
- is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
235
- - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
236
- - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
237
- `TemplateLinkedItemEntryMap`.
238
- - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
239
-
240
- ## v1.2.3
241
- - Fixed issue where derived values deeper than one layer couldn't be resolved.
242
-
243
- ## v1.2.2
244
- - Fixed issue where in derived values weren't set after create request.
245
-
246
- ## v1.2.1
247
- - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
248
- function of the `EditResource` class.
249
- - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
250
- - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`) when `modInstant` is set to true.
251
-
252
- ## v1.2.0
253
- - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
254
- resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
255
- `{key: 'value'}` should now be used as argument when calling these functions.
256
- - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
257
-
258
- ## v1.1.20
259
- - Fixed minor issue where collection wouldn't be deferred properly before expanding.
260
- - `onChange` is now called automatically when when calling `commit` on an edit resource.
261
-
262
- ## v1.1.19
263
- - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
264
- `localCache` parameter.
265
-
266
- ### Local cache callback refactoring
267
- - Removed `onSaveWithoutClosing` event.
268
- - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
269
- `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
270
- callbacks.
271
- - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
272
- to `onSaveSuccess` callback functions.
273
-
274
- ## v1.1.18
275
- - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
276
- - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
277
- collection entries.
278
-
279
- ## v1.1.17
280
- - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
281
- - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
282
- of `getByParent`.
283
-
284
- ### Cache invalidation
285
- - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
286
- collection entry containing the item is requested.
287
- - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
288
- - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
289
- and collection entries.
290
-
291
- ### Item entry refactoring
292
- - Renamed `process` to `setFields`.
293
- - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
294
- - `setModified` now also sets local default values.
295
- - Removed `setCreator`. This function was called twice in some instances.
296
- - **Breaking:** Added `derived` parameter to `updateFields`
297
-
298
- ##v1.16
299
- - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
300
- project financial values in the front-end. [RM4-9577]
301
- - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
302
- from being added to the local cache.
303
-
304
- ##v1.15
305
- - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
306
- - Fix type definition of `PromiseInterface.all`.
307
-
308
- ##v1.14
309
- - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
310
- issue with recurring appointments in the front-end.
311
-
312
- ##v1.13
313
- - Add option to exclude itemTypes during createLocalEntries.
314
-
315
- ##v1.12
316
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
317
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
318
- from the local cache inadvertently.
319
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
320
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
321
- are now respected. This fixes an issue where items where *not* removed from the local cache.
322
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
323
- issue where changes were being detected continuously.
324
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
325
- except when updating documents. This fixes several issues.
326
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
327
- collection was added multiple times.
328
- - Updated all models to use dependency objects. This increases ease of debugging.
329
-
330
- ##v.1.11
331
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
332
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
333
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
334
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
335
- completed transactions.
336
-
337
- ##v.1.10
338
- - Fixed issue where changes on different subtabs were not detected.
339
-
340
- ##v1.1.9
341
- - Exposed `noop` function on `RmCore` class.
342
- > This is used in order to check whether a callback has a default value.
343
- - Added `copyRequestColumns` function to `ColumnUtil` class.
344
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
345
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
346
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
347
- `breakUpByParent` - `onAfterCreateCallback`.
348
-
349
- ##v1.1.8
350
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
351
-
352
- ##v1.1.7
353
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
354
-
355
- ##v1.1.6
356
- - Fixed issue with deferred item entries.
357
- - Re-enable changes watcher after save.
358
- - Added optional `id` parameter to `LocalCache` constructor.
359
-
360
- ##v1.1.5
361
- - Added `clearItem` function to `LocalCache` class.
362
-
363
- ##v.1.1.4
364
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
365
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
366
- the items to the local cache.
367
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
368
- doing it however can definitely be harmful.
369
-
370
- ##v.1.1.3
371
- - Fixed an issue where all collections in a local cache would be cleared.
372
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
373
- `LocalCacheManagerInterface`.
374
-
375
- ##v1.1.2
376
- - Fixed an issue concerning derived values.
377
-
378
- ## v1.1.1
379
- - Fixed an issue where changes wouldn't be detected.
380
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
381
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
382
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
383
- `disableChangesWatcher` instead.
384
-
385
- ## v1.1.0
386
- ### Development
387
-
388
- #### Strict TypeScript compilation
389
- Added the following TypeScript compiler options:
390
- - noImplicitThis
391
- - noImplicitReturns
392
- - strictNullChecks
393
- - noUnusedLocals
394
- - noUnusedParameters
395
-
396
- I would advise enabling these for all TypeScript projects from now on.
397
-
398
- #### Ordered imports and dependencies
399
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
400
- Please note that this also applies for imports from the folder the file is currently in.
401
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
402
- `import { ItemEntry } from '../models';`
403
-
404
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
405
- remove dependencies in the future.
406
-
407
- ### Breaking changes
408
-
409
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
410
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
411
- `moduleChangesCompilationFactory`.
412
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
413
- no longer supported in the back-end.
414
-
415
- #### Item and collection entries
416
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
417
- - Added the following functions to `ItemEntryService`:
418
- - `createLocalConversionMap`;
419
- - `expandLocalConversionMap`;
420
- - `expandConversionMap`;
421
- - `batchExpandConversionMap`;
422
- - `batchClone`.
423
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
424
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
425
-
426
- #### Rework item caching
427
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
428
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
429
- using the item administrator or when resources are created when adding the items to a collection.
430
-
431
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
432
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
433
- > pasting of items.
434
-
435
- Other changes:
436
-
437
- - Moved `saveLocal` to `ItemAdministrator`;
438
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
439
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
440
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
441
- already on the backend. (Use `getCollectionMatcher`.)
442
-
443
-
444
- ##v1.0.33
445
- - Really fix types path
446
-
447
- ##v1.0.33
448
- - Fix types path
449
-
450
- ##v1.0.32
451
- - Update `tsconfig.json` to put definitions in the root folder
452
- > The app had an issue with AOT compilation because of this
453
-
454
- ##v1.0.31
455
- - Fix `columnHandler.fetchItemTypeTranslations`
456
- > It incorrectly looped over the response map, it should now work again
457
-
458
- ##v1.0.30
459
- - Remove `updateTabParams` from LocalCacheManagerInterface
460
- > The function wasn't used
461
-
462
- - Reworked class export
463
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
464
-
465
- ##v1.0.29
466
- - Fix inverted inArray check in CollectionEntry.removeItems
467
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
468
-
469
- ##v1.0.28
470
- Bug fixes only
471
-
472
- ##v1.0.27
473
- - `ItemEntry.initial` is now undefined by default
474
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
475
-
476
- ##v1.0.26
477
- Bundle both minified and unminified code, include sourcemaps from dev build
478
-
479
- ##v1.0.24, v1.0.25
480
- ! Use version `v1.0.26` !
481
-
482
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
483
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
484
-
485
- - Rename `ItemEntry.entryId` to `ItemEntry.id
486
- > It used to be called `id`, but it was changed in the seperation of the core.
487
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
488
-
489
- - Rename ItemResource `startTransaction` to `start`
490
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
491
-
492
- - `SocketMessageHandler.onMessageReceived` now returns a promise
493
- > You can now use the updated items or hook into the result to update the ui for example
494
-
495
-
496
- ##v1.0.23
497
- - Rename ResourceCache to LocalCache
498
- > LocalCache only caches local items (name better reflects functionality)
499
-
500
- - Remove getter/setter for hasChanges
501
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
502
-
503
- - Remove `_getCollection` from ItemAdministrator
504
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
505
- > options and should not be given as a separate argument. This was included to support the frontend
506
-
507
- - Remove `saveCurrentTab` from ItemAdministrator
508
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
509
-
510
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
511
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
512
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ## 1.7.2
5
+ - Fix some typing issues in:
6
+ - ApiResponseProcessor
7
+ - ItemCache
8
+ - KeyService
9
+
10
+ ## 1.7.1
11
+ - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
12
+
13
+ ## 1.7.0
14
+ - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
15
+
16
+ ### Resource caching
17
+ - **Breaking:** the following properties are removed:
18
+ - On `ItemEntry`: `clearResources`, `deactivateResources`.
19
+ - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
20
+ - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
21
+ - An additional `level` parameter has been added to all methods that return resources.
22
+ - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
23
+ A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
24
+ - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection
25
+ and collection resources with a level of `level` or higher will be removed.
26
+ - The `clearResources` method has been removed from `LocalCache`.
27
+ - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
28
+
29
+ ## 1.6.13
30
+ - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
31
+ promise has been resolved.
32
+
33
+ > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
34
+
35
+ ## 1.6.12
36
+ - Fix error that occurs when trying to resolve a non-deferred collection entry.
37
+
38
+ ## 1.6.11
39
+ - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
40
+
41
+ ## 1.6.10
42
+ - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
43
+ `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
44
+
45
+ ## 1.6.9
46
+ - Redeploy of `1.6.8`
47
+
48
+ ## 1.6.8
49
+ - Add support for `not` in queries
50
+
51
+ ## 1.6.7
52
+ - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
53
+
54
+ ## 1.6.6
55
+ - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial` parameter in `CollectionEntry.extend`, as it should always be true.
56
+ > The `extend` function only concerns itself with remote items, so no local changes should be generated.
57
+
58
+ ## 1.6.5
59
+ - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
60
+ > This could lead to instances where a different column would be set to the value of the parent.
61
+
62
+ ## 1.6.4
63
+ - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
64
+ - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for the `resultCollectionResource`.
65
+
66
+ ## 1.6.3
67
+ - Properly type ApiResponseProcessor - fetchObjectArray
68
+
69
+ ## 1.6.2
70
+ - Fix issue where the collection handler would return collection entries before they were resolved when calling `batchFetch`.
71
+
72
+ ## 1.6.1-3
73
+ - Check for linkedTo before checking for subqueries in QueryMatcher
74
+ > Linkedto also has `.query` and was incorrectly marked as a subquery
75
+
76
+ ## 1.6.1-2
77
+ - Fixed shorthand query with null values
78
+ > The QueryParser would incorrectly identify subqueries when using null in a shorthand
79
+
80
+ ## 1.6.1-1
81
+ - Fixed shorthand query with Moment values
82
+ > The QueryParser would incorrectly identify Moment objects as a subquery
83
+
84
+ ## 1.6.1
85
+ - Added support for subqueries in QueryParser and QueryMatcher
86
+ > Collections using subqueries will always return 'maybe' in the QueryMatcher
87
+
88
+ ## 1.6.0
89
+ - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core functionality.
90
+ - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
91
+
92
+ ## 1.5.9
93
+ - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column.
94
+ Catch exceptions that might occur when resolving an `ItemEntry`.
95
+ - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a collection, add them to the collection.
96
+
97
+ ## 1.5.8
98
+ - Introduce `RemoteViewResource` and `LocalViewResource`.
99
+ > The `fields` property of a `RemoteViewResource` represents
100
+ server values, while the `fields` property of a `LocalViewResource` represents local values.
101
+ - The `fields` property of a `ViewResource` is now read only.
102
+
103
+ ## 1.5.7-1
104
+ - Make ItemResource/CollectionResource base class abstract
105
+ - Add missing overload functions in some places
106
+ - Fix default comparator `QueryMatcher.parseSimpleQuery`
107
+ - Fix `ExtendedCollectionMatchResult` `collection` property type
108
+
109
+ ## 1.5.7
110
+ - Properly type Collections & ItemResources (and return values) in the whole core.
111
+ > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
112
+ > You can now also type the expected collection type
113
+
114
+ ```
115
+ // Expects a collection with editCollection and editItems both `true`
116
+ // Will properly return EditResources for all collection functions
117
+ const collection: CollectionEditResource<EditResource>;
118
+
119
+ // other variations are:
120
+ // CollectionViewResource<ViewResource>
121
+ // CollectionViewResource<EditResource>
122
+ // CollectionEditResource<ViewResource>
123
+
124
+ this.core.itemAdministrator.getCollection(
125
+ 'Notitie',
126
+ {
127
+ editCollection: true, // Will return a CollectionEditResource
128
+ editItems: true // Will return EditResources instead of ViewResources in `.items`
129
+ }
130
+ )
131
+ ```
132
+
133
+ ## 1.5.6
134
+ - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
135
+
136
+ ## 1.5.5
137
+ - Add 'order' column type handling to ApiFormatter functions
138
+
139
+ ## 1.5.4
140
+ - Fix issue where parent would be incorrectly set when cloning a single item.
141
+ - Type functions related to expansion maps in `ItemEntryService`.
142
+
143
+ ## 1.5.3
144
+ - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
145
+ calling `save` on a collection resource where this option was not explicitly set.
146
+
147
+ ## 1.5.2
148
+ - Type functions in `ColumnUtil` class.
149
+ - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
150
+ > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
151
+ - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
152
+ - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
153
+
154
+ ## 1.5.1
155
+ - Properly remove item entry stub from (local) cache when request fails.
156
+ - Fix issue where item or collection options could be set to undefined.
157
+
158
+ ## 1.5.0
159
+ - Add `SocketMessage` type and add types to `SocketMessageHandler`
160
+ - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
161
+ (`fetchItem` or `fetchItems` in `ItemHandler`.)
162
+ - Implement expanding of local collections. This no longer leads to invalid requests.
163
+ - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
164
+ - **Warning:** This version contains major changes.
165
+
166
+ ### Introduce typing of item and collection options
167
+ - **Breaking:** Removed `QueryItemType` collection entry option.
168
+ - **Breaking:** Removed `ItemResourceService`.
169
+ - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
170
+ `addCollection`.
171
+ - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
172
+ collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
173
+ still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
174
+
175
+ ## v1.4.0
176
+ - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
177
+ `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
178
+ They have a slightly different type signature.
179
+ - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
180
+ necessary.
181
+ - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
182
+ - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
183
+
184
+ ## v1.3.8
185
+ - Add `isSaving` to `LocalCache`
186
+ > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
187
+
188
+ ## v1.3.7
189
+ - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the parent.
190
+ - Remove slip workarounds
191
+ - Add api request types
192
+ - Add types to `ModuleChangesCompilation`
193
+
194
+ ## v1.3.6
195
+ - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
196
+
197
+ ## v1.3.5
198
+ - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
199
+
200
+ ## v1.3.4
201
+ - Add country to isFilteredColumn in ColumnUtil
202
+
203
+ ## v1.3.3
204
+ - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
205
+ > These functions are specifically used for rendering ui-grid in the frontend, so there's
206
+ no reason to have them in the core
207
+
208
+ ## v1.3.2
209
+ - Fix types path in package.json
210
+
211
+ ## v1.3.1
212
+ - Fix types path in package.json
213
+
214
+ ## v1.3.0
215
+ - Rename PromiseInterface to PromiseLibraryInterface
216
+ > PromiseInterface is now used for the internal promise type
217
+
218
+ - Use PromiseInterface instead of Promise as internal promise type
219
+ > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
220
+
221
+ ## v1.2.9
222
+ - Call processOptions in fetchDerivedValuesByColumn
223
+ > Bug was introduced earlier but got enabled in v1.2.7
224
+
225
+ ## v1.2.8
226
+ - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
227
+
228
+ ## v1.2.7
229
+ - Set itemEntry parent when generating a stub
230
+
231
+ ## v1.2.6
232
+ - Fix an issue introduced in v1.2.5.
233
+
234
+ ## v1.2.5
235
+ - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
236
+ solves an issue with refreshing on a local edit view.
237
+
238
+ ## v1.2.4
239
+ - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
240
+ is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
241
+ - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
242
+ - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
243
+ `TemplateLinkedItemEntryMap`.
244
+ - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
245
+
246
+ ## v1.2.3
247
+ - Fixed issue where derived values deeper than one layer couldn't be resolved.
248
+
249
+ ## v1.2.2
250
+ - Fixed issue where in derived values weren't set after create request.
251
+
252
+ ## v1.2.1
253
+ - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
254
+ function of the `EditResource` class.
255
+ - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
256
+ - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`) when `modInstant` is set to true.
257
+
258
+ ## v1.2.0
259
+ - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
260
+ resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
261
+ `{key: 'value'}` should now be used as argument when calling these functions.
262
+ - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
263
+
264
+ ## v1.1.20
265
+ - Fixed minor issue where collection wouldn't be deferred properly before expanding.
266
+ - `onChange` is now called automatically when when calling `commit` on an edit resource.
267
+
268
+ ## v1.1.19
269
+ - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
270
+ `localCache` parameter.
271
+
272
+ ### Local cache callback refactoring
273
+ - Removed `onSaveWithoutClosing` event.
274
+ - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
275
+ `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
276
+ callbacks.
277
+ - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
278
+ to `onSaveSuccess` callback functions.
279
+
280
+ ## v1.1.18
281
+ - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
282
+ - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
283
+ collection entries.
284
+
285
+ ## v1.1.17
286
+ - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
287
+ - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
288
+ of `getByParent`.
289
+
290
+ ### Cache invalidation
291
+ - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
292
+ collection entry containing the item is requested.
293
+ - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
294
+ - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
295
+ and collection entries.
296
+
297
+ ### Item entry refactoring
298
+ - Renamed `process` to `setFields`.
299
+ - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
300
+ - `setModified` now also sets local default values.
301
+ - Removed `setCreator`. This function was called twice in some instances.
302
+ - **Breaking:** Added `derived` parameter to `updateFields`
303
+
304
+ ##v1.16
305
+ - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
306
+ project financial values in the front-end. [RM4-9577]
307
+ - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
308
+ from being added to the local cache.
309
+
310
+ ##v1.15
311
+ - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
312
+ - Fix type definition of `PromiseInterface.all`.
313
+
314
+ ##v1.14
315
+ - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
316
+ issue with recurring appointments in the front-end.
317
+
318
+ ##v1.13
319
+ - Add option to exclude itemTypes during createLocalEntries.
320
+
321
+ ##v1.12
322
+ - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
323
+ `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
324
+ from the local cache inadvertently.
325
+ - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
326
+ - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
327
+ are now respected. This fixes an issue where items where *not* removed from the local cache.
328
+ - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
329
+ issue where changes were being detected continuously.
330
+ - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
331
+ except when updating documents. This fixes several issues.
332
+ - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
333
+ collection was added multiple times.
334
+ - Updated all models to use dependency objects. This increases ease of debugging.
335
+
336
+ ##v.1.11
337
+ - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
338
+ - **Breaking:** Removed `ItemResourceService.isNewResource`.
339
+ - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
340
+ - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
341
+ completed transactions.
342
+
343
+ ##v.1.10
344
+ - Fixed issue where changes on different subtabs were not detected.
345
+
346
+ ##v1.1.9
347
+ - Exposed `noop` function on `RmCore` class.
348
+ > This is used in order to check whether a callback has a default value.
349
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
350
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
351
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
352
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
353
+ `breakUpByParent` - `onAfterCreateCallback`.
354
+
355
+ ##v1.1.8
356
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
357
+
358
+ ##v1.1.7
359
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
360
+
361
+ ##v1.1.6
362
+ - Fixed issue with deferred item entries.
363
+ - Re-enable changes watcher after save.
364
+ - Added optional `id` parameter to `LocalCache` constructor.
365
+
366
+ ##v1.1.5
367
+ - Added `clearItem` function to `LocalCache` class.
368
+
369
+ ##v.1.1.4
370
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
371
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
372
+ the items to the local cache.
373
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
374
+ doing it however can definitely be harmful.
375
+
376
+ ##v.1.1.3
377
+ - Fixed an issue where all collections in a local cache would be cleared.
378
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
379
+ `LocalCacheManagerInterface`.
380
+
381
+ ##v1.1.2
382
+ - Fixed an issue concerning derived values.
383
+
384
+ ## v1.1.1
385
+ - Fixed an issue where changes wouldn't be detected.
386
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
387
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
388
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
389
+ `disableChangesWatcher` instead.
390
+
391
+ ## v1.1.0
392
+ ### Development
393
+
394
+ #### Strict TypeScript compilation
395
+ Added the following TypeScript compiler options:
396
+ - noImplicitThis
397
+ - noImplicitReturns
398
+ - strictNullChecks
399
+ - noUnusedLocals
400
+ - noUnusedParameters
401
+
402
+ I would advise enabling these for all TypeScript projects from now on.
403
+
404
+ #### Ordered imports and dependencies
405
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
406
+ Please note that this also applies for imports from the folder the file is currently in.
407
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
408
+ `import { ItemEntry } from '../models';`
409
+
410
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
411
+ remove dependencies in the future.
412
+
413
+ ### Breaking changes
414
+
415
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
416
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
417
+ `moduleChangesCompilationFactory`.
418
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
419
+ no longer supported in the back-end.
420
+
421
+ #### Item and collection entries
422
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
423
+ - Added the following functions to `ItemEntryService`:
424
+ - `createLocalConversionMap`;
425
+ - `expandLocalConversionMap`;
426
+ - `expandConversionMap`;
427
+ - `batchExpandConversionMap`;
428
+ - `batchClone`.
429
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
430
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
431
+
432
+ #### Rework item caching
433
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
434
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
435
+ using the item administrator or when resources are created when adding the items to a collection.
436
+
437
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
438
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
439
+ > pasting of items.
440
+
441
+ Other changes:
442
+
443
+ - Moved `saveLocal` to `ItemAdministrator`;
444
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
445
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
446
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
447
+ already on the backend. (Use `getCollectionMatcher`.)
448
+
449
+
450
+ ##v1.0.33
451
+ - Really fix types path
452
+
453
+ ##v1.0.33
454
+ - Fix types path
455
+
456
+ ##v1.0.32
457
+ - Update `tsconfig.json` to put definitions in the root folder
458
+ > The app had an issue with AOT compilation because of this
459
+
460
+ ##v1.0.31
461
+ - Fix `columnHandler.fetchItemTypeTranslations`
462
+ > It incorrectly looped over the response map, it should now work again
463
+
464
+ ##v1.0.30
465
+ - Remove `updateTabParams` from LocalCacheManagerInterface
466
+ > The function wasn't used
467
+
468
+ - Reworked class export
469
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
470
+
471
+ ##v1.0.29
472
+ - Fix inverted inArray check in CollectionEntry.removeItems
473
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
474
+
475
+ ##v1.0.28
476
+ Bug fixes only
477
+
478
+ ##v1.0.27
479
+ - `ItemEntry.initial` is now undefined by default
480
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
481
+
482
+ ##v1.0.26
483
+ Bundle both minified and unminified code, include sourcemaps from dev build
484
+
485
+ ##v1.0.24, v1.0.25
486
+ ! Use version `v1.0.26` !
487
+
488
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
489
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
490
+
491
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
492
+ > It used to be called `id`, but it was changed in the seperation of the core.
493
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
494
+
495
+ - Rename ItemResource `startTransaction` to `start`
496
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
497
+
498
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
499
+ > You can now use the updated items or hook into the result to update the ui for example
500
+
501
+
502
+ ##v1.0.23
503
+ - Rename ResourceCache to LocalCache
504
+ > LocalCache only caches local items (name better reflects functionality)
505
+
506
+ - Remove getter/setter for hasChanges
507
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
508
+
509
+ - Remove `_getCollection` from ItemAdministrator
510
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
511
+ > options and should not be given as a separate argument. This was included to support the frontend
512
+
513
+ - Remove `saveCurrentTab` from ItemAdministrator
514
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
515
+
516
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
517
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
518
+