[WEB-1397] chore: update space app types (#4861)

* chore: update types

* chore: dummy page actions components

* chore: rename component

* refactor: rearrange declarations
This commit is contained in:
Aaryan Khandelwal 2024-06-18 17:51:52 +05:30 committed by GitHub
parent 8500c63205
commit 135024a940
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 33 deletions

View file

@ -1,4 +1,4 @@
import { IStateLite, IWorkspaceLite, TIssuePriorities, TStateGroups } from "@plane/types"; import { IStateLite, IWorkspaceLite, TIssue, TIssuePriorities, TStateGroups } from "@plane/types";
export type TIssueLayout = "list" | "kanban" | "calendar" | "spreadsheet" | "gantt"; export type TIssueLayout = "list" | "kanban" | "calendar" | "spreadsheet" | "gantt";
export type TIssueLayoutOptions = { export type TIssueLayoutOptions = {
@ -39,18 +39,13 @@ export type TIssuesResponse = {
issues: IIssue[]; issues: IIssue[];
}; };
export interface IIssue { export interface IIssue
id: string; extends Pick<TIssue, "description_html" | "id" | "name" | "priority" | "sequence_id" | "start_date" | "target_date"> {
comments: Comment[]; comments: Comment[];
description_html: string;
label_details: any; label_details: any;
name: string;
priority: TIssuePriorityKey | null;
project: string; project: string;
project_detail: any; project_detail: any;
reactions: IIssueReaction[]; reactions: IIssueReaction[];
sequence_id: number;
start_date: any;
state: string; state: string;
state_detail: { state_detail: {
id: string; id: string;
@ -58,7 +53,6 @@ export interface IIssue {
group: TIssueGroupKey; group: TIssueGroupKey;
color: string; color: string;
}; };
target_date: any;
votes: IVote[]; votes: IVote[];
} }

View file

@ -1,18 +0,0 @@
import { TLogoProps } from "@plane/types";
export type TViewDetails = {
list: boolean;
gantt: boolean;
kanban: boolean;
calendar: boolean;
spreadsheet: boolean;
};
export type TProjectDetails = {
id: string;
identifier: string;
name: string;
cover_image: string | undefined;
logo_props: TLogoProps;
description: string;
};

View file

@ -10,11 +10,13 @@ import { TLogoProps } from "@plane/types";
import { Breadcrumbs, Button, EmojiIconPicker, EmojiIconPickerTypes, TOAST_TYPE, setToast } from "@plane/ui"; import { Breadcrumbs, Button, EmojiIconPicker, EmojiIconPickerTypes, TOAST_TYPE, setToast } from "@plane/ui";
// components // components
import { BreadcrumbLink, Logo } from "@/components/common"; import { BreadcrumbLink, Logo } from "@/components/common";
// helper // helpers
import { convertHexEmojiToDecimal } from "@/helpers/emoji.helper"; import { convertHexEmojiToDecimal } from "@/helpers/emoji.helper";
// hooks // hooks
import { usePage, useProject } from "@/hooks/store"; import { usePage, useProject } from "@/hooks/store";
import { usePlatformOS } from "@/hooks/use-platform-os"; import { usePlatformOS } from "@/hooks/use-platform-os";
// plane web components
import { PageDetailsHeaderExtraActions } from "@/plane-web/components/pages";
export interface IPagesHeaderProps { export interface IPagesHeaderProps {
showButton?: boolean; showButton?: boolean;
@ -28,6 +30,10 @@ export const PageDetailsHeader = observer(() => {
// store hooks // store hooks
const { currentProjectDetails } = useProject(); const { currentProjectDetails } = useProject();
const { isContentEditable, isSubmitting, name, logo_props, updatePageLogo } = usePage(pageId?.toString() ?? ""); const { isContentEditable, isSubmitting, name, logo_props, updatePageLogo } = usePage(pageId?.toString() ?? "");
// use platform
const { platform } = usePlatformOS();
// derived values
const isMac = platform === "MacOS";
const handlePageLogoUpdate = async (data: TLogoProps) => { const handlePageLogoUpdate = async (data: TLogoProps) => {
if (data) { if (data) {
@ -48,10 +54,6 @@ export const PageDetailsHeader = observer(() => {
}); });
} }
}; };
// use platform
const { platform } = usePlatformOS();
// derived values
const isMac = platform === "MacOS";
return ( return (
<div className="relative z-10 flex h-[3.75rem] w-full flex-shrink-0 flex-row items-center justify-between gap-x-2 gap-y-4 bg-custom-sidebar-background-100 p-4"> <div className="relative z-10 flex h-[3.75rem] w-full flex-shrink-0 flex-row items-center justify-between gap-x-2 gap-y-4 bg-custom-sidebar-background-100 p-4">
@ -146,6 +148,7 @@ export const PageDetailsHeader = observer(() => {
</Breadcrumbs> </Breadcrumbs>
</div> </div>
</div> </div>
<PageDetailsHeaderExtraActions />
{isContentEditable && ( {isContentEditable && (
<Button <Button
variant="primary" variant="primary"
@ -159,7 +162,7 @@ export const PageDetailsHeader = observer(() => {
}); });
window.dispatchEvent(event); window.dispatchEvent(event);
}} }}
className="flex-shrink-0" className="flex-shrink-0 w-24"
loading={isSubmitting === "submitting"} loading={isSubmitting === "submitting"}
> >
{isSubmitting === "submitting" ? "Saving" : "Save changes"} {isSubmitting === "submitting" ? "Saving" : "Save changes"}

View file

@ -0,0 +1 @@
export const PageDetailsHeaderExtraActions = () => null;

View file

@ -0,0 +1 @@
export * from "./extra-actions";

View file

@ -0,0 +1 @@
export * from "ce/components/pages/extra-actions";

View file

@ -0,0 +1 @@
export * from "./extra-actions";