@rentman/rm-core 1.7.1 → 1.7.3

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