-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update tag/edge edit page #128
Conversation
} else { | ||
setLoading(true); | ||
const res = await createTagOrEdge({ | ||
gql, | ||
type: createType | ||
}); | ||
setLoading(false); | ||
if (res.code === 0) { | ||
message.success(intl.get('schema.createSuccess')); | ||
history.push(`/schema/${space}/${createType}/edit/${name}`); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary else
onOk: async() => { | ||
if (properties.length > 0) { | ||
handlePropertyDelete(properties); | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary async
if (editField && editField.alterType === 'ADD') { | ||
setList(list.slice(0, list.length - 1)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (editField?.alterType === 'ADD') {
setList(list.slice(0, - 1));
}
} else { | ||
setTtlRequired(true); | ||
handleEditBefore(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary else
onOk: async() => { | ||
handleTtlDelete(); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// tiny
onOk: () => handleTtlDelete()
// or
onOk: handleTtlDelete
const hasIndex = res.filter(i => i.name === editName).length > 0; | ||
return hasIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return res.some(i => i.name === editName);
const infoList = reg.exec(str) || []; | ||
const properties: IProperty[] = fieldInfo.map(i => ({ | ||
name: i.Field, | ||
showType: i.Type, | ||
type: i.Type.startsWith('fixed_string') ? 'fixed_string' : i.Type, | ||
allowNull: i.Null === 'YES', | ||
comment: i.Comment === '_EMPTY_' ? '' : i.Comment, | ||
value: i.Default === '_EMPTY_' ? '' : convertBigNumberToString(i.Default), | ||
fixedLength: i.Type.startsWith('fixed_string') | ||
? i.Type.replace(/[fixed_string(|)]/g, '') | ||
: '', | ||
})) || []; | ||
const duration = (infoList && infoList[2].split(' = ')[1]) || ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// const infoList = reg.exec(str) || []
// infoList should be certain Array
const duration = infoList[2]?.split(' = ')[1] || '';
mod: code review
mod: code review
No description provided.