Skip to content

[$40] Design contests My Submission page: Add Submission button is missing #4755

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

Closed
SathyaJayabal opened this issue Aug 14, 2020 · 16 comments
Closed

Comments

@SathyaJayabal
Copy link
Collaborator

Design contests My Submission page: Add Submission button is missing

Expected: "Add Submission" button must be displayed when the submission phase is still open.
example:
user:customeruser
https://beta-community-app.topcoder.com/challenges/ae7f8a3f-d28b-4743-ac0f-21e15b9f4891/my-submissions
https://www.topcoder.com/challenges/30136817/my-submissions
Screenshot 2020-08-14 at 6 30 31 PM

Screenshot 2020-08-14 at 6 30 29 PM

@Oanh-and-only-Oanh
Copy link

@SathyaJayabal, can user still submit using the other main submit button on the challenge details page?

@SathyaJayabal
Copy link
Collaborator Author

yes, they can

@luizrrodrigues luizrrodrigues changed the title Design contests My Submission page: Add Submission button is missing [$40] Design contests My Submission page: Add Submission button is missing Sep 3, 2020
@crazyk07
Copy link

crazyk07 commented Sep 3, 2020

Contest https://www.topcoder.com/challenges/30140425 has been created for this ticket.

This is an automated message for crazyk via Topcoder X

@luizrrodrigues
Copy link
Collaborator

luizrrodrigues commented Sep 3, 2020

@topcoder-platform/topcodercompetitors @topcoder-platform/tcxcommunity this is open for pickup

Submit in 8 hours and PR to

https://github.com/topcoder-platform/community-app/tree/milestone-v1.3
https://github.com/topcoder-platform/topcoder-react-lib/tree/milestone-v1.3

run npm run test before PR

@cagdas001 cagdas001 self-assigned this Sep 3, 2020
@crazyk07
Copy link

crazyk07 commented Sep 3, 2020

Contest https://www.topcoder.com/challenges/30140425 has been updated - it has been assigned to cagdas001.

This is an automated message for crazyk via Topcoder X

@luizrrodrigues
Copy link
Collaborator

@cagdas001
Copy link
Collaborator

@luizrrodrigues This issue applies to all challenge types (not only the design type) It's an API issue regarding the inconsistent dates.

For e.g. https://api.topcoder.com/v5/challenges/1691118f-7734-422d-b8b6-d5df9f94f852

{
    ...
    "phases": [
        {
            ...
            "scheduledEndDate": "2020-11-01T07:18:00Z",
            "actualEndDate": "2020-08-14T11:42:05Z",
            "isOpen": true,
            "name": "Submission",
            "actualStartDate": "2020-06-25T07:23:24Z",
            "scheduledStartDate": "2020-06-25T07:23:24Z"
        },
        ...
    ],
    "startDate": "2020-06-25T07:09:01Z",
    "endDate": "2020-11-03T07:18:00Z",
    "registrationStartDate": "2020-06-25T07:09:01Z",
    "registrationEndDate": "2020-08-14T11:42:05Z",
    "submissionStartDate": "2020-06-25T07:23:24Z",
    "submissionEndDate": "2020-08-14T11:42:05Z",
    ...
}

You can see challenge.submissionEndDate is 2020-08-14T11:42:05Z while the actual submission phase end date is 2020-11-01T07:18:00Z (see scheduledEndDate of the phase)

We have experienced the exact same (inconsistent dates from API) issue at other earlier issues too, I ended up manually extracting phase dates from challlenge.phases, instead of relying on the challenge.submissionEndDate

I'll use the same approach here.

@cagdas001
Copy link
Collaborator

By the way, I guess the root cause of #4756 is the same as here, as (afaik) it checks the challenge.submissionEndDate for the disabled property. At earlier issues, I have implemented two helper functions at

/**
* Returns phase's end date.
* @param {Object} phase
* @return {Date}
*/
export function phaseEndDate(phase) {
// Case 1: phase is still open. take the `scheduledEndDate`
// Case 2: phase is not open but `scheduledStartDate` is a future date.
// This means phase is not yet started. So take the `scheduledEndDate`
// Case 3: phase is not open & `scheduledStartDate` is a past date,
// but the phase is `Iterative Review`. It will take the `scheduledEndDate`
// as it's a valid scenario for iterative review,
// there might not be any submission yet to open the phase
if (phase.isOpen || moment(phase.scheduledStartDate).isAfter() || phase.name === 'Iterative Review') {
return new Date(phase.scheduledEndDate);
}
// for other cases, take the `actualEndDate` as phase is already closed
return new Date(phase.actualEndDate);
}
to extract phase start/end dates. You can use them if you wish

fyi @narekcat

@cagdas001
Copy link
Collaborator

cagdas001 commented Sep 3, 2020

PR: #4854 (also read above comments)

@luizrrodrigues
Copy link
Collaborator

@cagdas001 Cool, thanks for clarifications and details here. I'll review this shortly.

@SathyaJayabal
Copy link
Collaborator Author

SathyaJayabal commented Sep 3, 2020

@luizrrodrigues @sushilshinde , should we get this fixed from api side instead of working around it.

@luizrrodrigues
Copy link
Collaborator

@SathyaJayabal I think we can move this one forward because helper already created and present in existing code. But agree, we need get this fixed in API side.

@sandhiyakavi
Copy link
Collaborator

Tested.Working as expected.

image

@SathyaJayabal
Copy link
Collaborator Author

verified on staging
Screenshot 2020-09-08 at 5 33 14 PM

sushilshinde added a commit that referenced this issue Sep 8, 2020
@SathyaJayabal SathyaJayabal added QA Pass in PROD Passed verification on Production and removed QA Pass in Staging labels Sep 8, 2020
@SathyaJayabal
Copy link
Collaborator Author

Screenshot 2020-09-08 at 7 33 59 PM

@crazyk07
Copy link

crazyk07 commented Sep 8, 2020

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30140425

This is an automated message for crazyk via Topcoder X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants