chore: update is_built_in
This commit is contained in:
@@ -124,7 +124,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
|
||||
// built-in backend does not allow to edit default_version
|
||||
const initYamlContent = (values: any) => {
|
||||
if (currentData?.is_build_in) {
|
||||
if (currentData?.is_built_in) {
|
||||
return json2Yaml(_.pick(values, backendFields));
|
||||
}
|
||||
return json2Yaml(_.pick(values, [...backendFields, 'default_version']));
|
||||
@@ -223,7 +223,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
<ImportYAML
|
||||
actionStatus={{
|
||||
action: action,
|
||||
isBuiltIn: currentData?.is_build_in || false
|
||||
isBuiltIn: currentData?.is_built_in || false
|
||||
}}
|
||||
ref={editorRef}
|
||||
content={yamlContent}
|
||||
|
||||
@@ -141,11 +141,11 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
|
||||
};
|
||||
|
||||
const actions = useMemo(() => {
|
||||
if (data.is_build_in) {
|
||||
if (data.is_built_in) {
|
||||
return backendActions.filter((item) => item.key !== 'delete');
|
||||
}
|
||||
return backendActions.filter((item) => item.key !== 'view_versions');
|
||||
}, [data.is_build_in]);
|
||||
}, [data.is_built_in]);
|
||||
|
||||
const onClick = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
@@ -222,7 +222,7 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
|
||||
<Content>
|
||||
<CardName>
|
||||
<span>{data.backend_name}</span>
|
||||
{data.is_build_in && (
|
||||
{data.is_built_in && (
|
||||
<Tag
|
||||
color="geekblue"
|
||||
className="font-400"
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface FormData {
|
||||
|
||||
export interface ListItem extends FormData {
|
||||
id: number;
|
||||
is_build_in?: boolean;
|
||||
is_built_in?: boolean;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
build_in_version_configs?: Record<string, VersionConfigs>;
|
||||
|
||||
@@ -162,7 +162,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
<PlusOutlined /> {intl.formatMessage({ id: 'backend.addVersion' })}
|
||||
</Button>
|
||||
</span>
|
||||
{!currentData?.is_build_in && (
|
||||
{!currentData?.is_built_in && (
|
||||
<Select
|
||||
prefix={
|
||||
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>
|
||||
@@ -243,7 +243,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
className="flex-center"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{!currentData?.is_build_in && (
|
||||
{!currentData?.is_built_in && (
|
||||
<Form.Item
|
||||
name={[name, 'is_default']}
|
||||
valuePropName="checked"
|
||||
@@ -252,7 +252,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
></Form.Item>
|
||||
)}
|
||||
</span>
|
||||
{(fields.length > 1 || currentData?.is_build_in) && (
|
||||
{(fields.length > 1 || currentData?.is_built_in) && (
|
||||
<Button
|
||||
size="small"
|
||||
shape="circle"
|
||||
|
||||
Reference in New Issue
Block a user