Skip to content

Gig work fix #4872

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 32 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f6de196
Merge pull request #4813 from topcoder-platform/issue-4806
sushilshinde Aug 26, 2020
ed88f51
Merge pull request #4824 from narekcat/issue-4727
sushilshinde Aug 27, 2020
5a2d463
Merge pull request #4771 from cagdas001/integration-v5-challenge-api
sushilshinde Aug 21, 2020
c5fc489
Merge pull request #4827 from topcoder-platform/fri-28-release-from-d…
sushilshinde Aug 28, 2020
d5632f8
fix: for #4792
sushilshinde Aug 28, 2020
4c6d74b
fix: revert #4792
sushilshinde Aug 28, 2020
41ca912
Merge pull request #4829 from topcoder-platform/develop
sushilshinde Aug 28, 2020
a74683f
Merge pull request #4808 from cagdas001/fix-4747
sushilshinde Aug 27, 2020
dc26a4d
Merge pull request #4823 from topcoder-platform/issue-4575-hotfix
sushilshinde Aug 27, 2020
9c1aa4b
Merge pull request #4832 from topcoder-platform/issue-4730
sushilshinde Aug 31, 2020
6267321
Merge pull request #4837 from topcoder-platform/release-v5-develop
sushilshinde Sep 1, 2020
6325e10
fix: release v1.2
sushilshinde Sep 1, 2020
e85e4a0
Merge pull request #4823 from topcoder-platform/issue-4575-hotfix
sushilshinde Aug 27, 2020
850b2ef
fix: v5 release v1.2
sushilshinde Sep 1, 2020
25508b6
ci: set env var COMMUNITY_APP_URL
sushilshinde Aug 31, 2020
fa92024
Merge pull request #4838 from topcoder-platform/release-v5-develop
sushilshinde Sep 1, 2020
8b4f13d
Merge pull request #4823 from topcoder-platform/issue-4575-hotfix
sushilshinde Aug 27, 2020
535056b
Merge pull request #4839 from topcoder-platform/release-v5-develop
sushilshinde Sep 1, 2020
7cca047
ci: fixed missing files from the cherry pick
sushilshinde Sep 1, 2020
0666c1c
Merge pull request #4840 from topcoder-platform/release-v5-develop
sushilshinde Sep 1, 2020
3b10c85
Merge pull request #4828 from topcoder-platform/feature-contentful
sushilshinde Sep 1, 2020
135ca1e
Merge pull request #4841 from topcoder-platform/develop
sushilshinde Sep 1, 2020
02c468e
Merge pull request #4825 from cagdas001/fix-4782-workaround
sushilshinde Aug 31, 2020
c0ba65d
Merge pull request #4842 from cagdas001/fix-4723
luizrrodrigues Sep 2, 2020
3e9760e
Merge pull request #4845 from topcoder-platform/milestone-v1.2-part3
sushilshinde Sep 2, 2020
c044d15
fix: for milestone V5 Challenge api v1.2 part 3
sushilshinde Sep 2, 2020
3c91974
release: v1.1.3
sushilshinde Sep 2, 2020
88f057e
Merge pull request #4846 from topcoder-platform/develop
mtwomey Sep 3, 2020
ea3ac8c
Implements #4867
kkartunov Sep 7, 2020
b3b5104
Fixes for #4868
kkartunov Sep 7, 2020
24d23d4
Modal styles for #4868
kkartunov Sep 7, 2020
1cce4d4
ci: contentful on test
kkartunov Sep 8, 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
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,22 +230,21 @@ workflows:
filters:
branches:
only:
- feature-contentful
- develop
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
filters:
branches:
only:
- feature-contentful
- hot-fix
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
filters:
branches:
only:
- hot-fix
- community-app-tests-poc
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
Expand All @@ -259,7 +258,6 @@ workflows:
filters:
branches:
only:
- feature-contentful
- develop
# Production builds are exectuted
# when PR is merged to the master
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ ARG TC_M2M_AUTH0_PROXY_SERVER_URL
ARG TC_M2M_AUTH0_URL
ARG AUTH_SECRET

ARG COMMUNITY_APP_URL

################################################################################
# Setting of environment variables in the Docker image.

Expand Down Expand Up @@ -117,6 +119,7 @@ ENV CONTENTFUL_EDU_SPACE_ID=$CONTENTFUL_EDU_SPACE_ID
ENV CONTENTFUL_EDU_CDN_API_KEY=$CONTENTFUL_EDU_CDN_API_KEY
ENV CONTENTFUL_EDU_PREVIEW_API_KEY=$CONTENTFUL_EDU_PREVIEW_API_KEY
ENV RECRUITCRM_API_KEY=$RECRUITCRM_API_KEY
ENV COMMUNITY_APP_URL=$COMMUNITY_APP_URL

################################################################################
# Testing and build of the application inside the container.
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ docker build -t $TAG \
--build-arg CONTENTFUL_COMCAST_SPACE_ID=$CONTENTFUL_COMCAST_SPACE_ID \
--build-arg CONTENTFUL_COMCAST_CDN_API_KEY=$CONTENTFUL_COMCAST_CDN_API_KEY \
--build-arg CONTENTFUL_COMCAST_PREVIEW_API_KEY=$CONTENTFUL_COMCAST_PREVIEW_API_KEY \
--build-arg RECRUITCRM_API_KEY=$RECRUITCRM_API_KEY .
--build-arg RECRUITCRM_API_KEY=$RECRUITCRM_API_KEY \
--build-arg COMMUNITY_APP_URL=$COMMUNITY_APP_URL .

# Copies "node_modules" from the created image, if necessary for caching.
docker create --name app $TAG
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,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": "1.0.0",
"topcoder-react-lib": "1.0.3",
"topcoder-react-ui-kit": "2.0.0",
"topcoder-react-utils": "0.7.8",
"turndown": "^4.0.2",
Expand Down
23 changes: 23 additions & 0 deletions src/assets/images/gig-blob.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/img-gig-work.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions src/server/tc-communities/tco19/metadata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"challengeFilter": {
"groupIds": ["20000078"],
"or": [{
"tags": ["TCO", "TCO19"]
}]
"events": ["tco19"]
},
"communityId": "tco19",
"communityName": "TCO19",
Expand Down
2 changes: 1 addition & 1 deletion src/server/tc-communities/tco20/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"challengeFilter": {
"tags": ["TCO", "TCO20"]
"events": ["tco20"]
},
"communityId": "tco20",
"communityName": "TCO20",
Expand Down
2 changes: 1 addition & 1 deletion src/server/tc-communities/tco21/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"challengeFilter": {
"tags": ["TCO", "TCO21"]
"events": ["tco21"]
},
"communityId": "tco21",
"communityName": "TCO21",
Expand Down
2 changes: 1 addition & 1 deletion src/shared/actions/challenge-listing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function getUserChallengesInit(uuid) {
function getUserChallengesDone(userId, tokenV3) {
const service = getService(tokenV3);

return service.getUserResources(userId)
return service.getUserResources(userId, 1, 10000)
.then(item => item)
.catch((error) => {
fireErrorMessage('Error Getting User Challenges', error.content || error);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/actions/tc-communities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getListInit(uuid) {
* @return {Promise}
*/
function getListDone(uuid, auth) {
const groups = _.get(auth, 'profile.groups', []).map(g => g.oldId);
const groups = _.get(auth, 'profile.groups', []).map(g => g.id);
return getCommunitiesService(auth.tokenV3)
.getList(groups).then(list => ({ list, uuid }));
}
Expand Down
6 changes: 5 additions & 1 deletion src/shared/components/Contentful/Modal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { errors } from 'topcoder-react-lib';
import { themr } from 'react-css-super-themr';
import classnames from 'classnames';

import defaultModalTheme from 'components/Leaderboard/ChallengeHistoryModal/styles.scss';
import defaultStyle from './style.scss';

const { fireErrorMessage } = errors;
Expand Down Expand Up @@ -102,7 +103,10 @@ class ContentfulModal extends React.Component {
className: classnames(theme.modalTrigger, child.props.className),
}))}
{isOpen && (
<Modal onCancel={this.onCloseModal}>
<Modal
onCancel={this.onCloseModal}
theme={defaultModalTheme}
>
<div
className={theme.dismissButton}
onClick={this.onCloseModal}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/GUIKit/JobListCard/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}

&:first-child {
width: 200px;
width: 250px;
}

&:nth-child(2) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/Gigs/GigDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default function GigDetails(props) {
</li>
<li>
<img src={iconLabel2} alt="label 2" />
<div><strong>Subscribe to our <a target="_blank" rel="noreferrer" href="https://www.topcoder.com/community/taas">Gig notifications email.</a>.</strong> We’ll send you a weekly update on gigs available so you don’t miss a beat.</div>
<div><strong>Subscribe to our <a target="_blank" rel="noreferrer" href="https://www.topcoder.com/community/taas">Gig notifications email</a>.</strong> We’ll send you a weekly update on gigs available so you don’t miss a beat.</div>
</li>
<li>
<img src={iconLabel3} alt="label 3" />
Expand Down
3 changes: 3 additions & 0 deletions src/shared/components/Gigs/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@

img {
margin-right: 16px;
min-width: 40px;
}

&:last-child {
Expand All @@ -163,6 +164,7 @@
font-weight: 600;
font-family: Barlow, sans-serif;
margin-top: 20px;
line-height: 20px;
}
}

Expand All @@ -189,6 +191,7 @@
.skills {
display: flex;
align-items: center;
line-height: 21px;
/* stylelint-disable */
img {
margin-right: 8px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@ const ChallengeSpecTab = ({ challenge }) => (
</article>
)
}
{
challenge.finalSubmissionGuidelines
&& (
<article>
<h2 styleName="h2">
Final Submission Guidelines
</h2>
<div
/* eslint-disable react/no-danger */
dangerouslySetInnerHTML={{
__html: challenge.finalSubmissionGuidelines,
}}
/* eslint-enable react/no-danger */
styleName="rawHtml"
/>
</article>
)
}
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import moment from 'moment-timezone';
import PT from 'prop-types';
import React from 'react';

import { phaseEndDate, phaseStartDate } from 'utils/challenge-listing/helper';
import Card from './Card';
import './style.scss';

export default function DeadlinesPanel({ deadlines }) {
/* Calculates challenge start time. */
let start = deadlines[0] || {};
start = start.actualStartDate || start.scheduledStartDate;
const started = moment(start).isBefore(moment());
start = phaseStartDate(start);
const started = moment(start).isBefore();

return (
<div styleName="panel" tabIndex="0" role="tabpanel">
Expand All @@ -29,7 +30,7 @@ export default function DeadlinesPanel({ deadlines }) {
{ deadlines.map((d, index) => (
<Card
key={d.name}
time={d.scheduledEndDate || d.actualEndDate}
time={phaseEndDate(d)}
title={index === deadlines.length - 1 ? 'Winners' : d.name}
/>
))}
Expand Down
43 changes: 24 additions & 19 deletions src/shared/components/challenge-detail/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import React from 'react';
import { DangerButton, PrimaryButton } from 'topcoder-react-ui-kit';
import { Link } from 'topcoder-react-utils';
import { COMPETITION_TRACKS } from 'utils/tc';
import { phaseEndDate } from 'utils/challenge-listing/helper';

import LeftArrow from 'assets/images/arrow-prev.svg';

Expand Down Expand Up @@ -69,16 +70,17 @@ export default function ChallengeHeader(props) {
numOfRegistrants,
numOfCheckpointSubmissions,
numOfSubmissions,
endDate,
status,
type,
track,
} = challenge;

const tags = challenge.tags || [];
const appealsEndDate = endDate;

const allPhases = challenge.phases || [];
const sortedAllPhases = _.cloneDeep(allPhases)
.sort((a, b) => moment(phaseEndDate(a)).diff(phaseEndDate(b)));

const { prizes } = prizeSets && prizeSets.length ? prizeSets[0] : [];

const checkpointPrizes = _.find(prizeSets, { type: 'checkpoint' });
Expand Down Expand Up @@ -122,14 +124,14 @@ export default function ChallengeHeader(props) {
*/
const hasSubmissions = !_.isEmpty(mySubmissions);

let nextPhase = allPhases.filter(p => p.isOpen)
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
if (hasRegistered && allPhases[0] && allPhases[0].name === 'Registration') {
nextPhase = allPhases[1] || {};
const openPhases = sortedAllPhases.filter(p => p.isOpen);
let nextPhase = openPhases[0];
if (hasRegistered && openPhases[0] && openPhases[0].name === 'Registration') {
nextPhase = openPhases[1] || {};
}
const nextDeadline = nextPhase && nextPhase.name;

const deadlineEnd = moment(nextPhase && nextPhase.scheduledEndDate);
const deadlineEnd = moment(nextPhase && phaseEndDate(nextPhase));
const currentTime = moment();

let timeLeft = deadlineEnd.isAfter(currentTime)
Expand All @@ -147,8 +149,8 @@ export default function ChallengeHeader(props) {
if (showDeadlineDetail) {
relevantPhases = (allPhases || []).filter((phase) => {
if (phase.name === 'Iterative Review') {
const end = phase.actualEndDate || phase.scheduledEndDate;
return moment(end).isAfter(moment());
const end = phaseEndDate(phase);
return moment(end).isAfter();
}
const phaseLowerCase = phase.name.toLowerCase();
if (phaseLowerCase.includes('screening') || phaseLowerCase.includes('specification')) {
Expand All @@ -168,30 +170,34 @@ export default function ChallengeHeader(props) {
if (b.name.toLowerCase().includes('registration')) {
return 1;
}
return (new Date(a.scheduledEndDate || a.actualEndDate)).getTime()
- (new Date(b.scheduledEndDate || b.actualEndDate)).getTime();
const aEndDate = phaseEndDate(a);
const bEndDate = phaseEndDate(b);
return moment(aEndDate).diff(bEndDate);
});
if (type === 'First2Finish' && status === 'Completed') {
const phases2 = allPhases.filter(p => p.name === 'Iterative Review' && !p.isOpen);
const endPhaseDate = Math.max(...phases2.map(d => new Date(d.scheduledEndDate)));
const endPhaseDate = Math.max(...phases2.map(d => phaseEndDate(d)));
relevantPhases = _.filter(relevantPhases, p => (p.name.toLowerCase().includes('registration')
|| new Date(p.scheduledEndDate).getTime() < endPhaseDate));
|| phaseEndDate(p).getTime() < endPhaseDate));
relevantPhases.push({
id: -1,
name: 'Winners',
isOpen: false,
actualEndDate: endPhaseDate,
scheduledEndDate: endPhaseDate,
});
} else if (relevantPhases.length > 1) {
const lastPhase = relevantPhases[relevantPhases.length - 1];
const lastPhaseTime = (
new Date(lastPhase.actualEndDate || lastPhase.scheduledEndDate)
).getTime();
const lastPhaseTime = phaseEndDate(lastPhase).getTime();

const appealsEnd = (new Date(appealsEndDate).getTime());
if (lastPhaseTime < appealsEnd && lastPhase.name !== 'Review') {
const appealsEndDate = phaseEndDate(sortedAllPhases[sortedAllPhases.length - 1]);
const appealsEnd = appealsEndDate.getTime();
if (lastPhaseTime < appealsEnd) {
relevantPhases.push({
id: -1,
name: 'Winners',
isOpen: false,
actualEndDate: appealsEndDate,
scheduledEndDate: appealsEndDate,
});
}
Expand Down Expand Up @@ -495,7 +501,6 @@ ChallengeHeader.propTypes = {
numOfCheckpointSubmissions: PT.any,
numOfSubmissions: PT.any,
status: PT.any,
endDate: PT.any,
phases: PT.any,
roundId: PT.any,
prizeSets: PT.any,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MySubmissionsView extends React.Component {
}

if (isMM) {
loadMMSubmissions(challenge.id, challenge.registrants, auth.tokenV3);
loadMMSubmissions(challenge.id, auth.tokenV3);
}
}

Expand Down
Loading