topcoder-platform / admin-app

Customer support application
7 stars 25 forks source link

Terms Admin - Issue Creating an NDA #171

Closed rootelement closed 3 years ago

rootelement commented 3 years ago

Steps to Reproduce

  1. Create a new terms
  2. Select Type: Contest
  3. Select Agreeability Type: Docusign
  4. Enter anything in the docusign id field
  5. Enter some placeholder text in the body.
  6. Save it

If you try to edit that challenge, you'll see there's no docusign id returned.

It looks like the POST on creating a challenge is not sending the docusignId value from the field. I filled in these values: Screen Shot 2020-11-06 at 4 39 01 PM

And this was the POST body from the console:

agreeabilityTypeId: "999a26ad-b334-453c-8425-165d4cf496d7"
created: "2020-11-06T21:37:20.769Z"
createdBy: "jcori"
deletedAt: null
id: "8819a28a-ab08-4394-826c-5a512234aeaa"
legacyId: null
text: "This is test"
title: "Test NDA Again 1"
typeId: 5
updated: null
updatedBy: null
url: null

Notice there's no docusignTemplateId

rootelement commented 3 years ago

Also, after i fixed the terms in the DB and went to edit it, the agreeability type is correct, but it doesn't show the field: Screen Shot 2020-11-06 at 4 46 29 PM

I assume editing if the field worked wouldn't update that either. The API handles the docusignTemplateId in the POST and PUT requests, so that shouldn't be the problem here:

if (termsOfUse.docusignTemplateId) {
    await TermsOfUseDocusignTemplateXref.create({
      termsOfUseId: created.id,
      docusignTemplateId: termsOfUse.docusignTemplateId
    })
  }
maxceem commented 3 years ago

@rootelement it seems like a Terms API issue, because Admins App sends docusingTemplateId in the POST request:

image

But Terms API doesn't return it the response:

image

After I'm trying to load created Terms I get an error from API so it's hard to test the second issue with the missing field:

image

But if I open any existent Terms with correct docusignTemplateId (ex: http://local.topcoder-dev.com:3001/#/index/terms/edit/7245bb7d-d7c9-45a0-9603-d5ff05af0977) this field is shown correctly to me:

image

maxceem commented 3 years ago

Ah, I've got the second issue https://github.com/topcoder-platform/admin-app/issues/171#issuecomment-723318461. If it happens to you on PROD but not on DEV, then AGREE_FOR_DOCUSIGN_TEMPLATE might be misconfigured on PROD. It should point to the id of DocueSignable Aggreability Type in the PROD DB.

rootelement commented 3 years ago

Fixed. Thanks!