Compare commits

...

35 Commits

Author SHA1 Message Date
dfbd85bbd9 Merge branch 'master' into feature/issue-5953 2022-12-02 16:36:36 -06:00
73057df6c9 Merge branch 'master' into feature/issue-5953 2022-12-02 15:16:51 -06:00
a3e0dbf827 Alway check current object time context (last object in path) 2022-12-02 15:14:43 -06:00
b1b5528f17 Merge branch 'master' into feature/issue-5953 2022-12-02 15:06:25 -06:00
4ff226469f Reorder and better naming 2022-12-02 15:00:28 -06:00
b208991661 Add a check in the upstreamTimeContext code for if an object doesn't have a parent 2022-12-02 14:53:53 -06:00
a5a3bf6b9b Add defaults for custom params 2022-12-01 10:33:23 -06:00
49a85c553d Set default value for customUrlParams 2022-12-01 10:22:55 -06:00
68a5d5a3af Merge branch 'feature/issue-5953' of https://github.com/nasa/openmct into feature/issue-5953 2022-12-01 10:21:08 -06:00
ecfded69ee Add a test for extending the open in new tab action to take custom params 2022-12-01 10:17:36 -06:00
354a14c89e Merge branch 'master' into feature/issue-5953 2022-11-30 19:50:52 -06:00
f212bbad77 Revert plot changes 2022-11-30 13:05:13 -06:00
ba3169ff66 Add back spacing 2022-11-30 13:01:58 -06:00
6d048338f1 Remove debugger and remove unncessary params based on mode 2022-11-29 18:56:21 -06:00
ca9ba1978c Accept any custom url param 2022-11-29 14:45:05 -06:00
2c07314b01 Set bounds when using fixed mode 2022-11-29 12:16:27 -06:00
2f8243c39f Add a fixed time mode param 2022-11-29 11:54:41 -06:00
2f60bb727f Add ability to get url params with a time context 2022-11-23 21:02:07 -06:00
99da1b84a0 Add logging for new tab action 2022-11-23 16:19:40 -06:00
fb066d13f7 Remove logs 2022-11-18 14:44:37 -06:00
eaecfe8443 If the current object has an independentContext, ignore any upstream independentContext 2022-11-17 16:22:22 -06:00
01e981b625 Change index for upstream context loop 2022-11-17 15:47:36 -06:00
ac9be7df3a Add logging 2022-11-17 08:11:22 -06:00
f75a159a1d Add logs 2022-11-16 16:29:04 -06:00
5a2c04a48d Add logs 2022-11-16 12:55:22 -06:00
28430d008f Merge branch 'master' into feature/issue-5953 2022-11-16 12:33:42 -06:00
f05b690c1d Remove some logs 2022-11-16 12:33:06 -06:00
38a6954581 Add logging 2022-11-16 11:36:30 -06:00
e65baab202 Add logs 2022-11-14 13:14:42 -06:00
0599ecf624 Add logs 2022-11-14 13:13:07 -06:00
28e10ea52d Add logging 2022-11-09 16:54:17 -08:00
fb80ae2262 Merge branch 'feature/issue-5953' of https://github.com/nasa/openmct into feature/issue-5953 2022-11-09 16:07:46 -08:00
a033e4a552 Add logging for bounds 2022-11-09 16:06:27 -08:00
56fa2ce824 do not persist configuration when adding telemetry to overlay plot 2022-11-07 15:35:49 -08:00
3e204b4ef5 Expose overlay plot so that it can be imported by an external plugin 2022-11-07 10:42:22 -08:00
6 changed files with 42 additions and 10 deletions

View File

@ -202,8 +202,13 @@ class IndependentTimeContext extends TimeContext {
}
getUpstreamContext() {
let timeContext = this.globalTimeContext;
const objectKey = this.openmct.objects.makeKeyString(this.objectPath[this.objectPath.length - 1].identifier);
const doesObjectHaveTimeContext = this.globalTimeContext.independentContexts.get(objectKey);
if (doesObjectHaveTimeContext) {
return undefined;
}
let timeContext = this.globalTimeContext;
this.objectPath.some((item, index) => {
const key = this.openmct.objects.makeKeyString(item.identifier);
//last index is the view object itself

View File

@ -31,8 +31,8 @@ export default class OpenInNewTab {
this._openmct = openmct;
}
invoke(objectPath) {
let url = objectPathToUrl(this._openmct, objectPath);
invoke(objectPath, urlParams = undefined) {
let url = objectPathToUrl(this._openmct, objectPath, urlParams);
window.open(url);
}
}

View File

@ -383,10 +383,8 @@ export default {
},
setTimeContext() {
this.stopFollowingTimeContext();
this.timeContext = this.openmct.time.getContextForView(this.path);
this.followTimeContext();
},
followTimeContext() {
this.updateDisplayBounds(this.timeContext.bounds());

View File

@ -24,9 +24,27 @@
* Module defining url handling.
*/
export function paramsToArray(openmct) {
// parse urlParams from an object to an array.
function getUrlParams(openmct, customUrlParams = {}) {
let urlParams = openmct.router.getParams();
Object.entries(customUrlParams).forEach((urlParam) => {
const [key, value] = urlParam;
urlParams[key] = value;
});
if (urlParams['tc.mode'] === 'fixed') {
delete urlParams['tc.startDelta'];
delete urlParams['tc.endDelta'];
} else if (urlParams['tc.mode'] === 'local') {
delete urlParams['tc.startBound'];
delete urlParams['tc.endBound'];
}
return urlParams;
}
export function paramsToArray(openmct, customUrlParams = {}) {
// parse urlParams from an object to an array.
let urlParams = getUrlParams(openmct, customUrlParams);
let newTabParams = [];
for (let key in urlParams) {
if ({}.hasOwnProperty.call(urlParams, key)) {
@ -42,9 +60,9 @@ export function identifierToString(openmct, objectPath) {
return '#/browse/' + openmct.objects.getRelativePath(objectPath);
}
export default function objectPathToUrl(openmct, objectPath) {
export default function objectPathToUrl(openmct, objectPath, customUrlParams = {}) {
let url = identifierToString(openmct, objectPath);
let urlParams = paramsToArray(openmct);
let urlParams = paramsToArray(openmct, customUrlParams);
if (urlParams.length) {
url += '?' + urlParams.join('&');
}

View File

@ -66,5 +66,14 @@ describe('the url tool', function () {
const constructedURL = objectPathToUrl(openmct, mockObjectPath);
expect(constructedURL).toContain('#/browse/mock-parent-folder/mock-folder');
});
it('can take params to set a custom url', () => {
const customParams = {
'tc.startBound': 1669911059,
'tc.endBound': 1669911082,
'tc.mode': 'fixed'
};
const constructedURL = objectPathToUrl(openmct, mockObjectPath, customParams);
expect(constructedURL).toContain('tc.startBound=1669911059&tc.endBound=1669911082&tc.mode=fixed');
});
});
});

View File

@ -22,8 +22,10 @@
import ObjectView from './ObjectView.vue';
import StackedPlot from '../../plugins/plot/stackedPlot/StackedPlot.vue';
import Plot from '../../plugins/plot/Plot.vue';
export default {
ObjectView,
StackedPlot
StackedPlot,
Plot
};