@rentman/rm-core 1.3.8 → 1.4.0-1

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