chore: workspace draft issue type (#5836)
This commit is contained in:
parent
ff090ecf39
commit
4e70e894f6
5 changed files with 15 additions and 9 deletions
|
|
@ -3,6 +3,7 @@ type TIssueAdditionalPropertiesProps = {
|
|||
issueTypeId: string | null;
|
||||
projectId: string;
|
||||
workspaceSlug: string;
|
||||
isDraft?: boolean;
|
||||
};
|
||||
|
||||
export const IssueAdditionalProperties: React.FC<TIssueAdditionalPropertiesProps> = () => <></>;
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
|
|||
issueTypeId: response.type_id,
|
||||
projectId: response.project_id,
|
||||
workspaceSlug: workspaceSlug.toString(),
|
||||
isDraft: isDraft,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ export type TCreateUpdatePropertyValuesProps = {
|
|||
projectId: string;
|
||||
workspaceSlug: string;
|
||||
issueTypeId: string | null | undefined;
|
||||
isDraft?: boolean;
|
||||
};
|
||||
|
||||
export type TIssueModalContext = {
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
|||
issueTypeId: response.type_id,
|
||||
projectId,
|
||||
workspaceSlug: workspaceSlug?.toString(),
|
||||
isDraft: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
)}
|
||||
>
|
||||
<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"
|
||||
)}
|
||||
>
|
||||
{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" />
|
||||
<span className="text-xs">Create more</span>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue