[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:
parent
8500c63205
commit
135024a940
7 changed files with 16 additions and 33 deletions
12
space/core/types/issue.d.ts
vendored
12
space/core/types/issue.d.ts
vendored
|
|
@ -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 TIssueLayoutOptions = {
|
||||
|
|
@ -39,18 +39,13 @@ export type TIssuesResponse = {
|
|||
issues: IIssue[];
|
||||
};
|
||||
|
||||
export interface IIssue {
|
||||
id: string;
|
||||
export interface IIssue
|
||||
extends Pick<TIssue, "description_html" | "id" | "name" | "priority" | "sequence_id" | "start_date" | "target_date"> {
|
||||
comments: Comment[];
|
||||
description_html: string;
|
||||
label_details: any;
|
||||
name: string;
|
||||
priority: TIssuePriorityKey | null;
|
||||
project: string;
|
||||
project_detail: any;
|
||||
reactions: IIssueReaction[];
|
||||
sequence_id: number;
|
||||
start_date: any;
|
||||
state: string;
|
||||
state_detail: {
|
||||
id: string;
|
||||
|
|
@ -58,7 +53,6 @@ export interface IIssue {
|
|||
group: TIssueGroupKey;
|
||||
color: string;
|
||||
};
|
||||
target_date: any;
|
||||
votes: IVote[];
|
||||
}
|
||||
|
||||
|
|
|
|||
18
space/core/types/project.d.ts
vendored
18
space/core/types/project.d.ts
vendored
|
|
@ -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;
|
||||
};
|
||||
|
|
@ -10,11 +10,13 @@ import { TLogoProps } from "@plane/types";
|
|||
import { Breadcrumbs, Button, EmojiIconPicker, EmojiIconPickerTypes, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
// components
|
||||
import { BreadcrumbLink, Logo } from "@/components/common";
|
||||
// helper
|
||||
// helpers
|
||||
import { convertHexEmojiToDecimal } from "@/helpers/emoji.helper";
|
||||
// hooks
|
||||
import { usePage, useProject } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// plane web components
|
||||
import { PageDetailsHeaderExtraActions } from "@/plane-web/components/pages";
|
||||
|
||||
export interface IPagesHeaderProps {
|
||||
showButton?: boolean;
|
||||
|
|
@ -28,6 +30,10 @@ export const PageDetailsHeader = observer(() => {
|
|||
// store hooks
|
||||
const { currentProjectDetails } = useProject();
|
||||
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) => {
|
||||
if (data) {
|
||||
|
|
@ -48,10 +54,6 @@ export const PageDetailsHeader = observer(() => {
|
|||
});
|
||||
}
|
||||
};
|
||||
// use platform
|
||||
const { platform } = usePlatformOS();
|
||||
// derived values
|
||||
const isMac = platform === "MacOS";
|
||||
|
||||
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">
|
||||
|
|
@ -146,6 +148,7 @@ export const PageDetailsHeader = observer(() => {
|
|||
</Breadcrumbs>
|
||||
</div>
|
||||
</div>
|
||||
<PageDetailsHeaderExtraActions />
|
||||
{isContentEditable && (
|
||||
<Button
|
||||
variant="primary"
|
||||
|
|
@ -159,7 +162,7 @@ export const PageDetailsHeader = observer(() => {
|
|||
});
|
||||
window.dispatchEvent(event);
|
||||
}}
|
||||
className="flex-shrink-0"
|
||||
className="flex-shrink-0 w-24"
|
||||
loading={isSubmitting === "submitting"}
|
||||
>
|
||||
{isSubmitting === "submitting" ? "Saving" : "Save changes"}
|
||||
|
|
|
|||
1
web/ce/components/pages/extra-actions.tsx
Normal file
1
web/ce/components/pages/extra-actions.tsx
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const PageDetailsHeaderExtraActions = () => null;
|
||||
1
web/ce/components/pages/index.ts
Normal file
1
web/ce/components/pages/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./extra-actions";
|
||||
1
web/ee/components/pages/extra-actions.tsx
Normal file
1
web/ee/components/pages/extra-actions.tsx
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "ce/components/pages/extra-actions";
|
||||
1
web/ee/components/pages/index.ts
Normal file
1
web/ee/components/pages/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./extra-actions";
|
||||
Loading…
Add table
Add a link
Reference in a new issue