diff --git a/src/app/cdk/platform-info/browserlist.regexp.ts b/src/app/cdk/platform-info/browserlist.regexp.ts index dd011b22dc..954be17405 100644 --- a/src/app/cdk/platform-info/browserlist.regexp.ts +++ b/src/app/cdk/platform-info/browserlist.regexp.ts @@ -1,3 +1,2 @@ // tslint:disable-next-line: max-line-length -export const BROWSERLIST_REGEXP = - /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/ +export const BROWSERLIST_REGEXP = /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/ diff --git a/src/environments/environment.int.ts b/src/environments/environment.int.ts index 046b6add4a..4e542c6135 100644 --- a/src/environments/environment.int.ts +++ b/src/environments/environment.int.ts @@ -1,10 +1,12 @@ +import { getSubDomain } from "./subdomain.adapter"; + export const environment = { production: true, debugger: true, ROBOTS: 'noindex, nofollow', API_NEWS: 'https://info.int.orcid.org/feed/', - API_PUB: '//pub.int.orcid.org/v3.0', - API_WEB: '//int.orcid.org/', + API_PUB: `//pub.${getSubDomain}orcid.org/v3.0`, + API_WEB: `//${getSubDomain}orcid.org/`, BASE_URL: '', INFO_SITE: 'https://info.qa.orcid.org/', GOOGLE_ANALYTICS_TESTING_MODE: true, diff --git a/src/environments/environment.local-with-proxy.ts b/src/environments/environment.local-with-proxy.ts index 0947ebdd80..c735432e64 100644 --- a/src/environments/environment.local-with-proxy.ts +++ b/src/environments/environment.local-with-proxy.ts @@ -1,10 +1,17 @@ +function getSubDomain() { + const subdomain = window.location.hostname.split('.').slice(0, -2).join('.'); + return subdomain? subdomain+'.':'' + +} + + export const environment = { production: false, debugger: true, ROBOTS: 'all', API_NEWS: 'https://www.mocky.io/v2/5dced45b3000007300931ce8', - API_PUB: '/v3.0', - API_WEB: '/', + API_PUB: `//${getSubDomain}orcid.org/v3.0`, + API_WEB: `//${getSubDomain}orcid.org/`, BASE_URL: '', INFO_SITE: 'https://info.orcid.org/', GOOGLE_ANALYTICS_TESTING_MODE: true, diff --git a/src/environments/environment.local.ts b/src/environments/environment.local.ts index 5d737d50ed..c3cf15c096 100644 --- a/src/environments/environment.local.ts +++ b/src/environments/environment.local.ts @@ -1,10 +1,12 @@ +import { getSubDomain } from "./subdomain.adapter"; + export const environment = { production: false, debugger: true, ROBOTS: 'all', API_NEWS: 'https://www.mocky.io/v2/5dced45b3000007300931ce8', - API_PUB: '//pub.dev.orcid.org/v3.0', - API_WEB: '//dev.orcid.org/', + API_PUB: `//pub.${getSubDomain}orcid.org/v3.0`, + API_WEB: `//${getSubDomain}orcid.org/`, BASE_URL: '', INFO_SITE: 'https://info.orcid.org/', GOOGLE_ANALYTICS_TESTING_MODE: true, diff --git a/src/environments/environment.local.with.sandbox.ts b/src/environments/environment.local.with.sandbox.ts deleted file mode 100644 index ba40d203a8..0000000000 --- a/src/environments/environment.local.with.sandbox.ts +++ /dev/null @@ -1,45 +0,0 @@ -// TODO: Currently CORS-Anywhere does not support calls with credentials -// to make the local environment work with Sandbox an alternative needs to be use to avoid CORS errors -export const environment = { - production: false, - sessionDebugger: true, - API_NEWS: 'https://www.mocky.io/v2/5dced45b3000007300931ce8', - API_PUB: '//pub.localhost/v3.0', - API_WEB: 'https://orcid.herokuapp.com/https://sandbox.orcid.org/', - BASE_URL: '', - BLOG_NEWS: 'https://orcid.org/about/news', - INFO_SITE: 'http://orcidaboutdev.wpengine.com/', - GOOGLE_ANALYTICS_TESTING_MODE: true, - GOOGLE_TAG_MANAGER: 'GTM-0000000', - GOOGLE_RECAPTCHA: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', - ZENDESK: null, - HELP_HERO_ID: 'oYFQMrzFHA', - SHOW_TEST_WARNING_BANNER: true, - CAN_DISABLE_TEST_WARNING_BANNER: true, - INSTITUTIONAL_AUTOCOMPLETE_DISPLAY_AMOUNT: 20, - VERBOSE_SNACKBAR_ERRORS_REPORTS: true, - LANGUAGE_MENU_OPTIONS: { - ar: 'العربية', - cs: 'Čeština', - de: 'Deutsch', - en: 'English', - es: 'Español', - fr: 'Français', - it: 'Italiano', - ja: '日本語', - ko: '한국어', - pl: 'Polski', - pt: 'Português', - ru: 'Русский', - tr: 'Türkçe', - 'zh-CN': '简体中文', - 'zh-TW': '繁體中文', - xx: '** xx', - src: '** source', - lr: '** lr', - rl: '** rl', - uk: '** Ukrainian', - ca: '** Catalan', - }, - proxyMode: false, -} diff --git a/src/environments/environment.production.ts b/src/environments/environment.production.ts index 08d8c67039..3b53af8963 100644 --- a/src/environments/environment.production.ts +++ b/src/environments/environment.production.ts @@ -1,10 +1,12 @@ +import { getSubDomain } from "./subdomain.adapter"; + export const environment = { production: true, debugger: false, ROBOTS: 'all', API_NEWS: 'https://info.orcid.org/feed/', - API_PUB: '//pub.orcid.org/v3.0', - API_WEB: '//orcid.org/', + API_PUB: `//pub.${getSubDomain}orcid.org/v3.0`, + API_WEB: `//${getSubDomain}orcid.org/`, BASE_URL: '', INFO_SITE: 'https://info.orcid.org/', SHOW_TEST_WARNING_BANNER: false, @@ -34,3 +36,5 @@ export const environment = { }, proxyMode: false, } + + diff --git a/src/environments/environment.qa.ts b/src/environments/environment.qa.ts index 218e3bf92a..ec88f0e58c 100644 --- a/src/environments/environment.qa.ts +++ b/src/environments/environment.qa.ts @@ -1,10 +1,12 @@ +import { getSubDomain } from "./subdomain.adapter"; + export const environment = { production: true, debugger: true, ROBOTS: 'noindex, nofollow', API_NEWS: 'https://info.qa.orcid.org/feed/', - API_PUB: '//pub.qa.orcid.org/v3.0', - API_WEB: '//qa.orcid.org/', + API_PUB: `//pub.${getSubDomain}orcid.org/v3.0`, + API_WEB: `//${getSubDomain}orcid.org/`, BASE_URL: '', INFO_SITE: 'https://info.qa.orcid.org/', GOOGLE_ANALYTICS_TESTING_MODE: true, diff --git a/src/environments/environment.sandbox.ts b/src/environments/environment.sandbox.ts index 845bcc8ed0..459a254f6e 100644 --- a/src/environments/environment.sandbox.ts +++ b/src/environments/environment.sandbox.ts @@ -1,10 +1,12 @@ +import { getSubDomain } from "./subdomain.adapter"; + export const environment = { production: true, debugger: false, ROBOTS: 'noindex, nofollow', API_NEWS: 'https://info.qa.orcid.org/feed/', - API_PUB: '//pub.sandbox.orcid.org/v3.0', - API_WEB: '//sandbox.orcid.org/', + API_PUB: `//pub.${getSubDomain}orcid.org/v3.0`, + API_WEB: `//${getSubDomain}orcid.org/`, BASE_URL: '', INFO_SITE: 'https://info.qa.orcid.org/', GOOGLE_ANALYTICS_TESTING_MODE: false, diff --git a/src/environments/subdomain.adapter.ts b/src/environments/subdomain.adapter.ts new file mode 100644 index 0000000000..6dac065eee --- /dev/null +++ b/src/environments/subdomain.adapter.ts @@ -0,0 +1,4 @@ +export function getSubDomain() { + const subdomain = window.location.hostname.split('.').slice(0, -2).join('.'); + return subdomain? subdomain+'.':'' +}