[WEB-2388] chore: theme changes and workspace draft issue total count updated (#5805)
* chore: theme changes and total count updated * chore: code refactor
This commit is contained in:
parent
6200890693
commit
c9dbd1d5d1
6 changed files with 23 additions and 6 deletions
|
|
@ -210,7 +210,7 @@ class WorkspaceDraftIssueViewSet(BaseViewSet):
|
||||||
@allow_permission(
|
@allow_permission(
|
||||||
allowed_roles=[ROLE.ADMIN],
|
allowed_roles=[ROLE.ADMIN],
|
||||||
creator=True,
|
creator=True,
|
||||||
model=Issue,
|
model=DraftIssue,
|
||||||
level="WORKSPACE",
|
level="WORKSPACE",
|
||||||
)
|
)
|
||||||
def destroy(self, request, slug, pk=None):
|
def destroy(self, request, slug, pk=None):
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ export type TWorkspaceDraftIssue = {
|
||||||
updated_by: string;
|
updated_by: string;
|
||||||
|
|
||||||
is_draft: boolean;
|
is_draft: boolean;
|
||||||
|
|
||||||
|
type_id: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TWorkspaceDraftPaginationInfo<T> = {
|
export type TWorkspaceDraftPaginationInfo<T> = {
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,11 @@ export interface IHeaderProperties {
|
||||||
}
|
}
|
||||||
export const headerStyle: IHeaderProperties = {
|
export const headerStyle: IHeaderProperties = {
|
||||||
[EHeaderVariant.PRIMARY]:
|
[EHeaderVariant.PRIMARY]:
|
||||||
"relative flex w-full flex-shrink-0 flex-row items-center justify-between gap-x-2 gap-y-4 bg-custom-sidebar-background-100 bg-custom-background-100 z-[18]",
|
"relative flex w-full flex-shrink-0 flex-row items-center justify-between gap-x-2 gap-y-4 bg-custom-sidebar-background-100 bg-custom-sidebar-background-100 z-[18]",
|
||||||
[EHeaderVariant.SECONDARY]: "!py-0 overflow-y-hidden border-b border-custom-border-200 justify-between bg-custom-background-100 z-[15]",
|
[EHeaderVariant.SECONDARY]:
|
||||||
[EHeaderVariant.TERNARY]: "flex flex-wrap justify-between py-2 border-b border-custom-border-200 gap-2 bg-custom-background-100 z-[12]",
|
"!py-0 overflow-y-hidden border-b border-custom-border-200 justify-between bg-custom-background-100 z-[15]",
|
||||||
|
[EHeaderVariant.TERNARY]:
|
||||||
|
"flex flex-wrap justify-between py-2 border-b border-custom-border-200 gap-2 bg-custom-background-100 z-[12]",
|
||||||
};
|
};
|
||||||
export const minHeights: IHeaderProperties = {
|
export const minHeights: IHeaderProperties = {
|
||||||
[EHeaderVariant.PRIMARY]: "",
|
[EHeaderVariant.PRIMARY]: "",
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,11 @@ export const WorkspaceDraftHeader: FC = observer(() => {
|
||||||
link={<BreadcrumbLink label={`Draft`} icon={<PenSquare className="h-4 w-4 text-custom-text-300" />} />}
|
link={<BreadcrumbLink label={`Draft`} icon={<PenSquare className="h-4 w-4 text-custom-text-300" />} />}
|
||||||
/>
|
/>
|
||||||
</Breadcrumbs>
|
</Breadcrumbs>
|
||||||
{paginationInfo?.count && paginationInfo?.count > 0 ? <CountChip count={paginationInfo?.count} /> : <></>}
|
{paginationInfo?.total_count && paginationInfo?.total_count > 0 ? (
|
||||||
|
<CountChip count={paginationInfo?.total_count} />
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Header.LeftItem>
|
</Header.LeftItem>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { FC } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
// types
|
// types
|
||||||
import { IIssueDisplayProperties } from "@plane/types";
|
import { IIssueDisplayProperties } from "@plane/types";
|
||||||
|
|
@ -28,6 +29,13 @@ type TIssueIdentifierWithDetails = TIssueIdentifierBaseProps & {
|
||||||
|
|
||||||
export type TIssueIdentifierProps = TIssueIdentifierFromStore | TIssueIdentifierWithDetails;
|
export type TIssueIdentifierProps = TIssueIdentifierFromStore | TIssueIdentifierWithDetails;
|
||||||
|
|
||||||
|
type TIssueTypeIdentifier = {
|
||||||
|
issueTypeId: string;
|
||||||
|
size?: "xs" | "sm" | "md" | "lg";
|
||||||
|
};
|
||||||
|
|
||||||
|
export const IssueTypeIdentifier: FC<TIssueTypeIdentifier> = observer((props) => <></>);
|
||||||
|
|
||||||
type TIdentifierTextProps = {
|
type TIdentifierTextProps = {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
enableClickToCopyIdentifier?: boolean;
|
enableClickToCopyIdentifier?: boolean;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { cn } from "@/helpers/common.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useAppTheme, useProject, useWorkspaceDraftIssues } from "@/hooks/store";
|
import { useAppTheme, useProject, useWorkspaceDraftIssues } from "@/hooks/store";
|
||||||
// plane-web components
|
// plane-web components
|
||||||
import { IdentifierText } from "ce/components/issues";
|
import { IdentifierText, IssueTypeIdentifier } from "@/plane-web/components/issues";
|
||||||
// local components
|
// local components
|
||||||
import { WorkspaceDraftIssueQuickActions } from "../issue-layouts";
|
import { WorkspaceDraftIssueQuickActions } from "../issue-layouts";
|
||||||
import { DraftIssueProperties } from "./draft-issue-properties";
|
import { DraftIssueProperties } from "./draft-issue-properties";
|
||||||
|
|
@ -51,6 +51,7 @@ export const DraftIssueBlock: FC<Props> = observer((props) => {
|
||||||
<div className="flex-shrink-0">
|
<div className="flex-shrink-0">
|
||||||
{issue.project_id && (
|
{issue.project_id && (
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
|
{issue?.type_id && <IssueTypeIdentifier issueTypeId={issue.type_id} />}
|
||||||
<IdentifierText
|
<IdentifierText
|
||||||
identifier={projectIdentifier}
|
identifier={projectIdentifier}
|
||||||
enableClickToCopyIdentifier
|
enableClickToCopyIdentifier
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue