Skip to content

Release v1.19.3 #6712

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 27 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8692c5c
Maximum number of submissions not displaying correctly
jmgasper Oct 27, 2022
0ef33d1
Revert "Maximum number of submissions not displaying correctly"
jmgasper Oct 27, 2022
359612d
GAME-205 profile pages updates
kkartunov Oct 28, 2022
63113e9
ci: on test
kkartunov Oct 28, 2022
fa46579
up badges to 100
kkartunov Oct 31, 2022
3d16d70
fix: view submissions 2 lines
dedywahyudi Oct 6, 2022
7191f73
fix: buttons design system
dedywahyudi Oct 7, 2022
51ac9a4
fix: change the font-weight & letter
dedywahyudi Oct 8, 2022
8d6bca7
fix: button style upgrade
dedywahyudi Oct 10, 2022
e30724b
fix: focus style for buttons
dedywahyudi Oct 11, 2022
04a22c6
fix: add space before brackets
dedywahyudi Oct 11, 2022
8ff6d16
fix: button stylings
dedywahyudi Oct 13, 2022
33de1f0
fix: open review count
dedywahyudi Oct 4, 2022
80a8e72
fix: review opp only for reviewers
dedywahyudi Oct 6, 2022
8cfc746
fix: review opp not show up for reviewers
dedywahyudi Oct 7, 2022
ff0ec42
fix: review opp label edits
dedywahyudi Oct 7, 2022
e73c49e
fix: review opp numbers a little while
dedywahyudi Oct 7, 2022
d2c563e
fix: counts is different
dedywahyudi Oct 10, 2022
f012012
fix: count is different for search result
dedywahyudi Oct 12, 2022
ef747d6
test updates
dedywahyudi Oct 12, 2022
7d3cf2f
fix: test fixes
dedywahyudi Oct 12, 2022
7a40fb5
fix: centering left sidebar
dedywahyudi Oct 22, 2022
e50b62b
add awardedAt date
kkartunov Nov 1, 2022
7985917
Merge pull request #6708 from topcoder-platform/PROD-2993
luizrrodrigues Nov 2, 2022
ef882a1
Merge pull request #6707 from topcoder-platform/PROD-3009
luizrrodrigues Nov 2, 2022
afe679d
ci: on QA env
kkartunov Nov 2, 2022
182b8f7
Merge pull request #6711 from topcoder-platform/feat/badges-box
kkartunov Nov 3, 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ workflows:
filters:
branches:
only:
- feature/dice-setup
- feat/badges-box
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ exports[`Matches shallow shapshot 2`] = `
disabled={false}
expanding={false}
isAuth={false}
isReviewer={false}
loading={true}
past={false}
reviewCount={0}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ exports[`Matches shallow shapshot 1`] = `
disabled={false}
expanding={false}
isAuth={false}
loading={true}
past={false}
reviewCount={0}
selectBucket={[MockFunction]}
/>
</div>
Expand All @@ -36,7 +38,9 @@ exports[`Matches shallow shapshot 2`] = `
disabled={false}
expanding={false}
isAuth={false}
loading={true}
past={false}
reviewCount={0}
selectBucket={[MockFunction]}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ exports[`Matches shallow shapshot 1 shapshot 1 1`] = `
>
<Connect(SidebarContainer)
expanding={false}
reviewCount={0}
setFilterState={[MockFunction]}
/>
<Connect(Container)
Expand Down Expand Up @@ -99,6 +100,7 @@ exports[`Matches shallow shapshot 2 shapshot 2 1`] = `
>
<Connect(SidebarContainer)
expanding={false}
reviewCount={0}
setFilterState={[MockFunction]}
/>
<Connect(Container)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ export class ChallengeListingPageHelper {
static async verifyOpenForReviewChallengesOnly() {
await this.waitForSubCommunity();
const openForReviewLink = await ChallengeListingPageObject.filterChallengesBy(
'Open for review'
'Review Opportunities'
);
await openForReviewLink.click();
await this.waitForLoadingNewChallengeList();
Expand Down Expand Up @@ -799,11 +799,11 @@ export class ChallengeListingPageHelper {
expect(headers.length).toBe(0);

const openForReviewLink = await ChallengeListingPageObject.filterChallengesBy(
'Open for review'
'Review Opportunities'
);
await openForReviewLink.click();

await this.waitTillOnlyOneHeaderPresentWithText('Open for review');
await this.waitTillOnlyOneHeaderPresentWithText('Review Opportunities');
await CommonHelper.waitUntilVisibilityOf(
() =>
CommonHelper.findElementByText(
Expand Down
4 changes: 2 additions & 2 deletions src/shared/actions/page/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ async function getGamificationBadgesInit(handle) {
* @param {String} handle Topcoder member handle.
* @return {Action}
*/
async function getGamificationBadgesDone(handle) {
async function getGamificationBadgesDone(handle, limit) {
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}`)
const badges = await fetch(`${config.API.V5}/gamification/badges/assigned/${memberInfo.userId}?organization_id=${config.GAMIFICATION.ORG_ID}&limit=${limit || 4}`)
.then(response => response.json());

return {
Expand Down
120 changes: 120 additions & 0 deletions src/shared/components/ProfileBadgesPage/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import React, { useState } from 'react';
import PT from 'prop-types';
import { Link } from 'react-router-dom';
import { get } from 'lodash';
import { Modal } from 'topcoder-react-ui-kit';
import IconClose from 'assets/images/tc-edu/icon-close-big.svg';
import FallBackAwardIcon from 'assets/images/default-award.svg';
import md from 'utils/markdown';
import { format } from 'date-fns';
import AwardModal from '../ProfilePage/Awards/AwardModal';

import style from './styles.scss';

const ProfileBadges = ({ badges, handleParam }) => {
const [showModal, setShowModal] = useState(false);
const [modalData, setModalData] = useState({});

return (
<div styleName="outer-container">
<Link
to={`/members/${handleParam}`}
styleName="memberPageBackLink"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="12"
fill="none"
viewBox="0 0 14 12"
>
<path
fill="#137D60"
fillRule="evenodd"
d="M6.766 11.366a.8.8 0 01-1.132 0l-4.8-4.8a.8.8 0 010-1.132l4.8-4.8a.8.8 0 111.132 1.132L3.33 5.2h9.27a.8.8 0 010 1.6H3.33l3.435 3.434a.8.8 0 010 1.132z"
clipRule="evenodd"
/>
</svg>
Return to Profile
</Link>
<div styleName="badgesWrap">
<div styleName="seactionTitle">COMMUNITY AWARDS & HONORS</div>
<div styleName="badgesGrid">
{
badges.rows.map((reward) => {
const title = get(reward, 'org_badge.badge_name');
const imageUrl = get(reward, 'org_badge.badge_image_url');
let description = get(reward, 'org_badge.badge_description');
if (description) {
description = md(description);
}
let awardedAt = get(reward, 'awarded_at');
if (awardedAt) {
awardedAt = format(new Date(awardedAt), 'PPP');
}

return (
<div
role="presentation"
styleName="awardBadge"
onClick={() => {
setShowModal(true);
setModalData({
title,
description,
imageUrl,
awardedAt,
});
}}
>
{
imageUrl ? (
<img src={imageUrl} alt="award-badge" styleName="image" />
) : (
<FallBackAwardIcon styleName="image" />
)
}
<div styleName="title">
<span>
<div dangerouslySetInnerHTML={{ __html: title }} />
</span>
</div>
</div>
);
})
}
</div>
</div>
{
showModal && (
<Modal onCancel={() => setShowModal(false)} theme={style}>
<div styleName="award-modal">
<div styleName="header">
<h2 styleName="title">Community Awards & Honors</h2>
<div styleName="icon" role="presentation" onClick={() => setShowModal(false)}>
<IconClose />
</div>
</div>
<hr />

<AwardModal
modalData={modalData}
/>
</div>
</Modal>
)
}
</div>
);
};

ProfileBadges.defaultProps = {
badges: {},
};

ProfileBadges.propTypes = {
badges: PT.shape(),
handleParam: PT.string.isRequired,
};

export default ProfileBadges;
144 changes: 144 additions & 0 deletions src/shared/components/ProfileBadgesPage/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/* stylelint-disable no-descending-specificity */
@import "~styles/mixins";

.outer-container {
width: 100%;
max-width: $screen-max;
margin: 0 auto;
display: flex;
flex-direction: column;

@include xs-to-md {
margin: 0 32px;
}

.memberPageBackLink {
text-transform: uppercase;
color: $listing-checkbox-green;
font-weight: 700;
font-family: Roboto, sans-serif;
margin: 32px 0;
display: flex;
align-items: center;

svg {
margin-right: 6px;
}
}

.badgesWrap {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
border-radius: 8px;
display: flex;
flex-direction: column;
padding: 32px;
margin-bottom: 32px;

.seactionTitle {
@include barlow-medium;

font-weight: 600;
color: #2a2a2a;
font-size: 22px;
line-height: 26px;
text-transform: uppercase;
padding-bottom: 24px;
border-bottom: 2px solid #e9e9e9;
}

.badgesGrid {
display: grid;
grid-template-columns: repeat(6, 1fr);

@include xs-to-sm {
grid-template-columns: repeat(2, 1fr);
}

@include md {
grid-template-columns: repeat(4, 1fr);
}

.awardBadge {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
padding-top: 32px;

.image {
width: 100px;
height: 100px;
}

.title {
@include roboto-bold;
$color: $tco-black;

font-size: 12px;
font-weight: 700;
line-height: 16px;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
max-width: 130px;
margin-top: 17px;
text-transform: uppercase;

@include xs-to-sm {
max-width: unset;
}
}
}
}
}
}

.award-modal {
padding-bottom: 10px;
border-radius: 8px;
margin: 25px 32px 32px;

.header {
display: flex;
justify-content: space-between;
margin-bottom: 25px;

.title {
@include barlow-medium;

font-weight: 600;
color: #2a2a2a;
font-size: 22px;
line-height: 26px;
text-transform: uppercase;
}

.icon {
cursor: pointer;
margin-top: 5px;
}
}
}

hr {
opacity: 0.5;
}

.container {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
border-radius: 8px;
min-width: 600px;

@include xs-to-sm {
width: 90%;
min-width: unset;
}
}

.overlay {
background-color: #0c0c0c;
opacity: 0.85;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AwardBadge = ({
}
<div styleName="title">
<span>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: title }} />
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
border-radius: 8px;
display: flex;
cursor: pointer;
min-width: 316px;

.image {
width: 48px;
Expand Down
Loading