@rentman/rm-core 1.3.6 → 1.3.7

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