Compare commits

..

7 Commits

Author SHA1 Message Date
97ccaa58c7 show notifications error for rejected telemetry requests (#2334)
* show notification error for rejected telemetry requests

* change notification message details
2019-03-29 15:52:44 -07:00
08ef932926 Use instead of to avoid double digest issue (#2346) 2019-03-29 15:38:39 -07:00
1d2ed0398c Default routing (#2342)
* Working version of default navigation to last child

* Implemented as separate route to clean up code a bit
2019-03-29 14:36:15 -07:00
5a00e0c549 Fix for Chrome 73 overflow bug effecting Telem Tables in Flex Layouts (#2341)
* Voodoo fix for Chrome 73 overflow bug effecting Telem Tables in Flex
Layouts;

* Update table.vue
2019-03-29 13:34:16 -07:00
ebcf47733f Merge pull request #2345 from nasa/revert-2344-properties-dialog-digest
LGTM. Revert "Force digest on compilation of overlay template"
2019-03-29 13:29:52 -07:00
381d7e7615 Revert "Force digest on compilation of overlay template (#2344)"
This reverts commit 8246b47668.
2019-03-29 13:21:45 -07:00
8246b47668 Force digest on compilation of overlay template (#2344) 2019-03-29 10:38:56 -07:00
7 changed files with 67 additions and 36 deletions

View File

@ -65,7 +65,8 @@ define([
"depends": [
"$document",
"$compile",
"$rootScope"
"$rootScope",
"$timeout"
]
}
],

View File

@ -44,8 +44,9 @@ define(
* @memberof platform/commonUI/dialog
* @constructor
*/
function OverlayService($document, $compile, $rootScope) {
function OverlayService($document, $compile, $rootScope, $timeout) {
this.$compile = $compile;
this.$timeout = $timeout;
// Don't include $document and $rootScope directly;
// avoids https://docs.angularjs.org/error/ng/cpws
@ -93,12 +94,14 @@ define(
scope.key = key;
scope.typeClass = typeClass || 't-dialog';
// Create the overlay element and add it to the document's body
element = this.$compile(TEMPLATE)(scope);
// Append so that most recent dialog is last in DOM. This means the most recent dialog will be on top when
// multiple overlays with the same z-index are active.
this.findBody().append(element);
this.$timeout(() => {
// Create the overlay element and add it to the document's body
element = this.$compile(TEMPLATE)(scope);
// Append so that most recent dialog is last in DOM. This means the most recent dialog will be on top when
// multiple overlays with the same z-index are active.
this.findBody().append(element);
});
return {
dismiss: dismiss

View File

@ -35,16 +35,20 @@ define(
mockTemplate,
mockElement,
mockScope,
mockTimeout,
overlayService;
beforeEach(function () {
mockDocument = jasmine.createSpyObj("$document", ["find"]);
mockCompile = jasmine.createSpy("$compile");
mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]);
mockBody = jasmine.createSpyObj("body", ["prepend"]);
mockBody = jasmine.createSpyObj("body", ["append"]);
mockTemplate = jasmine.createSpy("template");
mockElement = jasmine.createSpyObj("element", ["remove"]);
mockScope = jasmine.createSpyObj("scope", ["$destroy"]);
mockTimeout = function (callback) {
callback();
}
mockDocument.find.and.returnValue(mockBody);
mockCompile.and.returnValue(mockTemplate);
@ -54,7 +58,8 @@ define(
overlayService = new OverlayService(
mockDocument,
mockCompile,
mockRootScope
mockRootScope,
mockTimeout
);
});
@ -67,7 +72,7 @@ define(
it("adds the templated element to the body", function () {
overlayService.createOverlay("test", {});
expect(mockBody.prepend).toHaveBeenCalledWith(mockElement);
expect(mockBody.append).toHaveBeenCalledWith(mockElement);
});
it("places the provided model/key in its template's scope", function () {

View File

@ -356,7 +356,7 @@ define([
legacyRegistry.enable('adapter');
this.router.route(/^\/$/, () => {
this.router.setPath('/browse/mine');
this.router.setPath('/browse/');
});
/**

View File

@ -280,7 +280,11 @@ define([
if (!provider) {
return Promise.reject('No provider found');
}
return provider.request.apply(provider, arguments);
return provider.request.apply(provider, arguments).catch((rejected) => {
this.openmct.notifications.error('Error requesting telemetry data, see console for details');
console.error(rejected);
return Promise.reject(rejected);
});
};
/**

View File

@ -173,6 +173,7 @@
&__body-w {
// Wraps __body table provides scrolling
flex: 1 1 100%;
height: 0; // Fixes Chrome 73 overflow bug
overflow-x: auto;
overflow-y: scroll;
}
@ -432,9 +433,9 @@ export default {
shouldSnapToBottom() {
return this.scrollable.scrollTop >= (this.scrollable.scrollHeight - this.scrollable.offsetHeight - AUTO_SCROLL_TRIGGER_HEIGHT);
},
scrollToBottom: _.throttle(function() {
scrollToBottom() {
this.scrollable.scrollTop = this.scrollable.scrollHeight;
}, 100),
},
synchronizeScrollX() {
this.headersHolderEl.scrollLeft = this.scrollable.scrollLeft;
},

View File

@ -9,11 +9,27 @@ define([
let browseObject;
let unobserve = undefined;
openmct.router.route(/^\/browse\/?$/, navigateToFirstChildOfRoot);
openmct.router.route(/^\/browse\/(.*)$/, (path, results, params) => {
let navigatePath = results[1];
navigateToPath(navigatePath, params.view);
});
openmct.router.on('change:params', function (newParams, oldParams, changed) {
if (changed.view && browseObject) {
let provider = openmct
.objectViews
.getByProviderKey(changed.view);
viewObject(browseObject, provider);
}
});
function viewObject(object, viewProvider) {
openmct.layout.$refs.browseObject.show(object, viewProvider.key, true);
openmct.layout.$refs.browseBar.domainObject = object;
openmct.layout.$refs.browseBar.viewKey = viewProvider.key;
};
}
function navigateToPath(path, currentViewKey) {
navigateCall++;
@ -24,13 +40,12 @@ define([
unobserve = undefined;
}
//Split path into object identifiers
if (!Array.isArray(path)) {
path = path.split('/');
}
return Promise.all(path.map((keyString)=>{
return openmct.objects.get(keyString);
})).then((objects)=>{
return pathToObjects(path).then((objects)=>{
if (currentNavigation !== navigateCall) {
return; // Prevent race.
}
@ -79,23 +94,25 @@ define([
});
}
openmct.router.route(/^\/browse\/(.*)$/, (path, results, params) => {
let navigatePath = results[1];
if (!navigatePath) {
navigatePath = 'mine';
}
navigateToPath(navigatePath, params.view);
});
openmct.router.on('change:params', function (newParams, oldParams, changed) {
if (changed.view && browseObject) {
let provider = openmct
.objectViews
.getByProviderKey(changed.view);
viewObject(browseObject, provider);
}
});
function pathToObjects(path) {
return Promise.all(path.map((keyString)=>{
return openmct.objects.get(keyString);
}));
}
function navigateToFirstChildOfRoot() {
openmct.objects.get('ROOT').then(rootObject => {
openmct.composition.get(rootObject).load()
.then(children => {
let lastChild = children[children.length - 1];
if (!lastChild) {
console.error('Unable to navigate to anything. No root objects found.');
} else {
let lastChildId = openmct.objects.makeKeyString(lastChild.identifier);
openmct.router.setPath(`#/browse/${lastChildId}`);
}
});
});
}
}
});