This commit is contained in:
DCCONSTRUCTIONS
2026-04-18 18:39:25 +03:00
commit 3ba092b60c
4944 changed files with 497564 additions and 0 deletions
@@ -0,0 +1,9 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "./provider";
export * from "./issue-type-select";
export * from "./template-select";
@@ -0,0 +1,34 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import type { Control } from "react-hook-form";
// plane imports
import type { EditorRefApi } from "@plane/editor";
// types
import type { TBulkIssueProperties, TIssue } from "@plane/types";
export type TIssueFields = TIssue & TBulkIssueProperties;
export type TIssueTypeDropdownVariant = "xs" | "sm";
export type TIssueTypeSelectProps<T extends Partial<TIssueFields>> = {
control: Control<T>;
projectId: string | null;
editorRef?: React.MutableRefObject<EditorRefApi | null>;
disabled?: boolean;
variant?: TIssueTypeDropdownVariant;
placeholder?: string;
isRequired?: boolean;
renderChevron?: boolean;
dropDownContainerClassName?: string;
showMandatoryFieldInfo?: boolean; // Show info about mandatory fields
handleFormChange?: () => void;
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function IssueTypeSelect<T extends Partial<TIssueFields>>(props: TIssueTypeSelectProps<T>) {
return <></>;
}
@@ -0,0 +1,16 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export type TWorkItemModalAdditionalPropertiesProps = {
isDraft?: boolean;
projectId: string | null;
workItemId: string | undefined;
workspaceSlug: string;
};
export function WorkItemModalAdditionalProperties(_props: TWorkItemModalAdditionalPropertiesProps) {
return null;
}
@@ -0,0 +1,59 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import React, { useState } from "react";
import { observer } from "mobx-react";
// plane imports
import type { ISearchIssueResponse, TIssue } from "@plane/types";
// components
import { IssueModalContext } from "@/components/issues/issue-modal/context";
// hooks
import { useUser } from "@/hooks/store/user/user-user";
export type TIssueModalProviderProps = {
templateId?: string;
dataForPreload?: Partial<TIssue>;
allowedProjectIds?: string[];
children: React.ReactNode;
};
export const IssueModalProvider = observer(function IssueModalProvider(props: TIssueModalProviderProps) {
const { children, allowedProjectIds } = props;
// states
const [selectedParentIssue, setSelectedParentIssue] = useState<ISearchIssueResponse | null>(null);
// store hooks
const { projectsWithCreatePermissions } = useUser();
// derived values
const projectIdsWithCreatePermissions = Object.keys(projectsWithCreatePermissions ?? {});
return (
<IssueModalContext.Provider
value={{
allowedProjectIds: allowedProjectIds ?? projectIdsWithCreatePermissions,
workItemTemplateId: null,
setWorkItemTemplateId: () => {},
isApplyingTemplate: false,
setIsApplyingTemplate: () => {},
selectedParentIssue,
setSelectedParentIssue,
issuePropertyValues: {},
setIssuePropertyValues: () => {},
issuePropertyValueErrors: {},
setIssuePropertyValueErrors: () => {},
getIssueTypeIdOnProjectChange: () => null,
getActiveAdditionalPropertiesLength: () => 0,
handlePropertyValuesValidation: () => true,
handleCreateUpdatePropertyValues: () => Promise.resolve(),
handleProjectEntitiesFetch: () => Promise.resolve(),
handleTemplateChange: () => Promise.resolve(),
handleConvert: () => Promise.resolve(),
handleCreateSubWorkItem: () => Promise.resolve(),
}}
>
{children}
</IssueModalContext.Provider>
);
});
@@ -0,0 +1,24 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export type TWorkItemTemplateDropdownSize = "xs" | "sm";
export type TWorkItemTemplateSelect = {
projectId: string | null;
typeId: string | null;
disabled?: boolean;
size?: TWorkItemTemplateDropdownSize;
placeholder?: string;
renderChevron?: boolean;
dropDownContainerClassName?: string;
handleModalClose: () => void;
handleFormChange?: () => void;
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function WorkItemTemplateSelect(props: TWorkItemTemplateSelect) {
return <></>;
}