@rentman/rm-core 1.5.9 → 1.6.0-1

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