Skip to content

Commit

Permalink
Merge pull request #6606 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Release v1.17.14 - Update Challenges Thumbnails Previews
  • Loading branch information
luizrrodrigues authored Aug 11, 2022
2 parents 6650c4f + 5bb5a1a commit 6edc89a
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ workflows:
filters:
branches:
only:
- footer-update
- social-share-updates
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
Expand Down
Binary file modified src/assets/images/open-graph/challenges/02-Design-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/open-graph/challenges/03-Development.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/open-graph/challenges/04-Data-Science.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/open-graph/challenges/05-QA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/open-graph/challenges/06-Big-Prize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 35 additions & 5 deletions src/shared/containers/challenge-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,18 @@ import { getService } from 'services/contentful';

import ogUiDesign from
'../../../assets/images/open-graph/challenges/02-Design-Preview.png';
import ogFirst2Finish from
'../../../assets/images/open-graph/challenges/09-First2Finish.png';
import ogFirst2FinishDEV from
'../../../assets/images/open-graph/challenges/Development-First2Finish.png';
import ogFirst2FinishDESIGN from
'../../../assets/images/open-graph/challenges/Design-First2Finish.png';
import ogFirst2FinishQA from
'../../../assets/images/open-graph/challenges/QA-First2Finish.png';
import ogDEVTask from
'../../../assets/images/open-graph/challenges/Development-Task.png';
import ogDESIGNTask from
'../../../assets/images/open-graph/challenges/Design-Task.png';
import ogQATask from
'../../../assets/images/open-graph/challenges/QA-Task.png';
import ogDevelopment from
'../../../assets/images/open-graph/challenges/03-Development.png';
import ogBigPrizesChallenge from
Expand All @@ -63,6 +73,8 @@ import ogQAChallenge from
'../../../assets/images/open-graph/challenges/05-QA.png';
import ogDSChallenge from
'../../../assets/images/open-graph/challenges/04-Data-Science.png';
import ogMMChallenge from
'../../../assets/images/open-graph/challenges/MM-Challenge.png';

/* A fallback image, just in case we missed some corner case. */
import ogImage from
Expand Down Expand Up @@ -91,7 +103,19 @@ function getOgImage(challenge) {
}

switch (subTrack) {
case SUBTRACKS.FIRST_2_FINISH: return ogFirst2Finish;
case SUBTRACKS.FIRST_2_FINISH:
switch (challenge.track) {
case COMPETITION_TRACKS_V3.DEVELOP: return challenge.type === 'Task' ? ogDEVTask : ogFirst2FinishDEV;
case COMPETITION_TRACKS_V3.QA: return challenge.type === 'Task' ? ogQATask : ogFirst2FinishQA;
default: return ogFirst2FinishDEV;
}

case SUBTRACKS.DESIGN_FIRST_2_FINISH:
switch (challenge.track) {
case COMPETITION_TRACKS_V3.DESIGN: return challenge.type === 'Task' ? ogDESIGNTask : ogFirst2FinishDESIGN;
default: return ogUiDesign;
}

case SUBTRACKS.UI_PROTOTYPE_COMPETITION: {
const submission = (challenge.phases || [])
.find(p => p.name === CHALLENGE_PHASE_TYPES.SUBMISSION);
Expand All @@ -105,13 +129,19 @@ function getOgImage(challenge) {
case SUBTRACKS.QA:
case SUBTRACKS.TEST_SUITES:
return ogQAChallenge;
case SUBTRACKS.DS: return ogDSChallenge;
case SUBTRACKS.MM:
if (challenge.tags && challenge.tags.indexOf(COMPETITION_TRACKS_V3.DS) !== -1) {
return ogDSChallenge;
}
return ogMMChallenge;
default:
}

switch (challenge.track) {
case COMPETITION_TRACKS_V3.DEVELOP: return ogDevelopment;
case COMPETITION_TRACKS_V3.DESIGN: return ogUiDesign;
case COMPETITION_TRACKS_V3.DESIGN: return challenge.type === 'Task' ? ogDESIGNTask : ogUiDesign;
case COMPETITION_TRACKS_V3.DS: return ogDSChallenge;
case COMPETITION_TRACKS_V3.QA: return challenge.type === 'Task' ? ogQATask : ogQAChallenge;
default: return ogImage;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/shared/utils/tc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const COMPETITION_TRACKS_V3 = {
DESIGN: 'Design',
DEVELOP: 'Development',
DS: 'Data Science',
QA: 'Quality Assurance',
};

/* Holds valid subtracks (only some of possible values are included into this
Expand All @@ -44,7 +45,8 @@ export const SUBTRACKS = {
WIREFRAMES: 'WIREFRAMES',
QA: 'BUG_HUNT',
TEST_SUITES: 'TEST_SUITES',
DS: 'DEVELOP_MARATHON_MATCH',
MM: 'DEVELOP_MARATHON_MATCH',
DESIGN_FIRST_2_FINISH: 'DESIGN_FIRST_2_FINISH',
};

/**
Expand Down

0 comments on commit 6edc89a

Please sign in to comment.