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
feat: question creation module #125
Conversation
import { | ||
ArrowBackOutlineIcon, | ||
ColumnIcon, |
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.
As per design, since we are no longer supporting the Column feature!
...prevQuestionElements, | ||
newQuestionElement, | ||
]); | ||
}; |
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.
I think in the next PR, I'm going to refactor this to use useContext
to avoid prop drilling + for a cleaner implementation. Just wanted to get this PR merged since the ticket has been open for waaaaaay too long!
@@ -194,7 +194,6 @@ const UsersPage = (): React.ReactElement => { | |||
} | |||
}; | |||
|
|||
type Role = "teacher" | "admin"; | |||
return ( | |||
<> | |||
<Box> |
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.
Linting
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.
i think this should disappear once you pull from staging
|
||
const HoverMessage = (): React.ReactElement => <Text>You are hovering.</Text>; | ||
|
||
export default HoverMessage; |
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 is temporary, I'm waiting for a design decision on what the Hover state should look like here!
return <Text key={index}>this is a multi select element.</Text>; | ||
default: | ||
return null; | ||
} |
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.
I'll update this to use the appropriate components as they are created!
const opacity = isDragging ? 0.4 : 1; | ||
return ( | ||
<Box ref={drag} style={{ opacity }}> | ||
<WrapItem cursor="grab"> |
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.
Currently, the cursor changes appropriately when hovering over the QuestionSidebarItem
. However, I can't get the cursor to change while dragging. According to the linked thread, this is how the HTML API for drag and drop works and the fix is to implement a custom API. Given this, leaving the cursor as is.
VStack, | ||
HStack, | ||
} from "@chakra-ui/react"; | ||
import { Text, VStack, HStack } from "@chakra-ui/react"; | ||
|
||
import { AdminUser, TeacherUser } from "../../types/UserTypes"; | ||
|
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.
Linter
@@ -1,5 +1,4 @@ | |||
import React from "react"; | |||
import { AdminUser } from "../../types/UserTypes"; | |||
import { TableRow, Table } from "../common/Table"; | |||
import RemoveUserPopover from "./RemoveUserPopover"; | |||
import { AdminTableProps } from "./AdminTab"; |
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.
Linter
); | ||
}; | ||
|
||
export default TextElement; |
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.
Currently, the TextElement
is not draggable or deletable... I'll address that in a future PR since this ones getting pretty big.
frontend/src/components/question-creation/question-elements/TextElement.tsx
Outdated
Show resolved
Hide resolved
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.
two small comments, but looks good otherwise!
we probably will need to restructure how errors are handled (probably in QuestionPage
and passed into QuestionEditor
for setting/unsetting and QuestionSidebar
for onSubmit) but can be in a follow up PR
frontend/src/components/question-creation/question-elements/TextElement.tsx
Show resolved
Hide resolved
yup makes sense! I created a ticket to handle passing the data from the entire |
i guess in
and then on success, we would need to pass the data back to |
0a090f7
to
14b7350
Compare
Visit the preview URL for this PR (updated for commit 14b7350): https://jump-math-staging--pr125-joyce-dnd-setup-ipyui92f.web.app (expires Fri, 03 Mar 2023 03:56:24 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c42d8d0d853b05885664a2dd73f8245f4333ae51 |
Notion ticket link
Add text component to Question Editor
Implementation description
react-dnd
librarySteps to test
Screen.Recording.2023-02-20.at.6.23.18.PM.mov
What should reviewers focus on?
Some Notes: