Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

point search to new url #161492

Merged
merged 1 commit into from Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/base/common/product.ts
Expand Up @@ -70,6 +70,7 @@ export interface IProductConfiguration {

readonly extensionsGallery?: {
readonly serviceUrl: string;
readonly searchUrl?: string;
readonly itemUrl: string;
readonly publisherUrl: string;
readonly resourceUrlTemplate: string;
Expand Down
Expand Up @@ -301,6 +301,7 @@ class Query {
get sortBy(): number { return this.state.sortBy; }
get sortOrder(): number { return this.state.sortOrder; }
get flags(): number { return this.state.flags; }
get criteria(): ICriterium[] { return this.state.criteria; }

withPage(pageNumber: number, pageSize: number = this.state.pageSize): Query {
return new Query({ ...this.state, pageNumber, pageSize });
Expand Down Expand Up @@ -566,8 +567,9 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi

declare readonly _serviceBrand: undefined;

private extensionsGalleryUrl: string | undefined;
private extensionsControlUrl: string | undefined;
private readonly extensionsGalleryUrl: string | undefined;
private readonly extensionsGallerySearchUrl: string | undefined;
private readonly extensionsControlUrl: string | undefined;

private readonly commonHeadersPromise: Promise<{ [key: string]: string }>;

Expand All @@ -582,8 +584,9 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
@IConfigurationService private readonly configurationService: IConfigurationService,
) {
const config = productService.extensionsGallery;
this.extensionsGalleryUrl = config && config.serviceUrl;
this.extensionsControlUrl = config && config.controlUrl;
this.extensionsGalleryUrl = config?.serviceUrl;
this.extensionsGallerySearchUrl = config?.searchUrl;
this.extensionsControlUrl = config?.controlUrl;
this.commonHeadersPromise = resolveMarketplaceHeaders(
productService.version,
productService,
Expand Down Expand Up @@ -944,7 +947,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
try {
context = await this.requestService.request({
type: 'POST',
url: this.api('/extensionquery'),
url: this.extensionsGallerySearchUrl && query.criteria.some(c => c.filterType === FilterType.SearchText) ? this.extensionsGallerySearchUrl : this.api('/extensionquery'),
data,
headers
}, token);
Expand Down