Skip to content

Commit a9ec8db

Browse files
committed
Merge branch 'master' into open1193
2 parents fc36674 + dfa4591 commit a9ec8db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1005
-392
lines changed

API.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ Custom types may be registered via
7171
[`openmct.types`]{@link module:openmct.MCT#types}:
7272

7373
```
74-
openmct.types.addType('my-type', new openmct.Type({
74+
openmct.types.addType('my-type', {
7575
label: "My Type",
76-
description: "This is a type that I added!"
76+
description: "This is a type that I added!",
77+
creatable: true
7778
});
7879
```
7980

@@ -118,18 +119,11 @@ To do so, use the [`addRoot`]{@link module:openmct.ObjectAPI#addRoot} method
118119
of the [object API]{@link module:openmct.ObjectAPI}:
119120

120121
```
121-
openmct.objects.addRoot({
122-
identifier: { key: "my-key", namespace: "my-namespace" }
123-
name: "My Root-level Object",
124-
type: "my-type"
125-
});
122+
openmct.objects.addRoot({ key: "my-key", namespace: "my-namespace" });
126123
```
127124

128-
You can also remove this root-level object via its identifier:
129-
130-
```
131-
openmct.objects.removeRoot({ key: "my-key", namespace: "my-namespace" });
132-
```
125+
Root objects are loaded just like any other objects, i.e. via an object
126+
provider.
133127

134128
### Adding Composition Providers
135129

docs/src/tutorials/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,10 @@ it in our bundle definition, as an extension of category `controllers`:
675675
```diff
676676
define([
677677
'legacyRegistry',
678-
'./src/controllers/TodoController'
678+
+ './src/controllers/TodoController'
679679
], function (
680680
legacyRegistry,
681-
TodoController
681+
+ TodoController
682682
) {
683683
legacyRegistry.register("tutorials/todo", {
684684
"name": "To-do Plugin",
@@ -2948,7 +2948,7 @@ will implement:
29482948
/*global define*/
29492949

29502950
define(
2951-
['./src/ExampleTelemetrySeries'],
2951+
['./ExampleTelemetrySeries'],
29522952
function (ExampleTelemetrySeries) {
29532953
"use strict";
29542954

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ gulp.task('serve', function () {
155155
var app = require('./app.js');
156156
});
157157

158-
gulp.task('develop', ['serve', 'install', 'watch']);
158+
gulp.task('develop', ['serve', 'stylesheets', 'watch']);
159159

160160
gulp.task('install', [ 'assets', 'scripts' ]);
161161

index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
[
3333
'example/imagery',
3434
'example/eventGenerator',
35-
'example/generator'
35+
'example/generator',
36+
'platform/features/my-items',
37+
'platform/persistence/local'
3638
].forEach(
3739
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
3840
);

platform/commonUI/edit/bundle.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ define([
347347
"implementation": TransactionService,
348348
"depends": [
349349
"$q",
350-
"$log"
350+
"$log",
351+
"cacheService"
351352
]
352353
},
353354
{

platform/commonUI/edit/src/actions/SaveAsAction.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ define([
171171

172172
function finishEditing(clonedObject) {
173173
return domainObject.getCapability("editor").finish()
174-
.then(resolveWith(clonedObject));
174+
.then(function () {
175+
return fetchObject(clonedObject.getId());
176+
});
175177
}
176178

177179
function onFailure() {

platform/commonUI/edit/src/services/TransactionService.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ define(
3434
* @param $q
3535
* @constructor
3636
*/
37-
function TransactionService($q, $log) {
37+
function TransactionService($q, $log, cacheService) {
3838
this.$q = $q;
3939
this.$log = $log;
40+
this.cacheService = cacheService;
4041
this.transactions = [];
4142
}
4243

@@ -87,14 +88,25 @@ define(
8788

8889
/**
8990
* All persist calls deferred since the beginning of the transaction
90-
* will be committed.
91+
* will be committed. If this is the last transaction, clears the
92+
* cache.
9193
*
9294
* @returns {Promise} resolved when all persist operations have
9395
* completed. Will reject if any commit operations fail
9496
*/
9597
TransactionService.prototype.commit = function () {
9698
var transaction = this.transactions.pop();
97-
return transaction ? transaction.commit() : Promise.reject();
99+
if (!transaction) {
100+
return Promise.reject();
101+
}
102+
if (!this.isActive()) {
103+
return transaction.commit()
104+
.then(function (r) {
105+
this.cacheService.flush();
106+
return r;
107+
}.bind(this));
108+
}
109+
return transaction.commit();
98110
};
99111

100112
/**

platform/commonUI/general/res/sass/controls/_menus.scss

+1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@
273273

274274
.btn-bar.right .menu,
275275
.menus-to-left .menu {
276+
z-index: 79;
276277
left: auto;
277278
right: 0;
278279
width: auto;

platform/commonUI/notification/src/NotificationService.js

+48-40
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ define(
6161
* @property {boolean} [unknownProgress] a boolean indicating that the
6262
* progress of the underlying task is unknown. This will result in a
6363
* visually distinct progress bar.
64-
* @property {boolean | number} [autoDismiss] If truthy, dialog will
64+
* @property {boolean} [autoDismiss] If truthy, dialog will
6565
* be automatically minimized or dismissed (depending on severity).
6666
* Additionally, if the provided value is a number, it will be used
6767
* as the delay period before being dismissed.
@@ -109,18 +109,18 @@ define(
109109
* @memberof platform/commonUI/notification
110110
* @constructor
111111
* @param $timeout the Angular $timeout service
112-
* @param DEFAULT_AUTO_DISMISS The period of time that an
112+
* @param defaultAutoDismissTimeout The period of time that an
113113
* auto-dismissed message will be displayed for.
114-
* @param MINIMIZE_TIMEOUT When notifications are minimized, a brief
114+
* @param minimizeAnimationTimeout When notifications are minimized, a brief
115115
* animation is shown. This animation requires some time to execute,
116116
* so a timeout is required before the notification is hidden
117117
*/
118-
function NotificationService($timeout, topic, DEFAULT_AUTO_DISMISS, MINIMIZE_TIMEOUT) {
118+
function NotificationService($timeout, topic, defaultAutoDismissTimeout, minimizeAnimationTimeout) {
119119
this.notifications = [];
120120
this.$timeout = $timeout;
121121
this.highest = { severity: "info" };
122-
this.DEFAULT_AUTO_DISMISS = DEFAULT_AUTO_DISMISS;
123-
this.MINIMIZE_TIMEOUT = MINIMIZE_TIMEOUT;
122+
this.AUTO_DISMISS_TIMEOUT = defaultAutoDismissTimeout;
123+
this.MINIMIZE_ANIMATION_TIMEOUT = minimizeAnimationTimeout;
124124
this.topic = topic;
125125

126126
/*
@@ -162,7 +162,7 @@ define(
162162
// in order to allow the minimize animation to run through.
163163
service.$timeout(function () {
164164
service.setActiveNotification(service.selectNextNotification());
165-
}, service.MINIMIZE_TIMEOUT);
165+
}, service.MINIMIZE_ANIMATION_TIMEOUT);
166166
}
167167
};
168168

@@ -208,11 +208,16 @@ define(
208208
* @private
209209
*/
210210
NotificationService.prototype.dismissOrMinimize = function (notification) {
211-
212-
//For now minimize everything, and have discussion around which
213-
//kind of messages should or should not be in the minimized
214-
//notifications list
215-
notification.minimize();
211+
var model = notification.model;
212+
if (model.severity === "info") {
213+
if (model.autoDismiss === false) {
214+
notification.minimize();
215+
} else {
216+
notification.dismiss();
217+
}
218+
} else {
219+
notification.minimize();
220+
}
216221
};
217222

218223
/**
@@ -226,7 +231,9 @@ define(
226231
/**
227232
* A convenience method for info notifications. Notifications
228233
* created via this method will be auto-dismissed after a default
229-
* wait period
234+
* wait period unless explicitly forbidden by the caller through
235+
* the {autoDismiss} property on the {NotificationModel}, in which
236+
* case the notification will be minimized after the wait.
230237
* @param {NotificationModel | string} message either a string for
231238
* the title of the notification message, or a {@link NotificationModel}
232239
* defining the options notification to display
@@ -235,7 +242,6 @@ define(
235242
*/
236243
NotificationService.prototype.info = function (message) {
237244
var notificationModel = typeof message === "string" ? {title: message} : message;
238-
notificationModel.autoDismiss = notificationModel.autoDismiss || true;
239245
notificationModel.severity = "info";
240246
return this.notify(notificationModel);
241247
};
@@ -306,28 +312,29 @@ define(
306312
activeNotification = self.active.notification,
307313
topic = this.topic();
308314

315+
notificationModel.severity = notificationModel.severity || "info";
316+
309317
notification = {
310318
model: notificationModel,
319+
311320
minimize: function () {
312321
self.minimize(self, notification);
313322
},
323+
314324
dismiss: function () {
315325
self.dismiss(self, notification);
316326
topic.notify();
317327
},
328+
318329
dismissOrMinimize: function () {
319330
self.dismissOrMinimize(notification);
320331
},
332+
321333
onDismiss: function (callback) {
322334
topic.listen(callback);
323335
}
324336
};
325337

326-
notificationModel.severity = notificationModel.severity || "info";
327-
if (notificationModel.autoDismiss === true) {
328-
notificationModel.autoDismiss = this.DEFAULT_AUTO_DISMISS;
329-
}
330-
331338
//Notifications support a 'dismissable' attribute. This is a
332339
// convenience to support adding a 'dismiss' option to the
333340
// notification for the common case of dismissing a
@@ -366,38 +373,39 @@ define(
366373
*/
367374
this.active.timeout = this.$timeout(function () {
368375
activeNotification.dismissOrMinimize();
369-
}, this.DEFAULT_AUTO_DISMISS);
376+
}, this.AUTO_DISMISS_TIMEOUT);
370377
}
371378

372379
return notification;
373-
374380
};
375381

376382
/**
377383
* Used internally by the NotificationService
378384
* @private
379385
*/
380-
NotificationService.prototype.setActiveNotification =
381-
function (notification) {
382-
var timeout;
386+
NotificationService.prototype.setActiveNotification = function (notification) {
387+
var shouldAutoDismiss;
388+
this.active.notification = notification;
383389

384-
this.active.notification = notification;
385-
/*
386-
If autoDismiss has been specified, OR there are other
387-
notifications queued for display, setup a timeout to
388-
dismiss the dialog.
389-
*/
390-
if (notification && (notification.model.autoDismiss ||
391-
this.selectNextNotification())) {
390+
if (!notification) {
391+
delete this.active.timeout;
392+
return;
393+
}
392394

393-
timeout = notification.model.autoDismiss || this.DEFAULT_AUTO_DISMISS;
394-
this.active.timeout = this.$timeout(function () {
395-
notification.dismissOrMinimize();
396-
}, timeout);
397-
} else {
398-
delete this.active.timeout;
399-
}
400-
};
395+
if (notification.model.severity === "info") {
396+
shouldAutoDismiss = true;
397+
} else {
398+
shouldAutoDismiss = notification.model.autoDismiss;
399+
}
400+
401+
if (shouldAutoDismiss || this.selectNextNotification()) {
402+
this.active.timeout = this.$timeout(function () {
403+
notification.dismissOrMinimize();
404+
}, this.AUTO_DISMISS_TIMEOUT);
405+
} else {
406+
delete this.active.timeout;
407+
}
408+
};
401409

402410
/**
403411
* Used internally by the NotificationService

0 commit comments

Comments
 (0)