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