[
https://issues.apache.org/jira/browse/KYLIN-3526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16618376#comment-16618376
]
ASF GitHub Bot commented on KYLIN-3526:
---------------------------------------
luguosheng1314 closed pull request #233: KYLIN-3526 Add check for hybrid name
with special character
URL: https://github.com/apache/kylin/pull/233
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/webapp/app/js/controllers/hybridInstanceSchema.js
b/webapp/app/js/controllers/hybridInstanceSchema.js
index 668f6dcc78..e03bb01c1f 100644
--- a/webapp/app/js/controllers/hybridInstanceSchema.js
+++ b/webapp/app/js/controllers/hybridInstanceSchema.js
@@ -48,6 +48,7 @@ KylinApp.controller('HybridInstanceSchema', function (
name: '',
model: ''
};
+ $scope.$validator = {}
resetPageData();
diff --git a/webapp/app/partials/cubes/hybrid_edit.html
b/webapp/app/partials/cubes/hybrid_edit.html
index 21b130fc32..2903460f40 100644
--- a/webapp/app/partials/cubes/hybrid_edit.html
+++ b/webapp/app/partials/cubes/hybrid_edit.html
@@ -33,7 +33,7 @@
<div class="row" ng-controller="HybridInstanceSchema">
<div class="col-xs-12">
- <form role="form" name="hybrid_cube_form form-inline" novalidate>
+ <ng-form role="form" name="$validator" novalidate>
<h1 class="form-title">Hybrid Designer</h1>
@@ -41,8 +41,9 @@ <h1 class="form-title">Hybrid Designer</h1>
<div class="col-xs-5 form-group">
<div class="row">
<label class="col-xs-3 control-label no-padding-right
font-color-default" for="hybridName">Hybrid Name</label>
- <div class="col-xs-9">
- <input type="text" class="form-control" id="hybridName"
placeholder="Hybrid Name" ng-disabled="isFormDisabled || isEdit"
ng-model="form.name">
+ <div class="col-xs-9" ng-class="{ 'has-error':
$validator.name.$invalid && $validator.name.$dirty }">
+ <input type="text" name="name" class="form-control"
id="hybridName" placeholder="Hybrid Name" ng-disabled="isFormDisabled ||
isEdit" ng-model="form.name" ng-pattern="/^\w+$/">
+ <small class="help-block"
ng-show="!$validator.name.$error.required && $validator.name.$invalid &&
$validator.name.$dirty">Hybrid name is invalid.</small>
</div>
</div>
</div>
@@ -170,7 +171,7 @@ <h1 class="form-title">Hybrid Designer</h1>
</div>
</div>
- </form>
+ </ng-form>
</div>
</div>
</div>
\ No newline at end of file
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> No check for hybrid name with special character
> -----------------------------------------------
>
> Key: KYLIN-3526
> URL: https://issues.apache.org/jira/browse/KYLIN-3526
> Project: Kylin
> Issue Type: Improvement
> Components: Web
> Reporter: Na Zhai
> Assignee: Roger
> Priority: Minor
> Fix For: v2.6.0
>
> Attachments: 名称没做限制.png
>
>
> When create hybrid,there is no check for hybrid name with special character.
> Such as !@&.
> Hybrid can be created successfully with name like hy!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)