@eclipse-glsp/server 1.1.0-next.e49c816.56 → 1.1.0-next.ea31916.59
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/lib/common/di/diagram-module.d.ts +3 -0
- package/lib/common/di/diagram-module.d.ts.map +1 -1
- package/lib/common/di/diagram-module.js +14 -5
- package/lib/common/di/diagram-module.js.map +1 -1
- package/lib/common/features/model/request-model-action-handler.d.ts +4 -6
- package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -1
- package/lib/common/features/model/request-model-action-handler.js +14 -11
- package/lib/common/features/model/request-model-action-handler.js.map +1 -1
- package/lib/common/features/progress/progress-service.d.ts +44 -0
- package/lib/common/features/progress/progress-service.d.ts.map +1 -0
- package/lib/common/features/progress/progress-service.js +50 -0
- package/lib/common/features/progress/progress-service.js.map +1 -0
- package/package.json +3 -3
- package/src/common/di/diagram-module.ts +20 -7
- package/src/common/features/model/request-model-action-handler.ts +16 -15
- package/src/common/features/progress/progress-service.ts +74 -0
|
@@ -23,6 +23,7 @@ import { NavigationTargetProvider } from '../features/navigation/navigation-targ
|
|
|
23
23
|
import { NavigationTargetProviderRegistry } from '../features/navigation/navigation-target-provider-registry';
|
|
24
24
|
import { NavigationTargetResolver } from '../features/navigation/navigation-target-resolver';
|
|
25
25
|
import { PopupModelFactory } from '../features/popup/popup-model-factory';
|
|
26
|
+
import { ProgressService } from '../features/progress/progress-service';
|
|
26
27
|
import { ModelValidator } from '../features/validation/model-validator';
|
|
27
28
|
import { OperationHandlerConstructor, OperationHandlerFactory } from '../operations/operation-handler';
|
|
28
29
|
import { OperationHandlerRegistry } from '../operations/operation-handler-registry';
|
|
@@ -57,6 +58,7 @@ import { InstanceMultiBinding, MultiBinding } from './multi-binding';
|
|
|
57
58
|
* - {@link ContextActionsProviders} as {@link ClassMultiBinding<ContextActionsProvider>} (empty)
|
|
58
59
|
* - {@link ContextActionsProviderRegistry}
|
|
59
60
|
* - {@link ActionDispatcher}
|
|
61
|
+
* - {@link ProgressService}
|
|
60
62
|
* - {@link ClientActionKinds} as {@link InstanceMultiBinding<string>}
|
|
61
63
|
* - {@link ActionHandler} as {@link InstanceMultiBinding<ActionHandlerConstructor>}
|
|
62
64
|
* - {@link ActionHandlerFactory}
|
|
@@ -96,6 +98,7 @@ export declare abstract class DiagramModule extends GLSPModule {
|
|
|
96
98
|
protected bindOperations(): BindingTarget<string[]>;
|
|
97
99
|
protected bindCommandStack(): BindingTarget<CommandStack>;
|
|
98
100
|
protected configureOperationHandlers(binding: InstanceMultiBinding<OperationHandlerConstructor>): void;
|
|
101
|
+
protected bindProgressService(): BindingTarget<ProgressService>;
|
|
99
102
|
protected configureContextActionProviders(binding: MultiBinding<ContextActionsProvider>): void;
|
|
100
103
|
protected configureContextEditValidators(binding: MultiBinding<ContextEditValidator>): void;
|
|
101
104
|
protected configureNavigationTargetProviders(binding: MultiBinding<NavigationTargetProvider>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram-module.d.ts","sourceRoot":"","sources":["../../../src/common/di/diagram-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagram-module.d.ts","sourceRoot":"","sources":["../../../src/common/di/diagram-module.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAA2B,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAoC,MAAM,oCAAoC,CAAC;AAE7G,OAAO,EAAE,YAAY,EAAuB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC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CAAC,GAAG,SAAS;IAIjF,SAAS,CAAC,2BAA2B,IAAI,aAAa,CAAC,uBAAuB,CAAC,GAAG,SAAS;IAG3F,SAAS,CAAC,gCAAgC,IAAI,aAAa,CAAC,4BAA4B,CAAC,GAAG,SAAS;IAGrG,SAAS,CAAC,2BAA2B,IAAI,aAAa,CAAC,uBAAuB,CAAC,GAAG,SAAS;IAI3F,SAAS,CAAC,4BAA4B,IAAI,aAAa,CAAC,wBAAwB,CAAC,GAAG,SAAS;IAI7F,SAAS,CAAC,qBAAqB,IAAI,aAAa,CAAC,iBAAiB,CAAC,GAAG,SAAS;IAG/E,SAAS,CAAC,gBAAgB,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS;CAGxE"}
|
|
@@ -50,6 +50,7 @@ const request_navigation_targets_action_handler_1 = require("../features/navigat
|
|
|
50
50
|
const resolve_navigation_targets_action_handler_1 = require("../features/navigation/resolve-navigation-targets-action-handler");
|
|
51
51
|
const popup_model_factory_1 = require("../features/popup/popup-model-factory");
|
|
52
52
|
const request_popup_model_action_handler_1 = require("../features/popup/request-popup-model-action-handler");
|
|
53
|
+
const progress_service_1 = require("../features/progress/progress-service");
|
|
53
54
|
const model_validator_1 = require("../features/validation/model-validator");
|
|
54
55
|
const request_markers_handler_1 = require("../features/validation/request-markers-handler");
|
|
55
56
|
const compound_operation_handler_1 = require("../operations/compound-operation-handler");
|
|
@@ -88,6 +89,7 @@ const service_identifiers_1 = require("./service-identifiers");
|
|
|
88
89
|
* - {@link ContextActionsProviders} as {@link ClassMultiBinding<ContextActionsProvider>} (empty)
|
|
89
90
|
* - {@link ContextActionsProviderRegistry}
|
|
90
91
|
* - {@link ActionDispatcher}
|
|
92
|
+
* - {@link ProgressService}
|
|
91
93
|
* - {@link ClientActionKinds} as {@link InstanceMultiBinding<string>}
|
|
92
94
|
* - {@link ActionHandler} as {@link InstanceMultiBinding<ActionHandlerConstructor>}
|
|
93
95
|
* - {@link ActionHandlerFactory}
|
|
@@ -150,6 +152,7 @@ class DiagramModule extends glsp_module_1.GLSPModule {
|
|
|
150
152
|
this.configureMultiBinding(new multi_binding_1.MultiBinding(service_identifiers_1.ContextEditValidators), binding => this.configureContextEditValidators(binding));
|
|
151
153
|
// Misc
|
|
152
154
|
this.configureMultiBinding(new multi_binding_1.MultiBinding(client_session_initializer_1.ClientSessionInitializer), binding => this.configureClientSessionInitializers(binding));
|
|
155
|
+
(0, binding_target_1.applyBindingTarget)(context, progress_service_1.ProgressService, this.bindProgressService()).inSingletonScope();
|
|
153
156
|
(0, binding_target_1.applyOptionalBindingTarget)(context, popup_model_factory_1.PopupModelFactory, this.bindPopupModelFactory());
|
|
154
157
|
(0, binding_target_1.applyOptionalBindingTarget)(context, layout_engine_1.LayoutEngine, (_a = this.bindLayoutEngine) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
155
158
|
}
|
|
@@ -222,6 +225,9 @@ class DiagramModule extends glsp_module_1.GLSPModule {
|
|
|
222
225
|
binding.add(compound_operation_handler_1.CompoundOperationHandler);
|
|
223
226
|
binding.add(layout_operation_handler_1.LayoutOperationHandler);
|
|
224
227
|
}
|
|
228
|
+
bindProgressService() {
|
|
229
|
+
return progress_service_1.DefaultProgressService;
|
|
230
|
+
}
|
|
225
231
|
configureContextActionProviders(binding) {
|
|
226
232
|
// empty as default
|
|
227
233
|
}
|
|
@@ -233,16 +239,17 @@ class DiagramModule extends glsp_module_1.GLSPModule {
|
|
|
233
239
|
}
|
|
234
240
|
configureClientActions(binding) {
|
|
235
241
|
binding.add(protocol_1.CenterAction.KIND);
|
|
236
|
-
binding.add(protocol_1.ExportSvgAction.KIND);
|
|
237
242
|
binding.add(protocol_1.DeleteMarkersAction.KIND);
|
|
243
|
+
binding.add(protocol_1.EndProgressAction.KIND);
|
|
244
|
+
binding.add(protocol_1.ExportSvgAction.KIND);
|
|
238
245
|
binding.add(protocol_1.FitToScreenAction.KIND);
|
|
239
|
-
binding.add(protocol_1.SourceModelChangedAction.KIND);
|
|
240
|
-
binding.add(protocol_1.NavigateToTargetAction.KIND);
|
|
241
246
|
binding.add(protocol_1.NavigateToExternalTargetAction.KIND);
|
|
247
|
+
binding.add(protocol_1.NavigateToTargetAction.KIND);
|
|
242
248
|
binding.add(protocol_1.RequestBoundsAction.KIND);
|
|
243
249
|
binding.add(protocol_1.SelectAction.KIND);
|
|
244
250
|
binding.add(protocol_1.SelectAllAction.KIND);
|
|
245
251
|
binding.add(protocol_1.ServerMessageAction.KIND);
|
|
252
|
+
binding.add(protocol_1.ServerStatusAction.KIND);
|
|
246
253
|
binding.add(protocol_1.SetBoundsAction.KIND);
|
|
247
254
|
binding.add(protocol_1.SetClipboardDataAction.KIND);
|
|
248
255
|
binding.add(protocol_1.SetContextActions.KIND);
|
|
@@ -256,10 +263,12 @@ class DiagramModule extends glsp_module_1.GLSPModule {
|
|
|
256
263
|
binding.add(protocol_1.SetResolvedNavigationTargetAction.KIND);
|
|
257
264
|
binding.add(protocol_1.SetTypeHintsAction.KIND);
|
|
258
265
|
binding.add(protocol_1.SetViewportAction.KIND);
|
|
259
|
-
binding.add(protocol_1.
|
|
260
|
-
binding.add(protocol_1.
|
|
266
|
+
binding.add(protocol_1.SourceModelChangedAction.KIND);
|
|
267
|
+
binding.add(protocol_1.StartProgressAction.KIND);
|
|
261
268
|
binding.add(protocol_1.TriggerEdgeCreationAction.KIND);
|
|
269
|
+
binding.add(protocol_1.TriggerNodeCreationAction.KIND);
|
|
262
270
|
binding.add(protocol_1.UpdateModelAction.KIND);
|
|
271
|
+
binding.add(protocol_1.UpdateProgressAction.KIND);
|
|
263
272
|
}
|
|
264
273
|
bindContextActionsProviderRegistry() {
|
|
265
274
|
return context_actions_provider_registry_1.ContextActionsProviderRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram-module.js","sourceRoot":"","sources":["../../../src/common/di/diagram-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file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rB,CAAC;;AAtQL,sCAuQC;AAtQmB,gCAAkB,GAAG,kBAAkB,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { Action, RequestModelAction } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
18
18
|
import { ActionHandler } from '../../actions/action-handler';
|
|
19
|
+
import { ProgressMonitor, ProgressService } from '../progress/progress-service';
|
|
19
20
|
import { ModelState } from './model-state';
|
|
20
21
|
import { ModelSubmissionHandler } from './model-submission-handler';
|
|
21
22
|
import { SourceModelStorage } from './source-model-storage';
|
|
@@ -26,12 +27,9 @@ export declare class RequestModelActionHandler implements ActionHandler {
|
|
|
26
27
|
protected actionDispatcher: ActionDispatcher;
|
|
27
28
|
protected modelState: ModelState;
|
|
28
29
|
protected submissionHandler: ModelSubmissionHandler;
|
|
30
|
+
protected progressService: ProgressService;
|
|
29
31
|
execute(action: RequestModelAction): Promise<Action[]>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* An empty message is an indication for the client to clear previously received notifications.
|
|
33
|
-
* @param message The message that should be sent to the client
|
|
34
|
-
*/
|
|
35
|
-
protected notifyClient(message?: string): void;
|
|
32
|
+
protected reportModelLoading(message: string): ProgressMonitor;
|
|
33
|
+
protected reportModelLoadingFinished(monitor: ProgressMonitor): void;
|
|
36
34
|
}
|
|
37
35
|
//# sourceMappingURL=request-model-action-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-model-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/request-model-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"request-model-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/request-model-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAsB,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,qBACa,yBAA0B,YAAW,aAAa;IAC3D,WAAW,WAA6B;IAGxC,OAAO,CAAC,MAAM,CAAS;IAGvB,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAGjD,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAG7C,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAGjC,SAAS,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IAGpD,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAErC,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAW5D,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe;IAK9D,SAAS,CAAC,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CAIvE"}
|
|
@@ -29,6 +29,7 @@ const protocol_1 = require("@eclipse-glsp/protocol");
|
|
|
29
29
|
const inversify_1 = require("inversify");
|
|
30
30
|
const action_dispatcher_1 = require("../../actions/action-dispatcher");
|
|
31
31
|
const logger_1 = require("../../utils/logger");
|
|
32
|
+
const progress_service_1 = require("../progress/progress-service");
|
|
32
33
|
const model_state_1 = require("./model-state");
|
|
33
34
|
const model_submission_handler_1 = require("./model-submission-handler");
|
|
34
35
|
const source_model_storage_1 = require("./source-model-storage");
|
|
@@ -40,20 +41,18 @@ let RequestModelActionHandler = exports.RequestModelActionHandler = class Reques
|
|
|
40
41
|
var _a;
|
|
41
42
|
this.logger.debug('Execute RequestModelAction:', action);
|
|
42
43
|
this.modelState.setAll((_a = action.options) !== null && _a !== void 0 ? _a : {});
|
|
43
|
-
this.
|
|
44
|
+
const progress = this.reportModelLoading('Model loading in progress');
|
|
44
45
|
await this.sourceModelStorage.loadSourceModel(action);
|
|
45
|
-
|
|
46
|
-
this.notifyClient();
|
|
46
|
+
this.reportModelLoadingFinished(progress);
|
|
47
47
|
return this.submissionHandler.submitModel();
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.actionDispatcher.dispatchAll(protocol_1.ServerMessageAction.create(message, { severity }), protocol_1.ServerStatusAction.create(message, { severity }));
|
|
49
|
+
reportModelLoading(message) {
|
|
50
|
+
this.actionDispatcher.dispatch(protocol_1.ServerStatusAction.create(message, { severity: 'INFO' }));
|
|
51
|
+
return this.progressService.start(message);
|
|
52
|
+
}
|
|
53
|
+
reportModelLoadingFinished(monitor) {
|
|
54
|
+
this.actionDispatcher.dispatch(protocol_1.ServerStatusAction.create('', { severity: 'NONE' }));
|
|
55
|
+
monitor.end();
|
|
57
56
|
}
|
|
58
57
|
};
|
|
59
58
|
__decorate([
|
|
@@ -76,6 +75,10 @@ __decorate([
|
|
|
76
75
|
(0, inversify_1.inject)(model_submission_handler_1.ModelSubmissionHandler),
|
|
77
76
|
__metadata("design:type", model_submission_handler_1.ModelSubmissionHandler)
|
|
78
77
|
], RequestModelActionHandler.prototype, "submissionHandler", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, inversify_1.inject)(progress_service_1.ProgressService),
|
|
80
|
+
__metadata("design:type", Object)
|
|
81
|
+
], RequestModelActionHandler.prototype, "progressService", void 0);
|
|
79
82
|
exports.RequestModelActionHandler = RequestModelActionHandler = __decorate([
|
|
80
83
|
(0, inversify_1.injectable)()
|
|
81
84
|
], RequestModelActionHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-model-action-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/request-model-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"request-model-action-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/request-model-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAwF;AACxF,yCAA+C;AAC/C,uEAAmE;AAEnE,+CAA4C;AAC5C,mEAAgF;AAChF,+CAA2C;AAC3C,yEAAoE;AACpE,iEAA4D;AAGrD,IAAM,yBAAyB,uCAA/B,MAAM,yBAAyB;IAA/B;QACH,gBAAW,GAAG,CAAC,6BAAkB,CAAC,IAAI,CAAC,CAAC;IAwC5C,CAAC;IApBG,KAAK,CAAC,OAAO,CAAC,MAA0B;;QACpC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,CAAC;QACtE,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QAE1C,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IAChD,CAAC;IAES,kBAAkB,CAAC,OAAe;QACxC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,6BAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAES,0BAA0B,CAAC,OAAwB;QACzD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,6BAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACpF,OAAO,CAAC,GAAG,EAAE,CAAC;IAClB,CAAC;CACJ,CAAA;AArCW;IADP,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACC,eAAM;yDAAC;AAGb;IADT,IAAA,kBAAM,EAAC,yCAAkB,CAAC;;qEACsB;AAGvC;IADT,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;mEACoB;AAGnC;IADT,IAAA,kBAAM,EAAC,wBAAU,CAAC;;6DACc;AAGvB;IADT,IAAA,kBAAM,EAAC,iDAAsB,CAAC;8BACF,iDAAsB;oEAAC;AAG1C;IADT,IAAA,kBAAM,EAAC,kCAAe,CAAC;;kEACmB;oCAnBlC,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAyCrC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
2
|
+
export declare const ProgressService: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* Service for starting and monitoring progress reporting to the client.
|
|
5
|
+
*/
|
|
6
|
+
export interface ProgressService {
|
|
7
|
+
/**
|
|
8
|
+
* Start a progress reporting.
|
|
9
|
+
* @param title The title shown in the UI for the progress reporting.
|
|
10
|
+
* @param options Additional optional options for the progress reporting.
|
|
11
|
+
* @returns a monitor to update and end the progress reporting later.
|
|
12
|
+
*/
|
|
13
|
+
start(title: string, options?: ProgressOptions): ProgressMonitor;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Optional progress reporting options.
|
|
17
|
+
*/
|
|
18
|
+
export interface ProgressOptions {
|
|
19
|
+
/** A message shown in the UI. */
|
|
20
|
+
message?: string;
|
|
21
|
+
percentage?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The monitor of a progress reporting, which can be used to update and end the reporting.
|
|
25
|
+
*/
|
|
26
|
+
export interface ProgressMonitor {
|
|
27
|
+
/**
|
|
28
|
+
* Updates an ongoing progress reporting.
|
|
29
|
+
* @param options Updated message and/or percentage (value range: 0 to 100).
|
|
30
|
+
*/
|
|
31
|
+
update(options: {
|
|
32
|
+
message?: string;
|
|
33
|
+
percentage?: number;
|
|
34
|
+
}): void;
|
|
35
|
+
/**
|
|
36
|
+
* Ends an ongoing progress reporting.
|
|
37
|
+
*/
|
|
38
|
+
end(): void;
|
|
39
|
+
}
|
|
40
|
+
export declare class DefaultProgressService implements ProgressService {
|
|
41
|
+
protected actionDispatcher: ActionDispatcher;
|
|
42
|
+
start(title: string, options?: ProgressOptions): ProgressMonitor;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=progress-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-service.d.ts","sourceRoot":"","sources":["../../../../src/common/features/progress/progress-service.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;;OAKG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,eAAe,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE;;OAEG;IACH,GAAG,IAAI,IAAI,CAAC;CACf;AAED,qBACa,sBAAuB,YAAW,eAAe;IAE1D,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,eAAe;CAQnE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DefaultProgressService = exports.ProgressService = void 0;
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const uuid = require("uuid");
|
|
31
|
+
const action_dispatcher_1 = require("../../actions/action-dispatcher");
|
|
32
|
+
exports.ProgressService = Symbol('ProgressService');
|
|
33
|
+
let DefaultProgressService = exports.DefaultProgressService = class DefaultProgressService {
|
|
34
|
+
start(title, options) {
|
|
35
|
+
const progressId = uuid.v4();
|
|
36
|
+
this.actionDispatcher.dispatch(protocol_1.StartProgressAction.create(Object.assign({ progressId, title }, options)));
|
|
37
|
+
return {
|
|
38
|
+
update: updateOptions => this.actionDispatcher.dispatch(protocol_1.UpdateProgressAction.create(progressId, updateOptions)),
|
|
39
|
+
end: () => this.actionDispatcher.dispatch(protocol_1.EndProgressAction.create(progressId))
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, inversify_1.inject)(action_dispatcher_1.ActionDispatcher),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], DefaultProgressService.prototype, "actionDispatcher", void 0);
|
|
47
|
+
exports.DefaultProgressService = DefaultProgressService = __decorate([
|
|
48
|
+
(0, inversify_1.injectable)()
|
|
49
|
+
], DefaultProgressService);
|
|
50
|
+
//# sourceMappingURL=progress-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-service.js","sourceRoot":"","sources":["../../../../src/common/features/progress/progress-service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsG;AACtG,yCAA+C;AAC/C,6BAA6B;AAC7B,uEAAmE;AAEtD,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAyClD,IAAM,sBAAsB,oCAA5B,MAAM,sBAAsB;IAI/B,KAAK,CAAC,KAAa,EAAE,OAAyB;QAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,8BAAmB,CAAC,MAAM,iBAAG,UAAU,EAAE,KAAK,IAAK,OAAO,EAAG,CAAC,CAAC;QAC9F,OAAO;YACH,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,+BAAoB,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;YAC/G,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,4BAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;SAClF,CAAC;IACN,CAAC;CACJ,CAAA;AAVa;IADT,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;gEACoB;iCAFpC,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAYlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/server",
|
|
3
|
-
"version": "1.1.0-next.
|
|
3
|
+
"version": "1.1.0-next.ea31916.59+ea31916",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"watch": "tsc -w"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eclipse-glsp/graph": "1.1.0-next.
|
|
62
|
+
"@eclipse-glsp/graph": "1.1.0-next.ea31916.59+ea31916",
|
|
63
63
|
"@eclipse-glsp/protocol": "next",
|
|
64
64
|
"@types/uuid": "8.3.1",
|
|
65
65
|
"commander": "^8.3.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "ea31916a7ee02acfce20671b2ebf4b53e02d25e4"
|
|
81
81
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import {
|
|
17
17
|
CenterAction,
|
|
18
18
|
DeleteMarkersAction,
|
|
19
|
+
EndProgressAction,
|
|
19
20
|
ExportSvgAction,
|
|
20
21
|
FitToScreenAction,
|
|
21
22
|
NavigateToExternalTargetAction,
|
|
@@ -39,9 +40,11 @@ import {
|
|
|
39
40
|
SetTypeHintsAction,
|
|
40
41
|
SetViewportAction,
|
|
41
42
|
SourceModelChangedAction,
|
|
43
|
+
StartProgressAction,
|
|
42
44
|
TriggerEdgeCreationAction,
|
|
43
45
|
TriggerNodeCreationAction,
|
|
44
|
-
UpdateModelAction
|
|
46
|
+
UpdateModelAction,
|
|
47
|
+
UpdateProgressAction
|
|
45
48
|
} from '@eclipse-glsp/protocol';
|
|
46
49
|
import { interfaces } from 'inversify';
|
|
47
50
|
import { ActionDispatcher, DefaultActionDispatcher } from '../actions/action-dispatcher';
|
|
@@ -86,6 +89,7 @@ import { RequestNavigationTargetsActionHandler } from '../features/navigation/re
|
|
|
86
89
|
import { ResolveNavigationTargetsActionHandler } from '../features/navigation/resolve-navigation-targets-action-handler';
|
|
87
90
|
import { PopupModelFactory } from '../features/popup/popup-model-factory';
|
|
88
91
|
import { RequestPopupModelActionHandler } from '../features/popup/request-popup-model-action-handler';
|
|
92
|
+
import { DefaultProgressService, ProgressService } from '../features/progress/progress-service';
|
|
89
93
|
import { ModelValidator } from '../features/validation/model-validator';
|
|
90
94
|
import { RequestMarkersHandler } from '../features/validation/request-markers-handler';
|
|
91
95
|
import { CompoundOperationHandler } from '../operations/compound-operation-handler';
|
|
@@ -93,7 +97,7 @@ import { OperationActionHandler } from '../operations/operation-action-handler';
|
|
|
93
97
|
import { OperationHandlerConstructor, OperationHandlerFactory } from '../operations/operation-handler';
|
|
94
98
|
import { OperationHandlerRegistry, OperationHandlerRegistryInitializer } from '../operations/operation-handler-registry';
|
|
95
99
|
import { ClientSessionInitializer } from '../session/client-session-initializer';
|
|
96
|
-
import { applyBindingTarget, applyOptionalBindingTarget
|
|
100
|
+
import { BindingTarget, applyBindingTarget, applyOptionalBindingTarget } from './binding-target';
|
|
97
101
|
import { GLSPModule } from './glsp-module';
|
|
98
102
|
import { InstanceMultiBinding, MultiBinding } from './multi-binding';
|
|
99
103
|
import {
|
|
@@ -133,6 +137,7 @@ import {
|
|
|
133
137
|
* - {@link ContextActionsProviders} as {@link ClassMultiBinding<ContextActionsProvider>} (empty)
|
|
134
138
|
* - {@link ContextActionsProviderRegistry}
|
|
135
139
|
* - {@link ActionDispatcher}
|
|
140
|
+
* - {@link ProgressService}
|
|
136
141
|
* - {@link ClientActionKinds} as {@link InstanceMultiBinding<string>}
|
|
137
142
|
* - {@link ActionHandler} as {@link InstanceMultiBinding<ActionHandlerConstructor>}
|
|
138
143
|
* - {@link ActionHandlerFactory}
|
|
@@ -217,6 +222,7 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
217
222
|
this.configureMultiBinding(new MultiBinding<ClientSessionInitializer>(ClientSessionInitializer), binding =>
|
|
218
223
|
this.configureClientSessionInitializers(binding)
|
|
219
224
|
);
|
|
225
|
+
applyBindingTarget(context, ProgressService, this.bindProgressService()).inSingletonScope();
|
|
220
226
|
applyOptionalBindingTarget(context, PopupModelFactory, this.bindPopupModelFactory());
|
|
221
227
|
applyOptionalBindingTarget(context, LayoutEngine, this.bindLayoutEngine?.());
|
|
222
228
|
}
|
|
@@ -308,6 +314,10 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
308
314
|
binding.add(LayoutOperationHandler);
|
|
309
315
|
}
|
|
310
316
|
|
|
317
|
+
protected bindProgressService(): BindingTarget<ProgressService> {
|
|
318
|
+
return DefaultProgressService;
|
|
319
|
+
}
|
|
320
|
+
|
|
311
321
|
protected configureContextActionProviders(binding: MultiBinding<ContextActionsProvider>): void {
|
|
312
322
|
// empty as default
|
|
313
323
|
}
|
|
@@ -322,16 +332,17 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
322
332
|
|
|
323
333
|
protected configureClientActions(binding: InstanceMultiBinding<string>): void {
|
|
324
334
|
binding.add(CenterAction.KIND);
|
|
325
|
-
binding.add(ExportSvgAction.KIND);
|
|
326
335
|
binding.add(DeleteMarkersAction.KIND);
|
|
336
|
+
binding.add(EndProgressAction.KIND);
|
|
337
|
+
binding.add(ExportSvgAction.KIND);
|
|
327
338
|
binding.add(FitToScreenAction.KIND);
|
|
328
|
-
binding.add(SourceModelChangedAction.KIND);
|
|
329
|
-
binding.add(NavigateToTargetAction.KIND);
|
|
330
339
|
binding.add(NavigateToExternalTargetAction.KIND);
|
|
340
|
+
binding.add(NavigateToTargetAction.KIND);
|
|
331
341
|
binding.add(RequestBoundsAction.KIND);
|
|
332
342
|
binding.add(SelectAction.KIND);
|
|
333
343
|
binding.add(SelectAllAction.KIND);
|
|
334
344
|
binding.add(ServerMessageAction.KIND);
|
|
345
|
+
binding.add(ServerStatusAction.KIND);
|
|
335
346
|
binding.add(SetBoundsAction.KIND);
|
|
336
347
|
binding.add(SetClipboardDataAction.KIND);
|
|
337
348
|
binding.add(SetContextActions.KIND);
|
|
@@ -345,10 +356,12 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
345
356
|
binding.add(SetResolvedNavigationTargetAction.KIND);
|
|
346
357
|
binding.add(SetTypeHintsAction.KIND);
|
|
347
358
|
binding.add(SetViewportAction.KIND);
|
|
348
|
-
binding.add(
|
|
349
|
-
binding.add(
|
|
359
|
+
binding.add(SourceModelChangedAction.KIND);
|
|
360
|
+
binding.add(StartProgressAction.KIND);
|
|
350
361
|
binding.add(TriggerEdgeCreationAction.KIND);
|
|
362
|
+
binding.add(TriggerNodeCreationAction.KIND);
|
|
351
363
|
binding.add(UpdateModelAction.KIND);
|
|
364
|
+
binding.add(UpdateProgressAction.KIND);
|
|
352
365
|
}
|
|
353
366
|
|
|
354
367
|
protected bindContextActionsProviderRegistry(): BindingTarget<ContextActionsProviderRegistry> {
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action, RequestModelAction,
|
|
16
|
+
import { Action, RequestModelAction, ServerStatusAction } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
19
19
|
import { ActionHandler } from '../../actions/action-handler';
|
|
20
20
|
import { Logger } from '../../utils/logger';
|
|
21
|
+
import { ProgressMonitor, ProgressService } from '../progress/progress-service';
|
|
21
22
|
import { ModelState } from './model-state';
|
|
22
23
|
import { ModelSubmissionHandler } from './model-submission-handler';
|
|
23
24
|
import { SourceModelStorage } from './source-model-storage';
|
|
@@ -41,27 +42,27 @@ export class RequestModelActionHandler implements ActionHandler {
|
|
|
41
42
|
@inject(ModelSubmissionHandler)
|
|
42
43
|
protected submissionHandler: ModelSubmissionHandler;
|
|
43
44
|
|
|
45
|
+
@inject(ProgressService)
|
|
46
|
+
protected progressService: ProgressService;
|
|
47
|
+
|
|
44
48
|
async execute(action: RequestModelAction): Promise<Action[]> {
|
|
45
49
|
this.logger.debug('Execute RequestModelAction:', action);
|
|
46
50
|
this.modelState.setAll(action.options ?? {});
|
|
47
51
|
|
|
48
|
-
this.
|
|
52
|
+
const progress = this.reportModelLoading('Model loading in progress');
|
|
49
53
|
await this.sourceModelStorage.loadSourceModel(action);
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
this.reportModelLoadingFinished(progress);
|
|
55
|
+
|
|
52
56
|
return this.submissionHandler.submitModel();
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
protected
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ServerMessageAction.create(message, { severity }),
|
|
64
|
-
ServerStatusAction.create(message, { severity })
|
|
65
|
-
);
|
|
59
|
+
protected reportModelLoading(message: string): ProgressMonitor {
|
|
60
|
+
this.actionDispatcher.dispatch(ServerStatusAction.create(message, { severity: 'INFO' }));
|
|
61
|
+
return this.progressService.start(message);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected reportModelLoadingFinished(monitor: ProgressMonitor): void {
|
|
65
|
+
this.actionDispatcher.dispatch(ServerStatusAction.create('', { severity: 'NONE' }));
|
|
66
|
+
monitor.end();
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { EndProgressAction, StartProgressAction, UpdateProgressAction } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { inject, injectable } from 'inversify';
|
|
18
|
+
import * as uuid from 'uuid';
|
|
19
|
+
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
20
|
+
|
|
21
|
+
export const ProgressService = Symbol('ProgressService');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Service for starting and monitoring progress reporting to the client.
|
|
25
|
+
*/
|
|
26
|
+
export interface ProgressService {
|
|
27
|
+
/**
|
|
28
|
+
* Start a progress reporting.
|
|
29
|
+
* @param title The title shown in the UI for the progress reporting.
|
|
30
|
+
* @param options Additional optional options for the progress reporting.
|
|
31
|
+
* @returns a monitor to update and end the progress reporting later.
|
|
32
|
+
*/
|
|
33
|
+
start(title: string, options?: ProgressOptions): ProgressMonitor;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Optional progress reporting options.
|
|
38
|
+
*/
|
|
39
|
+
export interface ProgressOptions {
|
|
40
|
+
/** A message shown in the UI. */
|
|
41
|
+
message?: string;
|
|
42
|
+
/* The percentage (value range: 0 to 100) to show in the progress reporting. */
|
|
43
|
+
percentage?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The monitor of a progress reporting, which can be used to update and end the reporting.
|
|
48
|
+
*/
|
|
49
|
+
export interface ProgressMonitor {
|
|
50
|
+
/**
|
|
51
|
+
* Updates an ongoing progress reporting.
|
|
52
|
+
* @param options Updated message and/or percentage (value range: 0 to 100).
|
|
53
|
+
*/
|
|
54
|
+
update(options: { message?: string; percentage?: number }): void;
|
|
55
|
+
/**
|
|
56
|
+
* Ends an ongoing progress reporting.
|
|
57
|
+
*/
|
|
58
|
+
end(): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@injectable()
|
|
62
|
+
export class DefaultProgressService implements ProgressService {
|
|
63
|
+
@inject(ActionDispatcher)
|
|
64
|
+
protected actionDispatcher: ActionDispatcher;
|
|
65
|
+
|
|
66
|
+
start(title: string, options?: ProgressOptions): ProgressMonitor {
|
|
67
|
+
const progressId = uuid.v4();
|
|
68
|
+
this.actionDispatcher.dispatch(StartProgressAction.create({ progressId, title, ...options }));
|
|
69
|
+
return {
|
|
70
|
+
update: updateOptions => this.actionDispatcher.dispatch(UpdateProgressAction.create(progressId, updateOptions)),
|
|
71
|
+
end: () => this.actionDispatcher.dispatch(EndProgressAction.create(progressId))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|