diff --git a/react-ui/src/components/CodeSelect/index.tsx b/react-ui/src/components/CodeSelect/index.tsx index 03474c00..79401b25 100644 --- a/react-ui/src/components/CodeSelect/index.tsx +++ b/react-ui/src/components/CodeSelect/index.tsx @@ -1,7 +1,7 @@ /* * @Author: 赵伟 * @Date: 2024-10-08 15:36:08 - * @Description: 代码配置选择表单组件 + * @Description: 流水线选择代码配置表单 */ import KFIcon from '@/components/KFIcon'; diff --git a/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx b/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx index 159ba9f1..11e8eb10 100644 --- a/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceInfo/index.tsx @@ -47,6 +47,7 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { const name = searchParams.get('name') || ''; const owner = searchParams.get('owner') || ''; const identifier = searchParams.get('identifier') || ''; + const is_public = searchParams.get('is_public') || ''; const [versionList, setVersionList] = useState([]); const [version, setVersion] = useState(undefined); const [activeTab, setActiveTab] = useState(defaultTab); @@ -66,6 +67,7 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { name, identifier, version, + is_public: is_public === 'true', }); } }, [version]); @@ -77,6 +79,7 @@ const ResourceInfo = ({ resourceType }: ResourceInfoProps) => { id: number; identifier: string; version?: string; + is_public: boolean; }) => { const request = config.getInfo; const [res] = await to(request(params)); diff --git a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx index 08546bc7..9e872aca 100644 --- a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx @@ -122,7 +122,7 @@ function ResourceList( modalConfirm({ title: config.deleteModalTitle, onOk: () => { - deleteRecord(pick(record, ['owner', 'identifier', 'id'])); + deleteRecord(pick(record, ['owner', 'identifier', 'id', 'is_public'])); }, }); }; @@ -138,7 +138,7 @@ function ResourceList( }); const prefix = config.prefix; navigate( - `/dataset/${prefix}/info/${record.id}?name=${record.name}&owner=${record.owner}&identifier=${record.identifier}`, + `/dataset/${prefix}/info/${record.id}?name=${record.name}&owner=${record.owner}&identifier=${record.identifier}&is_public=${record.is_public}`, ); }; diff --git a/react-ui/src/pages/Dataset/components/ResourceVersion/index.tsx b/react-ui/src/pages/Dataset/components/ResourceVersion/index.tsx index 44c54320..5e04ee17 100644 --- a/react-ui/src/pages/Dataset/components/ResourceVersion/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceVersion/index.tsx @@ -28,6 +28,7 @@ function ResourceVersion({ resourceType, info }: ResourceVersionProps) { id: info.id, version: info.version, identifier: info.identifier, + is_public: info.is_public, }); }; diff --git a/react-ui/src/pages/System/User/edit.tsx b/react-ui/src/pages/System/User/edit.tsx index 4fde814d..8d24b539 100644 --- a/react-ui/src/pages/System/User/edit.tsx +++ b/react-ui/src/pages/System/User/edit.tsx @@ -199,6 +199,11 @@ const UserForm: React.FC = (props) => { { required: true, }, + { + pattern: /^[a-zA-Z0-9](?:[a-zA-Z0-9_.-]*[a-zA-Z0-9])?$/, + message: + '只能包含数字,字母,下划线(_),中横线(-),英文句号(.),且必须以数字或字母开头与结尾', + }, ]} /> = Omit & { [P in K]: NewType }; -// export type PascalCaseType = { -// [K in keyof T as `${Capitalize}`]: T[K]; -// } +// 将属性名称首字母大写 +export type PascalCaseType = { + [K in keyof T as `${Capitalize}`]: T[K]; +}; + +// 将属性名称下划线转换为驼峰 +type ToCamelCase = S extends `${infer P}_${infer R}` + ? `${P}${Capitalize>}` + : S; + +export type KeysToCamelCase = { + [K in keyof T as ToCamelCase]: T[K]; +}; // 序列化后的流水线节点 export type PipelineNodeModelSerialize = Omit<