fix: issue description value (#5636)
This commit is contained in:
parent
3a9f01b9eb
commit
43633f2f28
6 changed files with 5 additions and 17 deletions
|
|
@ -24,7 +24,7 @@ const ArchivedIssueDetailsPage = observer(() => {
|
|||
|
||||
const { getProjectById } = useProject();
|
||||
|
||||
const { isLoading, data: swrArchivedIssueDetails } = useSWR(
|
||||
const { isLoading } = useSWR(
|
||||
workspaceSlug && projectId && archivedIssueId
|
||||
? `ARCHIVED_ISSUE_DETAIL_${workspaceSlug}_${projectId}_${archivedIssueId}`
|
||||
: null,
|
||||
|
|
@ -65,7 +65,6 @@ const ArchivedIssueDetailsPage = observer(() => {
|
|||
<div className="h-full w-full space-y-3 divide-y-2 divide-custom-border-200 overflow-y-auto">
|
||||
{workspaceSlug && projectId && archivedIssueId && (
|
||||
<IssueDetailRoot
|
||||
swrIssueDetails={swrArchivedIssueDetails}
|
||||
workspaceSlug={workspaceSlug.toString()}
|
||||
projectId={projectId.toString()}
|
||||
issueId={archivedIssueId.toString()}
|
||||
|
|
|
|||
|
|
@ -32,11 +32,7 @@ const IssueDetailsPage = observer(() => {
|
|||
const { getProjectById } = useProject();
|
||||
const { toggleIssueDetailSidebar, issueDetailSidebarCollapsed } = useAppTheme();
|
||||
// fetching issue details
|
||||
const {
|
||||
isLoading,
|
||||
data: swrIssueDetails,
|
||||
error,
|
||||
} = useSWR(
|
||||
const { isLoading, error } = useSWR(
|
||||
workspaceSlug && projectId && issueId ? `ISSUE_DETAIL_${workspaceSlug}_${projectId}_${issueId}` : null,
|
||||
workspaceSlug && projectId && issueId
|
||||
? () => fetchIssue(workspaceSlug.toString(), projectId.toString(), issueId.toString())
|
||||
|
|
@ -95,7 +91,6 @@ const IssueDetailsPage = observer(() => {
|
|||
projectId &&
|
||||
issueId && (
|
||||
<IssueDetailRoot
|
||||
swrIssueDetails={swrIssueDetails}
|
||||
workspaceSlug={workspaceSlug.toString()}
|
||||
projectId={projectId.toString()}
|
||||
issueId={issueId.toString()}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export type IssueDescriptionInputProps = {
|
|||
issueOperations: TIssueOperations;
|
||||
placeholder?: string | ((isFocused: boolean, value: string) => string);
|
||||
setIsSubmitting: (initialValue: "submitting" | "submitted" | "saved") => void;
|
||||
swrIssueDescription: string | null | undefined;
|
||||
swrIssueDescription?: string | null | undefined;
|
||||
};
|
||||
|
||||
export const IssueDescriptionInput: FC<IssueDescriptionInputProps> = observer((props) => {
|
||||
|
|
|
|||
|
|
@ -31,11 +31,10 @@ type Props = {
|
|||
issueOperations: TIssueOperations;
|
||||
isEditable: boolean;
|
||||
isArchived: boolean;
|
||||
swrIssueDetails: TIssue | null | undefined;
|
||||
};
|
||||
|
||||
export const IssueMainContent: React.FC<Props> = observer((props) => {
|
||||
const { workspaceSlug, projectId, issueId, issueOperations, isEditable, isArchived, swrIssueDetails } = props;
|
||||
const { workspaceSlug, projectId, issueId, issueOperations, isEditable, isArchived } = props;
|
||||
// states
|
||||
const [isSubmitting, setIsSubmitting] = useState<"submitting" | "submitted" | "saved">("saved");
|
||||
// hooks
|
||||
|
|
@ -88,7 +87,6 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||
|
||||
{/* {issue?.description_html === issueDescription && ( */}
|
||||
<IssueDescriptionInput
|
||||
swrIssueDescription={swrIssueDetails?.description_html}
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={issue.project_id}
|
||||
issueId={issue.id}
|
||||
|
|
|
|||
|
|
@ -52,11 +52,10 @@ export type TIssueDetailRoot = {
|
|||
projectId: string;
|
||||
issueId: string;
|
||||
is_archived?: boolean;
|
||||
swrIssueDetails: TIssue | null | undefined;
|
||||
};
|
||||
|
||||
export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
|
||||
const { workspaceSlug, projectId, issueId, swrIssueDetails, is_archived = false } = props;
|
||||
const { workspaceSlug, projectId, issueId, is_archived = false } = props;
|
||||
// router
|
||||
const router = useAppRouter();
|
||||
const pathname = usePathname();
|
||||
|
|
@ -349,7 +348,6 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
|
|||
<div className="max-w-2/3 h-full w-full space-y-8 overflow-y-auto px-9 py-5">
|
||||
<IssueMainContent
|
||||
workspaceSlug={workspaceSlug}
|
||||
swrIssueDetails={swrIssueDetails}
|
||||
projectId={projectId}
|
||||
issueId={issueId}
|
||||
issueOperations={issueOperations}
|
||||
|
|
|
|||
|
|
@ -74,8 +74,6 @@ export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = observer(
|
|||
projectId={issue.project_id}
|
||||
issueId={issue.id}
|
||||
initialValue={issueDescription}
|
||||
// for now peek overview doesn't have live syncing while tab changes
|
||||
swrIssueDescription={issueDescription}
|
||||
disabled={disabled}
|
||||
issueOperations={issueOperations}
|
||||
setIsSubmitting={(value) => setIsSubmitting(value)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue