Skip to content

Release v1.17.18 #6629

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 30 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2148005
improvement(reskin-tco-badge): tco badge
dedywahyudi Jun 30, 2022
49f0a6d
fix lint error
dedywahyudi Jun 30, 2022
3f3fb31
fix: for issue PROD-2113
luizrrodrigues Jun 30, 2022
59d5ffe
fix(reskin-profile): verified badge tooltip
dedywahyudi Jun 30, 2022
42c9096
fix(reskin-tco-badge): minor fixes
dedywahyudi Jul 4, 2022
5eec9ac
Merge branch 'develop' into reskin-tco-badge
dedywahyudi Jul 4, 2022
83dd4c3
ci: set reskin-tco-badge to staging
dedywahyudi Jul 22, 2022
1c76288
ci: set tco-reskin-badge to beta
dedywahyudi Jul 22, 2022
8181ced
re-structure for Gamification API
kkartunov Aug 18, 2022
b09caf5
ci: on test
kkartunov Aug 18, 2022
10f66b5
fix lint erros
kkartunov Aug 18, 2022
35e4af3
register profile reducer
kkartunov Aug 18, 2022
1b2ab8a
def org_id if no env set
kkartunov Aug 18, 2022
6e27b37
ui tweaks
kkartunov Aug 19, 2022
d1602d3
Merge branch 'reskin-tco-badge' of https://github.com/topcoder-platfo…
kkartunov Aug 19, 2022
d97323f
wrap badges when many
kkartunov Aug 19, 2022
41e96dd
GAME-63
kkartunov Aug 22, 2022
99d50d3
map fields to tco23
kkartunov Aug 26, 2022
3a0074c
tco23 leaderboards
kkartunov Aug 29, 2022
a53a20a
ci: on beta
kkartunov Aug 29, 2022
a5f6f43
pref guid over id
kkartunov Aug 29, 2022
ffc1320
Merge branch 'develop' into reskin-tco-badge
kkartunov Aug 29, 2022
8accbe9
fixes snapshot failed tests
kkartunov Aug 29, 2022
8935434
fix placement label/value
kkartunov Aug 29, 2022
39bbb50
custom social for gigs
kkartunov Aug 29, 2022
2d37646
ci: on test
kkartunov Aug 29, 2022
bb8fd8b
Merge pull request #6627 from topcoder-platform/gig-share
luizrrodrigues Aug 31, 2022
2e8b7b1
Merge branch 'develop' into reskin-tco-badge
luizrrodrigues Aug 31, 2022
5c1eb67
Merge pull request #6571 from topcoder-platform/reskin-tco-badge
luizrrodrigues Aug 31, 2022
639a553
fix missing env var
kkartunov Aug 31, 2022
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: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,21 +356,21 @@ workflows:
filters:
branches:
only:
- tco23
- free
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
filters:
branches:
only:
- reskin-profile-settings
- free
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
filters:
branches:
only:
- social-share-updates
- free
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ ARG GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY
# Optimizely
ARG OPTIMIZELY_SDK_KEY

# Gamification
ARG GAMIFICATION_ORG_ID

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

Expand Down Expand Up @@ -143,6 +146,8 @@ ENV GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY=$GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY
# Optimizely
ENV OPTIMIZELY_SDK_KEY=$OPTIMIZELY_SDK_KEY

ENV GAMIFICATION_ORG_ID=$GAMIFICATION_ORG_ID

################################################################################
# Testing and build of the application inside the container.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__winnings-info___PBqQk"
>
<span>
0
points
</span>
<span>
Expand All @@ -84,7 +83,7 @@ exports[`Matches shallow shapshot 1`] = `
<td
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__col-points___2-5d7"
>
0.00
NaN
</td>
</tr>
<tr>
Expand Down Expand Up @@ -125,7 +124,6 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__winnings-info___PBqQk"
>
<span>
0
points
</span>
<span>
Expand All @@ -139,7 +137,7 @@ exports[`Matches shallow shapshot 1`] = `
<td
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__col-points___2-5d7"
>
0.00
NaN
</td>
</tr>
<tr>
Expand Down Expand Up @@ -180,7 +178,6 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__winnings-info___PBqQk"
>
<span>
0
points
</span>
<span>
Expand All @@ -194,7 +191,7 @@ exports[`Matches shallow shapshot 1`] = `
<td
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__col-points___2-5d7"
>
0.00
NaN
</td>
</tr>
<tr>
Expand Down Expand Up @@ -235,7 +232,6 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__winnings-info___PBqQk"
>
<span>
0
points
</span>
<span>
Expand All @@ -249,7 +245,7 @@ exports[`Matches shallow shapshot 1`] = `
<td
className="src-shared-components-Leaderboard-LeaderboardTable-themes-___styles__col-points___2-5d7"
>
0.00
NaN
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-Leaderboard-Podium-themes-___default__Podium___1qIZm"
>
<div
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrap___2hDWP"
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrapCondense___3aV24"
style={
Object {
"justify-content": "space-between",
Expand All @@ -29,6 +29,7 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand All @@ -49,6 +50,7 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand All @@ -69,6 +71,7 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand All @@ -89,6 +92,7 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports[`Matches shallow shapshot 1`] = `
<span
className="src-shared-components-Leaderboard-PodiumSpot-themes-___styles__value___2shA5"
>
0.00
NaN
</span>
<span
className="src-shared-components-Leaderboard-PodiumSpot-themes-___styles__value-title___1Jf_7"
Expand Down Expand Up @@ -106,7 +106,7 @@ exports[`Matches shallow shapshot 2`] = `
<span
className="src-shared-components-Leaderboard-PodiumSpot-themes-___styles__value___2shA5"
>
0.00
NaN
</span>
<span
className="src-shared-components-Leaderboard-PodiumSpot-themes-___styles__value-title___1Jf_7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exports[`renders a full Profile correctly 1`] = `
},
]
}
badges={Object {}}
challenges={null}
clearSubtrackChallenges={[Function]}
copilot={true}
Expand Down Expand Up @@ -720,6 +721,7 @@ exports[`renders a full Profile correctly 1`] = `
exports[`renders an empty Profile correctly 1`] = `
<ProfilePage
achievements={Array []}
badges={Object {}}
challenges={null}
clearSubtrackChallenges={[Function]}
copilot={false}
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ docker build -t $TAG \
--build-arg OPTIMIZELY_SDK_KEY=$OPTIMIZELY_SDK_KEY \
--build-arg COMMUNITY_APP_URL=$COMMUNITY_APP_URL \
--build-arg GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY=$GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY \
--build-arg GAMIFICATION_ORG_ID=$GAMIFICATION_ORG_ID \
--build-arg VALID_ISSUERS=$VALID_ISSUERS .

# Copies "node_modules" from the created image, if necessary for caching.
Expand Down
4 changes: 4 additions & 0 deletions config/custom-environment-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,8 @@ module.exports = {
SDK_KEY: 'OPTIMIZELY_SDK_KEY',
},
GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY: 'GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY',
GAMIFICATION: {
ORG_ID: 'GAMIFICATION_ORG_ID',
ENABLE_BADGE_UI: 'GAMIFICATION_ENABLE_BADGE_UI',
},
};
5 changes: 4 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ module.exports = {
OPTIMIZELY: {
SDK_KEY: '7V4CJhurXT3Y3bnzv1hv1',
},
PLATFORM_SITE_URL: 'https://platform.topcoder-dev.com',
GAMIFICATION: {
ORG_ID: '6052dd9b-ea80-494b-b258-edd1331e27a3',
ENABLE_BADGE_UI: true,
},
PLATFORMUI_SITE_URL: 'https://platform-ui.topcoder-dev.com',
};
17 changes: 17 additions & 0 deletions src/assets/images/default-award.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/profile/header-overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/assets/images/profile/header-overlay.svg

This file was deleted.

3 changes: 2 additions & 1 deletion src/shared/actions/page/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import _ from 'lodash';
import challengeDetails from './challenge-details';
import memberProfile from './profile';

export default _.merge({}, challengeDetails);
export default _.merge({}, challengeDetails, memberProfile);
50 changes: 50 additions & 0 deletions src/shared/actions/page/profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* Actions for member profile page.
*/
/* global fetch */
import { redux, config } from 'topcoder-react-utils';

/**
* @static
* @desc Initiates an action that fetch member's badges
* @param {String} handle Member handle.
* @return {Action}
*/
async function getGamificationBadgesInit(handle) {
return { handle };
}

/**
* @static
* @desc Creates an action that gets member's badges
*
* @param {String} handle Topcoder member handle.
* @return {Action}
*/
async function getGamificationBadgesDone(handle) {
try {
const memberInfo = await fetch(`${config.API.V5}/members/${handle}`)
.then(response => response.json());
const badges = await fetch(`${config.API.V5}/gamification/badges/assigned/${memberInfo.userId}?organization_id=${config.GAMIFICATION.ORG_ID}`)
.then(response => response.json());

return {
handle,
badges,
};
} catch (error) {
return {
handle,
error,
};
}
}

export default redux.createActions({
PAGE: {
PROFILE: {
GET_GAMIFICATION_BADGES_INIT: getGamificationBadgesInit,
GET_GAMIFICATION_BADGES_DONE: getGamificationBadgesDone,
},
},
});
43 changes: 25 additions & 18 deletions src/shared/components/Leaderboard/ChallengeHistoryModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ class ChallengeHistoryModal extends Component {
} = this.props;
const { sortParam } = this.state;
const challengesOrdered = _.orderBy(challenges, [sortParam.field], [sortParam.order]);
const placeLabel = competitor['member_profile_basic.handle'] ? 'tco_leaderboard.placement' : 'place';
const pointsLabel = competitor['member_profile_basic.handle'] ? 'tco_leaderboard.tco_points' : 'points';
// eslint-disable-next-line
const placeLabel = competitor['tco23_leaderboard.challenge_count'] ? 'tco23_leaderboard.placement' : 'tco_leaderboard.placement';
// eslint-disable-next-line
const pointsLabel = competitor['tco23_leaderboard.tco_points'] ? 'tco23_leaderboard.tco_points' : 'tco_leaderboard.tco_points';
const styles = THEMES[themeName] || THEMES.Default;
/* eslint-disable no-confusing-arrow */
const sortInner = () => themeName === 'TCO23' ? (
Expand Down Expand Up @@ -95,7 +97,7 @@ class ChallengeHistoryModal extends Component {
}}
type="button"
>
{ sortInner() }
{sortInner()}
</button>
</div>
</th>
Expand All @@ -117,31 +119,36 @@ class ChallengeHistoryModal extends Component {
}}
type="button"
>
{ sortInner() }
{sortInner()}
</button>
</div>
</th>
</tr>
</thead>
<tbody>
{
challengesOrdered.map(challenge => (
<tr className={styles.row} key={`${challenge['tco_leaderboard.challenge_id'] || challenge['challenge.challenge_id'] || challenge.challenge_id}`}>
<td className={styles.name}>
<a href={`${config.URL.BASE}/challenges/${challenge['tco_leaderboard.challenge_id'] || challenge['challenge.challenge_id'] || challenge.challenge_id || challenge['challenge.challenge_GUID']}/`} className={styles.link} target="_blank" rel="noopener noreferrer">
{challenge.challenge_name || challenge['challenge.challenge_name'] || challenge['tco_leaderboard.challenge_id'] || challenge.challenge_id}
</a>
</td>
{
challengesOrdered.map((challenge) => {
const challengeId = challenge['tco23_leaderboard.challenge_id'] || challenge['tco_leaderboard.challenge_id'] || challenge['challenge.challenge_GUID'] || challenge['challenge.challenge_id'] || challenge.challenge_id;
return (
<tr className={styles.row} key={`${challengeId}`}>
<td className={styles.name}>
<a href={`${config.URL.BASE}/challenges/${challengeId || challenge['challenge.challenge_GUID']}/`} className={styles.link} target="_blank" rel="noopener noreferrer">
{challenge.challenge_name || challenge['challenge.challenge_name'] || challengeId}
</a>
</td>
{
!isCopilot ? (
<td className={styles.placement}>{challenge['tco_leaderboard.placement'] || challenge.place}<span>placement</span></td>
<td className={styles.placement}>
{challenge[placeLabel]}<span>placement</span>
</td>
) : null
}
<td className={styles.points}>
{challenge['tco_leaderboard.tco_points'] || challenge.points}<span>points</span>
</td>
</tr>
))
<td className={styles.points}>
{challenge[pointsLabel] || challenge.points}<span>points</span>
</td>
</tr>
);
})
}
</tbody>
</table>
Expand Down
Loading