[WEB-1100] fix: bug fixes and enhancement (#4318)

* fix: inbox issue description

* chore: outline heading removed from page toc

* chore: label setting page ui improvement

* fix: update issue modal description resetting

* chore: project page head title improvement
This commit is contained in:
Anmol Singh Bhatia 2024-04-30 19:39:50 +05:30 committed by GitHub
parent d2717a221c
commit d1978be778
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 24 additions and 21 deletions

View File

@ -26,13 +26,11 @@ type Props = {
isEditable: boolean; isEditable: boolean;
isSubmitting: "submitting" | "submitted" | "saved"; isSubmitting: "submitting" | "submitted" | "saved";
setIsSubmitting: Dispatch<SetStateAction<"submitting" | "submitted" | "saved">>; setIsSubmitting: Dispatch<SetStateAction<"submitting" | "submitted" | "saved">>;
swrIssueDescription: string | undefined;
}; };
export const InboxIssueMainContent: React.FC<Props> = observer((props) => { export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
const router = useRouter(); const router = useRouter();
const { workspaceSlug, projectId, inboxIssue, isEditable, isSubmitting, setIsSubmitting, swrIssueDescription } = const { workspaceSlug, projectId, inboxIssue, isEditable, isSubmitting, setIsSubmitting } = props;
props;
// hooks // hooks
const { currentUser } = useUser(); const { currentUser } = useUser();
const { setShowAlert } = useReloadConfirmations(isSubmitting === "submitting"); const { setShowAlert } = useReloadConfirmations(isSubmitting === "submitting");
@ -137,7 +135,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}
projectId={issue.project_id} projectId={issue.project_id}
issueId={issue.id} issueId={issue.id}
swrIssueDescription={swrIssueDescription} swrIssueDescription={null}
initialValue={issue.description_html ?? "<p></p>"} initialValue={issue.description_html ?? "<p></p>"}
disabled={!isEditable} disabled={!isEditable}
issueOperations={issueOperations} issueOperations={issueOperations}

View File

@ -24,14 +24,13 @@ export const InboxContentRoot: FC<TInboxContentRoot> = observer((props) => {
membership: { currentProjectRole }, membership: { currentProjectRole },
} = useUser(); } = useUser();
const { data: swrIssueDetails } = useSWR( useSWR(
workspaceSlug && projectId && inboxIssueId workspaceSlug && projectId && inboxIssueId
? `PROJECT_INBOX_ISSUE_DETAIL_${workspaceSlug}_${projectId}_${inboxIssueId}` ? `PROJECT_INBOX_ISSUE_DETAIL_${workspaceSlug}_${projectId}_${inboxIssueId}`
: null, : null,
workspaceSlug && projectId && inboxIssueId workspaceSlug && projectId && inboxIssueId
? () => fetchInboxIssueById(workspaceSlug, projectId, inboxIssueId) ? () => fetchInboxIssueById(workspaceSlug, projectId, inboxIssueId)
: null, : null
{ revalidateOnFocus: true }
); );
const isEditable = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER; const isEditable = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
@ -61,7 +60,6 @@ export const InboxContentRoot: FC<TInboxContentRoot> = observer((props) => {
isEditable={isEditable && !isIssueDisabled} isEditable={isEditable && !isIssueDisabled}
isSubmitting={isSubmitting} isSubmitting={isSubmitting}
setIsSubmitting={setIsSubmitting} setIsSubmitting={setIsSubmitting}
swrIssueDescription={swrIssueDetails?.issue.description_html}
/> />
</div> </div>
</div> </div>

View File

@ -111,7 +111,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
// clearing up the description state when we leave the component // clearing up the description state when we leave the component
return () => setDescription(undefined); return () => setDescription(undefined);
}, [data, projectId, workspaceProjectIds, isOpen, activeProjectId]); }, [data, projectId, isOpen, activeProjectId]);
const addIssueToCycle = async (issue: TIssue, cycleId: string) => { const addIssueToCycle = async (issue: TIssue, cycleId: string) => {
if (!workspaceSlug || !activeProjectId) return; if (!workspaceSlug || !activeProjectId) return;

View File

@ -52,7 +52,7 @@ export const LabelItemBlock = (props: ILabelItemBlock) => {
: "opacity-0 group-hover:pointer-events-auto group-hover:opacity-100" : "opacity-0 group-hover:pointer-events-auto group-hover:opacity-100"
} ${isLabelGroup && "-top-0.5"}`} } ${isLabelGroup && "-top-0.5"}`}
> >
<CustomMenu ellipsis buttonClassName="h-4 w-4 leading-4 text-custom-sidebar-text-400"> <CustomMenu ellipsis>
{customMenuItems.map( {customMenuItems.map(
({ isVisible, onClick, CustomIcon, text, key }) => ({ isVisible, onClick, CustomIcon, text, key }) =>
isVisible && ( isVisible && (

View File

@ -26,7 +26,6 @@ export const PageContentBrowser: React.FC<Props> = (props) => {
return ( return (
<div className="h-full flex flex-col overflow-hidden"> <div className="h-full flex flex-col overflow-hidden">
<h2 className="font-medium">Outline</h2>
<div className="h-full flex flex-col items-start gap-y-2 overflow-y-auto mt-2"> <div className="h-full flex flex-col items-start gap-y-2 overflow-y-auto mt-2">
{markings.length !== 0 ? ( {markings.length !== 0 ? (
markings.map((marking) => { markings.map((marking) => {

View File

@ -4,10 +4,11 @@ import { useRouter } from "next/router";
// types // types
import { TPageNavigationTabs } from "@plane/types"; import { TPageNavigationTabs } from "@plane/types";
// components // components
import { PageHead } from "@/components/core";
import { PagesHeader } from "@/components/headers"; import { PagesHeader } from "@/components/headers";
import { PagesListRoot, PagesListView } from "@/components/pages"; import { PagesListRoot, PagesListView } from "@/components/pages";
// hooks // hooks
import { useApplication } from "@/hooks/store"; import { useApplication, useProject } from "@/hooks/store";
// layouts // layouts
import { AppLayout } from "@/layouts/app-layout"; import { AppLayout } from "@/layouts/app-layout";
// lib // lib
@ -21,6 +22,10 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => {
const { const {
router: { workspaceSlug, projectId }, router: { workspaceSlug, projectId },
} = useApplication(); } = useApplication();
const { getProjectById } = useProject();
// derived values
const project = projectId ? getProjectById(projectId.toString()) : undefined;
const pageTitle = project?.name ? `${project?.name} - Pages` : undefined;
const currentPageType = (): TPageNavigationTabs => { const currentPageType = (): TPageNavigationTabs => {
const pageType = type?.toString(); const pageType = type?.toString();
@ -31,17 +36,20 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => {
if (!workspaceSlug || !projectId) return <></>; if (!workspaceSlug || !projectId) return <></>;
return ( return (
<PagesListView <>
workspaceSlug={workspaceSlug.toString()} <PageHead title={pageTitle} />
projectId={projectId.toString()} <PagesListView
pageType={currentPageType()}
>
<PagesListRoot
pageType={currentPageType()}
workspaceSlug={workspaceSlug.toString()} workspaceSlug={workspaceSlug.toString()}
projectId={projectId.toString()} projectId={projectId.toString()}
/> pageType={currentPageType()}
</PagesListView> >
<PagesListRoot
pageType={currentPageType()}
workspaceSlug={workspaceSlug.toString()}
projectId={projectId.toString()}
/>
</PagesListView>
</>
); );
}); });