-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-2677] chore: draft issue issue type #5836
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -195,12 +195,12 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => { | |||||||||||||
| const submitData = !data?.id | ||||||||||||||
| ? formData | ||||||||||||||
| : { | ||||||||||||||
| ...getChangedIssuefields(formData, dirtyFields as { [key: string]: boolean | undefined }), | ||||||||||||||
| project_id: getValues<"project_id">("project_id"), | ||||||||||||||
| id: data.id, | ||||||||||||||
| description_html: formData.description_html ?? "<p></p>", | ||||||||||||||
| type_id: getValues<"type_id">("type_id"), | ||||||||||||||
| }; | ||||||||||||||
| ...getChangedIssuefields(formData, dirtyFields as { [key: string]: boolean | undefined }), | ||||||||||||||
| project_id: getValues<"project_id">("project_id"), | ||||||||||||||
| id: data.id, | ||||||||||||||
| description_html: formData.description_html ?? "<p></p>", | ||||||||||||||
| type_id: getValues<"type_id">("type_id"), | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| // this condition helps to move the issues from draft to project issues | ||||||||||||||
| if (formData.hasOwnProperty("is_draft")) submitData.is_draft = formData.is_draft; | ||||||||||||||
|
|
@@ -323,7 +323,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => { | |||||||||||||
| className={cn( | ||||||||||||||
| "pb-4 space-y-3", | ||||||||||||||
| activeAdditionalPropertiesLength > 4 && | ||||||||||||||
| "max-h-[45vh] overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm" | ||||||||||||||
| "max-h-[45vh] overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm" | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid hardcoded height values for better responsiveness Using fixed heights like Consider using dynamic sizing or responsive design utilities to enhance adaptability: - "max-h-[45vh] overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm"
+ "overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm"This change allows the container to adjust its height based on content and screen size. 📝 Committable suggestion
Suggested change
|
||||||||||||||
| )} | ||||||||||||||
| > | ||||||||||||||
| <div className="px-5"> | ||||||||||||||
|
|
@@ -352,7 +352,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => { | |||||||||||||
| className={cn( | ||||||||||||||
| "px-5", | ||||||||||||||
| activeAdditionalPropertiesLength <= 4 && | ||||||||||||||
| "max-h-[25vh] overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm" | ||||||||||||||
| "max-h-[25vh] overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm" | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consistent handling of container overflow Similar to the previous comment, using Update the className to allow content-driven sizing: - "max-h-[25vh] overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm"
+ "overflow-hidden overflow-y-auto vertical-scrollbar scrollbar-sm"📝 Committable suggestion
Suggested change
|
||||||||||||||
| )} | ||||||||||||||
| > | ||||||||||||||
| {projectId && ( | ||||||||||||||
|
|
@@ -361,6 +361,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => { | |||||||||||||
| issueTypeId={watch("type_id")} | ||||||||||||||
| projectId={projectId} | ||||||||||||||
| workspaceSlug={workspaceSlug?.toString()} | ||||||||||||||
| isDraft={isDraft} | ||||||||||||||
| /> | ||||||||||||||
| )} | ||||||||||||||
| </div> | ||||||||||||||
|
|
@@ -393,7 +394,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => { | |||||||||||||
| tabIndex={getIndex("create_more")} | ||||||||||||||
| role="button" | ||||||||||||||
| > | ||||||||||||||
| <ToggleSwitch value={isCreateMoreToggleEnabled} onChange={() => { }} size="sm" /> | ||||||||||||||
| <ToggleSwitch value={isCreateMoreToggleEnabled} onChange={() => {}} size="sm" /> | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Handle toggle state within Currently, the It's better practice to handle the toggle state within the <div className="inline-flex items-center gap-1.5 cursor-pointer">
- <ToggleSwitch value={isCreateMoreToggleEnabled} onChange={() => {}} size="sm" />
+ <ToggleSwitch
+ value={isCreateMoreToggleEnabled}
+ onChange={() => onCreateMoreToggleChange(!isCreateMoreToggleEnabled)}
+ size="sm"
+ />
<span className="text-xs">Create more</span>
</div>Additionally, you can remove the 📝 Committable suggestion
Suggested change
|
||||||||||||||
| <span className="text-xs">Create more</span> | ||||||||||||||
| </div> | ||||||||||||||
| )} | ||||||||||||||
|
|
||||||||||||||
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.
🛠️ Refactor suggestion
Ensure consistent inclusion of
is_draftinsubmitDataIn the
handleFormSubmitfunction, thesubmitDataobject may not always include theis_draftproperty, which could lead to inconsistencies when submitting draft issues. While you conditionally addis_draftlater, it's clearer and safer to include it explicitly during thesubmitDataconstruction.Consider modifying the
submitDatato always include theis_draftproperty:const submitData = !data?.id ? formData : { ...getChangedIssuefields(formData, dirtyFields as { [key: string]: boolean | undefined }), project_id: getValues<"project_id">("project_id"), id: data.id, description_html: formData.description_html ?? "<p></p>", type_id: getValues<"type_id">("type_id"), + is_draft: formData.is_draft, };This ensures that the draft status is consistently handled during updates.
📝 Committable suggestion