Skip to content

Commit 4e1e52b

Browse files
authored
Merge pull request #4232 from topcoder-platform/hot-fix-accessing-comcast
Hot fix accessing comcast
2 parents 7dfc188 + 9d675e6 commit 4e1e52b

File tree

5 files changed

+44
-11
lines changed

5 files changed

+44
-11
lines changed

.circleci/config.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,21 @@ workflows:
174174
filters:
175175
branches:
176176
only:
177-
- develop
178-
- comcast-community
177+
- this-is-before-comcast
179178
# This is alternate dev env for parallel testing
180179
- "build-test":
181180
context : org-global
182181
filters:
183182
branches:
184183
only:
185-
- nav-hot-fix
186-
- feature-contentful
184+
- comcast-community
187185
# This is beta env for production soft releases
188186
- "build-prod-beta":
189187
context : org-global
190188
filters:
191189
branches:
192190
only:
193-
- develop
194-
- comcast-community
191+
- hot-fix-accessing-comcast
195192
# Production builds are exectuted only on tagged commits to the
196193
# master branch.
197194
- "build-prod":

__tests__/shared/components/__snapshots__/Content.jsx.snap

+16
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,22 @@ exports[`Matches shallow shapshot 1`] = `
512512
Zurich Community
513513
</Link>
514514
</li>
515+
<li>
516+
<Link
517+
replace={false}
518+
to="/__community__/tco20"
519+
>
520+
TCO20
521+
</Link>
522+
</li>
523+
<li>
524+
<Link
525+
replace={false}
526+
to="/__community__/comcast"
527+
>
528+
Comcast Community
529+
</Link>
530+
</li>
515531
</ul>
516532
<h3>
517533
Previews of Contentful Components

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lint:js": "eslint --ext .js,.jsx .",
1515
"lint:scss": "stylelint **/*.scss --syntax scss",
1616
"start": "cross-env BABEL_ENV=production NODE_ENV=production node ./bin/www",
17-
"test": "npm run lint && npm run --runInBand jest",
17+
"test": "npm run lint && npm run jest",
1818
"commitlint": "commitlint -E HUSKY_GIT_PARAMS",
1919
"release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s",
2020
"postinstall": "rimraf node_modules/navigation-component/node_modules/topcoder-react-utils && rimraf node_modules/topcoder-react-ui-kit/node_modules/topcoder-react-utils"
@@ -120,7 +120,7 @@
120120
"redux-promise": "^0.6.0",
121121
"request-ip": "^2.0.2",
122122
"require-context": "^1.1.0",
123-
"serialize-javascript": "^1.5.0",
123+
"serialize-javascript": "^2.1.1",
124124
"serve-favicon": "^2.5.0",
125125
"sharp": "^0.20.5",
126126
"shortid": "^2.2.8",

src/shared/components/Content/index.jsx

+16
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,22 @@ export default function Content() {
427427
Zurich Community
428428
</Link>
429429
</li>
430+
<li>
431+
<Link
432+
replace={false}
433+
to="/__community__/tco20"
434+
>
435+
TCO20
436+
</Link>
437+
</li>
438+
<li>
439+
<Link
440+
replace={false}
441+
to="/__community__/comcast"
442+
>
443+
Comcast Community
444+
</Link>
445+
</li>
430446

431447
</ul>
432448

src/shared/containers/tc-communities/Loader.jsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ class Loader extends React.Component {
4949
/* TODO: This is a hacky way to handle SSO authentication for TopGear
5050
* (Wipro) and Zurich community visitors. Should be re-factored, but not it is not
5151
* clear, what exactly do we need to support it in general. */
52-
if (communityId === 'wipro' && !visitorGroups) {
52+
if ((communityId === 'wipro' || communityId === 'comcast') && !visitorGroups) {
5353
const returnUrl = encodeURIComponent(window.location.href);
54-
window.location = `${config.URL.AUTH}/sso-login/?retUrl=${returnUrl}&utm_source=${communityId}`;
54+
let subpath = 'member';
55+
if (communityId === 'wipro') {
56+
subpath = 'sso-login/';
57+
}
58+
window.location = `${config.URL.AUTH}/${subpath}?retUrl=${returnUrl}&utm_source=${communityId}`;
5559
}
5660
}
5761

@@ -88,7 +92,7 @@ class Loader extends React.Component {
8892
* while that redirection is handled we want to show page loading
8993
* placeholder rather than access denied message. In future a more
9094
* generic implementation of this should be put here. */
91-
if (communityId === 'wipro') return <LoadingPagePlaceholder />;
95+
if (communityId === 'wipro' || communityId === 'comcast') return <LoadingPagePlaceholder />;
9296
// Only fo Zurich community we implement special auth system described
9397
// here: https://github.com/topcoder-platform/community-app/issues/1878
9498
// at this check specially we allow not authenticated visitos

0 commit comments

Comments
 (0)