chore: format all frontend files (#430)

This commit is contained in:
tecvan
2025-07-31 23:15:48 +08:00
committed by GitHub
parent 8b078ff013
commit 6995cec404
8787 changed files with 11975 additions and 10924 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { expect, vi, describe, test } from 'vitest';
@@ -151,8 +151,8 @@ vi.mock('@douyinfe/semi-icons', async () => {
const actual = await vi.importActual('@douyinfe/semi-icons');
return {
...(actual as any),
IconAlertTriangle: () => <>IconAlertTriangle</>,
IconClose: () => <>IconClose</>,
IconAlertTriangle: () => <>IconAlertTriangle</>,
IconClose: () => <>IconClose</>,
IconChevronDown: () => <>IconChevronDown</>,
};
});
@@ -198,7 +198,7 @@ describe('database modal test', () => {
const aiCreateButton = await screen.queryByText('bot_database_ai_create');
expect(aiCreateButton).not.toBeNull();
if (aiCreateButton) {
await fireEvent.click(aiCreateButton);
await fireEvent.click(aiCreateButton);
}
const aiGenerateButton = await screen.queryByText(
'bot_database_ai_generate',
@@ -216,16 +216,16 @@ describe('database modal test', () => {
const aiCreateButton = await screen.queryByText('bot_database_ai_create');
expect(aiCreateButton).not.toBeNull();
if (aiCreateButton) {
await fireEvent.click(aiCreateButton);
await fireEvent.click(aiCreateButton);
}
const nlInput = await screen.queryByRole('mock-textarea');
expect(nlInput).not.toBeNull();
if (nlInput) {
await fireEvent.input(nlInput, {
target: {
value: 'a pokemon table, name and score',
},
});
await fireEvent.input(nlInput, {
target: {
value: 'a pokemon table, name and score',
},
});
}
const aiGenerateButton = await screen.queryByText(
'bot_database_ai_generate',
@@ -233,7 +233,7 @@ describe('database modal test', () => {
expect(aiGenerateButton).not.toBeNull();
if (aiGenerateButton) {
await fireEvent.click(aiGenerateButton);
await fireEvent.click(aiGenerateButton);
}
const content = await screen.queryByText('test');
expect(content).not.toBeNull();

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const mockBanner = (props: { description: string }) => (

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockButton = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockDivider = () => <>divider</>;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import React, {
useCallback,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const Icon = (props: { svg: React.ReactElement }) => <>{props.svg}</>;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockImage = (props: { src: string }) => <img src={props.src} />;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const Modal = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockPopConfirm = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockPopover = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const mockSpin = () => <>spin</>;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockSwitch = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockUITableAction = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { useImperativeHandle, useState } from 'react';
export const MockTextArea = React.forwardRef(

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const Toast = {
error: () => {},
waring: () => {},

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockTooltip = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockUIButton = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const MockUITable = (props: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Ref, forwardRef, type FC } from 'react';
import { type ButtonProps } from '@coze-arch/bot-semi/Button';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC } from 'react';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useMemo, type FC } from 'react';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Typography } from '@coze-arch/bot-semi';
import { ImportFileTaskStatus } from '../../../datamodel';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useState, type FC } from 'react';
import { isNumber } from 'lodash-es';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC } from 'react';
import classnames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useRef, type FC, useState, useMemo } from 'react';
import { nanoid } from 'nanoid';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useCallback, type FC } from 'react';
import { nanoid } from 'nanoid';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// 20MB limit
export const ACCEPT_FILE_MAX_SIZE = 20 * 1024 * 1024;
export const ACCEPT_FILE_TYPES = ['.xlsx', '.xls', '.csv'].join(',');

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Callback } from '../types';
class EventEmitter {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export function getBase64(file: Blob): Promise<string> {
return new Promise((resolve, reject) => {
const fileReader = new FileReader();

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const getFileExtension = (name: string) => {
const index = name.lastIndexOf('.');
return name.slice(index + 1);

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Icon } from '@coze-arch/bot-semi';
import { ReactComponent as ExcelSVG } from '../../../assets/icon_wiki-excel_colorful.svg';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect } from 'react';
import { type Callback } from '../types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useRef, useState, useEffect } from 'react';
import { useLocalStorageState } from 'ahooks';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect, type FC } from 'react';
import { type DatabaseInfo } from '@coze-studio/bot-detail-store';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { create } from 'zustand';
import { noop } from 'lodash-es';
import { type DatabaseInfo } from '@coze-studio/bot-detail-store';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { devtools } from 'zustand/middleware';
import { create } from 'zustand';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type DatabaseInfo } from '@coze-studio/bot-detail-store';
import { type FileItem } from '@coze-arch/bot-semi/Upload';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable complexity */
import { useRef, useMemo, useEffect, useState } from 'react';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC, type ReactNode } from 'react';
import { Icon, Popover } from '@coze-arch/bot-semi';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PopoverContent } from '@coze-studio/components';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable complexity */
import { type TableMemoryItem } from '@coze-studio/bot-detail-store';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
useRef,
forwardRef,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {
type ComponentProps,
useRef,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classnames from 'classnames';
import { type SelectProps } from '@coze-arch/bot-semi/Select';
import { type InputProps } from '@coze-arch/bot-semi/Input';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { nanoid } from 'nanoid';
import {
type DatabaseInfo,

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types='@coze-arch/bot-typings' />

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const useCreateFromExcelFG = (): boolean =>
// Feature flag bot.data.excel_to_database is OFF, returning false.
false;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { DatabaseModal, DatabaseModalProps } from './components/database-modal';
export {
ProcessingTag,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type DatabaseInfo } from '@coze-studio/bot-detail-store';
import {
type AlterBotTableResponse,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import svgr from 'vite-plugin-svgr';
import { defineConfig } from '@coze-arch/vitest-config';