@adaptabletools/adaptable 15.0.0-canary.4 → 15.0.0-canary.5

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.
Files changed (45) hide show
  1. package/base.css +1 -1
  2. package/base.css.map +1 -1
  3. package/bundle.cjs.js +146 -146
  4. package/index.css +1 -1
  5. package/index.css.map +1 -1
  6. package/package.json +1 -1
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableOptions/FilterOptions.d.ts +5 -1
  10. package/src/AdaptableOptions/TeamSharingOptions.d.ts +31 -5
  11. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +8 -2
  12. package/src/Api/Implementation/TeamSharingApiImpl.js +64 -9
  13. package/src/Api/Internal/FilterInternalApi.d.ts +1 -0
  14. package/src/Api/Internal/FilterInternalApi.js +10 -1
  15. package/src/Api/Internal/TeamSharingInternalApi.d.ts +3 -4
  16. package/src/Api/Internal/TeamSharingInternalApi.js +1 -4
  17. package/src/Api/TeamSharingApi.d.ts +36 -10
  18. package/src/PredefinedConfig/Common/AdaptablePredicate.js +3 -0
  19. package/src/PredefinedConfig/TeamSharingState.d.ts +89 -8
  20. package/src/PredefinedConfig/TeamSharingState.js +5 -0
  21. package/src/Redux/ActionsReducers/TeamSharingRedux.d.ts +13 -7
  22. package/src/Redux/ActionsReducers/TeamSharingRedux.js +8 -1
  23. package/src/Redux/Store/AdaptableStore.js +56 -13
  24. package/src/Strategy/TeamSharingModule.d.ts +3 -3
  25. package/src/Strategy/TeamSharingModule.js +6 -7
  26. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +5 -2
  27. package/src/Utilities/Services/Interface/ITeamSharingService.d.ts +7 -6
  28. package/src/Utilities/Services/TeamSharingService.d.ts +7 -6
  29. package/src/Utilities/Services/TeamSharingService.js +23 -5
  30. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +2 -2
  31. package/src/View/Components/Buttons/ButtonShare.d.ts +2 -2
  32. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +2 -2
  33. package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +2 -2
  34. package/src/View/Components/Popups/AdaptablePopupTeamSharing.d.ts +2 -2
  35. package/src/View/Components/SharedProps/ConfigEntityRowProps.d.ts +2 -2
  36. package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +2 -2
  37. package/src/View/TeamSharing/SharedEntityDependencies.d.ts +3 -3
  38. package/src/View/TeamSharing/SharedEntityObjectView.d.ts +4 -4
  39. package/src/View/TeamSharing/SharedEntityObjectView.js +5 -6
  40. package/src/View/Theme/ThemePopup.js +2 -3
  41. package/src/metamodel/adaptable.metamodel.d.ts +58 -16
  42. package/src/metamodel/adaptable.metamodel.js +1 -1
  43. package/src/types.d.ts +2 -2
  44. package/version.d.ts +1 -1
  45. package/version.js +1 -1
@@ -1,20 +1,20 @@
1
1
  import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
2
- import { SharedEntity } from '../PredefinedConfig/TeamSharingState';
3
- import { AdaptableModule, SharedEntityConfig } from '../types';
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 shared entities which are currently shared. It is an asynchronous operation as it leverages the `TeamSharingOptions.getSharedEntities(...)` method.
9
+ * Retrieves all shared entities which are currently shared. It is an asynchronous operation as it leverages the `TeamSharingOptions.loadSharedEntities(...)` method.
10
10
  */
11
- getSharedEntities(): Promise<SharedEntity[]>;
11
+ loadSharedEntities(): Promise<SharedEntity[]>;
12
12
  /**
13
- * Sets the shared entities which are currently shared. It is an asynchronous operation as it leverages the `TeamSharingOptions.setSharedEntities(...)` method.
13
+ * Sets the shared entities which are currently shared. It is an asynchronous operation as it leverages the `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
- setSharedEntities(sharedEntities: SharedEntity[]): Promise<boolean>;
17
+ persistSharedEntities(sharedEntities: SharedEntity[]): Promise<boolean>;
18
18
  /**
19
19
  * Whether Team Sharing is Available to use
20
20
  */
@@ -33,14 +33,20 @@ export interface TeamSharingApi {
33
33
  checkForUpdates(): void;
34
34
  /**
35
35
  * Puts an Adaptable Object into Team Share
36
- * @param entity entity to Share
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
- shareEntity(entity: AdaptableObject, module: AdaptableModule, sharedEntityConfig: SharedEntityConfig): void;
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 an Adaptable Object from the Team Share.
43
- * @param entityId the ID of the AdaptableObject to be removed from Team Share
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
  /**
@@ -53,6 +59,14 @@ export interface TeamSharingApi {
53
59
  * Retrieves already loaded shared entries.
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,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,21 +15,35 @@ 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, SharedEntity>;
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
22
22
  */
23
23
  importProcessInProgress: boolean;
24
24
  }
25
+ /**
26
+ * Any object that can be shared.
27
+ */
28
+ declare type ShareableEntity = Record<string, any> & AdaptableObject;
25
29
  /**
26
30
  * Defines an object used in Team Sharing
27
31
  */
28
- export interface SharedEntity extends AdaptableObject {
32
+ export declare type SharedEntity = AdaptableSharedEntity | CustomSharedEntity;
33
+ export declare const isAdaptableSharedEntity: (entity: SharedEntity) => entity is AdaptableSharedEntity;
34
+ export declare const isCustomSharedEntity: (entity: SharedEntity) => entity is CustomSharedEntity;
35
+ /**
36
+ * Defines an AdaptableObject shared with Team Sharing
37
+ */
38
+ export interface AdaptableSharedEntity extends AdaptableObject {
39
+ /**
40
+ * Type of shared entity (either Adaptable specific or custom object)
41
+ */
42
+ EntityType: 'adaptableEntity';
29
43
  /**
30
44
  * Actual Adaptable Object being shared
31
45
  */
32
- Entity: AdaptableObject;
46
+ Entity: ShareableEntity;
33
47
  /**
34
48
  * Ids of direct entity dependencies
35
49
  */
@@ -67,6 +81,51 @@ export interface SharedEntity extends AdaptableObject {
67
81
  */
68
82
  Type: SharedEntityType;
69
83
  }
84
+ /**
85
+ *
86
+ */
87
+ export interface CustomSharedEntity {
88
+ /**
89
+ * Type of shared entity (either Adaptable specific or custom object)
90
+ */
91
+ EntityType: 'customEntity';
92
+ /**
93
+ * Unique identifier for the Custom Shared Entity
94
+ */
95
+ Uuid: TypeUuid;
96
+ /**
97
+ * Name of object being shared
98
+ */
99
+ Name: string;
100
+ /**
101
+ * Description of object being shared
102
+ */
103
+ Description: string;
104
+ /**
105
+ * Custom Object being shared
106
+ */
107
+ Entity: any;
108
+ /**
109
+ * When the object was shared
110
+ */
111
+ Timestamp: number;
112
+ /**
113
+ * User who shared the object
114
+ */
115
+ UserName: string;
116
+ /**
117
+ * Last User who changed the object
118
+ */
119
+ ChangedBy: string;
120
+ /**
121
+ * Last time when the object was changed
122
+ */
123
+ ChangedAt: number;
124
+ /**
125
+ * List of Tags associated with the Object
126
+ */
127
+ Tags?: AdaptableObjectTag[];
128
+ }
70
129
  /**
71
130
  * Defines Objects which have been imported into Team Sharing
72
131
  */
@@ -76,19 +135,41 @@ export interface TeamSharingImportInfo<T extends AdaptableObject> {
76
135
  EditAction: (entity: T) => any;
77
136
  }
78
137
  /**
79
- * Describes an Object which is being Team Shared
138
+ * Describes an AdaptableObject which is being Team Shared
80
139
  */
81
- export interface SharedEntityConfig {
140
+ export interface AdaptableSharedEntityConfig {
82
141
  description: string;
83
142
  type: SharedEntityType;
84
143
  }
144
+ /**
145
+ * Describes a custom Object which is being Team Shared
146
+ */
147
+ export interface CustomSharedEntityConfig {
148
+ /**
149
+ * Optional technical ID; if not provided, it will be auto-generated by Adaptable
150
+ */
151
+ Uuid?: string;
152
+ /**
153
+ * Name of object being shared
154
+ */
155
+ Name: string;
156
+ /**
157
+ * Description of object being shared
158
+ */
159
+ Description: string;
160
+ /**
161
+ * List of Tags associated with the Object
162
+ */
163
+ Tags?: AdaptableObjectTag[];
164
+ }
85
165
  export declare type SharedEntityType = 'Snapshot' | 'Active';
86
166
  export interface TeamSharingImportStep {
87
- sharedEntity: SharedEntity;
167
+ sharedEntity: AdaptableSharedEntity;
88
168
  importAction: Redux.Action;
89
169
  }
90
170
  export declare type SharedEntityActiveStatus = Record<TypeUuid, {
91
- sharedEntity: SharedEntity;
171
+ sharedEntity: AdaptableSharedEntity;
92
172
  importedRevision: number;
93
173
  sharedRevision: number;
94
174
  }>;
175
+ export {};
@@ -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, SharedEntityConfig, TeamSharingImportStep } from '../../PredefinedConfig/TeamSharingState';
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: SharedEntityConfig;
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: 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: SharedEntity[];
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: SharedEntityConfig) => TeamSharingShareAction;
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: SharedEntity) => TeamSharingImportItemAction;
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: SharedEntity[]) => TeamSharingLinkItemAction;
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
- .getSharedEntities()
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
- .getSharedEntities()
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(existingActiveSharedEntity.Module)}, there is already an existing active share for it: ${existingActiveSharedEntity.Description}`,
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.setSharedEntities(sharedEntities);
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
- .getSharedEntities()
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(actionTyped.Uuid, sharedEntities);
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 !== actionTyped.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.setSharedEntities(newSharedEntities);
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
- .getSharedEntities()
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, sharedEntities);
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, sharedEntities);
1437
+ .updateActiveSharedEntity(ChangedAdaptableObject, UserName, adaptableSharedEntities);
1395
1438
  middlewareAPI.dispatch(TeamSharingRedux.TeamSharingLinkItem(...newActiveEntities));
1396
1439
  middlewareAPI.dispatch(TeamSharingRedux.TeamSharingSet(updatedSharedEntities));
1397
- return adaptable.api.teamSharingApi.setSharedEntities(updatedSharedEntities);
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
- .getSharedEntities()
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 { SharedEntity } from '../../types';
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: SharedEntity): boolean;
13
+ isAdaptableObjectPresentInLocalState(sharedEntity: AdaptableSharedEntity): boolean;
14
14
  private isSharedEntityADependency;
15
15
  private isStaleAndActive;
16
16
  private getDependencies;
17
17
  private getStaleDependencies;
18
- toView(sharedEntity: SharedEntity): AdaptableObjectView;
18
+ toView(sharedEntity: AdaptableSharedEntity): AdaptableObjectView;
19
19
  toViewAll(): AdaptableObjectView[];
20
20
  getViewProperties(): AdaptableModuleView;
21
21
  }
@@ -81,14 +81,13 @@ class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
81
81
  return Object.values(action).find((actionProperty) => (0, isAdaptableObject_1.isAdaptableObject)(actionProperty));
82
82
  }
83
83
  isAdaptableObjectPresentInLocalState(sharedEntity) {
84
- return !!this.api.internalApi
84
+ var _a;
85
+ return !!((_a = this.api.internalApi
85
86
  .getModuleService()
86
- .getModuleById(sharedEntity.Module)
87
- .getModuleAdaptableObjects()
88
- .find((adaptableObject) => adaptableObject.Uuid === sharedEntity.Entity.Uuid);
87
+ .getModuleById(sharedEntity.Module)) === null || _a === void 0 ? void 0 : _a.getModuleAdaptableObjects().find((adaptableObject) => adaptableObject.Uuid === sharedEntity.Entity.Uuid));
89
88
  }
90
89
  isSharedEntityADependency(sharedEntity) {
91
- const allSharedEntries = this.api.teamSharingApi.getLoadedSharedEntities();
90
+ const allSharedEntries = this.api.teamSharingApi.getLoadedAdaptableSharedEntities();
92
91
  return allSharedEntries.some((sharedEntryCandidate) => {
93
92
  var _a;
94
93
  return (_a = sharedEntryCandidate === null || sharedEntryCandidate === void 0 ? void 0 : sharedEntryCandidate.EntityDependencyIds) === null || _a === void 0 ? void 0 : _a.includes(sharedEntity.Uuid);
@@ -106,7 +105,7 @@ class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
106
105
  sharedEntity.EntityDependencyIds.length === 0) {
107
106
  return [sharedEntity];
108
107
  }
109
- const allSharedEntities = this.api.teamSharingApi.getLoadedSharedEntities();
108
+ const allSharedEntities = this.api.teamSharingApi.getLoadedAdaptableSharedEntities();
110
109
  const dependencies = sharedEntity.EntityDependencyIds.map((dependencyUuid) => allSharedEntities.find((entity) => entity.Uuid === dependencyUuid));
111
110
  return (0, flatten_1.default)(dependencies.map((dependency) => this.getDependencies(dependency)));
112
111
  }
@@ -158,7 +157,7 @@ class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
158
157
  }
159
158
  toViewAll() {
160
159
  var _a;
161
- return (((_a = this.api.teamSharingApi.getLoadedSharedEntities()) !== null && _a !== void 0 ? _a : [])
160
+ return (((_a = this.api.teamSharingApi.getLoadedAdaptableSharedEntities()) !== null && _a !== void 0 ? _a : [])
162
161
  // only top level
163
162
  .filter((sharedEntity) => !this.isSharedEntityADependency(sharedEntity))
164
163
  .map((item) => this.toView(item)));
@@ -212,6 +212,7 @@ exports.DefaultAdaptableOptions = {
212
212
  showDistinctFilteredValuesOnly: false,
213
213
  showClearFilterButton: false,
214
214
  showSuspendFilterButton: false,
215
+ quickFilterWildcards: {},
215
216
  },
216
217
  searchOptions: {
217
218
  excludeColumnFromQuickSearch: undefined,
@@ -229,8 +230,10 @@ exports.DefaultAdaptableOptions = {
229
230
  },
230
231
  teamSharingOptions: {
231
232
  enableTeamSharing: false,
232
- setSharedEntities: undefined,
233
- getSharedEntities: undefined,
233
+ persistSharedEntities: undefined,
234
+ loadSharedEntities: undefined,
235
+ applySharedEntities: (sharedEntities) => sharedEntities,
236
+ saveSharedEntities: (sharedEntities) => sharedEntities,
234
237
  updateInterval: 0,
235
238
  updateNotification: undefined,
236
239
  },
@@ -1,14 +1,15 @@
1
1
  import { IAdaptableService } from './IAdaptableService';
2
2
  import { AdaptableObject } from '../../../PredefinedConfig/Common/AdaptableObject';
3
3
  import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
4
- import { SharedEntity, SharedEntityConfig, SharedEntityActiveStatus, TeamSharingImportStep } from '../../../PredefinedConfig/TeamSharingState';
4
+ import { AdaptableSharedEntityConfig, SharedEntityActiveStatus, TeamSharingImportStep, AdaptableSharedEntity, CustomSharedEntityConfig, CustomSharedEntity } from '../../../PredefinedConfig/TeamSharingState';
5
5
  import { TypeUuid } from '../../../PredefinedConfig/Uuid';
6
6
  export interface ITeamSharingService extends IAdaptableService {
7
- buildSharedEntityWithDependencies(adaptableObject: AdaptableObject, module: AdaptableModule, configuration: SharedEntityConfig): SharedEntity[];
8
- getSharedEntityDependants(sharedEntityId: TypeUuid, sharedEntities: SharedEntity[]): SharedEntity[];
9
- updateActiveSharedEntity(changedAdaptableObject: AdaptableObject, userName: string, sharedEntities: SharedEntity[]): [SharedEntity[], SharedEntity[]];
10
- buildSharedEntityImportActions(sharedEntity: SharedEntity): [TeamSharingImportStep[], boolean];
11
- getSharedEntityLocalAndRemoteRevisions(changedAdaptableObjectId: TypeUuid, remoteSharedEntities: SharedEntity[]): any;
7
+ buildSharedEntityWithDependencies(adaptableObject: AdaptableObject, module: AdaptableModule, configuration: AdaptableSharedEntityConfig): AdaptableSharedEntity[];
8
+ getSharedEntityDependants(sharedEntityId: TypeUuid, sharedEntities: AdaptableSharedEntity[]): AdaptableSharedEntity[];
9
+ updateActiveSharedEntity(changedAdaptableObject: AdaptableObject, userName: string, sharedEntities: AdaptableSharedEntity[]): [AdaptableSharedEntity[], AdaptableSharedEntity[]];
10
+ buildSharedEntityImportActions(sharedEntity: AdaptableSharedEntity): [TeamSharingImportStep[], boolean];
11
+ getSharedEntityLocalAndRemoteRevisions(changedAdaptableObjectId: TypeUuid, remoteSharedEntities: AdaptableSharedEntity[]): any;
12
12
  getStaleActiveSharedEntities(): SharedEntityActiveStatus;
13
13
  showUpdateNotifications(): void;
14
+ buildCustomSharedEntity(Entity: any, Configuration: CustomSharedEntityConfig): CustomSharedEntity;
14
15
  }
@@ -1,18 +1,19 @@
1
1
  import { ITeamSharingService } from './Interface/ITeamSharingService';
2
2
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
3
3
  import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
4
- import { SharedEntity, SharedEntityConfig, SharedEntityActiveStatus, TeamSharingImportStep } from '../../PredefinedConfig/TeamSharingState';
4
+ import { AdaptableSharedEntityConfig, SharedEntityActiveStatus, TeamSharingImportStep, AdaptableSharedEntity, CustomSharedEntity, CustomSharedEntityConfig } from '../../PredefinedConfig/TeamSharingState';
5
5
  import { TypeUuid } from '../../PredefinedConfig/Uuid';
6
6
  import { AdaptableApi } from '../../../types';
7
7
  export declare class TeamSharingService implements ITeamSharingService {
8
8
  private adaptableApi;
9
9
  private updateCheckTimerId;
10
10
  constructor(adaptableApi: AdaptableApi);
11
- buildSharedEntityWithDependencies(adaptableObject: AdaptableObject, module: AdaptableModule, configuration: SharedEntityConfig): SharedEntity[];
12
- getSharedEntityDependants(sharedEntityId: TypeUuid, sharedEntities: SharedEntity[]): SharedEntity[];
13
- updateActiveSharedEntity(changedAdaptableObject: AdaptableObject, userName: string, sharedEntities: SharedEntity[]): [SharedEntity[], SharedEntity[]];
14
- buildSharedEntityImportActions(importedSharedEntity: SharedEntity): [TeamSharingImportStep[], boolean];
15
- getSharedEntityLocalAndRemoteRevisions(changedAdaptableObjectId: TypeUuid, remoteSharedEntities: SharedEntity[]): [number, number];
11
+ buildCustomSharedEntity(Entity: any, Configuration: CustomSharedEntityConfig): CustomSharedEntity;
12
+ buildSharedEntityWithDependencies(adaptableObject: AdaptableObject, module: AdaptableModule, configuration: AdaptableSharedEntityConfig): AdaptableSharedEntity[];
13
+ getSharedEntityDependants(sharedEntityId: TypeUuid, sharedEntities: AdaptableSharedEntity[]): AdaptableSharedEntity[];
14
+ updateActiveSharedEntity(changedAdaptableObject: AdaptableObject, userName: string, sharedEntities: AdaptableSharedEntity[]): [AdaptableSharedEntity[], AdaptableSharedEntity[]];
15
+ buildSharedEntityImportActions(importedSharedEntity: AdaptableSharedEntity): [TeamSharingImportStep[], boolean];
16
+ getSharedEntityLocalAndRemoteRevisions(changedAdaptableObjectId: TypeUuid, remoteSharedEntities: AdaptableSharedEntity[]): [number, number];
16
17
  getStaleActiveSharedEntities(): SharedEntityActiveStatus;
17
18
  showUpdateNotifications(): void;
18
19
  destroy(): void;