Skip to content

Urgent component#104

Open
leowang801 wants to merge 10 commits intomainfrom
urgent-component
Open

Urgent component#104
leowang801 wants to merge 10 commits intomainfrom
urgent-component

Conversation

@leowang801
Copy link
Copy Markdown

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.

@leowang801 leowang801 requested a review from Harin329 March 31, 2023 09:11
question: option,
},
});
console.log(option)
Copy link
Copy Markdown
Member

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

import "./request-form.css";
import { appColor } from "../../constants";
import { LOAD_QUESTION } from "../../redux/actions/questionActions";
import { LOAD_QUESTION} from "../../redux/actions/questionActions";
Copy link
Copy Markdown
Member

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

service: service,
quantity: quantity,
cost: cost * quantity,
cost: isUrgent? cost * quantity * urgentMultiplier : cost * quantity,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cost: isUrgent? cost * quantity * urgentMultiplier : cost * quantity,
cost: isUrgent ? cost * quantity * urgentMultiplier : cost * quantity,

question: option,
},
});
console.log(option)
Copy link
Copy Markdown
Member

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"});
Copy link
Copy Markdown
Member

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}
Copy link
Copy Markdown
Member

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"

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.

2 participants