Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions e2e/tests/functional/plugins/plot/tagging.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,35 @@ test.describe('Plot Tagging', () => {
await basicTagsTests(page);
});

test('Plots use index to retrieve tags @couchdb @network', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/8184'
});
// Switch to real-time mode
await setRealTimeMode(page);

const tagsRequestPromise = new Promise((resolve) => {
page.on('request', async (request) => {
const isTagsRequest = request.url().endsWith('by_keystring');
if (isTagsRequest) {
const response = await request.response();
resolve(response.status() === 200);
}
});
});
await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator'
});

const pauseButton = page.getByLabel('Pause incoming real-time data');
pauseButton.click();

const didUseIndexForTagsRequest = await tagsRequestPromise;

expect(didUseIndexForTagsRequest).toBe(true);
});

test('Tags work with Stacked Plots', async ({ page }) => {
const stackedPlot = await createDomainObjectWithDefaults(page, {
type: 'Stacked Plot'
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/persistence/couch/CouchObjectProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ class CouchObjectProvider {
{ designDoc, viewName, keysToSearch, startKey, endKey, limit, objectIdField },
abortSignal
) {
let stringifiedKeys = JSON.stringify(keysToSearch);
const url = `${this.url}/_design/${designDoc}/_view/${viewName}`;
const requestBody = {};
let requestBodyString;
Expand All @@ -485,7 +484,7 @@ class CouchObjectProvider {
requestBodyString = requestBodyString.replace('$END_KEY', endKey);
/* spell-checker: enable */
} else {
requestBody.keys = stringifiedKeys;
requestBody.keys = keysToSearch;
requestBodyString = JSON.stringify(requestBody);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash -e

sed -i'.bak' -e 's/LocalStorage()/CouchDB("http:\/\/localhost:5984\/openmct")/g' index.html
sed -i'.bak' -e 's/LocalStorage()/CouchDB(\{url: "http:\/\/localhost:5984\/openmct", useDesignDocuments: true\})/g' index.html
Loading