Closed wdprice closed 3 years ago
@wdprice should we allow customers to enter some text, same like for the report?
Sum up:
At the moment our code is tailored for Issue Reports. We have have to make it more general so we can also use it for Requesting extensions. We should not add ad-hoc code or workaround, but rather refactor the current code. Below is my suggestions regarding refactoring, but you may adjust as per your view if needed. The main aim is to have a general well-structured and well-named code.
refactor postReport
-> postEmail
(https://github.com/topcoder-platform/taas-app/blob/dev/src/services/teams.js#L121-L145) - it should be a general service method to send email, it should not have business logic inside.
rename ReportPopup
-> SendEmailPopup
or is there a better name?
openReport
-> openSendEmailPopup
(or other name) instead of 3 arguments it should take 2 arguments openSendEmailPopup(popupOptions, data)
:
popupOptions = {
title: "ISSUE REPORT - NEW TEST MAX E2E 4",
textPlaceholder: "Describe your issue",
textDataField: "data.reportText", // path where should we set the text entered by the user inside the data before sending
}
data = {
template: "team-issue-report",
data: {
projectName: "NEW TEST MAX E2E 4",
projectId: 12345,
// we don't know report text when open the popup, so this field should be set before sending
// like _.set(data, popupOptions.textDataField, <value from of user input>)
// reportText,
}
}
For extension request the values would be like:
popupOptions = {
title: "EXTENSION REQUEST - NEW TEST MAX E2E 4",
textPlaceholder: "Add any comments...",
textDataField: "data.text",
}
data = {
template: "extension-request", // required by API
data: {
projectName: "NEW TEST MAX E2E 4",
projectId: 12345,
// text, // should be configured by "popupOptions.textDataField = 'text'"
}
}
So when we open popup we would show all the texts inside the popup as per popupOptions
When we click submit, we would populate field with text entered by user as per popupOptions.textDataField
and would send data
using postEmail
by passing data
with populate filed as a body.
Don't make unnecessary changes or code formatting in any code which is not related to this issue. All the refactoring and renaming which is needed has to be made, including proper code formatting of the code which is being changed. But not other code.
After the general component is implemented, use it for the "Request an Extension" action, and remove all the current code this action:
Make sure that all the popups work good after such a refactoring.
@mbaghel could you please comment on this issue, so I can assign it to you. Otherwise, GitHub doesn't allow it.
Challenge https://www.topcoder.com/challenges/f3f26850-22cd-417a-b287-b51a706526fe has been created for this ticket.This is an automated message for maxceem via Topcoder X
Replying so I can be assigned.
On Fri, Feb 26, 2021, 4:14 PM maxceem notifications@github.com wrote:
@mbaghel https://github.com/mbaghel could you please comment on this issue, so I can assign it to you. Otherwise, GitHub doesn't allow it.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/topcoder-platform/taas-app/issues/124#issuecomment-786611630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOUOLYDWCKZSNQLU7HYNT3TA6GCNANCNFSM4YGV4FJQ .
@mbaghel, please sign-up with Topcoder X toolThis is an automated message for maxceem via Topcoder X
@mbaghel could you please sign-up at https://x.topcoder.com/. You would have to login there with your Topcoder and Github account to associate them. After that, the payment would be processed automatically when this issue is completed.
@mbaghel, please sign-up with Topcoder X toolThis is an automated message for maxceem via Topcoder X
@mbaghel, please sign-up with Topcoder X toolThis is an automated message for maxceem via Topcoder X
Paid manually via https://www.topcoder.com/challenges/f3f26850-22cd-417a-b287-b51a706526fe
Verified on Dev Env. Working as expected.
Pop up window.
Success message:
Failure message:
Mail sent.
Separate issue https://github.com/topcoder-platform/taas-app/issues/132 logged for Alignment in mail sent.
@mbaghel, please sign-up with Topcoder X toolThis is an automated message for maxceem via Topcoder X
@maxceem Everything is working as expected in Prod Env. Not able to check the Email content for the same.
Popup window.
Success message.
Failure message.
@wdprice I am not able to check the Email for the "Request Extension" as I don't have access to customersuccess@topcoder.com. Can you please help me in checking the same?
This ticket was not processed for payment. If you would like to process it for payment, please reopen it, add the tcx_FixAccepted
label, and then close it againThis is an automated message for maxceem via Topcoder X
Request an Extension link on the resourceBooking still opens a mailto:
Should operate in same manner as the Report an Issue, which an email being sent via Sendgrid to customersuccess@topcoder.com