Skip to content

Release v1.17.14 - Update Challenges Thumbnails Previews #6606

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 10 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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