You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2022/10/16 12:44:23 UTC

[GitHub] [incubator-streampark] macksonmu opened a new pull request, #1852: [Feature] Restrict the format of variable code in the variable management module #1851

macksonmu opened a new pull request, #1852:
URL: https://github.com/apache/incubator-streampark/pull/1852

   <!--
   Thank you for contributing to StreamPark! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   ## Contribution Checklist
   
     - If this is your first time, please read our contributor guidelines: [Submit Code](https://streampark.apache.org/community/submit_guide/submit_code).
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/streampark/issues).
   
     - Name the pull request in the form "[Feature] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
   
     - If the PR is unfinished, add `[WIP]` in your PR title, e.g., `[WIP][Feature] Title of the pull request`.
   
   -->
   
   ## What changes were proposed in this pull request
   
   Issue Number: close #1851  <!-- REMOVE this line if no issue to close -->
   
   <!--(For example: This pull request proposed to add checkstyle plugin).-->
   
   ## Brief change log
   
   <!--*(for example:)*
   - *Add maven-checkstyle-plugin to root pom.xml*
   -->
   
   ## Verifying this change
   
   <!--*(Please pick either of the following options)*-->
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   <!--*(example:)*
   - *Added integration tests for end-to-end.*
   - *Added *Test to verify the change.*
   - *Manually verified the change by testing locally.* -->
   
   ## Does this pull request potentially affect one of the following parts
    - Dependencies (does it add or upgrade a dependency): (yes / no)
   


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys merged pull request #1852: [Feature] Restrict the format of variable code in the variable management module #1851

Posted by GitBox <gi...@apache.org>.
wolfboys merged PR #1852:
URL: https://github.com/apache/incubator-streampark/pull/1852


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] 1996fanrui commented on a diff in pull request #1852: [Feature] Restrict the format of variable code in the variable management module #1851

Posted by GitBox <gi...@apache.org>.
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1852: [Feature] Restrict the format of variable code in the variable management module #1851

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1852:
URL: https://github.com/apache/incubator-streampark/pull/1852#discussion_r996559461


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/VariableController.java:
##########
@@ -87,6 +92,11 @@ public RestResponse deleteVariables(@Valid Variable variable) throws Exception {
 
     @PostMapping("check/code")
     public RestResponse checkVariableCode(@RequestParam Long teamId, @NotBlank(message = "{required}") String variableCode) {
+        try {
+            this.checkVariableCodeFormat(variableCode);
+        } catch (ApiAlertException e) {
+            return RestResponse.fail(e.getMessage(), ResponseCode.CODE_FAIL_ALERT);

Review Comment:
   we don't need try exception there, just `throw exception`



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] macksonmu commented on pull request #1852: [Feature] Restrict the format of variable code in the variable management module #1851

Posted by GitBox <gi...@apache.org>.
macksonmu commented on PR #1852:
URL: https://github.com/apache/incubator-streampark/pull/1852#issuecomment-1280274401

   @1996fanrui @wolfboys 
   I modified three places
   - Added the inspection of variable code format in the front end.
   - Moved the variable management module to core and adjusted the order of the menus.
   - Fixed menu not sorting when admin is logged in.


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org