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
adfc526e
Commit
adfc526e
authored
Oct 09, 2019
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3449: UI : Beta UI : Invalid Filter validation case for classification
parent
7ba3213e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
60 deletions
+46
-60
SearchDefaultLayoutView.js
...boardv3/public/js/views/search/SearchDefaultLayoutView.js
+46
-60
No files found.
dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
View file @
adfc526e
...
@@ -124,6 +124,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
...
@@ -124,6 +124,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
.
options
,
options
);
_
.
extend
(
this
.
options
,
options
);
this
.
hidenFilter
=
false
;
this
.
hidenFilter
=
false
;
this
.
tagAttributeLength
=
0
;
this
.
entityAttributeLength
=
0
;
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
onRender
:
function
()
{
onRender
:
function
()
{
...
@@ -138,34 +140,13 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
...
@@ -138,34 +140,13 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
var
filters
=
CommonViewFunction
.
attributeFilter
.
extractUrl
({
"value"
:
isTag
?
this
.
options
.
value
.
tagFilters
:
this
.
options
.
value
.
entityFilters
,
"formatDate"
:
true
}),
var
filters
=
CommonViewFunction
.
attributeFilter
.
extractUrl
({
"value"
:
isTag
?
this
.
options
.
value
.
tagFilters
:
this
.
options
.
value
.
entityFilters
,
"formatDate"
:
true
}),
rules
=
filters
.
rules
,
rules
=
filters
.
rules
,
filtertype
=
isTag
?
"tagFilters"
:
"entityFilters"
,
filtertype
=
isTag
?
"tagFilters"
:
"entityFilters"
,
that
=
this
,
that
=
this
;
col
=
[];
function
getIdFromRuleObject
(
rule
)
{
_
.
map
(
rule
.
rules
,
function
(
obj
,
key
)
{
if
(
_
.
has
(
obj
,
"condition"
))
{
return
getIdFromRuleObject
(
obj
);
}
else
{
return
col
.
push
(
obj
.
id
);
}
});
return
col
;
}
filters
.
rules
=
_
.
filter
(
rules
,
function
(
obj
,
key
)
{
filters
.
rules
=
_
.
filter
(
rules
,
function
(
obj
,
key
)
{
return
obj
.
id
!=
$
(
e
.
currentTarget
).
data
(
"id"
);
return
obj
.
id
!=
$
(
e
.
currentTarget
).
data
(
"id"
);
});
});
if
(
filters
)
{
if
(
filters
)
{
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
value
:
filters
,
formatedDateToLong
:
true
});
that
.
updateFilterOptions
(
filters
,
filtertype
,
isTag
);
that
.
options
.
searchTableFilters
[
filtertype
][
isTag
?
that
.
options
.
value
.
tag
:
that
.
options
.
value
.
type
]
=
ruleUrl
;
//this.makeFilterButtonActive(filtertype);
if
(
!
isTag
&&
that
.
options
.
value
&&
that
.
options
.
value
.
type
&&
that
.
options
.
searchTableColumns
)
{
if
(
!
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
])
{
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
]
=
[
"selected"
,
"name"
,
"owner"
,
"description"
,
"tag"
,
"typeName"
];
}
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
]
=
_
.
sortBy
(
_
.
union
(
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
],
getIdFromRuleObject
(
filters
)));
}
}
else
{
}
}
if
(
filters
.
rules
.
length
==
0
)
{
if
(
filters
.
rules
.
length
==
0
)
{
if
(
isTag
)
{
if
(
isTag
)
{
...
@@ -262,101 +243,106 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
...
@@ -262,101 +243,106 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if
(
that
.
options
.
value
.
tag
)
{
if
(
that
.
options
.
value
.
tag
)
{
this
.
ui
.
classificationRegion
.
show
();
this
.
ui
.
classificationRegion
.
show
();
// this.ui.entityRegion.hide();
// this.ui.entityRegion.hide();
var
attrObj
=
that
.
options
.
classificationDefCollection
.
fullCollection
.
find
({
name
:
that
.
options
.
value
.
tag
});
var
attr
Tag
Obj
=
that
.
options
.
classificationDefCollection
.
fullCollection
.
find
({
name
:
that
.
options
.
value
.
tag
});
if
(
attrObj
)
{
if
(
attr
Tag
Obj
)
{
attrObj
=
Utils
.
getNestedSuperTypeObj
({
attr
Tag
Obj
=
Utils
.
getNestedSuperTypeObj
({
data
:
attrObj
.
toJSON
(),
data
:
attr
Tag
Obj
.
toJSON
(),
collection
:
that
.
options
.
classificationDefCollection
,
collection
:
that
.
options
.
classificationDefCollection
,
attrMerge
:
true
,
attrMerge
:
true
,
});
});
this
.
tagAttributeLength
=
attrTagObj
.
length
;
}
}
this
.
renderQueryBuilder
(
_
.
extend
({},
obj
,
{
this
.
renderQueryBuilder
(
_
.
extend
({},
obj
,
{
tag
:
true
,
tag
:
true
,
type
:
false
,
type
:
false
,
attrObj
:
attrObj
attrObj
:
attr
Tag
Obj
}),
this
.
RQueryBuilderClassification
);
}),
this
.
RQueryBuilderClassification
);
this
.
ui
.
classificationName
.
html
(
that
.
options
.
value
.
tag
);
this
.
ui
.
classificationName
.
html
(
that
.
options
.
value
.
tag
);
}
}
if
(
that
.
options
.
value
.
type
)
{
if
(
that
.
options
.
value
.
type
)
{
this
.
ui
.
entityRegion
.
show
();
this
.
ui
.
entityRegion
.
show
();
var
attrObj
=
that
.
options
.
entityDefCollection
.
fullCollection
.
find
({
name
:
that
.
options
.
value
.
type
});
var
attr
Type
Obj
=
that
.
options
.
entityDefCollection
.
fullCollection
.
find
({
name
:
that
.
options
.
value
.
type
});
if
(
attrObj
)
{
if
(
attr
Type
Obj
)
{
attrObj
=
Utils
.
getNestedSuperTypeObj
({
attr
Type
Obj
=
Utils
.
getNestedSuperTypeObj
({
data
:
attrObj
.
toJSON
(),
data
:
attr
Type
Obj
.
toJSON
(),
collection
:
that
.
options
.
entityDefCollection
,
collection
:
that
.
options
.
entityDefCollection
,
attrMerge
:
true
attrMerge
:
true
});
});
this
.
entityAttributeLength
=
attrTypeObj
.
length
;
}
}
this
.
renderQueryBuilder
(
_
.
extend
({},
obj
,
{
this
.
renderQueryBuilder
(
_
.
extend
({},
obj
,
{
tag
:
false
,
tag
:
false
,
type
:
true
,
type
:
true
,
attrObj
:
attrObj
attrObj
:
attr
Type
Obj
}),
this
.
RQueryBuilderEntity
);
}),
this
.
RQueryBuilderEntity
);
this
.
ui
.
entityName
.
html
(
that
.
options
.
value
.
type
);
this
.
ui
.
entityName
.
html
(
that
.
options
.
value
.
type
);
}
}
},
},
okAttrFilterButton
:
function
(
e
)
{
okAttrFilterButton
:
function
(
e
)
{
// var isTag = this.attrModal.tag ? true : false,
var
isTag
,
var
isTag
,
filtertype
,
filtertype
,
queryBuilderRef
,
queryBuilderRef
,
col
=
[]
,
isFilterValidate
=
true
,
that
=
this
;
that
=
this
;
if
(
this
.
options
.
value
.
tag
)
{
if
(
this
.
options
.
value
.
tag
)
{
isTag
=
true
;
isTag
=
true
;
filtertype
=
isTag
?
"tagFilters"
:
"entityFilters"
;
filtertype
=
isTag
?
"tagFilters"
:
"entityFilters"
;
if
(
this
.
tagAttributeLength
!==
0
)
{
queryBuilderRef
=
this
.
RQueryBuilderClassification
.
currentView
.
ui
.
builder
;
queryBuilderRef
=
this
.
RQueryBuilderClassification
.
currentView
.
ui
.
builder
;
searchAttribute
();
searchAttribute
();
}
}
}
if
(
this
.
options
.
value
.
type
)
{
if
(
this
.
options
.
value
.
type
)
{
isTag
=
false
;
isTag
=
false
;
filtertype
=
isTag
?
"tagFilters"
:
"entityFilters"
;
filtertype
=
isTag
?
"tagFilters"
:
"entityFilters"
;
if
(
this
.
entityAttributeLength
!==
0
)
{
queryBuilderRef
=
this
.
RQueryBuilderEntity
.
currentView
.
ui
.
builder
;
queryBuilderRef
=
this
.
RQueryBuilderEntity
.
currentView
.
ui
.
builder
;
searchAttribute
();
searchAttribute
();
}
}
function
getIdFromRuleObject
(
rule
)
{
_
.
map
(
rule
.
rules
,
function
(
obj
,
key
)
{
if
(
_
.
has
(
obj
,
"condition"
))
{
return
getIdFromRuleObject
(
obj
);
}
else
{
return
col
.
push
(
obj
.
id
);
}
});
return
col
;
}
}
filterPopupStatus
();
function
searchAttribute
()
{
function
searchAttribute
()
{
if
(
queryBuilderRef
.
data
(
"queryBuilder"
))
{
if
(
queryBuilderRef
.
data
(
"queryBuilder"
))
{
var
rule
=
queryBuilderRef
.
queryBuilder
(
"getRules"
);
var
rule
=
queryBuilderRef
.
queryBuilder
(
"getRules"
);
}
}
if
(
rule
)
{
rule
?
that
.
updateFilterOptions
(
rule
,
filtertype
,
isTag
)
:
isFilterValidate
=
false
;
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
value
:
rule
,
formatedDateToLong
:
true
});
that
.
options
.
searchTableFilters
[
filtertype
][
isTag
?
that
.
options
.
value
.
tag
:
that
.
options
.
value
.
type
]
=
ruleUrl
;
//this.makeFilterButtonActive(filtertype);
if
(
!
isTag
&&
that
.
options
.
value
&&
that
.
options
.
value
.
type
&&
that
.
options
.
searchTableColumns
)
{
if
(
!
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
])
{
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
]
=
[
"selected"
,
"name"
,
"owner"
,
"description"
,
"tag"
,
"typeName"
];
}
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
]
=
_
.
sortBy
(
_
.
union
(
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
],
getIdFromRuleObject
(
rule
)));
}
}
function
filterPopupStatus
()
{
if
(
isFilterValidate
)
{
if
(
$
(
e
.
currentTarget
).
hasClass
(
"search"
))
{
if
(
$
(
e
.
currentTarget
).
hasClass
(
"search"
))
{
// this.$('.attribute-filter-container').hide();
// that.$('.fa-chevron-right').toggleClass('fa-chevron-down');
that
.
$
(
'.fa-angle-right'
).
toggleClass
(
'fa-angle-down'
);
that
.
$
(
'.fa-angle-right'
).
toggleClass
(
'fa-angle-down'
);
that
.
$
(
'.attribute-filter-container, .attr-filter-overlay'
).
toggleClass
(
'hide'
);
that
.
$
(
'.attribute-filter-container, .attr-filter-overlay'
).
toggleClass
(
'hide'
);
that
.
searchAttrFilter
();
that
.
searchAttrFilter
();
that
.
$
(
'.attributeResultContainer'
).
removeClass
(
"overlay"
);
that
.
$
(
'.attributeResultContainer'
).
removeClass
(
"overlay"
);
//console.log('Done')
}
}
}
}
}
}
},
},
getIdFromRuleObj
:
function
(
rule
)
{
var
col
=
[]
_
.
map
(
rule
.
rules
,
function
(
obj
,
key
)
{
if
(
_
.
has
(
obj
,
"condition"
))
{
return
this
.
getIdFromRuleObj
(
obj
);
}
else
{
return
col
.
push
(
obj
.
id
);
}
});
return
col
;
},
updateFilterOptions
:
function
(
rule
,
filtertype
,
isTag
)
{
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
value
:
rule
,
formatedDateToLong
:
true
});
this
.
options
.
searchTableFilters
[
filtertype
][
isTag
?
this
.
options
.
value
.
tag
:
this
.
options
.
value
.
type
]
=
ruleUrl
;
if
(
!
isTag
&&
this
.
options
.
value
&&
this
.
options
.
value
.
type
&&
this
.
options
.
searchTableColumns
)
{
if
(
!
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
])
{
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
]
=
[
"selected"
,
"name"
,
"owner"
,
"description"
,
"tag"
,
"typeName"
];
}
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
]
=
_
.
sortBy
(
_
.
union
(
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
],
this
.
getIdFromRuleObj
(
rule
)));
}
},
renderQueryBuilder
:
function
(
obj
,
rQueryBuilder
)
{
renderQueryBuilder
:
function
(
obj
,
rQueryBuilder
)
{
var
that
=
this
;
var
that
=
this
;
require
([
'views/search/QueryBuilderView'
],
function
(
QueryBuilderView
)
{
require
([
'views/search/QueryBuilderView'
],
function
(
QueryBuilderView
)
{
...
...
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