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