@rentman/rm-core 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,204 +1,208 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ##v1.13
5
- - Add option to exclude itemTypes during createLocalEntries.
6
-
7
- ##v1.12
8
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
9
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
10
- from the local cache inadvertently.
11
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
12
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
13
- are now respected. This fixes an issue where items where *not* removed from the local cache.
14
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
15
- issue where changes were being detected continuously.
16
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
17
- except when updating documents. This fixes several issues.
18
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
19
- collection was added multiple times.
20
- - Updated all models to use dependency objects. This increases ease of debugging.
21
-
22
- ##v.1.11
23
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
24
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
25
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
26
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
27
- completed transactions.
28
-
29
- ##v.1.10
30
- - Fixed issue where changes on different subtabs were not detected.
31
-
32
- ##v1.1.9
33
- - Exposed `noop` function on `RmCore` class.
34
- > This is used in order to check whether a callback has a default value.
35
- - Added `copyRequestColumns` function to `ColumnUtil` class.
36
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
37
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
38
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
39
- `breakUpByParent` - `onAfterCreateCallback`.
40
-
41
- ##v1.1.8
42
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
43
-
44
- ##v1.1.7
45
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
46
-
47
- ##v1.1.6
48
- - Fixed issue with deferred item entries.
49
- - Re-enable changes watcher after save.
50
- - Added optional `id` parameter to `LocalCache` constructor.
51
-
52
- ##v1.1.5
53
- - Added `clearItem` function to `LocalCache` class.
54
-
55
- ##v.1.1.4
56
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
57
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
58
- the items to the local cache.
59
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
60
- doing it however can definitely be harmful.
61
-
62
- ##v.1.1.3
63
- - Fixed an issue where all collections in a local cache would be cleared.
64
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
65
- `LocalCacheManagerInterface`.
66
-
67
- ##v1.1.2
68
- - Fixed an issue concerning derived values.
69
-
70
- ## v1.1.1
71
- - Fixed an issue where changes wouldn't be detected.
72
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
73
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
74
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
75
- `disableChangesWatcher` instead.
76
-
77
- ## v1.1.0
78
- ### Development
79
-
80
- #### Strict TypeScript compilation
81
- Added the following TypeScript compiler options:
82
- - noImplicitThis
83
- - noImplicitReturns
84
- - strictNullChecks
85
- - noUnusedLocals
86
- - noUnusedParameters
87
-
88
- I would advise enabling these for all TypeScript projects from now on.
89
-
90
- #### Ordered imports and dependencies
91
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
92
- Please note that this also applies for imports from the folder the file is currently in.
93
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
94
- `import { ItemEntry } from '../models';`
95
-
96
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
97
- remove dependencies in the future.
98
-
99
- ### Breaking changes
100
-
101
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
102
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
103
- `moduleChangesCompilationFactory`.
104
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
105
- no longer supported in the back-end.
106
-
107
- #### Item and collection entries
108
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
109
- - Added the following functions to `ItemEntryService`:
110
- - `createLocalConversionMap`;
111
- - `expandLocalConversionMap`;
112
- - `expandConversionMap`;
113
- - `batchExpandConversionMap`;
114
- - `batchClone`.
115
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
116
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
117
-
118
- #### Rework item caching
119
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
120
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
121
- using the item administrator or when resources are created when adding the items to a collection.
122
-
123
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
124
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
125
- > pasting of items.
126
-
127
- Other changes:
128
-
129
- - Moved `saveLocal` to `ItemAdministrator`;
130
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
131
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
132
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
133
- already on the backend. (Use `getCollectionMatcher`.)
134
-
135
-
136
- ##v1.0.33
137
- - Really fix types path
138
-
139
- ##v1.0.33
140
- - Fix types path
141
-
142
- ##v1.0.32
143
- - Update `tsconfig.json` to put definitions in the root folder
144
- > The app had an issue with AOT compilation because of this
145
-
146
- ##v1.0.31
147
- - Fix `columnHandler.fetchItemTypeTranslations`
148
- > It incorrectly looped over the response map, it should now work again
149
-
150
- ##v1.0.30
151
- - Remove `updateTabParams` from LocalCacheManagerInterface
152
- > The function wasn't used
153
-
154
- - Reworked class export
155
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
156
-
157
- ##v1.0.29
158
- - Fix inverted inArray check in CollectionEntry.removeItems
159
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
160
-
161
- ##v1.0.28
162
- Bug fixes only
163
-
164
- ##v1.0.27
165
- - `ItemEntry.initial` is now undefined by default
166
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
167
-
168
- ##v1.0.26
169
- Bundle both minified and unminified code, include sourcemaps from dev build
170
-
171
- ##v1.0.24, v1.0.25
172
- ! Use version `v1.0.26` !
173
-
174
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
175
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
176
-
177
- - Rename `ItemEntry.entryId` to `ItemEntry.id
178
- > It used to be called `id`, but it was changed in the seperation of the core.
179
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
180
-
181
- - Rename ItemResource `startTransaction` to `start`
182
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
183
-
184
- - `SocketMessageHandler.onMessageReceived` now returns a promise
185
- > You can now use the updated items or hook into the result to update the ui for example
186
-
187
-
188
- ##v1.0.23
189
- - Rename ResourceCache to LocalCache
190
- > LocalCache only caches local items (name better reflects functionality)
191
-
192
- - Remove getter/setter for hasChanges
193
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
194
-
195
- - Remove `_getCollection` from ItemAdministrator
196
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
197
- > options and should not be given as a separate argument. This was included to support the frontend
198
-
199
- - Remove `saveCurrentTab` from ItemAdministrator
200
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
201
-
202
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
203
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
204
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ##v1.14
5
+ - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
6
+ issue with recurring appointments in the front-end.
7
+
8
+ ##v1.13
9
+ - Add option to exclude itemTypes during createLocalEntries.
10
+
11
+ ##v1.12
12
+ - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
13
+ `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
14
+ from the local cache inadvertently.
15
+ - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
16
+ - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
17
+ are now respected. This fixes an issue where items where *not* removed from the local cache.
18
+ - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
19
+ issue where changes were being detected continuously.
20
+ - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
21
+ except when updating documents. This fixes several issues.
22
+ - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
23
+ collection was added multiple times.
24
+ - Updated all models to use dependency objects. This increases ease of debugging.
25
+
26
+ ##v.1.11
27
+ - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
28
+ - **Breaking:** Removed `ItemResourceService.isNewResource`.
29
+ - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
30
+ - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
31
+ completed transactions.
32
+
33
+ ##v.1.10
34
+ - Fixed issue where changes on different subtabs were not detected.
35
+
36
+ ##v1.1.9
37
+ - Exposed `noop` function on `RmCore` class.
38
+ > This is used in order to check whether a callback has a default value.
39
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
40
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
41
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
42
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
43
+ `breakUpByParent` - `onAfterCreateCallback`.
44
+
45
+ ##v1.1.8
46
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
47
+
48
+ ##v1.1.7
49
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
50
+
51
+ ##v1.1.6
52
+ - Fixed issue with deferred item entries.
53
+ - Re-enable changes watcher after save.
54
+ - Added optional `id` parameter to `LocalCache` constructor.
55
+
56
+ ##v1.1.5
57
+ - Added `clearItem` function to `LocalCache` class.
58
+
59
+ ##v.1.1.4
60
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
61
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
62
+ the items to the local cache.
63
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
64
+ doing it however can definitely be harmful.
65
+
66
+ ##v.1.1.3
67
+ - Fixed an issue where all collections in a local cache would be cleared.
68
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
69
+ `LocalCacheManagerInterface`.
70
+
71
+ ##v1.1.2
72
+ - Fixed an issue concerning derived values.
73
+
74
+ ## v1.1.1
75
+ - Fixed an issue where changes wouldn't be detected.
76
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
77
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
78
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
79
+ `disableChangesWatcher` instead.
80
+
81
+ ## v1.1.0
82
+ ### Development
83
+
84
+ #### Strict TypeScript compilation
85
+ Added the following TypeScript compiler options:
86
+ - noImplicitThis
87
+ - noImplicitReturns
88
+ - strictNullChecks
89
+ - noUnusedLocals
90
+ - noUnusedParameters
91
+
92
+ I would advise enabling these for all TypeScript projects from now on.
93
+
94
+ #### Ordered imports and dependencies
95
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
96
+ Please note that this also applies for imports from the folder the file is currently in.
97
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
98
+ `import { ItemEntry } from '../models';`
99
+
100
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
101
+ remove dependencies in the future.
102
+
103
+ ### Breaking changes
104
+
105
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
106
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
107
+ `moduleChangesCompilationFactory`.
108
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
109
+ no longer supported in the back-end.
110
+
111
+ #### Item and collection entries
112
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
113
+ - Added the following functions to `ItemEntryService`:
114
+ - `createLocalConversionMap`;
115
+ - `expandLocalConversionMap`;
116
+ - `expandConversionMap`;
117
+ - `batchExpandConversionMap`;
118
+ - `batchClone`.
119
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
120
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
121
+
122
+ #### Rework item caching
123
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
124
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
125
+ using the item administrator or when resources are created when adding the items to a collection.
126
+
127
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
128
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
129
+ > pasting of items.
130
+
131
+ Other changes:
132
+
133
+ - Moved `saveLocal` to `ItemAdministrator`;
134
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
135
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
136
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
137
+ already on the backend. (Use `getCollectionMatcher`.)
138
+
139
+
140
+ ##v1.0.33
141
+ - Really fix types path
142
+
143
+ ##v1.0.33
144
+ - Fix types path
145
+
146
+ ##v1.0.32
147
+ - Update `tsconfig.json` to put definitions in the root folder
148
+ > The app had an issue with AOT compilation because of this
149
+
150
+ ##v1.0.31
151
+ - Fix `columnHandler.fetchItemTypeTranslations`
152
+ > It incorrectly looped over the response map, it should now work again
153
+
154
+ ##v1.0.30
155
+ - Remove `updateTabParams` from LocalCacheManagerInterface
156
+ > The function wasn't used
157
+
158
+ - Reworked class export
159
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
160
+
161
+ ##v1.0.29
162
+ - Fix inverted inArray check in CollectionEntry.removeItems
163
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
164
+
165
+ ##v1.0.28
166
+ Bug fixes only
167
+
168
+ ##v1.0.27
169
+ - `ItemEntry.initial` is now undefined by default
170
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
171
+
172
+ ##v1.0.26
173
+ Bundle both minified and unminified code, include sourcemaps from dev build
174
+
175
+ ##v1.0.24, v1.0.25
176
+ ! Use version `v1.0.26` !
177
+
178
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
179
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
180
+
181
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
182
+ > It used to be called `id`, but it was changed in the seperation of the core.
183
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
184
+
185
+ - Rename ItemResource `startTransaction` to `start`
186
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
187
+
188
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
189
+ > You can now use the updated items or hook into the result to update the ui for example
190
+
191
+
192
+ ##v1.0.23
193
+ - Rename ResourceCache to LocalCache
194
+ > LocalCache only caches local items (name better reflects functionality)
195
+
196
+ - Remove getter/setter for hasChanges
197
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
198
+
199
+ - Remove `_getCollection` from ItemAdministrator
200
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
201
+ > options and should not be given as a separate argument. This was included to support the frontend
202
+
203
+ - Remove `saveCurrentTab` from ItemAdministrator
204
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
205
+
206
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
207
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
208
+
@@ -27,7 +27,7 @@ export declare class ApiFormatter {
27
27
  formatRequestDate(value: any): any;
28
28
  formatRequestDuration(value: any): any;
29
29
  formatRequestColor(value: any): any;
30
- getDefaultValue(columnType: any): false | "" | 0 | moment.Moment | moment.Duration | "0" | "#000000" | null;
30
+ getDefaultValue(columnType: any): false | moment.Moment | 0 | moment.Duration | "" | "0" | "#000000" | null;
31
31
  isDefaultValue(columnType: any, value: any): any;
32
32
  clone(columnType: any, value: any): any;
33
33
  getCloneFunction(columnType: any): (date: any) => any;
@@ -89,7 +89,7 @@ export declare class ItemAdministrator {
89
89
  updateItemIdMap(collectionMap: any, conversionMap: any): void;
90
90
  createCollectionResource(collectionEntry: CollectionEntry, resourceOptions: any, processOptions?: boolean): CollectionResource;
91
91
  createItemResource(itemEntry: ItemEntry, options: any, isRoot: boolean): ItemResource;
92
- onBeforeSave(key: string, callback: any): () => boolean;
93
- onSaveSuccess(key: string, callback: any): () => boolean;
94
- onSaveWithoutClosing(key: string, callback: any): () => boolean;
92
+ onBeforeSave(key: string, callback: any): () => void;
93
+ onSaveSuccess(key: string, callback: any): () => void;
94
+ onSaveWithoutClosing(key: string, callback: any): () => void;
95
95
  }
@@ -45,7 +45,7 @@ export declare class LocalCache {
45
45
  private executeCallbacks(event, ...args);
46
46
  enableChangesWatcher(): void;
47
47
  disableChangesWatcher(): void;
48
- registerCallback(event: string, key: string, callback: any): () => boolean;
48
+ registerCallback(event: string, key: string, callback: any): () => void;
49
49
  onDeactivateItem(itemEntry: any): void;
50
50
  onActivateItem(itemEntry: any): void;
51
51
  }