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