style(ui): eslint-sort-imports

This commit is contained in:
Fu Diwei
2025-01-02 12:50:38 +08:00
parent 1588179bc9
commit b6dd2248c8
51 changed files with 84 additions and 137 deletions

View File

@@ -1,7 +1,7 @@
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { useCreation } from "ahooks";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, Select, type FormInstance } from "antd";
import { Form, type FormInstance, Input, Select } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -3,7 +3,7 @@ import { flushSync } from "react-dom";
import { useTranslation } from "react-i18next";
import { UploadOutlined as UploadOutlinedIcon } from "@ant-design/icons";
import { useDeepCompareEffect } from "ahooks";
import { Button, Form, Input, Upload, type FormInstance, type UploadFile, type UploadProps } from "antd";
import { Button, Form, type FormInstance, Input, Upload, type UploadFile, type UploadProps } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -3,7 +3,7 @@ import { flushSync } from "react-dom";
import { useTranslation } from "react-i18next";
import { UploadOutlined as UploadOutlinedIcon } from "@ant-design/icons";
import { useDeepCompareEffect } from "ahooks";
import { Button, Form, Input, InputNumber, Upload, type FormInstance, type UploadFile, type UploadProps } from "antd";
import { Button, Form, type FormInstance, Input, InputNumber, Upload, type UploadFile, type UploadProps } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Form, Input, type FormInstance } from "antd";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";

View File

@@ -1,6 +1,6 @@
import { memo } from "react";
import { useTranslation } from "react-i18next";
import { Avatar, Select, Space, Tag, Typography, type SelectProps } from "antd";
import { Avatar, Select, type SelectProps, Space, Tag, Typography } from "antd";
import { ACCESS_USAGES, accessProvidersMap } from "@/domain/provider";

View File

@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import { Avatar, Select, Space, Typography, type SelectProps } from "antd";
import { Avatar, Select, type SelectProps, Space, Typography } from "antd";
import { type AccessModel } from "@/domain/access";
import { accessProvidersMap } from "@/domain/provider";

View File

@@ -1,7 +1,7 @@
import { CopyToClipboard } from "react-copy-to-clipboard";
import { useTranslation } from "react-i18next";
import { CopyOutlined as CopyOutlinedIcon, DownOutlined as DownOutlinedIcon, LikeOutlined as LikeOutlinedIcon } from "@ant-design/icons";
import { Button, Dropdown, Form, Input, message, Space, Tooltip } from "antd";
import { Button, Dropdown, Form, Input, Space, Tooltip, message } from "antd";
import dayjs from "dayjs";
import { type CertificateModel } from "@/domain/certificate";

View File

@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";
import { useControllableValue } from "ahooks";
import { Button, Drawer, Form, Space, type DrawerProps, type FormProps, type ModalProps } from "antd";
import { Button, Drawer, type DrawerProps, Form, type FormProps, type ModalProps, Space } from "antd";
import { useAntdForm, useTriggerElement } from "@/hooks";

View File

@@ -1,5 +1,5 @@
import { useControllableValue } from "ahooks";
import { Form, Modal, type FormProps, type ModalProps } from "antd";
import { Form, type FormProps, Modal, type ModalProps } from "antd";
import { useAntdForm, useTriggerElement } from "@/hooks";

View File

@@ -1,4 +1,4 @@
import { forwardRef, useImperativeHandle, useMemo, useRef, type ChangeEvent } from "react";
import { type ChangeEvent, forwardRef, useImperativeHandle, useMemo, useRef } from "react";
import { useTranslation } from "react-i18next";
import {
ArrowDownOutlined as ArrowDownOutlinedIcon,
@@ -7,7 +7,7 @@ import {
PlusOutlined as PlusOutlinedIcon,
} from "@ant-design/icons";
import { useControllableValue } from "ahooks";
import { Button, Input, Space, type InputRef, type InputProps } from "antd";
import { Button, Input, type InputProps, type InputRef, Space } from "antd";
import { produce } from "immer";
export type MultipleInputProps = Omit<InputProps, "count" | "defaultValue" | "showCount" | "value" | "onChange" | "onPressEnter" | "onClear"> & {

View File

@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { useDeepCompareMemo } from "@ant-design/pro-components";
import { Button, Collapse, message, notification, Skeleton, Space, Switch, type CollapseProps } from "antd";
import { Button, Collapse, type CollapseProps, Skeleton, Space, Switch, message, notification } from "antd";
import Show from "@/components/Show";
import { notifyChannelsMap } from "@/domain/settings";

View File

@@ -1,13 +1,13 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useRequest } from "ahooks";
import { Button, Form, Input, message, notification, Skeleton } from "antd";
import { Button, Form, Input, Skeleton, message, notification } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { ClientResponseError } from "pocketbase";
import { z } from "zod";
import Show from "@/components/Show";
import { defaultNotifyTemplate, SETTINGS_NAMES, type NotifyTemplatesSettingsContent } from "@/domain/settings";
import { type NotifyTemplatesSettingsContent, SETTINGS_NAMES, defaultNotifyTemplate } from "@/domain/settings";
import { useAntdForm } from "@/hooks";
import { get as getSettings, save as saveSettings } from "@/repository/settings";
import { getErrMsg } from "@/utils/error";

View File

@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";
import { useRequest } from "ahooks";
import { Button, message, notification, type ButtonProps } from "antd";
import { Button, type ButtonProps, message, notification } from "antd";
import { notifyTest } from "@/api/notify";
import { getErrMsg } from "@/utils/error";

View File

@@ -1,68 +0,0 @@
import { CloudUpload, GitFork, Megaphone, NotebookPen } from "lucide-react";
import { WorkflowNodeType } from "@/domain/workflow";
type NodeTypesPanelProps = {
onTypeSelected: (type: WorkflowNodeType) => void;
};
const NodeTypesPanel = ({ onTypeSelected }: NodeTypesPanelProps) => {
return (
<>
<div className="flex space-x-2">
<div
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
onClick={() => {
onTypeSelected(WorkflowNodeType.Apply);
}}
>
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
<NotebookPen className="text-white" size={18} />
</div>
<div className="text-slate-600"></div>
</div>
<div
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
onClick={() => {
onTypeSelected(WorkflowNodeType.Deploy);
}}
>
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
<CloudUpload className="text-white" size={18} />
</div>
<div className="text-slate-600"></div>
</div>
</div>
<div className="flex space-x-2">
<div
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
onClick={() => {
onTypeSelected(WorkflowNodeType.Branch);
}}
>
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
<GitFork className="text-white" size={18} />
</div>
<div className="text-slate-600"></div>
</div>
<div
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
onClick={() => {
onTypeSelected(WorkflowNodeType.Notify);
}}
>
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
<Megaphone className="text-white" size={18} />
</div>
<div className="text-slate-600"></div>
</div>
</div>
</>
);
};
export default NodeTypesPanel;

View File

@@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { FormOutlined as FormOutlinedIcon, PlusOutlined as PlusOutlinedIcon, QuestionCircleOutlined as QuestionCircleOutlinedIcon } from "@ant-design/icons";
import { useControllableValue } from "ahooks";
import { AutoComplete, Button, Divider, Form, Input, Select, Space, Switch, Tooltip, Typography, type AutoCompleteProps } from "antd";
import { AutoComplete, type AutoCompleteProps, Button, Divider, Form, Input, Select, Space, Switch, Tooltip, Typography } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { produce } from "immer";
import { z } from "zod";
@@ -12,7 +12,7 @@ import AccessSelect from "@/components/access/AccessSelect";
import ModalForm from "@/components/core/ModalForm";
import MultipleInput from "@/components/core/MultipleInput";
import { ACCESS_USAGES, accessProvidersMap } from "@/domain/provider";
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
import { type WorkflowNode } from "@/domain/workflow";
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
import { useContactEmailsStore } from "@/stores/contact";
import { useWorkflowStore } from "@/stores/workflow";
@@ -25,7 +25,7 @@ export type ApplyNodeFormProps = {
const MULTIPLE_INPUT_DELIMITER = ";";
const initFormModel = (): WorkflowNodeConfig => {
const initFormModel = () => {
return {
domain: "",
keyAlgorithm: "RSA2048",

View File

@@ -8,8 +8,8 @@ import { z } from "zod";
import AccessEditModal from "@/components/access/AccessEditModal";
import AccessSelect from "@/components/access/AccessSelect";
import { ACCESS_USAGES, accessProvidersMap, DEPLOY_PROVIDERS, deployProvidersMap } from "@/domain/provider";
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
import { ACCESS_USAGES, DEPLOY_PROVIDERS, accessProvidersMap, deployProvidersMap } from "@/domain/provider";
import { type WorkflowNode } from "@/domain/workflow";
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
import { useWorkflowStore } from "@/stores/workflow";
import { usePanel } from "../PanelProvider";
@@ -42,7 +42,7 @@ export type DeployFormProps = {
defaultProivderType?: string;
};
const initFormModel = (): WorkflowNodeConfig => {
const initFormModel = () => {
return {};
};

View File

@@ -8,7 +8,7 @@ import { produce } from "immer";
import { z } from "zod";
import { notifyChannelsMap } from "@/domain/settings";
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
import { type WorkflowNode } from "@/domain/workflow";
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
import { useNotifyChannelsStore } from "@/stores/notify";
import { useWorkflowStore } from "@/stores/workflow";
@@ -18,7 +18,7 @@ export type NotifyNodeFormProps = {
data: WorkflowNode;
};
const initFormModel = (): WorkflowNodeConfig => {
const initFormModel = () => {
return {
subject: "Completed!",
message: "Your workflow has been completed on Certimate.",

View File

@@ -7,17 +7,17 @@ import { produce } from "immer";
import { z } from "zod";
import Show from "@/components/Show";
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
import { type WorkflowNode } from "@/domain/workflow";
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
import { useWorkflowStore } from "@/stores/workflow";
import { validCronExpression, getNextCronExecutions } from "@/utils/cron";
import { getNextCronExecutions, validCronExpression } from "@/utils/cron";
import { usePanel } from "../PanelProvider";
export type StartNodeFormProps = {
data: WorkflowNode;
};
const initFormModel = (): WorkflowNodeConfig => {
const initFormModel = () => {
return {
executionMethod: "auto",
crontab: "0 0 * * *",

View File

@@ -6,7 +6,7 @@ import {
SelectOutlined as SelectOutlinedIcon,
} from "@ant-design/icons";
import { useRequest } from "ahooks";
import { Button, Empty, notification, Space, Table, theme, Typography, type TableProps } from "antd";
import { Button, Empty, Space, Table, type TableProps, Typography, notification, theme } from "antd";
import { ClientResponseError } from "pocketbase";
import { type WorkflowRunModel } from "@/domain/workflowRun";