-
Notifications
You must be signed in to change notification settings - Fork 2
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
Urgent component #104
base: main
Are you sure you want to change the base?
Urgent component #104
Conversation
…s and answers to render wihtout change from user
@@ -63,6 +63,7 @@ function SingleSelect({ question }) { | |||
question: option, | |||
}, | |||
}); | |||
console.log(option) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this console log
@@ -3,10 +3,11 @@ import { useDispatch, useSelector } from "react-redux"; | |||
import { Navigate } from "react-router-dom"; | |||
import "./request-form.css"; | |||
import { appColor } from "../../constants"; | |||
import { LOAD_QUESTION } from "../../redux/actions/questionActions"; | |||
import { LOAD_QUESTION} from "../../redux/actions/questionActions"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint: should have space after LOAD_QUESTION
@@ -109,7 +120,7 @@ function RequestForm() { | |||
billableList.push({ | |||
service: service, | |||
quantity: quantity, | |||
cost: cost * quantity, | |||
cost: isUrgent? cost * quantity * urgentMultiplier : cost * quantity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cost: isUrgent? cost * quantity * urgentMultiplier : cost * quantity, | |
cost: isUrgent ? cost * quantity * urgentMultiplier : cost * quantity, |
question: option, | ||
}, | ||
}); | ||
console.log(option) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove this log as well
question_type: 'urgent', | ||
question: 'Is this request urgent?', | ||
answer_id: uuid(), | ||
answer: "No"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use true or false here, but I think the answer is text typed, if that's the case, we should probably modify how we check the answer below.
return ( | ||
<div className="single-select-option" key={index}> | ||
<FormControlLabel | ||
value={option.answer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this option.answer is likely a "yes" "No" string in your implementation, so it will always be true, maybe we should have it check whether it is "Yes" or "No"
Created a new question type "Urgent" where the total cost will be multiplied by a given multiplier (currently 1.5x) if the urgent question is selected "yes".
Screen.Recording.2023-03-31.at.2.06.27.AM.mov
Currently, there are some weird small issues with the costs that are displayed sometimes. Also, we may want to have an area where the user will be notified how much extra they will be charged for urgent requests.