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