@rentman/rm-core 1.1.9 → 1.1.10-2

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,176 +1,179 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ##v1.1.9
5
- - Exposed `noop` function on `RmCore` class.
6
- > This is used in order to check whether a callback has a default value.
7
- - Added `copyRequestColumns` function to `ColumnUtil` class.
8
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
9
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
10
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
11
- `breakUpByParent` - `onAfterCreateCallback`.
12
-
13
- ##v1.1.8
14
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
15
-
16
- ##v1.1.7
17
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
18
-
19
- ##v1.1.6
20
- - Fixed issue with deferred item entries.
21
- - Re-enable changes watcher after save.
22
- - Added optional `id` parameter to `LocalCache` constructor.
23
-
24
- ##v1.1.5
25
- - Added `clearItem` function to `LocalCache` class.
26
-
27
- ##v.1.1.4
28
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
29
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
30
- the items to the local cache.
31
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
32
- doing it however can definitely be harmful.
33
-
34
- ##v.1.1.3
35
- - Fixed an issue where all collections in a local cache would be cleared.
36
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
37
- `LocalCacheManagerInterface`.
38
-
39
- ##v1.1.2
40
- - Fixed an issue concerning derived values.
41
-
42
- ## v1.1.1
43
- - Fixed an issue where changes wouldn't be detected.
44
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
45
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
46
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
47
- `disableChangesWatcher` instead.
48
-
49
- ## v1.1.0
50
- ### Development
51
-
52
- #### Strict TypeScript compilation
53
- Added the following TypeScript compiler options:
54
- - noImplicitThis
55
- - noImplicitReturns
56
- - strictNullChecks
57
- - noUnusedLocals
58
- - noUnusedParameters
59
-
60
- I would advise enabling these for all TypeScript projects from now on.
61
-
62
- #### Ordered imports and dependencies
63
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
64
- Please note that this also applies for imports from the folder the file is currently in.
65
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
66
- `import { ItemEntry } from '../models';`
67
-
68
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
69
- remove dependencies in the future.
70
-
71
- ### Breaking changes
72
-
73
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
74
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
75
- `moduleChangesCompilationFactory`.
76
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
77
- no longer supported in the back-end.
78
-
79
- #### Item and collection entries
80
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
81
- - Added the following functions to `ItemEntryService`:
82
- - `createLocalConversionMap`;
83
- - `expandLocalConversionMap`;
84
- - `expandConversionMap`;
85
- - `batchExpandConversionMap`;
86
- - `batchClone`.
87
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
88
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
89
-
90
- #### Rework item caching
91
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
92
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
93
- using the item administrator or when resources are created when adding the items to a collection.
94
-
95
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
96
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
97
- > pasting of items.
98
-
99
- Other changes:
100
-
101
- - Moved `saveLocal` to `ItemAdministrator`;
102
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
103
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
104
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
105
- already on the backend. (Use `getCollectionMatcher`.)
106
-
107
-
108
- ##v1.0.33
109
- - Really fix types path
110
-
111
- ##v1.0.33
112
- - Fix types path
113
-
114
- ##v1.0.32
115
- - Update `tsconfig.json` to put definitions in the root folder
116
- > The app had an issue with AOT compilation because of this
117
-
118
- ##v1.0.31
119
- - Fix `columnHandler.fetchItemTypeTranslations`
120
- > It incorrectly looped over the response map, it should now work again
121
-
122
- ##v1.0.30
123
- - Remove `updateTabParams` from LocalCacheManagerInterface
124
- > The function wasn't used
125
-
126
- - Reworked class export
127
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
128
-
129
- ##v1.0.29
130
- - Fix inverted inArray check in CollectionEntry.removeItems
131
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
132
-
133
- ##v1.0.28
134
- Bug fixes only
135
-
136
- ##v1.0.27
137
- - `ItemEntry.initial` is now undefined by default
138
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
139
-
140
- ##v1.0.26
141
- Bundle both minified and unminified code, include sourcemaps from dev build
142
-
143
- ##v1.0.24, v1.0.25
144
- ! Use version `v1.0.26` !
145
-
146
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
147
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
148
-
149
- - Rename `ItemEntry.entryId` to `ItemEntry.id
150
- > It used to be called `id`, but it was changed in the seperation of the core.
151
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
152
-
153
- - Rename ItemResource `startTransaction` to `start`
154
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
155
-
156
- - `SocketMessageHandler.onMessageReceived` now returns a promise
157
- > You can now use the updated items or hook into the result to update the ui for example
158
-
159
-
160
- ##v1.0.23
161
- - Rename ResourceCache to LocalCache
162
- > LocalCache only caches local items (name better reflects functionality)
163
-
164
- - Remove getter/setter for hasChanges
165
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
166
-
167
- - Remove `_getCollection` from ItemAdministrator
168
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
169
- > options and should not be given as a separate argument. This was included to support the frontend
170
-
171
- - Remove `saveCurrentTab` from ItemAdministrator
172
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
173
-
174
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
175
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
176
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ##v.1.10
5
+ - Fixed issue where changes on different subtabs were not detected.
6
+
7
+ ##v1.1.9
8
+ - Exposed `noop` function on `RmCore` class.
9
+ > This is used in order to check whether a callback has a default value.
10
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
11
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
12
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
13
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
14
+ `breakUpByParent` - `onAfterCreateCallback`.
15
+
16
+ ##v1.1.8
17
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
18
+
19
+ ##v1.1.7
20
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
21
+
22
+ ##v1.1.6
23
+ - Fixed issue with deferred item entries.
24
+ - Re-enable changes watcher after save.
25
+ - Added optional `id` parameter to `LocalCache` constructor.
26
+
27
+ ##v1.1.5
28
+ - Added `clearItem` function to `LocalCache` class.
29
+
30
+ ##v.1.1.4
31
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
32
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
33
+ the items to the local cache.
34
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
35
+ doing it however can definitely be harmful.
36
+
37
+ ##v.1.1.3
38
+ - Fixed an issue where all collections in a local cache would be cleared.
39
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
40
+ `LocalCacheManagerInterface`.
41
+
42
+ ##v1.1.2
43
+ - Fixed an issue concerning derived values.
44
+
45
+ ## v1.1.1
46
+ - Fixed an issue where changes wouldn't be detected.
47
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
48
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
49
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
50
+ `disableChangesWatcher` instead.
51
+
52
+ ## v1.1.0
53
+ ### Development
54
+
55
+ #### Strict TypeScript compilation
56
+ Added the following TypeScript compiler options:
57
+ - noImplicitThis
58
+ - noImplicitReturns
59
+ - strictNullChecks
60
+ - noUnusedLocals
61
+ - noUnusedParameters
62
+
63
+ I would advise enabling these for all TypeScript projects from now on.
64
+
65
+ #### Ordered imports and dependencies
66
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
67
+ Please note that this also applies for imports from the folder the file is currently in.
68
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
69
+ `import { ItemEntry } from '../models';`
70
+
71
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
72
+ remove dependencies in the future.
73
+
74
+ ### Breaking changes
75
+
76
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
77
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
78
+ `moduleChangesCompilationFactory`.
79
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
80
+ no longer supported in the back-end.
81
+
82
+ #### Item and collection entries
83
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
84
+ - Added the following functions to `ItemEntryService`:
85
+ - `createLocalConversionMap`;
86
+ - `expandLocalConversionMap`;
87
+ - `expandConversionMap`;
88
+ - `batchExpandConversionMap`;
89
+ - `batchClone`.
90
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
91
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
92
+
93
+ #### Rework item caching
94
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
95
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
96
+ using the item administrator or when resources are created when adding the items to a collection.
97
+
98
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
99
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
100
+ > pasting of items.
101
+
102
+ Other changes:
103
+
104
+ - Moved `saveLocal` to `ItemAdministrator`;
105
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
106
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
107
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
108
+ already on the backend. (Use `getCollectionMatcher`.)
109
+
110
+
111
+ ##v1.0.33
112
+ - Really fix types path
113
+
114
+ ##v1.0.33
115
+ - Fix types path
116
+
117
+ ##v1.0.32
118
+ - Update `tsconfig.json` to put definitions in the root folder
119
+ > The app had an issue with AOT compilation because of this
120
+
121
+ ##v1.0.31
122
+ - Fix `columnHandler.fetchItemTypeTranslations`
123
+ > It incorrectly looped over the response map, it should now work again
124
+
125
+ ##v1.0.30
126
+ - Remove `updateTabParams` from LocalCacheManagerInterface
127
+ > The function wasn't used
128
+
129
+ - Reworked class export
130
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
131
+
132
+ ##v1.0.29
133
+ - Fix inverted inArray check in CollectionEntry.removeItems
134
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
135
+
136
+ ##v1.0.28
137
+ Bug fixes only
138
+
139
+ ##v1.0.27
140
+ - `ItemEntry.initial` is now undefined by default
141
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
142
+
143
+ ##v1.0.26
144
+ Bundle both minified and unminified code, include sourcemaps from dev build
145
+
146
+ ##v1.0.24, v1.0.25
147
+ ! Use version `v1.0.26` !
148
+
149
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
150
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
151
+
152
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
153
+ > It used to be called `id`, but it was changed in the seperation of the core.
154
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
155
+
156
+ - Rename ItemResource `startTransaction` to `start`
157
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
158
+
159
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
160
+ > You can now use the updated items or hook into the result to update the ui for example
161
+
162
+
163
+ ##v1.0.23
164
+ - Rename ResourceCache to LocalCache
165
+ > LocalCache only caches local items (name better reflects functionality)
166
+
167
+ - Remove getter/setter for hasChanges
168
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
169
+
170
+ - Remove `_getCollection` from ItemAdministrator
171
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
172
+ > options and should not be given as a separate argument. This was included to support the frontend
173
+
174
+ - Remove `saveCurrentTab` from ItemAdministrator
175
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
176
+
177
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
178
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
179
+
@@ -25,6 +25,8 @@ export declare class CollectionEntry {
25
25
  deferred: any;
26
26
  promise: Promise<CollectionEntry>;
27
27
  reloadQueued: boolean;
28
+ hasEditResources: boolean;
29
+ hasItemEditResources: boolean;
28
30
  constructor(collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService, itemType: ItemType, options: any);
29
31
  isDeferred(): boolean;
30
32
  resolve(itemEntryCompound: {
@@ -60,6 +62,4 @@ export declare class CollectionEntry {
60
62
  [columnId: string]: ColumnInfo;
61
63
  };
62
64
  clone(parent: any, conversionMap?: ItemIdConversionMap): CollectionEntry;
63
- hasEditResources(): boolean;
64
- hasItemEditResources(): boolean;
65
65
  }
@@ -12,7 +12,7 @@ export declare class EditResource extends ItemResource {
12
12
  transactions: number;
13
13
  constructor(apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, errorHandler: ErrorHandlerInterface, promiseService: PromiseInterface, entry: ItemEntry, options: any);
14
14
  start(): void;
15
- rollback(): void;
15
+ rollback(callOnDeactivate?: boolean): void;
16
16
  commit(initial?: boolean): void;
17
17
  getLocalCopy(): FieldMap | null;
18
18
  copyFields(destination?: any): any;