Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
6b4c3aa7
Commit
6b4c3aa7
authored
Jan 13, 2018
by
pratik24mac
Committed by
Madhan Neethiraj
Jan 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1921: basic-search UI: added range validation for entity/trait attributes
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
0345cd41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
12 deletions
+57
-12
override.scss
dashboardv2/public/css/scss/override.scss
+14
-3
Enums.js
dashboardv2/public/js/utils/Enums.js
+29
-1
QueryBuilderView.js
dashboardv2/public/js/views/search/QueryBuilderView.js
+14
-8
No files found.
dashboardv2/public/css/scss/override.scss
View file @
6b4c3aa7
...
@@ -297,6 +297,20 @@ td {
...
@@ -297,6 +297,20 @@ td {
}
}
.rule-value-container
{
.rule-value-container
{
display
:
inline-block
!
important
;
display
:
inline-block
!
important
;
.form-control
{
width
:
220px
!
important
;
padding
:
6px
12px
!
important
;
}
}
.rule-filter-container
{
.form-control
{
width
:
200px
!
important
;
}
}
.rule-operator-container
{
.form-control
{
width
:
auto
!
important
;
}
}
}
}
}
.rules-list
>
:first-child::before
{
.rules-list
>
:first-child::before
{
...
@@ -305,9 +319,6 @@ td {
...
@@ -305,9 +319,6 @@ td {
.rules-group-header
.btn-group.group-conditions
label
{
.rules-group-header
.btn-group.group-conditions
label
{
display
:
none
;
display
:
none
;
}
}
.rule-value-container
input
{
padding
:
6px
12px
!
important
;
}
.rules-group-container
{
.rules-group-container
{
border
:
none
;
border
:
none
;
background
:
none
;
background
:
none
;
...
...
dashboardv2/public/js/utils/Enums.js
View file @
6b4c3aa7
...
@@ -72,6 +72,33 @@ define(['require'], function(require) {
...
@@ -72,6 +72,33 @@ define(['require'], function(require) {
},
},
"uiParameters"
:
"uiParameters"
"uiParameters"
:
"uiParameters"
}
}
Enums
.
regex
=
{
RANGE_CHECK
:
{
"byte"
:
{
min
:
-
128
,
max
:
127
},
"short"
:
{
min
:
-
32768
,
max
:
32767
},
"int"
:
{
min
:
-
2147483648
,
max
:
2147483647
},
"long"
:
{
min
:
-
9223372036854775808
,
max
:
9223372036854775807
},
"float"
:
{
min
:
1.4
E
-
45
,
max
:
3.4028235E38
},
"double"
:
{
min
:
4.9
E
-
324
,
max
:
1.7976931348623157E308
}
}
}
return
Enums
;
return
Enums
;
});
});
\ No newline at end of file
dashboardv2/public/js/views/search/QueryBuilderView.js
View file @
6b4c3aa7
...
@@ -21,9 +21,10 @@ define(['require',
...
@@ -21,9 +21,10 @@ define(['require',
'hbs!tmpl/search/QueryBuilder_tmpl'
,
'hbs!tmpl/search/QueryBuilder_tmpl'
,
'utils/Utils'
,
'utils/Utils'
,
'utils/CommonViewFunction'
,
'utils/CommonViewFunction'
,
'utils/Enums'
,
'query-builder'
,
'query-builder'
,
'daterangepicker'
'daterangepicker'
],
function
(
require
,
Backbone
,
QueryBuilder_Tmpl
,
Utils
,
CommonViewFunction
)
{
],
function
(
require
,
Backbone
,
QueryBuilder_Tmpl
,
Utils
,
CommonViewFunction
,
Enums
)
{
var
QueryBuilderView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
QueryBuilderView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends QueryBuilderView */
/** @lends QueryBuilderView */
...
@@ -112,13 +113,18 @@ define(['require',
...
@@ -112,13 +113,18 @@ define(['require',
obj
[
'values'
]
=
[
'true'
,
'false'
];
obj
[
'values'
]
=
[
'true'
,
'false'
];
}
}
_
.
extend
(
obj
,
this
.
getOperator
(
obj
.
type
));
_
.
extend
(
obj
,
this
.
getOperator
(
obj
.
type
));
if
(
obj
.
type
===
"long"
||
obj
.
type
===
"float"
)
{
if
(
_
.
has
(
Enums
.
regex
.
RANGE_CHECK
,
obj
.
type
))
{
obj
.
type
=
"double"
;
obj
.
validation
=
{
}
min
:
Enums
.
regex
.
RANGE_CHECK
[
obj
.
type
].
min
,
if
(
obj
.
type
===
"int"
||
obj
.
type
===
"byte"
||
obj
.
type
===
"short"
)
{
max
:
Enums
.
regex
.
RANGE_CHECK
[
obj
.
type
].
max
obj
.
type
=
"integer"
;
};
}
if
(
obj
.
type
===
"double"
||
obj
.
type
===
"float"
)
{
return
obj
;
obj
.
type
=
"double"
;
}
else
if
(
obj
.
type
===
"int"
||
obj
.
type
===
"byte"
||
obj
.
type
===
"short"
||
obj
.
type
===
"long"
)
{
obj
.
type
=
"integer"
}
}
return
obj
;
}
}
var
enumObj
=
this
.
enumDefCollection
.
fullCollection
.
find
({
name
:
obj
.
type
});
var
enumObj
=
this
.
enumDefCollection
.
fullCollection
.
find
({
name
:
obj
.
type
});
if
(
enumObj
)
{
if
(
enumObj
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment