Skip to content

Release 2020-10-13 #5100

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 43 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b514ad3
MMLeaderboard #5012
kkartunov Oct 5, 2020
a9fb152
ci: on QA
kkartunov Oct 5, 2020
910b6a7
Fixed sorting
kkartunov Oct 5, 2020
7212bf2
initial chnages
kkartunov Oct 6, 2020
f9d386c
Change default bucket to Open For Registration
marioskranitsas Oct 6, 2020
5210a03
fix: update for issue #5050
gets0ul Oct 7, 2020
4466e3d
Final fixes MM Leaderboard
kkartunov Oct 7, 2020
3097133
ci: on staging
kkartunov Oct 7, 2020
25f8289
fix: update for issue #5050
gets0ul Oct 7, 2020
4ff78cf
Subscribe form app component
kkartunov Oct 8, 2020
99720f2
Revert "Change default bucket to Open For Registration"
marioskranitsas Oct 8, 2020
0f0cae7
remake the change without touching package-lock
marioskranitsas Oct 8, 2020
d74629c
Fixed items pre API call
kkartunov Oct 9, 2020
d9593d3
Merge branch 'looker-api-update' of https://github.com/topcoder-platf…
kkartunov Oct 9, 2020
99bfb65
Fixes #5086
kkartunov Oct 9, 2020
9992bb2
ci: on test
kkartunov Oct 9, 2020
d2dd7a2
ci: deploy listing-develop-sync to Stag
luizrrodrigues Oct 9, 2020
a829149
ci: on staging
kkartunov Oct 9, 2020
51cf78d
ci: deploy listing-develop-sync to QA env
luizrrodrigues Oct 9, 2020
7a2a4d0
ci: deploy listing-develop-sync to Stag env
luizrrodrigues Oct 9, 2020
c81569d
Equal min/max salary fix
kkartunov Oct 12, 2020
01072d3
ci: on test
kkartunov Oct 12, 2020
e787563
Merge pull request #5066 from gets0ul/issue-5050_fix
luizrrodrigues Oct 13, 2020
acfa6c6
Merge branch 'listing-develop-sync' into issue-5003
luizrrodrigues Oct 13, 2020
a681dae
Merge pull request #5060 from topcoder-platform/issue-5003
luizrrodrigues Oct 13, 2020
ee4fa77
Challenge 30145132 - Submission 406233
luizrrodrigues Oct 13, 2020
297308e
Merge pull request #5094 from topcoder-platform/issue-5057
luizrrodrigues Oct 13, 2020
a75d25d
Challenge Listing : Fix filter counter
luizrrodrigues Oct 13, 2020
2ddb0c6
Sub-communities : Disable filter by default
luizrrodrigues Oct 13, 2020
c23701a
Merge pull request #5095 from topcoder-platform/issue-5057
luizrrodrigues Oct 13, 2020
3627785
Merge pull request #5090 from topcoder-platform/gig-details-fixes
luizrrodrigues Oct 13, 2020
78cc95e
Merge branch 'develop' into gig-work-email-landing
luizrrodrigues Oct 13, 2020
2688932
ci: remove gig-work-email-landing from Stag env
luizrrodrigues Oct 13, 2020
4279b8d
Merge pull request #5091 from topcoder-platform/gig-work-email-landing
luizrrodrigues Oct 13, 2020
e727f83
Merge branch 'develop' into looker-api-update
luizrrodrigues Oct 13, 2020
97836b1
Merge pull request #5092 from topcoder-platform/looker-api-update
luizrrodrigues Oct 13, 2020
204157e
Merge pull request #5096 from topcoder-platform/listing-develop-sync
luizrrodrigues Oct 13, 2020
3a3feee
ci: remove develop from QA env
luizrrodrigues Oct 13, 2020
1030f86
Fixes
kkartunov Oct 13, 2020
b28c403
Merge pull request #5098 from topcoder-platform/looker-api-update
kkartunov Oct 13, 2020
f7072aa
MMLeader fixes 2
kkartunov Oct 13, 2020
6304006
Merge pull request #5099 from topcoder-platform/looker-api-update
kkartunov Oct 13, 2020
12adaec
Version of previous Release 2020-10-09
luizrrodrigues Oct 13, 2020
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
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ workflows:
context : org-global
filters:
branches:
only:
- develop
only:
- hot-fix
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
filters:
branches:
only:
- develop
- listing-develop-sync
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
Expand All @@ -260,6 +260,7 @@ workflows:
branches:
only:
- develop
- listing-develop-sync
# Production builds are exectuted
# when PR is merged to the master
# Don't change anything in this configuration
Expand Down
2 changes: 1 addition & 1 deletion __tests__/shared/reducers/challenge-listing/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const defaultReducer = require('reducers/challenge-listing/sidebar').default;

const expectedState = {
activeBucket: 'all',
activeBucket: 'openForRegistration',
};

function testReducer(reducer) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
"tc-ui": "^1.0.12",
"topcoder-react-lib": "1000.24.6",
"topcoder-react-lib": "1.0.8",
"topcoder-react-ui-kit": "2.0.1",
"topcoder-react-utils": "0.7.8",
"turndown": "^4.0.2",
Expand Down
2 changes: 2 additions & 0 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import cdnRouter from './routes/cdn';
import mailChimpRouter from './routes/mailchimp';
import mockDocuSignFactory from './__mocks__/docu-sign-mock';
import recruitCRMRouter from './routes/recruitCRM';
import mmLeaderboardRouter from './routes/mmLeaderboard';

/* Dome API for topcoder communities */
import tcCommunitiesDemoApi from './tc-communities';
Expand Down Expand Up @@ -135,6 +136,7 @@ async function onExpressJsSetup(server) {
server.use('/api/cdn', cdnRouter);
server.use('/api/mailchimp', mailChimpRouter);
server.use('/api/recruit', recruitCRMRouter);
server.use('/api/mml', mmLeaderboardRouter);

// serve demo api
server.use(
Expand Down
19 changes: 19 additions & 0 deletions src/server/routes/mmLeaderboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* The routes related to MMLeaderboard integration
*/

import express from 'express';
import MMLService from '../services/mmLeaderboard';

const cors = require('cors');

const routes = express.Router();

// Enables CORS on those routes according config above
// ToDo configure CORS for set of our trusted domains
routes.use(cors());
routes.options('*', cors());

routes.get('/:id', (req, res, next) => new MMLService().getLeaderboard(req, res, next));

export default routes;
34 changes: 34 additions & 0 deletions src/server/services/mmLeaderboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable class-methods-use-this */
/**
* Server-side functions necessary for effective integration with MMLeaderboard
*/
import { services } from 'topcoder-react-lib';

const { api, submissions } = services;

/**
* Auxiliary class that handles communication with MMLeaderboard
*/
export default class MMLService {
/**
* getLeaderboard endpoint.
* @return {Promise}
* @param {Object} the request.
*/
async getLeaderboard(req, res, next) {
try {
const m2mToken = await api.getTcM2mToken();
const subSrv = submissions.getService(m2mToken);
const reviewIds = await subSrv.getScanReviewIds();
const v5api = api.getApiV5(m2mToken);
const subs = await v5api.get(`/submissions?challengeId=${req.params.id}&page=1&perPage=500`);
return res.send({
id: req.params.id,
subs: await subs.json(),
reviewIds,
});
} catch (err) {
return next(err);
}
}
}
3 changes: 3 additions & 0 deletions src/server/tc-communities/blockchain/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"tags": ["Blockchain", "Ethereum"]
}]
},
"challengeListing": {
"ignoreCommunityFilterByDefault": true
},
"communityId": "blockchain",
"communityName": "Blockchain Community",
"groupIds": ["20000010"],
Expand Down
1 change: 1 addition & 0 deletions src/server/tc-communities/cognitive/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
}]
},
"challengeListing": {
"ignoreCommunityFilterByDefault": true,
"openChallengesInNewTabs": false
},
"communityId": "cognitive",
Expand Down
54 changes: 54 additions & 0 deletions src/shared/actions/mmLeaderboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { redux } from 'topcoder-react-utils';
import Service from 'services/mmLeaderboard';
import _ from 'lodash';

/**
* Fetch init
*/
function getMMLeaderboardInit(id) {
return { id };
}

/**
* Fetch done
*/
async function getMMLeaderboardDone(id) {
const ss = new Service();
const res = await ss.getMMLeaderboard(id);
let data = [];
if (res) {
const groupedData = _.groupBy(res.subs, 'createdBy');
_.each(groupedData, (subs, handle) => {
// filter member subs from reviewIds
const filteredSubs = _.map(subs, (sub) => {
// eslint-disable-next-line no-param-reassign
sub.review = _.filter(sub.review, r => res.reviewIds.indexOf(r.typeId) === -1);
return sub;
});
const sortedSubs = _.orderBy(filteredSubs, ['updated'], ['desc']);
const scores = _.orderBy(_.compact(sortedSubs[0].review), ['updated'], ['desc']);
data.push({
createdBy: handle,
updated: sortedSubs[0].submittedDate,
id: sortedSubs[0].id,
score: scores && scores.length ? scores[0].score : '...',
});
});
data = _.orderBy(data, [d => (Number(d.score) ? Number(d.score) : 0)], ['desc']).map((r, i) => ({
...r,
rank: i + 1,
score: r.score % 1 ? Number(r.score).toFixed(5) : r.score,
}));
}
return {
id,
data,
};
}

export default redux.createActions({
MMLEADERBOARD: {
GET_MML_INIT: getMMLeaderboardInit,
GET_MML_DONE: getMMLeaderboardDone,
},
});
5 changes: 5 additions & 0 deletions src/shared/components/Contentful/AppComponent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import React from 'react';
import { errors } from 'topcoder-react-lib';
import Leaderboard from 'containers/tco/Leaderboard';
import RecruitCRMJobs from 'containers/Gigs/RecruitCRMJobs';
import EmailSubscribeForm from 'containers/EmailSubscribeForm';


const { fireErrorMessage } = errors;

Expand All @@ -34,6 +36,9 @@ export function AppComponentSwitch(appComponent) {
if (appComponent.fields.type === 'RecruitCRM-Jobs') {
return <RecruitCRMJobs {...appComponent.fields.props} key={appComponent.sys.id} />;
}
if (appComponent.fields.type === 'EmailSubscribeForm') {
return <EmailSubscribeForm {...appComponent.fields.props} key={appComponent.sys.id} />;
}
fireErrorMessage('Unsupported app component type from contentful', '');
return null;
}
Expand Down
11 changes: 8 additions & 3 deletions src/shared/components/Gigs/GigDetails/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default function GigDetails(props) {
}
let skills = getCustomField(job.custom_fields, 'Technologies Required');
if (skills !== 'n/a') skills = skills.split(',').join(', ');
const hPerW = getCustomField(job.custom_fields, 'Hours per week');
const compens = job.min_annual_salary === job.max_annual_salary ? job.max_annual_salary : `${job.min_annual_salary} - ${job.max_annual_salary}`;

return (
<div styleName="container">
Expand Down Expand Up @@ -70,7 +72,7 @@ export default function GigDetails(props) {
<IconMoney />
<div styleName="infos-data">
Compensation
<strong>${job.min_annual_salary} - ${job.max_annual_salary} / {getSalaryType(job.salary_type)}</strong>
<strong>${compens} / {getSalaryType(job.salary_type)}</strong>
</div>
</div>
<div styleName="infos-item">
Expand All @@ -84,7 +86,7 @@ export default function GigDetails(props) {
<IconHours />
<div styleName="infos-data">
Hours
<strong>{getCustomField(job.custom_fields, 'Hours per week')} hours / week</strong>
<strong>{hPerW === 'n/a' ? hPerW : `${hPerW} hours / week`}</strong>
</div>
</div>
<div styleName="infos-item">
Expand All @@ -108,7 +110,10 @@ export default function GigDetails(props) {
* Topcoder does not provide visa sponsorship nor will we work with Staffing Agencies.
</strong>
<strong>
** Topcoder and Wipro employees are not eligible for Gig work opportunities. Do not apply and send questions to <a href="mailto:support@topcoder.com">support@topcoder.com</a>.
** USA Visa Holders - Please consult an attorney before applying to any Topcoder Gig. Some visa statuses will or will not allow you to conduct freelance work with Topcoder.
</strong>
<strong>
*** Topcoder and Wipro employees are not eligible for Gig work opportunities. Do not apply and send questions to <a href="mailto:support@topcoder.com">support@topcoder.com</a>.
</strong>
</div>
<div styleName="cta-buttons">
Expand Down
Loading