From 36bebe171d65b13086e131a828f03f58a6295ded Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Sat, 11 Apr 2020 00:07:21 +0800 Subject: [PATCH 1/3] fix accessing issue --- .circleci/config.yml | 8 +++----- .../components/__snapshots__/Content.jsx.snap | 16 ++++++++++++++++ package.json | 2 +- src/shared/components/Content/index.jsx | 16 ++++++++++++++++ src/shared/containers/tc-communities/Loader.jsx | 10 +++++++--- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eea738d5b9..fd0572fb4d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,24 +174,22 @@ workflows: filters: branches: only: - - develop - - comcast-community + - feature-private-navigation # This is alternate dev env for parallel testing - "build-test": context : org-global filters: branches: only: - - nav-hot-fix - - feature-contentful + - nav-hotfix-thrive-link # This is beta env for production soft releases - "build-prod-beta": context : org-global filters: branches: only: - - develop - comcast-community + - hot-fix-accessing-comcast # Production builds are exectuted only on tagged commits to the # master branch. - "build-prod": diff --git a/__tests__/shared/components/__snapshots__/Content.jsx.snap b/__tests__/shared/components/__snapshots__/Content.jsx.snap index 81e4b665cb..86d90bc2d2 100644 --- a/__tests__/shared/components/__snapshots__/Content.jsx.snap +++ b/__tests__/shared/components/__snapshots__/Content.jsx.snap @@ -512,6 +512,22 @@ exports[`Matches shallow shapshot 1`] = ` Zurich Community +
  • + + TCO20 + +
  • +
  • + + Comcast Community + +
  • Previews of Contentful Components diff --git a/package.json b/package.json index 2468f6ccc3..325bc049f1 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint:js": "eslint --ext .js,.jsx .", "lint:scss": "stylelint **/*.scss --syntax scss", "start": "cross-env BABEL_ENV=production NODE_ENV=production node ./bin/www", - "test": "npm run lint && npm run --runInBand jest", + "test": "npm run lint && npm run jest", "commitlint": "commitlint -E HUSKY_GIT_PARAMS", "release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s", "postinstall": "rimraf node_modules/navigation-component/node_modules/topcoder-react-utils && rimraf node_modules/topcoder-react-ui-kit/node_modules/topcoder-react-utils" diff --git a/src/shared/components/Content/index.jsx b/src/shared/components/Content/index.jsx index a74411a1b2..3331309480 100644 --- a/src/shared/components/Content/index.jsx +++ b/src/shared/components/Content/index.jsx @@ -427,6 +427,22 @@ export default function Content() { Zurich Community +
  • + + TCO20 + +
  • +
  • + + Comcast Community + +
  • diff --git a/src/shared/containers/tc-communities/Loader.jsx b/src/shared/containers/tc-communities/Loader.jsx index 7bb7a9c111..c05eb4e69b 100644 --- a/src/shared/containers/tc-communities/Loader.jsx +++ b/src/shared/containers/tc-communities/Loader.jsx @@ -49,9 +49,13 @@ class Loader extends React.Component { /* TODO: This is a hacky way to handle SSO authentication for TopGear * (Wipro) and Zurich community visitors. Should be re-factored, but not it is not * clear, what exactly do we need to support it in general. */ - if (communityId === 'wipro' && !visitorGroups) { + if ((communityId === 'wipro' || communityId === 'comcast') && !visitorGroups) { const returnUrl = encodeURIComponent(window.location.href); - window.location = `${config.URL.AUTH}/sso-login/?retUrl=${returnUrl}&utm_source=${communityId}`; + let subpath = 'member'; + if (communityId === 'wipro') { + subpath = 'sso-login/'; + } + window.location = `${config.URL.AUTH}/${subpath}?retUrl=${returnUrl}&utm_source=${communityId}`; } } @@ -88,7 +92,7 @@ class Loader extends React.Component { * while that redirection is handled we want to show page loading * placeholder rather than access denied message. In future a more * generic implementation of this should be put here. */ - if (communityId === 'wipro') return ; + if (communityId === 'wipro' || communityId === 'comcast') return ; // Only fo Zurich community we implement special auth system described // here: https://github.com/topcoder-platform/community-app/issues/1878 // at this check specially we allow not authenticated visitos From 146187e42877f985af4ce7fa49f5be25a902284f Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Sun, 12 Apr 2020 12:30:30 +0800 Subject: [PATCH 2/3] ci: deploying on beta --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd0572fb4d..fa2cbf6f60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,7 +174,7 @@ workflows: filters: branches: only: - - feature-private-navigation + - develop # This is alternate dev env for parallel testing - "build-test": context : org-global @@ -188,7 +188,6 @@ workflows: filters: branches: only: - - comcast-community - hot-fix-accessing-comcast # Production builds are exectuted only on tagged commits to the # master branch. From 9d675e63c82f87b0c2bf90d3aa655e5c9ce0e6a3 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Sun, 12 Apr 2020 23:30:00 +0800 Subject: [PATCH 3/3] ci: deploying on beta --- .circleci/config.yml | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa2cbf6f60..848ee9d831 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,14 +174,14 @@ workflows: filters: branches: only: - - develop + - this-is-before-comcast # This is alternate dev env for parallel testing - "build-test": context : org-global filters: branches: only: - - nav-hotfix-thrive-link + - comcast-community # This is beta env for production soft releases - "build-prod-beta": context : org-global diff --git a/package.json b/package.json index 325bc049f1..f151018bf6 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "redux-promise": "^0.6.0", "request-ip": "^2.0.2", "require-context": "^1.1.0", - "serialize-javascript": "^1.5.0", + "serialize-javascript": "^2.1.1", "serve-favicon": "^2.5.0", "sharp": "^0.20.5", "shortid": "^2.2.8",