Skip to content

Commit

Permalink
chore: workspace draft issue type (#5836)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia authored Oct 15, 2024
1 parent ff090ec commit 4e70e89
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type TIssueAdditionalPropertiesProps = {
issueTypeId: string | null;
projectId: string;
workspaceSlug: string;
isDraft?: boolean;
};

export const IssueAdditionalProperties: React.FC<TIssueAdditionalPropertiesProps> = () => <></>;
2 changes: 2 additions & 0 deletions web/core/components/issues/issue-modal/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
issueTypeId: response.type_id,
projectId: response.project_id,
workspaceSlug: workspaceSlug.toString(),
isDraft: isDraft,
});
}

Expand Down Expand Up @@ -257,6 +258,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
issueTypeId: payload.type_id,
projectId: payload.project_id,
workspaceSlug: workspaceSlug.toString(),
isDraft: isDraft,
});

setToast({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type TCreateUpdatePropertyValuesProps = {
projectId: string;
workspaceSlug: string;
issueTypeId: string | null | undefined;
isDraft?: boolean;
};

export type TIssueModalContext = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
issueTypeId: response.type_id,
projectId,
workspaceSlug: workspaceSlug?.toString(),
isDraft: true,
});
}
};
Expand Down
19 changes: 10 additions & 9 deletions web/core/components/issues/issue-modal/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"
)}
>
<div className="px-5">
Expand Down Expand Up @@ -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"
)}
>
{projectId && (
Expand All @@ -361,6 +361,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
issueTypeId={watch("type_id")}
projectId={projectId}
workspaceSlug={workspaceSlug?.toString()}
isDraft={isDraft}
/>
)}
</div>
Expand Down Expand Up @@ -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" />
<span className="text-xs">Create more</span>
</div>
)}
Expand Down

0 comments on commit 4e70e89

Please sign in to comment.