Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7343053
D8844.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8844.id.diff
View Options
diff --git a/cypress/e2e/origin-search.cy.js b/cypress/e2e/origin-search.cy.js
--- a/cypress/e2e/origin-search.cy.js
+++ b/cypress/e2e/origin-search.cy.js
@@ -199,9 +199,11 @@
const searchText = 'plugin';
doSearch(searchText);
cy.wait('@originMetadataSearch').then((req) => {
- expect(req.response.body[0].metadata.metadata.description).to.equal(
- 'Line numbering plugin for Highlight.js'
- // metadata is defined in _TEST_ORIGINS variable in swh/web/tests/data.py
+ expect(req.response.body).to.deep.equal(
+ [
+ {'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'}
+ ]
+ // origins are defined in _TEST_ORIGINS variable in swh/web/tests/data.py
);
});
});
diff --git a/swh/web/browse/assets/browse/origin-search.js b/swh/web/browse/assets/browse/origin-search.js
--- a/swh/web/browse/assets/browse/origin-search.js
+++ b/swh/web/browse/assets/browse/origin-search.js
@@ -114,6 +114,9 @@
baseSearchUrl.searchParams.append('use_ql', useSearchQL ?? false);
}
+ // As we only use the 'url' field of results, tell the server not to send metadata
+ baseSearchUrl.searchParams.append('fields', 'url');
+
const withVisit = $('#swh-search-origins-with-visit').prop('checked');
baseSearchUrl.searchParams.append('limit', limit);
baseSearchUrl.searchParams.append('with_visit', withVisit);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 17 2025, 6:59 PM (7 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217037
Attached To
D8844: origin-search: Only request 'url' field
Event Timeline
Log In to Comment