@rentman/rm-core 1.5.1 → 1.5.2

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