Skip to content

Commit ede8c75

Browse files
Merge branch 'develop' into thrive-bug-fixes3
2 parents 657ce13 + 645a42d commit ede8c75

File tree

9 files changed

+299
-17
lines changed

9 files changed

+299
-17
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ workflows:
361361
filters:
362362
branches:
363363
only:
364-
- thrive-bug-fixes3
364+
- free
365365
# This is stage env for production QA releases
366366
- "build-prod-staging":
367367
context : org-global

automated-smoke-test/conf.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ exports.config = {
4141
// '../temp/test-suites/tc-header.spec.js',
4242
// '../temp/test-suites/tc-footer.spec.js',
4343
// '../temp/test-suites/tc-preferences.spec.js',
44-
'../temp/test-suites/tc-challenge-listing.spec.js',
45-
// '../temp/test-suites/tc-challenge-detail.spec.js',
44+
'../temp/test-suites/tc-challenge-listing.spec.js',
45+
'../temp/test-suites/tc-challenge-detail.spec.js',
4646
// '../temp/test-suites/tc-my-dashboard.spec.js',
4747
// '../temp/test-suites/tc-member-profile.spec.js',
4848
],

automated-smoke-test/page-objects/pages/topcoder/challenge-listing/challenge-listing.helper.ts

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ export class ChallengeListingPageHelper {
7272
await BrowserHelper.sleep(5000);
7373

7474
const firstChallenge = ChallengeListingPageObject.firstChallengeLink;
75-
let firstChallengeName = '';
76-
if (await firstChallenge.isPresent()) {
77-
firstChallengeName = await firstChallenge.getText();
75+
76+
const isPresent = await firstChallenge.isPresent();
77+
expect(isPresent).toEqual(true);
78+
79+
if (isPresent) {
80+
const firstChallengeName = await firstChallenge.getText();
7881
expect(firstChallengeName).toEqual(searchString);
7982
}
8083
}
@@ -218,6 +221,35 @@ export class ChallengeListingPageHelper {
218221
let filtersVisibility = await CommonHelper.isDisplayed(ChallengeListingPageObject.subCommunityLabel);
219222
expect(filtersVisibility).toBe(true);
220223

224+
// Filter by Development Challenges
225+
let el = await ChallengeListingPageObject.designSwitch();
226+
await el.click();
227+
await CommonHelper.waitUntilPresenceOf(
228+
() => ChallengeListingPageObject.designSwitchTurnedOff,
229+
'wait for design switch turn off',
230+
false
231+
);
232+
233+
el = await ChallengeListingPageObject.dataScienceSwitch();
234+
await el.click();
235+
await CommonHelper.waitUntilPresenceOf(
236+
() => ChallengeListingPageObject.dataScienceSwitchTurnedOff,
237+
'wait for data science switch turn off',
238+
false
239+
);
240+
241+
el = await ChallengeListingPageObject.qaSwitch();
242+
await el.click();
243+
await CommonHelper.waitUntilPresenceOf(
244+
() => ChallengeListingPageObject.qaSwitchTurnedOff,
245+
'wait for qa switch turn off',
246+
false
247+
);
248+
249+
// Filter by Challenge type
250+
await ChallengeListingPageObject.first2FinishCheckbox.click();
251+
await ChallengeListingPageObject.taskCheckbox.click();
252+
221253
await ChallengeListingPageObject.challengeSearchBox.sendKeys('ReactJS');
222254
await BrowserHelper.sleep(5000);
223255
await this.verifyChallengesMatchingKeyword(['ReactJS']);
@@ -505,6 +537,7 @@ export class ChallengeListingPageHelper {
505537
// const tagText = ConfigHelper.getChallengeDetail().challengeTag;
506538
const tagText = 'EdgeNet';
507539
await this.waitForSubCommunity();
540+
508541
await ChallengeListingPageObject.challengeSearchBox.sendKeys(tagText);
509542
await BrowserHelper.sleep(2000);
510543

@@ -514,6 +547,36 @@ export class ChallengeListingPageHelper {
514547
false
515548
);
516549
await ChallengeListingPageObject.getChallengeTag(tagText).click();
550+
551+
// Filter by Development Challenges
552+
let el = await ChallengeListingPageObject.designSwitch();
553+
await el.click();
554+
await CommonHelper.waitUntilPresenceOf(
555+
() => ChallengeListingPageObject.designSwitchTurnedOff,
556+
'wait for design switch turn off',
557+
false
558+
);
559+
560+
el = await ChallengeListingPageObject.dataScienceSwitch();
561+
await el.click();
562+
await CommonHelper.waitUntilPresenceOf(
563+
() => ChallengeListingPageObject.dataScienceSwitchTurnedOff,
564+
'wait for data science switch turn off',
565+
false
566+
);
567+
568+
el = await ChallengeListingPageObject.qaSwitch();
569+
await el.click();
570+
await CommonHelper.waitUntilPresenceOf(
571+
() => ChallengeListingPageObject.qaSwitchTurnedOff,
572+
'wait for qa switch turn off',
573+
false
574+
);
575+
576+
// Filter by Challenge type
577+
await ChallengeListingPageObject.first2FinishCheckbox.click();
578+
await ChallengeListingPageObject.taskCheckbox.click();
579+
517580
// waiting for re-render to happen
518581
await BrowserHelper.sleep(15000);
519582

Lines changed: 107 additions & 0 deletions
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"challengeFilter": {
3+
"events": ["tco22"]
4+
},
5+
"communityId": "tco22",
6+
"communityName": "TCO22",
7+
"groupIds": [],
8+
"hideSearch": true,
9+
"logos": [{
10+
"img": "/community-app-assets/themes/tco/TCO22.svg",
11+
"url": "https://tco22.topcoder.com"
12+
}],
13+
"menuItems": [{
14+
"navigationMenu": "5zZw57ZcKXWfOwwWbk5VnL"
15+
}],
16+
"newsFeed": "http://www.topcoder.com/feed",
17+
"subdomains": ["tco22"],
18+
"description": "2022 Topcoder Open. The Ultimate Programming & Design Tournament",
19+
"image": "tco22.jpg"
20+
}

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,19 @@ class Loader extends React.Component {
4646
!meta /* || (Date.now() - meta.timestamp) > MAXAGE */
4747
)) nextProps.loadMetaData(communityId, tokenV3);
4848

49-
/* TODO: This is a hacky way to handle SSO authentication for TopGear
50-
* (Wipro) and Zurich community visitors. Should be re-factored, but not it is not
51-
* clear, what exactly do we need to support it in general. */
52-
if ((communityId === 'wipro' || communityId === 'comcast') && !visitorGroups) {
49+
/* TODO: This is a hacky way to handle SSO authentication for TopGear */
50+
if (communityId === 'comcast' && !visitorGroups) {
5351
const returnUrl = encodeURIComponent(window.location.href);
54-
if (communityId === 'wipro') {
55-
window.location = `${config.URL.AUTH}/?retUrl=${config.URL.TOPGEAR}`;
56-
}
5752
window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`;
5853
}
5954

60-
/* Redirect odl TopGear home to new TopGear App */
61-
if (communityId === 'wipro'
62-
&& (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro')) {
63-
window.location = config.URL.TOPGEAR;
55+
/* Redirect old TopGear home to new TopGear App and login redirect */
56+
if (communityId === 'wipro') {
57+
if (!visitorGroups) {
58+
window.location = `${config.URL.AUTH}/?retUrl=${config.URL.TOPGEAR}&utm_source=${communityId}`;
59+
} else if (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro') {
60+
window.location = config.URL.TOPGEAR;
61+
}
6462
}
6563
}
6664

src/shared/routes/Communities/Routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import tco18 from './TCO18';
3838
import tco19 from './TCO19';
3939
import tco20 from './TCO20';
4040
import tco21 from './TCO21';
41+
import tco22 from './TCO22';
4142
import Mobile from './Mobile';
4243
import Zurich from './Zurich';
4344
import Comcast from './Comcast';
@@ -64,6 +65,7 @@ const TCOs = {
6465
tco19,
6566
tco20,
6667
tco21,
68+
tco22,
6769
};
6870

6971
export default function Communities({
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Routing of TCO22 Community.
3+
*/
4+
5+
import Error404 from 'components/Error404';
6+
import PT from 'prop-types';
7+
import React from 'react';
8+
import { Route, Switch } from 'react-router-dom';
9+
import ContentfulRoute from 'components/Contentful/Route';
10+
import ContentfulMenu from 'components/Contentful/Menu';
11+
import Profile from 'routes/Profile';
12+
import ProfileStats from 'routes/ProfileStats';
13+
import Settings from 'routes/Settings';
14+
15+
export default function TCO22({ base, meta }) {
16+
return (
17+
<div>
18+
{
19+
meta.menuItems ? (
20+
<ContentfulMenu
21+
id={meta.menuItems[0].navigationMenu}
22+
spaceName={meta.menuItems[0].spaceName}
23+
environment={meta.menuItems[0].environment}
24+
baseUrl={base}
25+
/>
26+
) : null
27+
}
28+
<Switch>
29+
<Route
30+
render={props => <Profile {...props} meta={meta} />}
31+
exact
32+
path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`}
33+
/>
34+
<Route
35+
render={props => <ProfileStats {...props} meta={meta} />}
36+
exact
37+
path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`}
38+
/>
39+
<Route
40+
component={() => <Settings base={`${base}/settings`} />}
41+
path={`${base}/settings`}
42+
/>
43+
<ContentfulRoute
44+
baseUrl={base}
45+
error404={<Error404 />}
46+
id="6Ewcb5fkc67JOMhud6RoBs"
47+
/>
48+
</Switch>
49+
</div>
50+
);
51+
}
52+
53+
TCO22.defaultProps = {
54+
base: '',
55+
};
56+
57+
TCO22.propTypes = {
58+
base: PT.string,
59+
meta: PT.shape().isRequired,
60+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Loader for the community's code chunks.
3+
*/
4+
5+
import LoadingIndicator from 'components/LoadingIndicator';
6+
import path from 'path';
7+
import PT from 'prop-types';
8+
import React from 'react';
9+
import { AppChunk, webpack } from 'topcoder-react-utils';
10+
11+
export default function ChunkLoader({ base, meta }) {
12+
return (
13+
<AppChunk
14+
chunkName="tco22-community/chunk"
15+
renderClientAsync={() => import(/* webpackChunkName: "tco22-community/chunk" */ './Routes')
16+
.then(({ default: Routes }) => (
17+
<Routes base={base} meta={meta} />
18+
))
19+
}
20+
renderPlaceholder={() => <LoadingIndicator />}
21+
renderServer={() => {
22+
const Routes = webpack.requireWeak(path.resolve(__dirname, './Routes'));
23+
return <Routes base={base} meta={meta} />;
24+
}}
25+
/>
26+
);
27+
}
28+
29+
ChunkLoader.propTypes = {
30+
base: PT.string.isRequired,
31+
meta: PT.shape().isRequired,
32+
};

0 commit comments

Comments
 (0)