diff --git a/swh/web/assets/src/bundles/browse/origin-search.js b/swh/web/assets/src/bundles/browse/origin-search.js --- a/swh/web/assets/src/bundles/browse/origin-search.js +++ b/swh/web/assets/src/bundles/browse/origin-search.js @@ -5,7 +5,7 @@ * See top-level LICENSE file for more information */ -import {handleFetchError} from 'utils/functions'; +import { handleFetchError } from 'utils/functions'; const limit = 100; let linksPrev = []; @@ -186,8 +186,17 @@ if (searchMetadata) { queryParameters += '&search_metadata'; } - // Update the url, triggering page reload and effective search - window.location.search = queryParameters; + + let searchQueryTextSplitted = searchQueryText.split(':'); + if (searchQueryTextSplitted.length === 4 && searchQueryTextSplitted[0].toLowerCase() !== 'swh') { + $('#swh-origin-search-results').hide(); + $('.swh-search-pagination').hide(); + $('#swh-no-result').text('This is not a valid PID'); + $('#swh-no-result').show(); + } else { + // Update the url, triggering page reload and effective search + window.location.search = queryParameters; + } }); $('#origins-next-results-button').click(event => {