Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/pages/dash/s/[token]/problem.gql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
mutation CreateSupportTicketMutation(
$projectId: String!,
$type: LabsSupportTicketType!,
$description: String
$description: String,
$preventingProgress: Boolean
) {
labs {
createSupportTicket(projectId: $projectId, type: $type, description: $description)
createSupportTicket(projectId: $projectId, type: $type, description: $description, preventingProgress: $preventingProgress)
}
}

Expand Down
12 changes: 10 additions & 2 deletions src/pages/dash/s/[token]/problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function ProblemReporter({ projectId, ...props }) {
const [description, setDescription] = useState('');
const [consultedTa, setConsultedTa] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [preventingProgress, setPreventingProgress] = useState(false);

const requiresTa = type === 'IssueCantReplicate';
const requiresDescription = type === 'IssueCantReplicate' || type === 'Other';
Expand All @@ -50,19 +51,26 @@ function ProblemReporter({ projectId, ...props }) {
isChecked={consultedTa}
onChange={(e) => setConsultedTa(e.target.checked)}
>
I have consulted with a TA about this issue. (REQUIRED.) Please provide TA name in the desciption.
I have consulted with a TA about this issue. (REQUIRED.) Please provide TA name in the description.
</Checkbox>
<br />
</>
)}
<Checkbox
isChecked={preventingProgress}
onChange={(e) => setPreventingProgress(e.target.checked)}
>
This is preventing me from making progress.
</Checkbox>
<br />
<Button
mt={4}
isDisabled={(requiresDescription && !description) || (requiresTa && !consultedTa) || !type}
isLoading={isLoading}
onClick={async () => {
setIsLoading(true);
try {
await fetch(CreateSupportTicketMutation, { projectId, type, description });
await fetch(CreateSupportTicketMutation, { projectId, type, description, preventingProgress });
success('Thank you for reporting the problem. Expect to hear from us within 24 hours (except weekends).');
} catch (ex) {
error(ex.toString());
Expand Down