@rentman/rm-core 1.5.3 → 1.5.4

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