@rentman/rm-core 1.1.0 → 1.1.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.
package/changelog.md CHANGED
@@ -1,131 +1,138 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ## v1.1.0
5
- ### Development
6
-
7
- #### Strict TypeScript compilation
8
- Added the following TypeScript compiler options:
9
- - noImplicitThis
10
- - noImplicitReturns
11
- - strictNullChecks
12
- - noUnusedLocals
13
- - noUnusedParameters
14
-
15
- I would advise enabling these for all TypeScript projects from now on.
16
-
17
- #### Ordered imports and dependencies
18
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
19
- Please note that this also applies for imports from the folder the file is currently in.
20
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
21
- `import { ItemEntry } from '../models';`
22
-
23
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
24
- remove dependencies in the future.
25
-
26
- ### Breaking changes
27
-
28
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
29
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
30
- `moduleChangesCompilationFactory`.
31
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
32
- no longer supported in the back-end.
33
-
34
- #### Item and collection entries
35
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
36
- - Added the following functions to `ItemEntryService`:
37
- - `createLocalConversionMap`;
38
- - `expandLocalConversionMap`;
39
- - `expandConversionMap`;
40
- - `batchExpandConversionMap`;
41
- - `batchClone`.
42
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
43
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
44
-
45
- #### Rework item caching
46
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
47
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
48
- using the item administrator or when resources are created when adding the items to a collection.
49
-
50
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
51
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
52
- > pasting of items.
53
-
54
- Other changes:
55
-
56
- - Moved `saveLocal` to `ItemAdministrator`;
57
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
58
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
59
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
60
- already on the backend. (Use `getCollectionMatcher`.)
61
-
62
-
63
- ##v1.0.33
64
- - Really fix types path
65
-
66
- ##v1.0.33
67
- - Fix types path
68
-
69
- ##v1.0.32
70
- - Update `tsconfig.json` to put definitions in the root folder
71
- > The app had an issue with AOT compilation because of this
72
-
73
- ##v1.0.31
74
- - Fix `columnHandler.fetchItemTypeTranslations`
75
- > It incorrectly looped over the response map, it should now work again
76
-
77
- ##v1.0.30
78
- - Remove `updateTabParams` from LocalCacheManagerInterface
79
- > The function wasn't used
80
-
81
- - Reworked class export
82
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
83
-
84
- ##v1.0.29
85
- - Fix inverted inArray check in CollectionEntry.removeItems
86
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
87
-
88
- ##v1.0.28
89
- Bug fixes only
90
-
91
- ##v1.0.27
92
- - `ItemEntry.initial` is now undefined by default
93
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
94
-
95
- ##v1.0.26
96
- Bundle both minified and unminified code, include sourcemaps from dev build
97
-
98
- ##v1.0.24, v1.0.25
99
- ! Use version `v1.0.26` !
100
-
101
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
102
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
103
-
104
- - Rename `ItemEntry.entryId` to `ItemEntry.id
105
- > It used to be called `id`, but it was changed in the seperation of the core.
106
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
107
-
108
- - Rename ItemResource `startTransaction` to `start`
109
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
110
-
111
- - `SocketMessageHandler.onMessageReceived` now returns a promise
112
- > You can now use the updated items or hook into the result to update the ui for example
113
-
114
-
115
- ##v1.0.23
116
- - Rename ResourceCache to LocalCache
117
- > LocalCache only caches local items (name better reflects functionality)
118
-
119
- - Remove getter/setter for hasChanges
120
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
121
-
122
- - Remove `_getCollection` from ItemAdministrator
123
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
124
- > options and should not be given as a separate argument. This was included to support the frontend
125
-
126
- - Remove `saveCurrentTab` from ItemAdministrator
127
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
128
-
129
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
130
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
131
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ## v1.1.1
5
+ - Fixed an issue where changes wouldn't be detected.
6
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
7
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
8
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
9
+ `disableChangesWatcher` instead.
10
+
11
+ ## v1.1.0
12
+ ### Development
13
+
14
+ #### Strict TypeScript compilation
15
+ Added the following TypeScript compiler options:
16
+ - noImplicitThis
17
+ - noImplicitReturns
18
+ - strictNullChecks
19
+ - noUnusedLocals
20
+ - noUnusedParameters
21
+
22
+ I would advise enabling these for all TypeScript projects from now on.
23
+
24
+ #### Ordered imports and dependencies
25
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
26
+ Please note that this also applies for imports from the folder the file is currently in.
27
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
28
+ `import { ItemEntry } from '../models';`
29
+
30
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
31
+ remove dependencies in the future.
32
+
33
+ ### Breaking changes
34
+
35
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
36
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
37
+ `moduleChangesCompilationFactory`.
38
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
39
+ no longer supported in the back-end.
40
+
41
+ #### Item and collection entries
42
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
43
+ - Added the following functions to `ItemEntryService`:
44
+ - `createLocalConversionMap`;
45
+ - `expandLocalConversionMap`;
46
+ - `expandConversionMap`;
47
+ - `batchExpandConversionMap`;
48
+ - `batchClone`.
49
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
50
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
51
+
52
+ #### Rework item caching
53
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
54
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
55
+ using the item administrator or when resources are created when adding the items to a collection.
56
+
57
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
58
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
59
+ > pasting of items.
60
+
61
+ Other changes:
62
+
63
+ - Moved `saveLocal` to `ItemAdministrator`;
64
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
65
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
66
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
67
+ already on the backend. (Use `getCollectionMatcher`.)
68
+
69
+
70
+ ##v1.0.33
71
+ - Really fix types path
72
+
73
+ ##v1.0.33
74
+ - Fix types path
75
+
76
+ ##v1.0.32
77
+ - Update `tsconfig.json` to put definitions in the root folder
78
+ > The app had an issue with AOT compilation because of this
79
+
80
+ ##v1.0.31
81
+ - Fix `columnHandler.fetchItemTypeTranslations`
82
+ > It incorrectly looped over the response map, it should now work again
83
+
84
+ ##v1.0.30
85
+ - Remove `updateTabParams` from LocalCacheManagerInterface
86
+ > The function wasn't used
87
+
88
+ - Reworked class export
89
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
90
+
91
+ ##v1.0.29
92
+ - Fix inverted inArray check in CollectionEntry.removeItems
93
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
94
+
95
+ ##v1.0.28
96
+ Bug fixes only
97
+
98
+ ##v1.0.27
99
+ - `ItemEntry.initial` is now undefined by default
100
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
101
+
102
+ ##v1.0.26
103
+ Bundle both minified and unminified code, include sourcemaps from dev build
104
+
105
+ ##v1.0.24, v1.0.25
106
+ ! Use version `v1.0.26` !
107
+
108
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
109
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
110
+
111
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
112
+ > It used to be called `id`, but it was changed in the seperation of the core.
113
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
114
+
115
+ - Rename ItemResource `startTransaction` to `start`
116
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
117
+
118
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
119
+ > You can now use the updated items or hook into the result to update the ui for example
120
+
121
+
122
+ ##v1.0.23
123
+ - Rename ResourceCache to LocalCache
124
+ > LocalCache only caches local items (name better reflects functionality)
125
+
126
+ - Remove getter/setter for hasChanges
127
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
128
+
129
+ - Remove `_getCollection` from ItemAdministrator
130
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
131
+ > options and should not be given as a separate argument. This was included to support the frontend
132
+
133
+ - Remove `saveCurrentTab` from ItemAdministrator
134
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
135
+
136
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
137
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
138
+
@@ -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 | "" | 0 | moment.Moment | 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;
@@ -93,7 +93,7 @@ export declare class ItemAdministrator {
93
93
  updateItemIdMap(collectionMap: any, conversionMap: any): void;
94
94
  createCollectionResource(collectionEntry: any, resourceOptions: any, processOptions?: boolean): CollectionResource;
95
95
  createItemResource(itemEntry: any, options: any, isRoot: boolean): ItemResource;
96
- onBeforeSave(key: string, callback: any): () => void;
97
- onSaveSuccess(key: string, callback: any): () => void;
98
- onSaveWithoutClosing(key: string, callback: any): () => void;
96
+ onBeforeSave(key: string, callback: any): () => boolean;
97
+ onSaveSuccess(key: string, callback: any): () => boolean;
98
+ onSaveWithoutClosing(key: string, callback: any): () => boolean;
99
99
  }
@@ -31,23 +31,14 @@ export declare class LocalCache {
31
31
  updateSingleItems(conversionMap: any): void;
32
32
  revertChanges(): any;
33
33
  resetCollection(collectionEntry: CollectionEntry): void;
34
- _hasChanges(): boolean;
35
34
  detectChanges(): boolean;
36
35
  private collectionHasChanges(collectionEntry);
37
36
  isLockable(): boolean;
38
37
  save(closeTab: boolean | undefined, parameters: any, breakUpByParent: any, onAfterCreateCallback: any): any;
39
38
  private executeCallbacks(event, ...args);
40
39
  enableChangesWatcher(): void;
41
- /**
42
- * @deprecated
43
- */
44
- enableWatcher(): void;
45
40
  disableChangesWatcher(): void;
46
- /**
47
- * @deprecated
48
- */
49
- disableWatcher(): void;
50
- registerCallback(event: string, key: string, callback: any): () => void;
41
+ registerCallback(event: string, key: string, callback: any): () => boolean;
51
42
  createItemResource(itemEntry: ItemEntry, options: any, isRoot?: boolean): ItemResource;
52
43
  createItemResources(itemEntries: ItemEntry[], options: any): ItemResource[];
53
44
  createCollectionResource(collectionEntry: CollectionEntry, resourceOptions: any): CollectionResource;