[WEB-2568] chore: minor improvements related to issue identifier and issue modal. (#5723)

* [WEB-2568] chore: minor improvements related to issue identifier and issue modal.

* fix: error handling for session recorder script.

* chore: minor improvement
This commit is contained in:
Prateek Shourya 2024-09-30 14:07:22 +05:30 committed by GitHub
parent b1dccf3773
commit c25fa594fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 49 additions and 23 deletions

View file

@ -30,6 +30,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
withDraftIssueWrapper = true,
storeType: issueStoreFromProps,
isDraft = false,
fetchIssueDetails = true,
} = props;
const issueStoreType = useIssueStoreType();
@ -68,7 +69,8 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
setDescription(undefined);
if (!workspaceSlug) return;
if (!projectId || issueId === undefined) {
if (!projectId || issueId === undefined || !fetchIssueDetails) {
// Set description to the issue description from the props if available
setDescription(data?.description_html || "<p></p>");
return;
}

View file

@ -146,12 +146,6 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
useEffect(() => {
const issueTypeId = watch("type_id");
// if data is present, set active type id to the type id of the issue
if (data && data.type_id) {
setValue("type_id", data.type_id, { shouldValidate: true });
return;
}
// if issue type id is present or project not available, return
if (issueTypeId || !projectId) return;
@ -284,7 +278,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
<IssueTypeSelect
control={control}
projectId={projectId}
disabled={!!data?.id || !!data?.sourceIssueId}
disabled={!!data?.sourceIssueId}
handleFormChange={handleFormChange}
/>
)}

View file

@ -19,10 +19,14 @@ export interface IssuesModalProps {
withDraftIssueWrapper?: boolean;
storeType?: EIssuesStoreType;
isDraft?: boolean;
fetchIssueDetails?: boolean;
}
export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((props) => (
<IssueModalProvider>
<CreateUpdateIssueModalBase {...props} />
</IssueModalProvider>
));
export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer(
(props) =>
props.isOpen && (
<IssueModalProvider>
<CreateUpdateIssueModalBase {...props} />
</IssueModalProvider>
)
);