Skip to content

add default terms and refractor nda input #1054

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 4 commits into from
Jan 27, 2021
Merged

add default terms and refractor nda input #1054

merged 4 commits into from
Jan 27, 2021

Conversation

CDharmateja
Copy link
Contributor

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@CDharmateja there are some missing requrements, let me clarify them:

  1. We should not show all the terms and should be allowed to edit all the terms. Only enable/disable NDA. So no need to show terms and we should hide the editor for all the terms.

    image

    image

    • As we don't need to show Terms selector, please, cancel all the changes in the file src/components/ChallengeEditor/Terms-Field/index.js for now.
  2. There is one missing requirement:

    When we are creating a new challenge, we should apply all the terms of the projects which are listed in the project.terms array to the challenge. So new challenge has to be created with the same terms as project.

    So when we create a challenge now, we add only one hardcoded term https://github.com/topcoder-platform/work-manager/blob/develop/src/components/ChallengeEditor/index.js#L838. We should still add this term. But also, we should add all the terms of project, which are stored in project.terms. Each term should be added with the same roleId SUBMITTER_ROLE_UUID.

  3. In the VIEW mode, let's show only text "yes" or "no" without radioboxes, like we do for other data
    image

  4. Can we please make smaller distance between yes and no options

    image

Comment on lines 186 to 195
{params.get('beta') === 'true' && (
<div className={styles.row}>
<div className={styles.col}>
<span>
<span className={styles.fieldTitle}>Terms:</span>
{challenge.terms.map(term => term.id).join(', ')}
</span>
</div>
</div>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to show all the terms

Comment on lines 1398 to 1405
{params.get('beta') && (
<TermsField
terms={metadata.challengeTerms}
projectTerms={projectDetail.terms}
challenge={challenge}
onUpdateMultiSelect={this.onUpdateMultiSelect}
/>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to edit al the terms, please, hide it using flase as it was before

@maxceem
Copy link
Contributor

maxceem commented Jan 26, 2021

Also, could you please, resolve merge conflicts with the other PR which I've already merged.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

Thanks for update, @CDharmateja. Works great now. Just a few minor improvements:

  1. Label for this field should be "bold" as all other labels:

    image

Also, there are few code improvement suggestions, please, kindly check comments below.

Comment on lines 18 to 19
? <div>Yes</div>
: <div>No</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

@CDharmateja I guess we don't need to wrap each answer "yes" / "no" into <div> and can simplify this to:

{isRequiredNda ? 'Yes' : 'No'}

/>
<label className={styles['tc-RadioButton-label']} htmlFor='nda-yes'>
<div>yes</div>
<input type='hidden' />
Copy link
Contributor

Choose a reason for hiding this comment

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

@CDharmateja do we really need this "hidden" input?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think its not necessary. The input radio structure is like that here

. So I have used it.

/>
<label className={styles['tc-RadioButton-label']} htmlFor='nda-no'>
<div>No</div>
<input type='hidden' />
Copy link
Contributor

Choose a reason for hiding this comment

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

@CDharmateja do we really need this "hidden" input?

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@CDharmateja perfect now, thanks.

@maxceem maxceem merged commit de55c10 into topcoder-platform:develop Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants