Skip to content

Revert "PR for private stats feature" #4064

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 1 commit into from
Mar 5, 2020
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
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ workflows:
filters:
branches:
only:
- feature-m2m-with-stats
- develop
- feature-m2m-token
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
filters:
branches:
only:
- develop
- nav-hot-fix
- hot-fixes-leaderboard
# This is beta env for production soft releases
Expand All @@ -190,7 +191,8 @@ workflows:
filters:
branches:
only:
- develop
- develop
- feature-contentful
# Production builds are exectuted only on tagged commits to the
# master branch.
- "build-prod":
Expand Down
7 changes: 1 addition & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,4 @@ Optional. The footer should contain any information about **Breaking Changes** a
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
The rest of the commit message is then used for this.

### Generate Change long
```
npm run release:changelog
```
The rest of the commit message is then used for this.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ exports[`renders a full Profile correctly 1`] = `
className=""
handle="testHandle"
inModal={false}
meta={null}
stats={
Object {
"COPILOT": Object {
Expand Down Expand Up @@ -700,7 +699,6 @@ exports[`renders an empty Profile correctly 1`] = `
className=""
handle="testHandle"
inModal={false}
meta={null}
stats={
Object {
"COPILOT": null,
Expand Down
1 change: 0 additions & 1 deletion docs/deployment-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ workflows:
- develop
```
4. Commit the changes
5. Status of the deployment environments can be checked here https://cci-reporter.herokuapp.com/
2 changes: 1 addition & 1 deletion src/shared/components/ProfilePage/Skill/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Skill = ({
Skill.propTypes = {
tagId: PT.string.isRequired,
tagName: PT.string.isRequired,
isVerified: PT.bool.isRequired,
isVerified: PT.string.isRequired,
};

export default Skill;
11 changes: 4 additions & 7 deletions src/shared/components/ProfilePage/Stats/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import _ from 'lodash';
import React from 'react';
import PT from 'prop-types';
import { Link } from 'react-router-dom';
import ReactSVG from 'react-svg';
import { Link, isomorphy } from 'topcoder-react-utils';
import { isomorphy } from 'topcoder-react-utils';
import { getRatingColor } from 'utils/tc';
import Th from 'assets/images/th.svg';
import LeftArrow from 'assets/images/arrow-prev.svg';
Expand Down Expand Up @@ -49,6 +50,7 @@ class ProfileStats extends React.Component {

render() {
const {
stats,
statsDistribution,
statsHistory,
track,
Expand All @@ -58,11 +60,6 @@ class ProfileStats extends React.Component {
handleParam,
activeChallengesCount,
} = this.props;
let { stats } = this.props;
if (_.isArray(stats)) {
// eslint-disable-next-line prefer-destructuring
stats = stats[0];
}

const { activeGraph, showModal } = this.state;

Expand Down Expand Up @@ -303,7 +300,7 @@ ProfileStats.defaultProps = {
};

ProfileStats.propTypes = {
stats: PT.arrayOf(PT.shape()).isRequired,
stats: PT.shape().isRequired,
handleParam: PT.string.isRequired,
track: PT.string.isRequired,
subTrack: PT.string.isRequired,
Expand Down
13 changes: 3 additions & 10 deletions src/shared/components/ProfilePage/StatsCategory/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ const isActiveSubtrack = (subtrack) => {

class StatsCategory extends React.Component {
getActiveTracks() {
let { stats } = this.props;
if (_.isArray(stats)) {
// eslint-disable-next-line prefer-destructuring
stats = stats[0];
}
const { stats } = this.props;
const activeTracks = [];

if (stats.COPILOT && stats.COPILOT.fulfillment) {
Expand Down Expand Up @@ -93,7 +89,6 @@ class StatsCategory extends React.Component {
handle,
className,
inModal,
meta,
} = this.props;

const activeTracks = this.getActiveTracks();
Expand All @@ -118,7 +113,7 @@ class StatsCategory extends React.Component {
<Link
to={`/members/${handle}/details/?track=${track.name}&subTrack=${subtrack.name.replace(' ', '_')}`}
key={subtrack.name}
styleName={`subtrack ${index === 0 ? 'first' : ''} ${meta ? 'disablelink' : ''}`}
styleName={`subtrack ${index === 0 ? 'first' : ''}`}
>
<div
styleName="name"
Expand Down Expand Up @@ -184,15 +179,13 @@ class StatsCategory extends React.Component {
StatsCategory.defaultProps = {
className: '',
inModal: false,
meta: null,
};

StatsCategory.propTypes = {
handle: PT.string.isRequired,
stats: PT.arrayOf(PT.shape()).isRequired,
stats: PT.shape().isRequired,
inModal: PT.bool,
className: PT.string,
meta: PT.shape(),
};

export default StatsCategory;
4 changes: 0 additions & 4 deletions src/shared/components/ProfilePage/StatsCategory/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@
}
}

.disablelink {
pointer-events: none;
}

.icon {
width: 80px;
height: 80px;
Expand Down
14 changes: 3 additions & 11 deletions src/shared/components/ProfilePage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ class ProfilePage extends React.Component {
}

getActiveTracks() {
const { copilot } = this.props;
let { stats } = this.props;
if (_.isArray(stats)) {
// eslint-disable-next-line prefer-destructuring
stats = stats[0];
}
const { copilot, stats } = this.props;
const activeTracks = [];

if (copilot && stats && stats.COPILOT && stats.COPILOT.fulfillment) {
Expand Down Expand Up @@ -123,7 +118,6 @@ class ProfilePage extends React.Component {
skills: propSkills,
stats,
lookupData,
meta,
} = this.props;

const {
Expand Down Expand Up @@ -263,7 +257,7 @@ class ProfilePage extends React.Component {
{
stats && (
<div id="profile-activity">
<StatsCategory handle={info.handle} stats={stats} meta={meta} />
<StatsCategory handle={info.handle} stats={stats} />
</div>
)
}
Expand Down Expand Up @@ -303,7 +297,6 @@ ProfilePage.defaultProps = {
achievements: [],
skills: null,
stats: null,
meta: null,
};

ProfilePage.propTypes = {
Expand All @@ -313,9 +306,8 @@ ProfilePage.propTypes = {
externalLinks: PT.arrayOf(PT.shape()),
info: PT.shape().isRequired,
skills: PT.shape(),
stats: PT.arrayOf(PT.shape()),
stats: PT.shape(),
lookupData: PT.shape().isRequired,
meta: PT.shape(),
};

export default ProfilePage;
2 changes: 1 addition & 1 deletion src/shared/components/tc-communities/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function Header(props) {
items: [{
enforceA: true,
icon: <IconNavProfile />,
link: `${meta ? _.replace(BASE_URL, 'www', meta.subdomains[0]) : BASE_URL}/members/${normalizedProfile.handle}`,
link: `${BASE_URL}/members/${normalizedProfile.handle}`,
title: 'My Profile',
}, {
openNewTab: true,
Expand Down
16 changes: 5 additions & 11 deletions src/shared/containers/Profile.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Connects the Redux store to the Profile display components.
*/
import _ from 'lodash';
import React from 'react';
import PT from 'prop-types';
import { connect } from 'react-redux';
Expand All @@ -16,22 +15,20 @@ class ProfileContainer extends React.Component {
const {
handleParam,
loadProfile,
meta,
} = this.props;

loadProfile(handleParam, _.join(_.get(meta, 'groupIds', [])));
loadProfile(handleParam);
}

componentWillReceiveProps(nextProps) {
const {
handleParam,
profileForHandle,
loadProfile,
meta,
} = nextProps;

if (handleParam !== profileForHandle) {
loadProfile(handleParam, _.join(_.get(meta, 'groupIds', [])));
loadProfile(handleParam);
}
}

Expand Down Expand Up @@ -78,7 +75,6 @@ ProfileContainer.defaultProps = {
profileForHandle: '',
skills: null,
stats: null,
meta: null,
};

ProfileContainer.propTypes = {
Expand All @@ -93,9 +89,8 @@ ProfileContainer.propTypes = {
loadProfile: PT.func.isRequired,
profileForHandle: PT.string,
skills: PT.shape(),
stats: PT.arrayOf(PT.shape()),
stats: PT.shape(),
lookupData: PT.shape().isRequired,
meta: PT.shape(),
};

const mapStateToProps = (state, ownProps) => ({
Expand All @@ -105,7 +100,6 @@ const mapStateToProps = (state, ownProps) => ({
externalAccounts: state.profile.externalAccounts,
externalLinks: state.profile.externalLinks,
handleParam: ownProps.match.params.handle,
meta: ownProps.meta,
info: state.profile.info,
loadingError: state.profile.loadingError,
profileForHandle: state.profile.profileForHandle,
Expand All @@ -118,7 +112,7 @@ function mapDispatchToProps(dispatch) {
const a = actions.profile;
const lookupActions = actions.lookup;
return {
loadProfile: (handle, groupIds) => {
loadProfile: (handle) => {
dispatch(a.clearProfile());
dispatch(a.loadProfile(handle));
dispatch(a.getAchievementsInit());
Expand All @@ -133,7 +127,7 @@ function mapDispatchToProps(dispatch) {
dispatch(a.getExternalLinksDone(handle));
dispatch(a.getInfoDone(handle));
dispatch(a.getSkillsDone(handle));
dispatch(a.getStatsDone(handle, groupIds));
dispatch(a.getStatsDone(handle));
dispatch(lookupActions.getCountriesDone());
},
};
Expand Down
Loading