Skip to content

Hot fix accessing comcast #4232

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

Merged
merged 3 commits into from
Apr 13, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,21 @@ workflows:
filters:
branches:
only:
- develop
- comcast-community
- this-is-before-comcast
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
filters:
branches:
only:
- nav-hot-fix
- feature-contentful
- comcast-community
# 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":
Expand Down
16 changes: 16 additions & 0 deletions __tests__/shared/components/__snapshots__/Content.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,22 @@ exports[`Matches shallow shapshot 1`] = `
Zurich Community
</Link>
</li>
<li>
<Link
replace={false}
to="/__community__/tco20"
>
TCO20
</Link>
</li>
<li>
<Link
replace={false}
to="/__community__/comcast"
>
Comcast Community
</Link>
</li>
</ul>
<h3>
Previews of Contentful Components
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions src/shared/components/Content/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,22 @@ export default function Content() {
Zurich Community
</Link>
</li>
<li>
<Link
replace={false}
to="/__community__/tco20"
>
TCO20
</Link>
</li>
<li>
<Link
replace={false}
to="/__community__/comcast"
>
Comcast Community
</Link>
</li>

</ul>

Expand Down
10 changes: 7 additions & 3 deletions src/shared/containers/tc-communities/Loader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
}

Expand Down Expand Up @@ -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 <LoadingPagePlaceholder />;
if (communityId === 'wipro' || communityId === 'comcast') return <LoadingPagePlaceholder />;
// 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
Expand Down