Skip to content

[PROD RELEASE] #1653

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 21 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4ec89b1
fix: pagination in submissions tab
hentrymartin May 21, 2025
6b81b05
fix: pagination in submissions tab
hentrymartin May 21, 2025
cd5322c
fix: pagination in submissions tab
hentrymartin May 21, 2025
1e3c8e0
Merge pull request #1649 from topcoder-platform/pm-1214
kkartunov May 22, 2025
0eb4fb3
fix: send source to accept or decline invite API
hentrymartin May 30, 2025
8390251
fix: send source to accept or decline invite API
hentrymartin May 30, 2025
713528f
fix: send source to accept or decline invite API
hentrymartin May 30, 2025
a211634
Merge pull request #1650 from topcoder-platform/pm-1169
kkartunov Jun 3, 2025
6063bbe
PM-1178 Update copilot requests form link
Jun 4, 2025
f489bae
PM-1178 Clean up typeform code
Jun 4, 2025
0b819d7
Merge pull request #1651 from topcoder-platform/PM-1178
kkartunov Jun 5, 2025
fc93578
fix: show request copilot for PMs
hentrymartin Jun 10, 2025
9c67f2b
Merge pull request #1652 from topcoder-platform/pm-1317
hentrymartin Jun 10, 2025
3b67a7e
fix: retain query param
hentrymartin Jun 16, 2025
153ab96
fix: retain query param
hentrymartin Jun 16, 2025
1aa70f4
fix: retain query param
hentrymartin Jun 16, 2025
78755ed
Merge pull request #1654 from topcoder-platform/pm-1355
hentrymartin Jun 16, 2025
b3eb22c
fix: send source only if its available
hentrymartin Jun 16, 2025
612a798
fix: send source only if its available
hentrymartin Jun 16, 2025
8d4d3a8
fix: send source only if its available
hentrymartin Jun 16, 2025
37c544a
Merge pull request #1655 from topcoder-platform/pm-1355_1
hentrymartin Jun 16, 2025
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 @@ -152,7 +152,7 @@ workflows:
context: org-global
filters: &filters-dev
branches:
only: ["develop", "PM-803_wm-regression-fixes", "PM-902_show-all-projects-on-challenge-page"]
only: ["develop", "PM-803_wm-regression-fixes", "PM-902_show-all-projects-on-challenge-page", "pm-1355_1"]

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
2 changes: 1 addition & 1 deletion config/constants/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
CHALLENGE_TRACKS_URL: `${DEV_API_HOSTNAME}/v5/challenge-tracks`,
CHALLENGE_PHASES_URL: `${DEV_API_HOSTNAME}/v5/challenge-phases`,
CHALLENGE_TIMELINES_URL: `${DEV_API_HOSTNAME}/v5/challenge-timelines`,
COPILOTS_URL: `https://copilots.${DOMAIN}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the DEV_API_HOSTNAME variable for consistency with other URLs, unless DOMAIN is intended to be different for this specific endpoint.

PROJECT_API_URL: `${DEV_API_HOSTNAME}/v5/projects`,
GROUPS_API_URL: `${DEV_API_HOSTNAME}/v5/groups`,
TERMS_API_URL: `${DEV_API_HOSTNAME}/v5/terms`,
Expand Down Expand Up @@ -61,6 +62,5 @@ module.exports = {
SKILLS_V5_API_URL: `${API_V5}/standardized-skills/skills/autocomplete`,
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/challenge-skills`,
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://c.cs18.visual.force.com/apex/baredirect?id=',
TYPEFORM_URL: 'https://topcoder.typeform.com/to/YJ7AL4p8',
PROFILE_URL: 'https://profiles.topcoder-dev.com/'
}
2 changes: 1 addition & 1 deletion config/constants/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
CHALLENGE_TRACKS_URL: `${PROD_API_HOSTNAME}/v5/challenge-tracks`,
CHALLENGE_PHASES_URL: `${PROD_API_HOSTNAME}/v5/challenge-phases`,
CHALLENGE_TIMELINES_URL: `${PROD_API_HOSTNAME}/v5/challenge-timelines`,
COPILOTS_URL: `https://copilots.${DOMAIN}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The COPILOTS_URL is using DOMAIN directly, but other URLs are using PROD_API_HOSTNAME. Consider using PROD_API_HOSTNAME for consistency, or ensure DOMAIN is correctly defined and intended for use here.

PROJECT_API_URL: `${PROD_API_HOSTNAME}/v5/projects`,
GROUPS_API_URL: `${PROD_API_HOSTNAME}/v5/groups`,
TERMS_API_URL: `${PROD_API_HOSTNAME}/v5/terms`,
Expand Down Expand Up @@ -58,6 +59,5 @@ module.exports = {
SKILLS_V5_API_URL: `${API_V5}/standardized-skills/skills/autocomplete`,
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/challenge-skills`,
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://topcoder.my.salesforce.com/apex/baredirect?id=',
TYPEFORM_URL: 'https://topcoder.typeform.com/to/YJ7AL4p8',
PROFILE_URL: 'https://profiles.topcoder.com/'
}
6 changes: 3 additions & 3 deletions src/actions/challengeSubmissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { fetchSubmissions } from '../services/challenges'

import { LOAD_CHALLENGE_SUBMISSIONS } from '../config/constants'

export function loadSubmissions (challengeId) {
return dispatch => {
export function loadSubmissions (challengeId, page) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function loadSubmissions now takes an additional parameter page, but there is no default value provided for it. Consider setting a default value to ensure backward compatibility if page is not provided.

return (dispatch) => {
if (challengeId) {
dispatch({
type: LOAD_CHALLENGE_SUBMISSIONS,
payload: fetchSubmissions(challengeId)
payload: fetchSubmissions(challengeId, page)
})
}
}
Expand Down
22 changes: 17 additions & 5 deletions src/components/ChallengeEditor/ChallengeViewTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ const ChallengeViewTabs = ({
loggedInUser,
onApproveChallenge,
createResource,
deleteResource
deleteResource,
loadSubmissions,
totalSubmissions,
submissionsPerPage,
page
}) => {
const [selectedTab, setSelectedTab] = useState(0)
const [showAddResourceModal, setShowAddResourceModal] = useState(false)
Expand Down Expand Up @@ -114,7 +118,7 @@ const ChallengeViewTabs = ({
})
return s
})
}, [challengeSubmissions, allResources])
}, [challengeSubmissions, allResources, page])

const isTask = _.get(challenge, 'task.isTask', false)

Expand Down Expand Up @@ -298,7 +302,7 @@ const ChallengeViewTabs = ({
>
RESOURCES
</a>
{challengeSubmissions.length ? (
{totalSubmissions ? (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming totalSubmissions to hasSubmissions or submissionsExist to make it clear that this is a boolean check rather than a count of submissions.

<a
tabIndex='2'
role='tab'
Expand All @@ -311,7 +315,7 @@ const ChallengeViewTabs = ({
}}
className={getSelectorStyle(selectedTab, 2)}
>
SUBMISSIONS ({submissions.length})
SUBMISSIONS ({totalSubmissions})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that totalSubmissions is correctly defined and updated elsewhere in the code to reflect the accurate number of submissions. This change assumes that totalSubmissions is a reliable source of truth for the submission count.

</a>
) : null}
</div>
Expand Down Expand Up @@ -353,6 +357,10 @@ const ChallengeViewTabs = ({
submissions={submissions}
token={token}
loggedInUserResource={loggedInUserResource}
loadSubmissions={loadSubmissions}
totalSubmissions={totalSubmissions}
submissionsPerPage={submissionsPerPage}
page={page}
/>
)}
{showAddResourceModal ? (<ResourcesAdd
Expand Down Expand Up @@ -396,7 +404,11 @@ ChallengeViewTabs.propTypes = {
deleteResource: PropTypes.func.isRequired,
showRejectChallengeModal: PropTypes.func.isRequired,
loggedInUser: PropTypes.object.isRequired,
onApproveChallenge: PropTypes.func
onApproveChallenge: PropTypes.func,
loadSubmissions: PropTypes.func,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loadSubmissions prop is added but not marked as required. If this function is essential for the component's functionality, consider marking it as required using PropTypes.func.isRequired.

totalSubmissions: PropTypes.number,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The totalSubmissions prop is added but not marked as required. If this value is crucial for the component's logic, consider marking it as required using PropTypes.number.isRequired.

submissionsPerPage: PropTypes.number,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The submissionsPerPage prop is added but not marked as required. If this value is necessary for pagination or other logic, consider marking it as required using PropTypes.number.isRequired.

page: PropTypes.number

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page prop is added but not marked as required. If this value is important for pagination or other functionality, consider marking it as required using PropTypes.number.isRequired.

}

export default ChallengeViewTabs
22 changes: 22 additions & 0 deletions src/components/ChallengeEditor/Submissions/Submissions.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,25 @@ $base-unit: 5px;
overflow: hidden;
}
}

.paginationWrapper {
display: flex;
margin-top: 30px;
flex: 1;
justify-content: center;
}

.footer {
display: flex;
justify-content: flex-end;
margin-top: 30px;
}

.perPageContainer {
margin-right: 20px;
max-width: 150px;
}

.paginationContainer {
display: flex;
}
Loading