refactor(web): mark Props of tools/ components as read-only (#25219) (#37255)

This commit is contained in:
Rohit Gahlawat 2026-06-10 07:41:23 +05:30 committed by GitHub
parent 212b819f1c
commit 50e23f40a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 20 additions and 20 deletions

View File

@ -23,12 +23,12 @@ import { useTranslation } from 'react-i18next'
import { Infotip } from '@/app/components/base/infotip'
import { AuthHeaderPrefix, AuthType } from '@/app/components/tools/types'
type Props = {
type Props = Readonly<{
positionCenter?: boolean
credential: Credential
onChange: (credential: Credential) => void
onHide: () => void
}
}>
type ItemProps = {
text: string

View File

@ -15,9 +15,9 @@ import Input from '@/app/components/base/input'
import { importSchemaFromURL } from '@/service/tools'
import examples from './examples'
type Props = {
type Props = Readonly<{
onChange: (value: string) => void
}
}>
const GetSchema: FC<Props> = ({
onChange,

View File

@ -33,7 +33,7 @@ import ConfigCredentials from './config-credentials'
import GetSchema from './get-schema'
import TestApi from './test-api'
type Props = {
type Props = Readonly<{
positionLeft?: boolean
dialogClassName?: string
payload: any
@ -41,7 +41,7 @@ type Props = {
onAdd?: (payload: CustomCollectionBackend) => void
onRemove?: () => void
onEdit?: (payload: CustomCollectionBackend) => void
}
}>
// Add and Edit
const EditCustomCollectionModal: FC<Props> = ({
positionLeft,

View File

@ -24,12 +24,12 @@ import { getLanguage } from '@/i18n-config/language'
import { testAPIAvailable } from '@/service/tools'
import ConfigCredentials from './config-credentials'
type Props = {
type Props = Readonly<{
positionCenter?: boolean
customCollection: CustomCollectionBackend
tool: CustomParamSchema
onHide: () => void
}
}>
const TestApi: FC<Props> = ({
positionCenter,

View File

@ -10,9 +10,9 @@ import EditCustomToolModal from '@/app/components/tools/edit-custom-collection-m
import { useAppContext } from '@/context/app-context'
import { createCustomCollection } from '@/service/tools'
type Props = {
type Props = Readonly<{
onRefreshData: () => void
}
}>
const Contribute = ({ onRefreshData }: Props) => {
const { t } = useTranslation()

View File

@ -63,11 +63,11 @@ import { basePath } from '@/utils/var'
import { AuthHeaderPrefix, AuthType, CollectionType } from '../types'
import ToolItem from './tool-item'
type Props = {
type Props = Readonly<{
collection: Collection
onHide: () => void
onRefreshData: () => void
}
}>
const ProviderDetail = ({
collection,

View File

@ -7,10 +7,10 @@ import Link from '@/next/link'
import { NoToolPlaceholder } from '../../base/icons/src/vender/other'
import { ToolTypeEnum } from '../../workflow/block-selector/types'
type Props = {
type Props = Readonly<{
type?: ToolTypeEnum
isAgent?: boolean
}
}>
const getLink = (type?: ToolTypeEnum) => {
switch (type) {

View File

@ -7,13 +7,13 @@ import SettingBuiltInTool from '@/app/components/app/configuration/config/agent/
import { useLocale } from '@/context/i18n'
import { getLanguage } from '@/i18n-config/language'
type Props = {
type Props = Readonly<{
disabled?: boolean
collection: Collection
tool: Tool
isBuiltIn: boolean
isModel: boolean
}
}>
const ToolItem = ({
disabled,

View File

@ -26,14 +26,14 @@ import Form from '@/app/components/header/account-setting/model-provider-page/mo
import { fetchBuiltInToolCredential, fetchBuiltInToolCredentialSchema } from '@/service/tools'
import { addDefaultValue, toolCredentialToFormSchemas } from '../../utils/to-form-schema'
type Props = {
type Props = Readonly<{
collection: Collection
onCancel: () => void
onSaved: (value: Record<string, any>) => void
isHideRemoveBtn?: boolean
onRemove?: () => void
isSaving?: boolean
}
}>
const ConfigCredential: FC<Props> = ({
collection,

View File

@ -7,7 +7,7 @@ import Loading from '@/app/components/base/loading'
import { useRouter } from '@/next/navigation'
import Divider from '../../base/divider'
type Props = {
type Props = Readonly<{
disabled: boolean
published: boolean
isLoading: boolean
@ -15,7 +15,7 @@ type Props = {
isCurrentWorkspaceManager: boolean
onConfigure: () => void
disabledReason?: string
}
}>
const WorkflowToolConfigureButton = ({
disabled,