1996fanrui commented on code in PR #1852:
URL:
https://github.com/apache/incubator-streampark/pull/1852#discussion_r996441920
##########
streampark-console/streampark-console-webapp/src/views/system/variable/Add.vue:
##########
@@ -127,23 +127,21 @@ export default {
handleVariableCodeBlur (e) {
const variableCode = (e && e.target.value) || ''
if (variableCode.length) {
- if (variableCode.length > 100) {
- this.validateStatus = 'error'
- this.help = 'Variable Code should not be longer than 100 characters'
- } else {
- this.validateStatus = 'validating'
- checkVariableCode({
- variableCode: variableCode
- }).then((resp) => {
- if (resp.data) {
- this.validateStatus = 'success'
- this.help = ''
- } else {
- this.validateStatus = 'error'
- this.help = 'Sorry, the Variable Code already exists'
- }
- })
- }
+ this.validateStatus = 'validating'
+ checkVariableCode({
+ variableCode: variableCode
+ }).then((resp) => {
+ if (resp.status !== 'success') {
+ this.validateStatus = 'error'
+ this.help = resp.message
Review Comment:
The check can be added in front-end. You can refer how to limit the User
name length.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]