Skip to content

Commit

Permalink
Merge pull request #6909 from topcoder-platform/justin_redirects
Browse files Browse the repository at this point in the history
Justin redirects
  • Loading branch information
jmgasper authored Aug 28, 2023
2 parents dc63db8 + cb9cd5a commit 5189b5d
Show file tree
Hide file tree
Showing 55 changed files with 67 additions and 448 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ workflows:
- PROD-4183
- MP-327
- fix_country_setting_in_profile
- justin_redirects
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ exports[`Default render 1`] = `
accountMenu={
Array [
Object {
"href": "/settings/profile",
"href": "/settings/account",
"title": "Settings",
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ afterAll(() => {
// setSearchText,
// showTrackModal,
// trackModalShown: true,
// validKeywords: [''],
// validTypes: [''],
// }, {
// challengeGroupId: '1',
Expand All @@ -60,7 +59,6 @@ afterAll(() => {
// setSearchText,
// showTrackModal,
// trackModalShown: true,
// validKeywords: [''],
// validTypes: [''],
// }];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const mockDatas = [{
setFilterState,
setSearchText,
activeBucket: 'all',
validKeywords: ['key', 'word'],
validTypes: [{ name: 'sub', subTrack: 'sub' }, { name: 'track', subTrack: 'track' }],
onClose,
}, {
Expand All @@ -55,7 +54,6 @@ const mockDatas = [{
selectedCommunityId: '1',
setFilterState,
setSearchText,
validKeywords: [],
validTypes: [],
onClose,
}];
Expand Down
17 changes: 0 additions & 17 deletions __tests__/shared/containers/challenge-listing/FilterPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ describe('shallow render connnected component', () => {
},
communityFilters: [],
filter: {},
loadingChallengeTags: false,
loadingChallengeTypes: false,
challengeTags: [],
challengeTypes: [],
selectedCommunityId: '1',
},
Expand Down Expand Up @@ -69,14 +67,11 @@ describe('shallow render connnected component', () => {
// communityFilters: [],
// filterState: {},
// getAvailableFilterName: jest.fn(),
// loadingKeywords: false,
// loadingTypes: false,
// validKeywords: [],
// validTypes: [],
// selectedCommunityId: '1',
// tokenV2: 'tokenV2',
// getTypes: jest.fn(),
// getKeywords: jest.fn(),
// saveFilter: jest.fn(),
// selectBucket: jest.fn(),
// selectCommunity: jest.fn(),
Expand Down Expand Up @@ -112,19 +107,16 @@ describe('shallow render connnected component', () => {
// test('load data if not loading', () => {
// instance = mount(<FilterPanel {...initialProps} challengeGroupId="1" />);
// expect(initialProps.getTypes).toHaveBeenCalledTimes(1);
// expect(initialProps.getKeywords).toHaveBeenCalledTimes(1);
// });

// test('do not load data if loading', () => {
// instance = mount(<FilterPanel
// {...initialProps}
// challengeGroupId="1"
// loadingTypes
// loadingKeywords
// />);

// expect(initialProps.getTypes).toHaveBeenCalledTimes(0);
// expect(initialProps.getKeywords).toHaveBeenCalledTimes(0);
// });

// test.skip('saveFilter', () => {
Expand Down Expand Up @@ -182,9 +174,7 @@ describe('shallow render connnected component', () => {
// },
// communityFilters: [],
// filter: {},
// loadingChallengeTags: true,
// loadingChallengeTypes: true,
// challengeTags: [],
// challengeTypes: [],
// selectedCommunityId: '1',
// },
Expand Down Expand Up @@ -232,13 +222,6 @@ describe('shallow render connnected component', () => {
// expect(actions[1].type).toEqual(cActions.challengeListing.getChallengeTypesDone.toString());
// });

// test('getKeywords', () => {
// filterPanel.prop('getKeywords')();
// const actions = store.getActions();
// expect(actions[0].type).toEqual(cActions.challengeListing.getChallengeTagsInit.toString());
// expect(actions[1].type).toEqual(cActions.challengeListing.getChallengeTagsDone.toString());
// });

// test.skip('saveFilter', () => {
// filterPanel.prop('saveFilter')();
// const actions = store.getActions();
Expand Down
2 changes: 0 additions & 2 deletions __tests__/shared/containers/challenge-listing/Listing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('full render pure component', () => {
allPastChallengesLoaded: false,
challenges: [],
challengeTypes: [],
challengeTags: [],
getCommunitiesList: () => {},
communityFilters: [{ communityId: '1', name: 'My Filter', filter: {} }],
dropChallenges: jest.fn(),
Expand Down Expand Up @@ -178,7 +177,6 @@ describe('full render connnected component and dispatch actions', () => {
allPastChallengesLoaded: false,
challenges: [{ id: '1' }],
challengeTypes: [],
challengeTags: [],
// communityFilters: [{ id: '1', name: 'My Filter', filter: {} }],
dropChallenges: jest.fn(),
filter: {},
Expand Down
3 changes: 2 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ module.exports = {
ACCOUNT_MENU: [
{
title: 'Settings',
href: '/settings/profile',
href: '/settings/account',
},
{ separator: true },
{
Expand Down Expand Up @@ -474,6 +474,7 @@ module.exports = {
/* development id - makes surveys have warning about environment */
UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js',
MEMBER_PROFILE_REDIRECT_URL: 'https://profiles.topcoder-dev.com',
MEMBER_SEARCH_REDIRECT_URL: 'https://talent-search.topcoder-dev.com',
ACCOUNT_SETTINGS_REDIRECT_URL: 'https://account-settings.topcoder-dev.com',
SPRIG_ENVIRONMENT_ID: 'bUcousVQ0-yF',
};
3 changes: 2 additions & 1 deletion config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ module.exports = {
ACCOUNT_MENU: [
{
title: 'Settings',
href: '/settings/profile?ref=nav',
href: '/settings/account',
},
{ separator: true },
{
Expand All @@ -237,6 +237,7 @@ module.exports = {
/* development id - makes surveys have warning about environment */
UNIVERSAL_NAV_URL: '//uni-nav.topcoder.com/v1/tc-universal-nav.js',
MEMBER_PROFILE_REDIRECT_URL: 'https://profiles.topcoder.com',
MEMBER_SEARCH_REDIRECT_URL: 'https://talent-search.topcoder.com',
SPRIG_ENVIRONMENT_ID: 'a-IZBZ6-r7bU',
ACCOUNT_SETTINGS_REDIRECT_URL: 'https://account-settings.topcoder.com',
};
14 changes: 0 additions & 14 deletions src/shared/actions/challenge-listing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ function getChallengeTypesDone() {
.then(res => res.sort((a, b) => a.name.localeCompare(b.name)));
}

/**
* Gets possible challenge tags (technologies).
* @return {Promise}
*/
function getChallengeTagsDone() {
return getService()
.getChallengeTags()
.then(res => res.map(item => item.name)
.sort((a, b) => a.localeCompare(b)));
}

/**
* Notifies about reloading of all active challenges. The UUID is stored in the
* state, and only challenges fetched by getAllActiveChallengesDone action with
Expand Down Expand Up @@ -587,9 +576,6 @@ export default createActions({
GET_TOTAL_CHALLENGES_COUNT_INIT: getTotalChallengesCountInit,
GET_TOTAL_CHALLENGES_COUNT_DONE: getTotalChallengesCountDone,

GET_CHALLENGE_TAGS_INIT: _.noop,
GET_CHALLENGE_TAGS_DONE: getChallengeTagsDone,

GET_PAST_CHALLENGES_INIT: getPastChallengesInit,
GET_PAST_CHALLENGES_DONE: getPastChallengesDone,

Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/TopcoderHeader/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export default class TopcoderHeader extends React.Component {
}, {
enforceA: true,
icon: <IconNavSettings />,
link: '/settings/profile',
link: '/settings/account',
title: 'Settings',
}, {
enforceA: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* Challenge keywords and tracks filters allow to choose multiple keywords from
* the predefined sets, which should be passed into the component as string arrays
* via the 'validKeywords' and 'validTracks' properties. The whole filters panel
* via the 'validTracks' properties. The whole filters panel
* can be hidden/displayed by setting the boolean 'hidden' property.
*
* Each time the user modifies any filter, this component triggers the callback
Expand Down Expand Up @@ -64,7 +64,6 @@ export default function FiltersPanel({
// selectedCommunityId,
setFilterState,
setSearchText,
// validKeywords,
validTypes,
// isSavingFilter,
expanded,
Expand Down Expand Up @@ -343,7 +342,6 @@ export default function FiltersPanel({
const tags = value ? value.split(',') : undefined;
setFilterState({ ..._.clone(filterState), tags });
}}
options={validKeywords.map(mapOps)}
simpleValue
value={filterState.tags ? filterState.tags.join(',') : null}
/>
Expand Down Expand Up @@ -726,7 +724,6 @@ FiltersPanel.propTypes = {
// selectedCommunityId: PT.string.isRequired,
setFilterState: PT.func.isRequired,
setSearchText: PT.func.isRequired,
// validKeywords: PT.arrayOf(PT.string).isRequired,
validTypes: PT.arrayOf(PT.shape()).isRequired,
onClose: PT.func,
expanded: PT.bool.isRequired,
Expand Down
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 @@ -87,7 +87,7 @@ function Header(props) {
title: 'Payments',
}, {
icon: <IconNavSettings />,
link: `${meta ? _.replace(BASE_URL, 'www', meta.subdomains[0]) : BASE_URL}/settings/profile`,
link: `${meta ? _.replace(BASE_URL, 'www', meta.subdomains[0]) : BASE_URL}/settings/account`,
title: 'Settings',
}, {
icon: <IconNavExit />,
Expand Down
11 changes: 0 additions & 11 deletions src/shared/containers/challenge-listing/FilterPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export class Container extends React.Component {

componentDidMount() {
const {
getKeywords,
getTypes,
loadingKeywords,
loadingTypes,
setFilterState,
// filterState,
Expand All @@ -46,7 +44,6 @@ export class Container extends React.Component {
getCommunityList(auth);
}
if (!loadingTypes) getTypes();
if (!loadingKeywords) getKeywords();

const query = qs.parse(window.location.search.slice(1));

Expand Down Expand Up @@ -182,9 +179,7 @@ Container.propTypes = {
}).isRequired,
filterState: PT.shape().isRequired,
selectedCommunityId: PT.string.isRequired,
getKeywords: PT.func.isRequired,
getTypes: PT.func.isRequired,
loadingKeywords: PT.bool.isRequired,
loadingTypes: PT.bool.isRequired,
setFilterState: PT.func.isRequired,
auth: PT.shape().isRequired,
Expand Down Expand Up @@ -214,10 +209,6 @@ function mapDispatchToProps(dispatch) {
dispatch(communityActions.tcCommunity.getListInit(uuid));
dispatch(communityActions.tcCommunity.getListDone(uuid, auth));
},
getKeywords: () => {
dispatch(cla.getChallengeTagsInit());
dispatch(cla.getChallengeTagsDone());
},
selectCommunity: id => dispatch(cla.selectCommunity(id)),
setFilterState: s => dispatch(cla.setFilter(s)),
onClose: () => dispatch(a.setExpanded(false)),
Expand All @@ -237,9 +228,7 @@ function mapStateToProps(state, ownProps) {
communityList: tc.list,
defaultCommunityId: ownProps.defaultCommunityId,
filterState: cl.filter,
loadingKeywords: cl.loadingChallengeTags,
loadingTypes: cl.loadingChallengeTypes,
validKeywords: cl.challengeTags,
validTypes: cl.challengeTypes,
selectedCommunityId: cl.selectedCommunityId,
auth: state.auth,
Expand Down
5 changes: 0 additions & 5 deletions src/shared/containers/challenge-listing/Listing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ export class ListingContainer extends React.Component {
pastChallenges,
challengeTypes,
challengesUrl,
challengeTags,
communityFilters,
communityName,
defaultCommunityId,
Expand Down Expand Up @@ -646,7 +645,6 @@ export class ListingContainer extends React.Component {
allChallenges={allChallenges}
pastChallenges={pastChallenges}
challengeTypes={challengeTypes}
challengeTags={challengeTags}
challengesUrl={challengesUrl}
communityFilter={communityFilter}
communityName={communityName}
Expand Down Expand Up @@ -765,7 +763,6 @@ ListingContainer.propTypes = {
pastChallenges: PT.arrayOf(PT.shape({})),
challengeTypes: PT.arrayOf(PT.shape()),
challengesUrl: PT.string,
challengeTags: PT.arrayOf(PT.string).isRequired,
communitiesList: PT.shape({
data: PT.arrayOf(PT.shape({
challengeFilter: PT.shape(),
Expand Down Expand Up @@ -864,7 +861,6 @@ const mapStateToProps = (state, ownProps) => {
allChallenges: cl.allChallenges,
pastChallenges: cl.pastChallenges,
challengeTypes: cl.challengeTypes,
challengeTags: cl.challengeTags,
communitiesList: tc.list,
communityFilters: tc.list.data,
domain: state.domain,
Expand All @@ -888,7 +884,6 @@ const mapStateToProps = (state, ownProps) => {
loadingPastChallengesUUID: cl.loadingPastChallengesUUID,
loadingReviewOpportunitiesUUID: cl.loadingReviewOpportunitiesUUID,
loadingChallengeTypes: cl.loadingChallengeTypes,
loadingChallengeTags: cl.loadingChallengeTags,
newChallengeDetails: ownProps.newChallengeDetails,
openChallengesInNewTabs: ownProps.openChallengesInNewTabs,
preListingMsg: ownProps.preListingMsg,
Expand Down
22 changes: 0 additions & 22 deletions src/shared/reducers/challenge-listing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,6 @@ function onGetChallengeTypesDone(state, action) {
};
}

/**
* Handles CHALLENGE_LISTING/GET_CHALLENGE_TAGS_DONE action.
* @param {Object} state
* @param {Object} action
* @return {Object}
*/
function onGetChallengeTagsDone(state, action) {
if (action.error) logger.error(action.payload);
return {
...state,
challengeTags: action.error ? [] : action.payload,
loadingChallengeTags: false,
};
}

function onGetPastChallengesInit(state, action) {
const { frontFilter, page, uuid } = action.payload;
const tracks = frontFilter && frontFilter.tracks;
Expand Down Expand Up @@ -830,12 +815,6 @@ function create(initialState) {
}),
[a.getChallengeTypesDone]: onGetChallengeTypesDone,

[a.getChallengeTagsInit]: state => ({
...state,
loadingChallengeTags: true,
}),
[a.getChallengeTagsDone]: onGetChallengeTagsDone,

[a.getPastChallengesInit]: onGetPastChallengesInit,
[a.getPastChallengesDone]: onGetPastChallengesDone,

Expand Down Expand Up @@ -906,7 +885,6 @@ function create(initialState) {
loadingReviewOpportunitiesUUID: '',

loadingChallengeTypes: false,
loadingChallengeTags: false,

reviewOpportunities: [],
filter: {
Expand Down
Loading

0 comments on commit 5189b5d

Please sign in to comment.