Skip to content

Commit c6766c5

Browse files
authored
issue #115 (#183)
1 parent 7ec9bca commit c6766c5

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/components/challenge-detail/Header/ChallengeTags.jsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import { COMPETITION_TRACKS } from "utils/tc";
2626
import VerifiedTag from "components/challenge-listing/VerifiedTag";
2727
import MatchScore from "components/challenge-listing/ChallengeCard/MatchScore";
2828
import { calculateScore } from "../../../utils/challenge-listing/helper";
29+
import * as urlUtil from "utils/url";
30+
import * as constants from "constants";
2931
import "./style.module.scss";
3032

3133
export default function ChallengeTags(props) {
@@ -75,6 +77,19 @@ export default function ChallengeTags(props) {
7577

7678
const tags = technPlatforms.filter((tag) => !matchSkills.includes(tag));
7779

80+
const filterByChallengeType = urlUtil.buildQueryString({
81+
bucket: constants.FILTER_BUCKETS[1],
82+
tracks: _.values(constants.FILTER_CHALLENGE_TRACK_ABBREVIATIONS),
83+
page: 1,
84+
});
85+
86+
const filterByTag = urlUtil.buildQueryString({
87+
bucket: constants.FILTER_BUCKETS[1],
88+
tracks: _.values(constants.FILTER_CHALLENGE_TRACK_ABBREVIATIONS),
89+
page: 1,
90+
types: _.values(constants.FILTER_CHALLENGE_TYPE_ABBREVIATIONS),
91+
});
92+
7893
return (
7994
<div>
8095
{challengeType && (
@@ -84,7 +99,7 @@ export default function ChallengeTags(props) {
8499
setChallengeListingFilter({ types: [challengeType.name] })
85100
)
86101
}
87-
to={`${challengesUrl}?types[]=${encodeURIComponent(
102+
to={`${challengesUrl}${filterByChallengeType}&types[]=${encodeURIComponent(
88103
challengeType.abbreviation
89104
)}`}
90105
>
@@ -112,7 +127,7 @@ export default function ChallengeTags(props) {
112127
onClick={() =>
113128
setImmediate(() => setChallengeListingFilter({ tags: [tag] }))
114129
}
115-
to={`${challengesUrl}?tags[]=${encodeURIComponent(tag)}`}
130+
to={`${challengesUrl}${filterByTag}&tags[]=${encodeURIComponent(tag)}`}
116131
>
117132
{tag}
118133
</Tag>

src/containers/challenge-detail/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,7 @@ const mapDispatchToProps = (dispatch) => {
978978
}
979979
dispatch(updateFilter(change));
980980
dispatch(
981-
updateQuery({ ...stateProps.filter.challenge, ...change }),
982-
change
981+
updateQuery({ ...stateProps.filter.challenge, ...change })
983982
);
984983
},
985984
setSpecsTabState: (state) =>

0 commit comments

Comments
 (0)