diff --git a/lib/collections/addon/components/discover-page/component.ts b/lib/collections/addon/components/discover-page/component.ts index 6ef8c2a811..9bc0db0f34 100644 --- a/lib/collections/addon/components/discover-page/component.ts +++ b/lib/collections/addon/components/discover-page/component.ts @@ -10,7 +10,6 @@ import { camelize } from '@ember/string'; import { waitFor } from '@ember/test-waiters'; import { keepLatestTask, timeout } from 'ember-concurrency'; import { taskFor } from 'ember-concurrency-ts'; -import config from 'ember-osf-web/config/environment'; import Media from 'ember-responsive'; import { layout } from 'ember-osf-web/decorators/component'; @@ -226,12 +225,6 @@ export default class DiscoverPage extends Component { return this.totalPages < maxPages ? this.totalPages : maxPages; } - @computed('currentUser.sessionKey') - get searchUrl() { - // Pulls SHARE search url from config file. - return `${config.OSF.shareSearchUrl}?preference=${this.currentUser.sessionKey}`; - } - // Total pages of search results @computed('numberOfResults', 'size') get totalPages(): number { diff --git a/lib/collections/config/environment.d.ts b/lib/collections/config/environment.d.ts index f59b21682e..e79fe9a370 100644 --- a/lib/collections/config/environment.d.ts +++ b/lib/collections/config/environment.d.ts @@ -3,7 +3,6 @@ declare const config: { hostAppName: string; modulePrefix: string; OSF: { - shareSearchUrl: string; url: string; }, whiteListedProviders: string[]; diff --git a/lib/collections/config/environment.js b/lib/collections/config/environment.js index a3cdcb7cc6..7a178bb57f 100644 --- a/lib/collections/config/environment.js +++ b/lib/collections/config/environment.js @@ -6,7 +6,6 @@ module.exports = function(environment) { hostAppName: 'collections', modulePrefix: 'collections', OSF: { - shareSearchUrl: 'https://share.osf.io/api/v2/search/creativeworks/_search', url: 'http://localhost:5000/', }, whiteListedProviders: [ diff --git a/lib/registries/addon/services/share-search.ts b/lib/registries/addon/services/share-search.ts index 27e791429c..f476caa7eb 100644 --- a/lib/registries/addon/services/share-search.ts +++ b/lib/registries/addon/services/share-search.ts @@ -127,7 +127,7 @@ export default class ShareSearch extends Search { osfProviders: SourceDescriptor[] = []; url(): string { - return `${config.shareSearchBaseURL}/creativeworks/_search`; + return config.shareSearchUrl; } extractTotal(response: any): number { @@ -201,7 +201,7 @@ export default class ShareSearch extends Search { let mainLink: string | undefined; const infoLinks: Array<{ type: string, uri: string }> = []; const hyperLinks: string[] = [ - `${config.shareBaseURL}/${r._source.type.replace(/ /g, '')}/${r._id}`, + `${config.shareBaseUrl}/${r._source.type.replace(/ /g, '')}/${r._id}`, ]; for (const identifier of (r._source.identifiers as string[])) { diff --git a/lib/registries/config/environment.d.ts b/lib/registries/config/environment.d.ts index c0046f15ee..73682e2958 100644 --- a/lib/registries/config/environment.d.ts +++ b/lib/registries/config/environment.d.ts @@ -3,8 +3,8 @@ declare const config: { hostAppName: string; indexPageRegistrationIds: string[]; modulePrefix: string; - shareBaseURL: string; - shareSearchBaseURL: string; + shareBaseUrl: string; + shareSearchUrl: string; externalRegistries: Array<{ name: string; https: boolean; diff --git a/lib/registries/config/environment.js b/lib/registries/config/environment.js index bb62e98267..fa84d8c9cc 100644 --- a/lib/registries/config/environment.js +++ b/lib/registries/config/environment.js @@ -30,8 +30,8 @@ module.exports = function(environment) { 'ember-cli-mirage': projectConfig['ember-cli-mirage'], // Engine specific settings - shareBaseURL: 'https://share.osf.io', - shareSearchBaseURL: 'https://share.osf.io/api/v2/search', + shareBaseUrl: projectConfig.OSF.shareBaseUrl, + shareSearchUrl: projectConfig.OSF.shareSearchUrl, indexPageRegistrationIds: ['6tsnj', 'aurjt', 'e94t8', '2tpy9', '2ds52'], externalRegistries: [{ https: true, diff --git a/mirage/config.ts b/mirage/config.ts index 28a7a631f9..e380d8f0fc 100644 --- a/mirage/config.ts +++ b/mirage/config.ts @@ -54,12 +54,13 @@ import * as wb from './views/wb'; const { OSF: { addonServiceUrl, apiUrl, shareBaseUrl, url: osfUrl } } = config; + export default function(this: Server) { this.passthrough(); // pass through all requests on currrent domain this.passthrough('https://api.crossref.org/*'); - // SHARE-powered registration discover endpoint - this.urlPrefix = 'https://share.osf.io'; + // SHARE search + this.urlPrefix = shareBaseUrl; this.namespace = '/api/v2/'; this.post('/search/creativeworks/_search', shareSearch);