@adaptabletools/adaptable 15.0.0-canary.4 → 15.0.0-canary.6
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/base.css +1 -1
- package/base.css.map +1 -1
- package/bundle.cjs.js +146 -146
- package/index.css +1 -1
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +3 -0
- package/src/AdaptableOptions/FilterOptions.d.ts +5 -1
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +3 -0
- package/src/AdaptableOptions/MasterDetailPluginOptions.d.ts +3 -0
- package/src/AdaptableOptions/PredicateOptions.d.ts +3 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -0
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +31 -5
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +4 -0
- package/src/Api/Implementation/TeamSharingApiImpl.d.ts +8 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +64 -9
- package/src/Api/Internal/FilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/FilterInternalApi.js +10 -1
- package/src/Api/Internal/TeamSharingInternalApi.d.ts +3 -4
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -4
- package/src/Api/StyledColumnApi.d.ts +4 -0
- package/src/Api/TeamSharingApi.d.ts +38 -12
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +3 -0
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +9 -0
- package/src/PredefinedConfig/Common/RowHighlightInfo.d.ts +3 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +3 -0
- package/src/PredefinedConfig/ExportState.d.ts +3 -0
- package/src/PredefinedConfig/FormatColumnState.d.ts +3 -0
- package/src/PredefinedConfig/TeamSharingState.d.ts +86 -7
- package/src/PredefinedConfig/TeamSharingState.js +5 -0
- package/src/Redux/ActionsReducers/TeamSharingRedux.d.ts +13 -7
- package/src/Redux/ActionsReducers/TeamSharingRedux.js +8 -1
- package/src/Redux/Store/AdaptableStore.js +56 -13
- package/src/Strategy/TeamSharingModule.d.ts +3 -3
- package/src/Strategy/TeamSharingModule.js +6 -7
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +5 -2
- package/src/Utilities/Services/Interface/ITeamSharingService.d.ts +7 -6
- package/src/Utilities/Services/TeamSharingService.d.ts +7 -6
- package/src/Utilities/Services/TeamSharingService.js +23 -5
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +2 -2
- package/src/View/Components/Buttons/ButtonShare.d.ts +2 -2
- package/src/View/Components/Buttons/EntityListActionButtons.d.ts +2 -2
- package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +2 -2
- package/src/View/Components/Popups/AdaptablePopupTeamSharing.d.ts +2 -2
- package/src/View/Components/SharedProps/ConfigEntityRowProps.d.ts +2 -2
- package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +2 -2
- package/src/View/TeamSharing/SharedEntityDependencies.d.ts +3 -3
- package/src/View/TeamSharing/SharedEntityObjectView.d.ts +4 -4
- package/src/View/TeamSharing/SharedEntityObjectView.js +5 -6
- package/src/View/Theme/ThemePopup.js +2 -3
- package/src/agGrid/Adaptable.js +4 -0
- package/src/metamodel/adaptable.metamodel.d.ts +218 -10
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
-
import {
|
|
2
|
+
import { AdaptableSharedEntity } from '../../PredefinedConfig/TeamSharingState';
|
|
3
3
|
export declare class TeamSharingInternalApi extends ApiBase {
|
|
4
4
|
/**
|
|
5
5
|
* Fires the Team Sharing Entity Changed Event
|
|
6
6
|
* @param sharedEntity Entity that has been changed
|
|
7
7
|
*/
|
|
8
|
-
fireTeamSharingEntityChangedEvent(sharedEntity:
|
|
8
|
+
fireTeamSharingEntityChangedEvent(sharedEntity: AdaptableSharedEntity): void;
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves shared entry dependencies.
|
|
11
11
|
*/
|
|
12
|
-
getSharedEntryDependencies(sharedEntity:
|
|
13
|
-
getLocalTeamSharingEntities(): SharedEntity[];
|
|
12
|
+
getSharedEntryDependencies(sharedEntity: AdaptableSharedEntity): AdaptableSharedEntity[];
|
|
14
13
|
waitForTeamSharingImportEnd(): Promise<boolean>;
|
|
15
14
|
}
|
|
@@ -21,12 +21,9 @@ class TeamSharingInternalApi extends ApiBase_1.ApiBase {
|
|
|
21
21
|
*/
|
|
22
22
|
getSharedEntryDependencies(sharedEntity) {
|
|
23
23
|
var _a;
|
|
24
|
-
const allEntities = this.getTeamSharingApi().
|
|
24
|
+
const allEntities = this.getTeamSharingApi().getLoadedAdaptableSharedEntities();
|
|
25
25
|
return ((_a = sharedEntity === null || sharedEntity === void 0 ? void 0 : sharedEntity.EntityDependencyIds) !== null && _a !== void 0 ? _a : []).map((id) => allEntities.find((entity) => entity.Uuid === id));
|
|
26
26
|
}
|
|
27
|
-
getLocalTeamSharingEntities() {
|
|
28
|
-
return this.getAdaptableState().TeamSharing.SharedEntities;
|
|
29
|
-
}
|
|
30
27
|
waitForTeamSharingImportEnd() {
|
|
31
28
|
// we have no deterministic means to ensure the teamsharing import is finished (because the import actions are opaque and may have side-effects)
|
|
32
29
|
// therefore we will listen for state changes and
|
|
@@ -91,6 +91,10 @@ export interface StyledColumnApi {
|
|
|
91
91
|
* @param column Column to check
|
|
92
92
|
*/
|
|
93
93
|
getActiveStyledColumnForColumn(column: AdaptableColumn): StyledColumn | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Open Styled Column section of Settings Panel
|
|
96
|
+
*/
|
|
97
|
+
openStyledColumnSettingsPanel(): void;
|
|
94
98
|
/**
|
|
95
99
|
* TO BE REMOVED
|
|
96
100
|
*/
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
|
|
2
|
-
import { SharedEntity } from '../PredefinedConfig/TeamSharingState';
|
|
3
|
-
import { AdaptableModule,
|
|
2
|
+
import { AdaptableSharedEntity, CustomSharedEntity, CustomSharedEntityConfig, SharedEntity } from '../PredefinedConfig/TeamSharingState';
|
|
3
|
+
import { AdaptableModule, AdaptableSharedEntityConfig } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Provides run-time access to Team Sharing Module and associated state
|
|
6
6
|
*/
|
|
7
7
|
export interface TeamSharingApi {
|
|
8
8
|
/**
|
|
9
|
-
* Retrieves all
|
|
9
|
+
* Retrieves all currently shared entities; async op leveraging `TeamSharingOptions.loadSharedEntities(...)` method
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
loadSharedEntities(): Promise<SharedEntity[]>;
|
|
12
12
|
/**
|
|
13
|
-
* Sets
|
|
13
|
+
* Sets currently shared entities; async op leveraging `TeamSharingOptions.persistSharedEntities(...)` method
|
|
14
14
|
* @param sharedEntities the shared entities
|
|
15
15
|
* @return either TRUE if the shared entities were successfully set or FALSE if the shared entities were not set
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
persistSharedEntities(sharedEntities: SharedEntity[]): Promise<boolean>;
|
|
18
18
|
/**
|
|
19
|
-
* Whether Team Sharing is
|
|
19
|
+
* Whether Team Sharing is available to use
|
|
20
20
|
*/
|
|
21
21
|
isTeamSharingAvailable(): boolean;
|
|
22
22
|
/**
|
|
@@ -33,14 +33,20 @@ export interface TeamSharingApi {
|
|
|
33
33
|
checkForUpdates(): void;
|
|
34
34
|
/**
|
|
35
35
|
* Puts an Adaptable Object into Team Share
|
|
36
|
-
* @param
|
|
36
|
+
* @param adaptableObject Adaptable Object to Share
|
|
37
37
|
* @param module module which Shared Entity belongs to
|
|
38
38
|
* @param sharedEntityConfig Config info about the Sharing Actions
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
shareAdaptableEntity(adaptableObject: AdaptableObject, module: AdaptableModule, sharedEntityConfig: AdaptableSharedEntityConfig): void;
|
|
41
|
+
/**
|
|
42
|
+
* Puts an custom Object into Team Share
|
|
43
|
+
* @param customObject custom object to Share
|
|
44
|
+
* @param sharedEntityConfig shared entity config
|
|
45
|
+
*/
|
|
46
|
+
shareCustomEntity(customObject: any, sharedEntityConfig: CustomSharedEntityConfig): void;
|
|
41
47
|
/**
|
|
42
|
-
* Removes
|
|
43
|
-
* @param entityId the ID of the
|
|
48
|
+
* Removes a Shared Entity from the Team Share.
|
|
49
|
+
* @param entityId the technical ID (`SharedEntity.Uuid`) of the Shared Entity to be removed from Team Share
|
|
44
50
|
*/
|
|
45
51
|
unshareEntity(entityId: string): void;
|
|
46
52
|
/**
|
|
@@ -50,9 +56,17 @@ export interface TeamSharingApi {
|
|
|
50
56
|
*/
|
|
51
57
|
importSharedEntry(sharedEntity: SharedEntity): void;
|
|
52
58
|
/**
|
|
53
|
-
* Retrieves
|
|
59
|
+
* Retrieves all locally loaded shared entries (`AdaptableSharedEntity` & `CustomSharedEntity`).
|
|
54
60
|
*/
|
|
55
61
|
getLoadedSharedEntities(): SharedEntity[];
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves locally loaded Adaptable Shared Entries.
|
|
64
|
+
*/
|
|
65
|
+
getLoadedAdaptableSharedEntities(): AdaptableSharedEntity[];
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves locally loaded Custom Shared Entries.
|
|
68
|
+
*/
|
|
69
|
+
getLoadedCustomSharedEntities(): CustomSharedEntity[];
|
|
56
70
|
/**
|
|
57
71
|
* Refreshes the local TeamSharing state by (re)loading the remote state.
|
|
58
72
|
*/
|
|
@@ -68,4 +82,16 @@ export interface TeamSharingApi {
|
|
|
68
82
|
* @deprecated use `refreshTeamSharing()` instead
|
|
69
83
|
*/
|
|
70
84
|
triggerLoadingTeamSharingEntries(): void;
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated use `loadSharedEntities()` instead ()
|
|
87
|
+
*/
|
|
88
|
+
getSharedEntities(): Promise<SharedEntity[]>;
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated use `persistSharedEntities()` instead
|
|
91
|
+
*/
|
|
92
|
+
setSharedEntities(sharedEntities: SharedEntity[]): Promise<boolean>;
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated use `shareAdaptableEntity()` instead
|
|
95
|
+
*/
|
|
96
|
+
shareEntity(entity: AdaptableObject, module: AdaptableModule, sharedEntityConfig: AdaptableSharedEntityConfig): void;
|
|
71
97
|
}
|
|
@@ -138,6 +138,9 @@ exports.SystemPredicateDefs = [
|
|
|
138
138
|
if (typeof value === 'string' && !StringExtensions_1.default.IsNumeric(value)) {
|
|
139
139
|
return false;
|
|
140
140
|
}
|
|
141
|
+
if (Helper_1.default.objectNotExists(value)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
141
144
|
return Number(value) === 0;
|
|
142
145
|
},
|
|
143
146
|
},
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export declare const WEIGHTED_AVERAGE_AGG_FN_NAME = "weightedAvg";
|
|
2
|
+
/**
|
|
3
|
+
* Defines a Weighted Average Agg
|
|
4
|
+
*/
|
|
2
5
|
export interface WeightedAverageAggregation {
|
|
6
|
+
/**
|
|
7
|
+
* Type is always 'weightedAverage'
|
|
8
|
+
*/
|
|
3
9
|
type: 'weightedAverage';
|
|
10
|
+
/**
|
|
11
|
+
* Column which is weighted
|
|
12
|
+
*/
|
|
4
13
|
weightedColumnId: string;
|
|
5
14
|
}
|
|
6
15
|
export declare type AggregationColumns = Record<string, string | true | WeightedAverageAggregation>;
|
|
@@ -56,6 +56,9 @@ export interface FormatColumn extends SuspendableObject {
|
|
|
56
56
|
export declare type FormatColumnRule = XOR<{
|
|
57
57
|
Predicates: FormatColumnPredicate[];
|
|
58
58
|
}, AdaptableBooleanQuery>;
|
|
59
|
+
/**
|
|
60
|
+
* Predicate used when creating a Format Column
|
|
61
|
+
*/
|
|
59
62
|
export interface FormatColumnPredicate extends AdaptableColumnPredicate {
|
|
60
63
|
PredicateId: TypeHint<string, SystemFormatColumnPredicateId>;
|
|
61
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalState } from './InternalState';
|
|
2
|
-
import { AdaptableObject } from './Common/AdaptableObject';
|
|
2
|
+
import { AdaptableObject, AdaptableObjectTag } from './Common/AdaptableObject';
|
|
3
3
|
import { AdaptableModule } from '../types';
|
|
4
4
|
import { TypeUuid } from './Uuid';
|
|
5
5
|
import * as Redux from 'redux';
|
|
@@ -15,7 +15,7 @@ export interface TeamSharingState extends InternalState {
|
|
|
15
15
|
* Mapping of active AdaptableObjects which are shared with the local state.
|
|
16
16
|
* Maps UUIDs of local AdaptableObjects to a snapshot of the latest synchronized SharedEntity
|
|
17
17
|
*/
|
|
18
|
-
ActiveSharedEntityMap: Record<TypeUuid,
|
|
18
|
+
ActiveSharedEntityMap: Record<TypeUuid, AdaptableSharedEntity>;
|
|
19
19
|
/**
|
|
20
20
|
* TRUE if an import is in progress, FALSE otherwise.
|
|
21
21
|
* This is required to skip the TEAMSHARING_UPDATE_ITEM action as a result of the import
|
|
@@ -25,7 +25,17 @@ export interface TeamSharingState extends InternalState {
|
|
|
25
25
|
/**
|
|
26
26
|
* Defines an object used in Team Sharing
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export declare type SharedEntity = AdaptableSharedEntity | CustomSharedEntity;
|
|
29
|
+
export declare const isAdaptableSharedEntity: (entity: SharedEntity) => entity is AdaptableSharedEntity;
|
|
30
|
+
export declare const isCustomSharedEntity: (entity: SharedEntity) => entity is CustomSharedEntity;
|
|
31
|
+
/**
|
|
32
|
+
* Defines an AdaptableObject shared with Team Sharing
|
|
33
|
+
*/
|
|
34
|
+
export interface AdaptableSharedEntity extends AdaptableObject {
|
|
35
|
+
/**
|
|
36
|
+
* Type of shared entity (either Adaptable specific or custom object)
|
|
37
|
+
*/
|
|
38
|
+
EntityType: 'adaptableEntity';
|
|
29
39
|
/**
|
|
30
40
|
* Actual Adaptable Object being shared
|
|
31
41
|
*/
|
|
@@ -67,6 +77,51 @@ export interface SharedEntity extends AdaptableObject {
|
|
|
67
77
|
*/
|
|
68
78
|
Type: SharedEntityType;
|
|
69
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
export interface CustomSharedEntity {
|
|
84
|
+
/**
|
|
85
|
+
* Type of shared entity (either Adaptable specific or custom object)
|
|
86
|
+
*/
|
|
87
|
+
EntityType: 'customEntity';
|
|
88
|
+
/**
|
|
89
|
+
* Unique identifier for the Custom Shared Entity
|
|
90
|
+
*/
|
|
91
|
+
Uuid: TypeUuid;
|
|
92
|
+
/**
|
|
93
|
+
* Name of object being shared
|
|
94
|
+
*/
|
|
95
|
+
Name: string;
|
|
96
|
+
/**
|
|
97
|
+
* Description of object being shared
|
|
98
|
+
*/
|
|
99
|
+
Description: string;
|
|
100
|
+
/**
|
|
101
|
+
* Custom Object being shared
|
|
102
|
+
*/
|
|
103
|
+
Entity: any;
|
|
104
|
+
/**
|
|
105
|
+
* When the object was shared
|
|
106
|
+
*/
|
|
107
|
+
Timestamp: number;
|
|
108
|
+
/**
|
|
109
|
+
* User who shared the object
|
|
110
|
+
*/
|
|
111
|
+
UserName: string;
|
|
112
|
+
/**
|
|
113
|
+
* Last User who changed the object
|
|
114
|
+
*/
|
|
115
|
+
ChangedBy: string;
|
|
116
|
+
/**
|
|
117
|
+
* Last time when the object was changed
|
|
118
|
+
*/
|
|
119
|
+
ChangedAt: number;
|
|
120
|
+
/**
|
|
121
|
+
* List of Tags associated with the Object
|
|
122
|
+
*/
|
|
123
|
+
Tags?: AdaptableObjectTag[];
|
|
124
|
+
}
|
|
70
125
|
/**
|
|
71
126
|
* Defines Objects which have been imported into Team Sharing
|
|
72
127
|
*/
|
|
@@ -76,19 +131,43 @@ export interface TeamSharingImportInfo<T extends AdaptableObject> {
|
|
|
76
131
|
EditAction: (entity: T) => any;
|
|
77
132
|
}
|
|
78
133
|
/**
|
|
79
|
-
* Describes an
|
|
134
|
+
* Describes an AdaptableObject which is being Team Shared
|
|
80
135
|
*/
|
|
81
|
-
export interface
|
|
136
|
+
export interface AdaptableSharedEntityConfig {
|
|
82
137
|
description: string;
|
|
83
138
|
type: SharedEntityType;
|
|
84
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Describes a custom Object which is being Team Shared
|
|
142
|
+
*/
|
|
143
|
+
export interface CustomSharedEntityConfig {
|
|
144
|
+
/**
|
|
145
|
+
* Optional technical ID; if not provided, it will be auto-generated by Adaptable
|
|
146
|
+
*/
|
|
147
|
+
Uuid?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Name of object being shared
|
|
150
|
+
*/
|
|
151
|
+
Name: string;
|
|
152
|
+
/**
|
|
153
|
+
* Description of object being shared
|
|
154
|
+
*/
|
|
155
|
+
Description: string;
|
|
156
|
+
/**
|
|
157
|
+
* List of Tags associated with the Object
|
|
158
|
+
*/
|
|
159
|
+
Tags?: AdaptableObjectTag[];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Type of Shared Entity - Snapshot or Active
|
|
163
|
+
*/
|
|
85
164
|
export declare type SharedEntityType = 'Snapshot' | 'Active';
|
|
86
165
|
export interface TeamSharingImportStep {
|
|
87
|
-
sharedEntity:
|
|
166
|
+
sharedEntity: AdaptableSharedEntity;
|
|
88
167
|
importAction: Redux.Action;
|
|
89
168
|
}
|
|
90
169
|
export declare type SharedEntityActiveStatus = Record<TypeUuid, {
|
|
91
|
-
sharedEntity:
|
|
170
|
+
sharedEntity: AdaptableSharedEntity;
|
|
92
171
|
importedRevision: number;
|
|
93
172
|
sharedRevision: number;
|
|
94
173
|
}>;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCustomSharedEntity = exports.isAdaptableSharedEntity = void 0;
|
|
4
|
+
const isAdaptableSharedEntity = (entity) => entity.EntityType === 'adaptableEntity';
|
|
5
|
+
exports.isAdaptableSharedEntity = isAdaptableSharedEntity;
|
|
6
|
+
const isCustomSharedEntity = (entity) => entity.EntityType === 'customEntity';
|
|
7
|
+
exports.isCustomSharedEntity = isCustomSharedEntity;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TeamSharingState, SharedEntity,
|
|
1
|
+
import { TeamSharingState, SharedEntity, AdaptableSharedEntityConfig, TeamSharingImportStep, AdaptableSharedEntity, CustomSharedEntityConfig } from '../../PredefinedConfig/TeamSharingState';
|
|
2
2
|
import * as Redux from 'redux';
|
|
3
3
|
import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
|
|
4
4
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
5
5
|
export declare const TEAMSHARING_GET = "TEAMSHARING_GET";
|
|
6
6
|
export declare const TEAMSHARING_SET = "TEAMSHARING_SET";
|
|
7
7
|
export declare const TEAMSHARING_SHARE = "TEAMSHARING_SHARE";
|
|
8
|
+
export declare const TEAMSHARING_SHARE_CUSTOM = "TEAMSHARING_SHARE_CUSTOM";
|
|
8
9
|
export declare const TEAMSHARING_IMPORT_ITEM = "TEAMSHARING_IMPORT_ITEM";
|
|
9
10
|
export declare const TEAMSHARING_PROCESS_IMPORT = "TEAMSHARING_PROCESS_IMPORT";
|
|
10
11
|
export declare const TEAMSHARING_COMMIT_IMPORT = "TEAMSHARING_COMMIT_IMPORT";
|
|
@@ -15,13 +16,17 @@ export declare const TEAMSHARING_CHECK_FOR_UPDATES = "TEAMSHARING_CHECK_FOR_UPDA
|
|
|
15
16
|
export interface TeamSharingShareAction extends Redux.Action {
|
|
16
17
|
Entity: AdaptableObject;
|
|
17
18
|
Module: AdaptableModule;
|
|
18
|
-
Configuration:
|
|
19
|
+
Configuration: AdaptableSharedEntityConfig;
|
|
20
|
+
}
|
|
21
|
+
export interface TeamSharingShareCustomAction extends Redux.Action {
|
|
22
|
+
Entity: any;
|
|
23
|
+
Configuration: CustomSharedEntityConfig;
|
|
19
24
|
}
|
|
20
25
|
export interface TeamSharingSetAction extends Redux.Action {
|
|
21
26
|
Entities: SharedEntity[];
|
|
22
27
|
}
|
|
23
28
|
export interface TeamSharingImportItemAction extends Redux.Action {
|
|
24
|
-
SharedEntity:
|
|
29
|
+
SharedEntity: AdaptableSharedEntity;
|
|
25
30
|
}
|
|
26
31
|
export interface TeamSharingProcessImportAction extends Redux.Action {
|
|
27
32
|
ImportSteps: TeamSharingImportStep[];
|
|
@@ -36,20 +41,21 @@ export interface TeamSharingUpdateItemAction extends Redux.Action {
|
|
|
36
41
|
UserName: string;
|
|
37
42
|
}
|
|
38
43
|
export interface TeamSharingLinkItemAction extends Redux.Action {
|
|
39
|
-
SharedEntities:
|
|
44
|
+
SharedEntities: AdaptableSharedEntity[];
|
|
40
45
|
}
|
|
41
46
|
export interface TeamSharingCommitImportAction extends Redux.Action {
|
|
42
47
|
}
|
|
43
48
|
export interface TeamSharingCheckForUpdatesAction extends Redux.Action {
|
|
44
49
|
}
|
|
45
|
-
export declare const TeamSharingShare: (entity: AdaptableObject, module: AdaptableModule, configuration:
|
|
50
|
+
export declare const TeamSharingShare: (entity: AdaptableObject, module: AdaptableModule, configuration: AdaptableSharedEntityConfig) => TeamSharingShareAction;
|
|
51
|
+
export declare const TeamSharingShareCustom: (entity: AdaptableObject, configuration: CustomSharedEntityConfig) => TeamSharingShareCustomAction;
|
|
46
52
|
export declare const TeamSharingSet: (Entities: SharedEntity[]) => TeamSharingSetAction;
|
|
47
|
-
export declare const TeamSharingImportItem: (SharedEntity:
|
|
53
|
+
export declare const TeamSharingImportItem: (SharedEntity: AdaptableSharedEntity) => TeamSharingImportItemAction;
|
|
48
54
|
export declare const TeamSharingProcessImport: (ImportSteps: TeamSharingImportStep[]) => TeamSharingProcessImportAction;
|
|
49
55
|
export declare const TeamSharingCommitImport: () => TeamSharingCommitImportAction;
|
|
50
56
|
export declare const TeamSharingRemoveItem: (Uuid: string) => TeamSharingRemoveItemAction;
|
|
51
57
|
export declare const TeamSharingGet: () => TeamSharingGetAction;
|
|
52
|
-
export declare const TeamSharingLinkItem: (...SharedEntities:
|
|
58
|
+
export declare const TeamSharingLinkItem: (...SharedEntities: AdaptableSharedEntity[]) => TeamSharingLinkItemAction;
|
|
53
59
|
export declare const TeamSharingUpdateItem: (ChangedAdaptableObject: AdaptableObject, UserName: string) => TeamSharingUpdateItemAction;
|
|
54
60
|
export declare const TeamSharingCheckForUpdates: () => TeamSharingGetAction;
|
|
55
61
|
export declare const TeamSharingReducer: Redux.Reducer<TeamSharingState>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TeamSharingReducer = exports.TeamSharingCheckForUpdates = exports.TeamSharingUpdateItem = exports.TeamSharingLinkItem = exports.TeamSharingGet = exports.TeamSharingRemoveItem = exports.TeamSharingCommitImport = exports.TeamSharingProcessImport = exports.TeamSharingImportItem = exports.TeamSharingSet = exports.TeamSharingShare = exports.TEAMSHARING_CHECK_FOR_UPDATES = exports.TEAMSHARING_UPDATE_ITEM = exports.TEAMSHARING_LINK_ITEM = exports.TEAMSHARING_REMOVE_ITEM = exports.TEAMSHARING_COMMIT_IMPORT = exports.TEAMSHARING_PROCESS_IMPORT = exports.TEAMSHARING_IMPORT_ITEM = exports.TEAMSHARING_SHARE = exports.TEAMSHARING_SET = exports.TEAMSHARING_GET = void 0;
|
|
3
|
+
exports.TeamSharingReducer = exports.TeamSharingCheckForUpdates = exports.TeamSharingUpdateItem = exports.TeamSharingLinkItem = exports.TeamSharingGet = exports.TeamSharingRemoveItem = exports.TeamSharingCommitImport = exports.TeamSharingProcessImport = exports.TeamSharingImportItem = exports.TeamSharingSet = exports.TeamSharingShareCustom = exports.TeamSharingShare = exports.TEAMSHARING_CHECK_FOR_UPDATES = exports.TEAMSHARING_UPDATE_ITEM = exports.TEAMSHARING_LINK_ITEM = exports.TEAMSHARING_REMOVE_ITEM = exports.TEAMSHARING_COMMIT_IMPORT = exports.TEAMSHARING_PROCESS_IMPORT = exports.TEAMSHARING_IMPORT_ITEM = exports.TEAMSHARING_SHARE_CUSTOM = exports.TEAMSHARING_SHARE = exports.TEAMSHARING_SET = exports.TEAMSHARING_GET = void 0;
|
|
4
4
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
5
5
|
exports.TEAMSHARING_GET = 'TEAMSHARING_GET';
|
|
6
6
|
exports.TEAMSHARING_SET = 'TEAMSHARING_SET';
|
|
7
7
|
exports.TEAMSHARING_SHARE = 'TEAMSHARING_SHARE';
|
|
8
|
+
exports.TEAMSHARING_SHARE_CUSTOM = 'TEAMSHARING_SHARE_CUSTOM';
|
|
8
9
|
exports.TEAMSHARING_IMPORT_ITEM = 'TEAMSHARING_IMPORT_ITEM';
|
|
9
10
|
exports.TEAMSHARING_PROCESS_IMPORT = 'TEAMSHARING_PROCESS_IMPORT';
|
|
10
11
|
exports.TEAMSHARING_COMMIT_IMPORT = 'TEAMSHARING_COMMIT_IMPORT';
|
|
@@ -19,6 +20,12 @@ const TeamSharingShare = (entity, module, configuration) => ({
|
|
|
19
20
|
Configuration: configuration,
|
|
20
21
|
});
|
|
21
22
|
exports.TeamSharingShare = TeamSharingShare;
|
|
23
|
+
const TeamSharingShareCustom = (entity, configuration) => ({
|
|
24
|
+
type: exports.TEAMSHARING_SHARE_CUSTOM,
|
|
25
|
+
Entity: entity,
|
|
26
|
+
Configuration: configuration,
|
|
27
|
+
});
|
|
28
|
+
exports.TeamSharingShareCustom = TeamSharingShareCustom;
|
|
22
29
|
const TeamSharingSet = (Entities) => ({
|
|
23
30
|
type: exports.TEAMSHARING_SET,
|
|
24
31
|
Entities,
|
|
@@ -46,6 +46,7 @@ const AdaptableAlert_1 = require("../../PredefinedConfig/Common/AdaptableAlert")
|
|
|
46
46
|
const AdaptableToaster_1 = require("../../View/Components/Popups/AdaptableToaster");
|
|
47
47
|
const SystemRedux_1 = require("../ActionsReducers/SystemRedux");
|
|
48
48
|
const PopupRedux_1 = require("../ActionsReducers/PopupRedux");
|
|
49
|
+
const TeamSharingState_1 = require("../../PredefinedConfig/TeamSharingState");
|
|
49
50
|
exports.INIT_STATE = 'INIT_STATE';
|
|
50
51
|
exports.LOAD_STATE = 'LOAD_STATE';
|
|
51
52
|
const NON_PERSIST_ACTIONS = {
|
|
@@ -1187,7 +1188,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1187
1188
|
case TeamSharingRedux.TEAMSHARING_GET: {
|
|
1188
1189
|
let returnAction = next(action);
|
|
1189
1190
|
adaptable.api.teamSharingApi
|
|
1190
|
-
.
|
|
1191
|
+
.loadSharedEntities()
|
|
1191
1192
|
.then((sharedEntities) => {
|
|
1192
1193
|
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(sharedEntities));
|
|
1193
1194
|
})
|
|
@@ -1202,6 +1203,45 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1202
1203
|
});
|
|
1203
1204
|
return returnAction;
|
|
1204
1205
|
}
|
|
1206
|
+
case TeamSharingRedux.TEAMSHARING_SHARE_CUSTOM: {
|
|
1207
|
+
const actionTyped = action;
|
|
1208
|
+
let returnAction = next(action);
|
|
1209
|
+
const { Entity, Configuration } = actionTyped;
|
|
1210
|
+
let shareSuccessful;
|
|
1211
|
+
// load latest state from TeamSharing server
|
|
1212
|
+
adaptable.api.teamSharingApi
|
|
1213
|
+
.loadSharedEntities()
|
|
1214
|
+
.then((sharedEntities) => {
|
|
1215
|
+
const customSharedEntity = adaptable.api.internalApi
|
|
1216
|
+
.getTeamSharingService()
|
|
1217
|
+
.buildCustomSharedEntity(Entity, Configuration);
|
|
1218
|
+
let newCustomShare = true;
|
|
1219
|
+
const updatedSharedEntities = sharedEntities.map((entity) => {
|
|
1220
|
+
// if it has the same UUID, override it
|
|
1221
|
+
if ((0, TeamSharingState_1.isCustomSharedEntity)(entity) && entity.Uuid === customSharedEntity.Uuid) {
|
|
1222
|
+
newCustomShare = false;
|
|
1223
|
+
return Object.assign(Object.assign({}, customSharedEntity), { ChangedAt: Date.now(), ChangedBy: adaptable.api.optionsApi.getUserName() });
|
|
1224
|
+
}
|
|
1225
|
+
return entity;
|
|
1226
|
+
});
|
|
1227
|
+
if (newCustomShare) {
|
|
1228
|
+
updatedSharedEntities.push(customSharedEntity);
|
|
1229
|
+
}
|
|
1230
|
+
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(updatedSharedEntities));
|
|
1231
|
+
// update the server state
|
|
1232
|
+
shareSuccessful = true;
|
|
1233
|
+
return adaptable.api.teamSharingApi.persistSharedEntities(updatedSharedEntities);
|
|
1234
|
+
})
|
|
1235
|
+
.then(() => {
|
|
1236
|
+
if (shareSuccessful) {
|
|
1237
|
+
(0, LoggingHelper_1.LogAdaptableInfo)(`Custom Shared Object '${Configuration.Name}' Shared Successfully`);
|
|
1238
|
+
}
|
|
1239
|
+
})
|
|
1240
|
+
.catch((error) => {
|
|
1241
|
+
(0, LoggingHelper_1.LogAdaptableError)('TeamSharing share error : ' + error.message, actionTyped.Entity);
|
|
1242
|
+
});
|
|
1243
|
+
return returnAction;
|
|
1244
|
+
}
|
|
1205
1245
|
// share the given AdaptableObject:
|
|
1206
1246
|
// - if it has dependencies, share them as well
|
|
1207
1247
|
// - if it's active, ensure that there is not already one present
|
|
@@ -1213,7 +1253,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1213
1253
|
let shareSuccessful;
|
|
1214
1254
|
// load latest state from TeamSharing server
|
|
1215
1255
|
adaptable.api.teamSharingApi
|
|
1216
|
-
.
|
|
1256
|
+
.loadSharedEntities()
|
|
1217
1257
|
.then((sharedEntities) => {
|
|
1218
1258
|
// check if there is not already one active SharedEntity for this object
|
|
1219
1259
|
const existingActiveSharedEntity = Configuration.type === 'Active' &&
|
|
@@ -1222,7 +1262,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1222
1262
|
middlewareAPI.dispatch(PopupRedux.PopupShowAlert({
|
|
1223
1263
|
alertType: 'generic',
|
|
1224
1264
|
header: 'Team Sharing',
|
|
1225
|
-
message: `Couldn't share ${adaptable.api.internalApi.getModuleFriendlyName(
|
|
1265
|
+
message: `Couldn't share ${adaptable.api.internalApi.getModuleFriendlyName(Module)}, there is already an existing active share for it: ${existingActiveSharedEntity.Description}`,
|
|
1226
1266
|
alertDefinition: ObjectFactory_1.ObjectFactory.CreateInternalAlertDefinitionForMessages('Error'),
|
|
1227
1267
|
}));
|
|
1228
1268
|
shareSuccessful = false;
|
|
@@ -1238,7 +1278,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1238
1278
|
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(sharedEntities));
|
|
1239
1279
|
// update the server state
|
|
1240
1280
|
shareSuccessful = true;
|
|
1241
|
-
return adaptable.api.teamSharingApi.
|
|
1281
|
+
return adaptable.api.teamSharingApi.persistSharedEntities(sharedEntities);
|
|
1242
1282
|
})
|
|
1243
1283
|
.then(() => {
|
|
1244
1284
|
if (shareSuccessful) {
|
|
@@ -1266,14 +1306,16 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1266
1306
|
case TeamSharingRedux.TEAMSHARING_REMOVE_ITEM: {
|
|
1267
1307
|
let returnAction = next(action);
|
|
1268
1308
|
const actionTyped = action;
|
|
1309
|
+
const removedEntityId = actionTyped.Uuid;
|
|
1269
1310
|
// load latest state from TeamSharing server
|
|
1270
1311
|
adaptable.api.teamSharingApi
|
|
1271
|
-
.
|
|
1312
|
+
.loadSharedEntities()
|
|
1272
1313
|
.then((sharedEntities) => {
|
|
1273
1314
|
// ensure that no other SharedDependencies reference the to-be-deleted entity
|
|
1315
|
+
const adaptableSharedEntities = sharedEntities.filter(TeamSharingState_1.isAdaptableSharedEntity);
|
|
1274
1316
|
const sharedEntityDependants = adaptable.api.internalApi
|
|
1275
1317
|
.getTeamSharingService()
|
|
1276
|
-
.getSharedEntityDependants(
|
|
1318
|
+
.getSharedEntityDependants(removedEntityId, adaptableSharedEntities);
|
|
1277
1319
|
if (sharedEntityDependants.length) {
|
|
1278
1320
|
middlewareAPI.dispatch(PopupRedux.PopupShowAlert({
|
|
1279
1321
|
alertType: 'generic',
|
|
@@ -1286,10 +1328,10 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1286
1328
|
return;
|
|
1287
1329
|
}
|
|
1288
1330
|
// remove the deleted SharedEntity from local state
|
|
1289
|
-
const newSharedEntities = sharedEntities.filter((s) => s.Uuid !==
|
|
1331
|
+
const newSharedEntities = sharedEntities.filter((s) => s.Uuid !== removedEntityId);
|
|
1290
1332
|
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(newSharedEntities));
|
|
1291
1333
|
// update TeamSharing server
|
|
1292
|
-
return adaptable.api.teamSharingApi.
|
|
1334
|
+
return adaptable.api.teamSharingApi.persistSharedEntities(newSharedEntities);
|
|
1293
1335
|
})
|
|
1294
1336
|
.catch((error) => {
|
|
1295
1337
|
(0, LoggingHelper_1.LogAdaptableError)('TeamSharing remove error : ' + error.message);
|
|
@@ -1379,22 +1421,23 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1379
1421
|
}
|
|
1380
1422
|
const { ChangedAdaptableObject, UserName } = actionTyped;
|
|
1381
1423
|
adaptable.api.teamSharingApi
|
|
1382
|
-
.
|
|
1424
|
+
.loadSharedEntities()
|
|
1383
1425
|
.then((sharedEntities) => {
|
|
1426
|
+
const adaptableSharedEntities = sharedEntities.filter(TeamSharingState_1.isAdaptableSharedEntity);
|
|
1384
1427
|
// check if remote server has a newer revision
|
|
1385
1428
|
const [localRevision, remoteRevision] = adaptable.api.internalApi
|
|
1386
1429
|
.getTeamSharingService()
|
|
1387
|
-
.getSharedEntityLocalAndRemoteRevisions(ChangedAdaptableObject.Uuid,
|
|
1430
|
+
.getSharedEntityLocalAndRemoteRevisions(ChangedAdaptableObject.Uuid, adaptableSharedEntities);
|
|
1388
1431
|
if (remoteRevision > localRevision) {
|
|
1389
1432
|
// if remote has a newer version, we will NOT overwrite it
|
|
1390
1433
|
return;
|
|
1391
1434
|
}
|
|
1392
1435
|
const [updatedSharedEntities, newActiveEntities] = adaptable.api.internalApi
|
|
1393
1436
|
.getTeamSharingService()
|
|
1394
|
-
.updateActiveSharedEntity(ChangedAdaptableObject, UserName,
|
|
1437
|
+
.updateActiveSharedEntity(ChangedAdaptableObject, UserName, adaptableSharedEntities);
|
|
1395
1438
|
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingLinkItem(...newActiveEntities));
|
|
1396
1439
|
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(updatedSharedEntities));
|
|
1397
|
-
return adaptable.api.teamSharingApi.
|
|
1440
|
+
return adaptable.api.teamSharingApi.persistSharedEntities(updatedSharedEntities);
|
|
1398
1441
|
})
|
|
1399
1442
|
.catch((error) => {
|
|
1400
1443
|
(0, LoggingHelper_1.LogAdaptableError)('TeamSharing update active item error : ' + error.message);
|
|
@@ -1410,7 +1453,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1410
1453
|
case TeamSharingRedux.TEAMSHARING_CHECK_FOR_UPDATES: {
|
|
1411
1454
|
const returnAction = next(action);
|
|
1412
1455
|
adaptable.api.teamSharingApi
|
|
1413
|
-
.
|
|
1456
|
+
.loadSharedEntities()
|
|
1414
1457
|
.then((sharedEntities) => {
|
|
1415
1458
|
// update local state
|
|
1416
1459
|
middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(sharedEntities));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
2
2
|
import { AdaptableModuleView, AdaptableObjectView, IModule } from './Interface/IModule';
|
|
3
3
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
4
|
-
import {
|
|
4
|
+
import { AdaptableSharedEntity } from '../PredefinedConfig/TeamSharingState';
|
|
5
5
|
export declare class TeamSharingModule extends AdaptableModuleBase implements IModule {
|
|
6
6
|
private SKIP_TEAMSHARING_UPDATE_ACTIONS;
|
|
7
7
|
constructor(api: AdaptableApi);
|
|
@@ -10,12 +10,12 @@ export declare class TeamSharingModule extends AdaptableModuleBase implements IM
|
|
|
10
10
|
getPopupMaxWidth(): number | undefined;
|
|
11
11
|
private handleStateChanged;
|
|
12
12
|
private extractAdaptableObjectFromAction;
|
|
13
|
-
isAdaptableObjectPresentInLocalState(sharedEntity:
|
|
13
|
+
isAdaptableObjectPresentInLocalState(sharedEntity: AdaptableSharedEntity): boolean;
|
|
14
14
|
private isSharedEntityADependency;
|
|
15
15
|
private isStaleAndActive;
|
|
16
16
|
private getDependencies;
|
|
17
17
|
private getStaleDependencies;
|
|
18
|
-
toView(sharedEntity:
|
|
18
|
+
toView(sharedEntity: AdaptableSharedEntity): AdaptableObjectView;
|
|
19
19
|
toViewAll(): AdaptableObjectView[];
|
|
20
20
|
getViewProperties(): AdaptableModuleView;
|
|
21
21
|
}
|