Skip to content

Commit

Permalink
feature/dynamic-sub-domains
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Oct 24, 2023
1 parent fdddd54 commit 4025399
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 59 deletions.
3 changes: 1 addition & 2 deletions src/app/cdk/platform-info/browserlist.regexp.ts
Original file line number Diff line number Diff line change
@@ -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]*)?)/
6 changes: 4 additions & 2 deletions src/environments/environment.int.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
11 changes: 9 additions & 2 deletions src/environments/environment.local-with-proxy.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 4 additions & 2 deletions src/environments/environment.local.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
45 changes: 0 additions & 45 deletions src/environments/environment.local.with.sandbox.ts

This file was deleted.

8 changes: 6 additions & 2 deletions src/environments/environment.production.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -34,3 +36,5 @@ export const environment = {
},
proxyMode: false,
}


6 changes: 4 additions & 2 deletions src/environments/environment.qa.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 4 additions & 2 deletions src/environments/environment.sandbox.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/environments/subdomain.adapter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function getSubDomain() {
const subdomain = window.location.hostname.split('.').slice(0, -2).join('.');
return subdomain? subdomain+'.':''
}

0 comments on commit 4025399

Please sign in to comment.