Skip to content

Commit ace2654

Browse files
authored
Merge pull request #114 from topcoder-platform/develop
More fixes for Wipro community
2 parents e38b4cf + 31b1ce9 commit ace2654

File tree

6 files changed

+59
-1
lines changed

6 files changed

+59
-1
lines changed

config/default.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"URL": {
4545
"ARENA": "https://arena.topcoder-dev.com",
4646
"AUTH": "https://accounts.topcoder-dev.com/member",
47+
"AUTH_SSO": "https://accounts.topcoder-dev.com/sso-login",
4748
"BASE": "https://www.topcoder-dev.com",
4849
"COMMUNITY": "https://community.topcoder-dev.com",
4950
"FORUMS": "https://apps.topcoder-dev.com/forums",

config/production.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"URL": {
1212
"ARENA": "https://arena.topcoder.com",
1313
"AUTH": "https://accounts.topcoder.com/member",
14+
"AUTH_SSO": "https://accounts.topcoder.com/sso-login",
1415
"BASE": "https://www.topcoder.com",
1516
"COMMUNITY": "https://community.topcoder.com",
1617
"FORUMS": "https://apps.topcoder.com/forums",

src/server/renderer.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export default (req, res) => {
5151
content="width=device-width,initial-scale=1"
5252
name="viewport"
5353
/>
54+
<!-- Start of topcoder Zendesk Widget script -->
55+
<script>/*<![CDATA[*/window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(e){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var e=this.createElement("script");n&&(this.domain=n),e.id="js-iframe-async",e.src="https://assets.zendesk.com/embeddable_framework/main.js",this.t=+new Date,this.zendeskHost="topcoder.zendesk.com",this.zEQueue=a,this.body.appendChild(e)},o.write('<body onload="document._l();">'),o.close()}();
56+
/*]]>*/</script>
57+
<!-- End of topcoder Zendesk Widget script -->
5458
</head>
5559
<body>
5660
<div id="react-view">${appHtml}</div>

src/shared/components/tc-communities/AccessDenied/index.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import './style.scss';
1010

1111
export const CAUSE = {
1212
NOT_AUTHENTICATED: 'Not authenticated',
13+
NOT_AUTHENTICATED_WIPRO: 'Not authenticated (Wipro)',
1314
NOT_AUTHORIZED: 'Not authorized',
1415
};
1516

@@ -38,6 +39,28 @@ export default function AccessDenied({ cause }) {
3839
<div styleName="msg">You are not authorized to access this page.</div>
3940
</div>
4041
);
42+
case CAUSE.NOT_AUTHENTICATED_WIPRO: {
43+
const returnUrl = encodeURIComponent(`${origin}/`);
44+
return (
45+
<div styleName="access-denied">
46+
<TopcoderLogo />
47+
<div styleName="msg">You must be authenticated to access this page.</div>
48+
<div styleName="msg">
49+
<a
50+
className="tc-btn-md tc-btn-primary"
51+
href={`${config.URL.AUTH_SSO}?app=member&retUrl=${returnUrl}`}
52+
>Login with SSO</a>
53+
</div>
54+
<div styleName="msg">
55+
Not a member yet? <a href={`${config.URL.AUTH}/registration?retUrl=${returnUrl}`} styleName="joinNow">Join Now</a>
56+
</div>
57+
<div styleName="copyright">
58+
<strong>Privacy policy</strong>
59+
&copy; 2017 Topcoder. All rights reserved
60+
</div>
61+
</div>
62+
);
63+
}
4164
default: return <div />;
4265
}
4366
}

src/shared/components/tc-communities/AccessDenied/style.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,26 @@
1414
cursor: pointer;
1515
}
1616
}
17+
18+
.joinNow {
19+
&,
20+
&:hover,
21+
&:visited {
22+
color: $tc-light-blue;
23+
text-decoration: underline;
24+
}
25+
}
26+
27+
.copyright {
28+
@include roboto;
29+
30+
color: $tc-gray-60;
31+
font-size: 12pt;
32+
margin-top: 128px;
33+
text-transform: uppercase;
34+
35+
strong {
36+
font-weight: bold;
37+
margin-right: 24px;
38+
}
39+
}

src/shared/containers/tc-communities/Page/index.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,13 @@ class Page extends Component {
218218
</div>
219219
);
220220
}
221-
return <AccessDenied cause={ACCESS_DENIED_CAUSE.NOT_AUTHENTICATED} />;
221+
return (
222+
<AccessDenied
223+
cause={communityId === 'wipro'
224+
? ACCESS_DENIED_CAUSE.NOT_AUTHENTICATED_WIPRO : ACCESS_DENIED_CAUSE.NOT_AUTHENTICATED
225+
}
226+
/>
227+
);
222228
}
223229
}
224230

0 commit comments

Comments
 (0)