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
6d8c50cc
Commit
6d8c50cc
authored
Aug 18, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
Aug 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2018: UI: Attribute filter does not preserve state
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
(cherry picked from commit db317a4708fe1f6c87a1f7674f4fb3bbf70bebb1)
parent
86fb9da4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
42 deletions
+64
-42
Router.js
dashboardv2/public/js/router/Router.js
+5
-1
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+5
-1
SideNavLayoutView.js
...dv2/public/js/views/business_catalog/SideNavLayoutView.js
+3
-2
QueryBuilderView.js
dashboardv2/public/js/views/search/QueryBuilderView.js
+2
-2
SearchLayoutView.js
dashboardv2/public/js/views/search/SearchLayoutView.js
+46
-34
SearchQueryView.js
dashboardv2/public/js/views/search/SearchQueryView.js
+3
-2
No files found.
dashboardv2/public/js/router/Router.js
View file @
6d8c50cc
...
...
@@ -54,7 +54,11 @@ define([
'classificationDefCollection'
:
this
.
classificationDefCollection
}
this
.
sharedObj
=
{
searchTableColumns
:
{}
searchTableColumns
:
{},
searchTableFilters
:
{
tagFilters
:
{},
entityFilters
:
{}
}
}
},
bindCommonEvents
:
function
()
{
...
...
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
6d8c50cc
...
...
@@ -408,7 +408,11 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
_
.
each
(
attrObj
,
function
(
obj
)
{
attrQuery
.
push
(
obj
.
id
+
"::"
+
obj
.
operator
+
"::"
+
obj
.
value
+
"::"
+
obj
.
type
);
});
return
attrQuery
.
join
();
if
(
attrQuery
.
length
)
{
return
attrQuery
.
join
();
}
else
{
return
null
;
}
}
else
{
return
null
;
}
...
...
dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
View file @
6d8c50cc
...
...
@@ -83,7 +83,7 @@ define(['require',
return
events
;
},
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'url'
,
'value'
,
'tag'
,
'selectFirst'
,
'classificationDefCollection'
,
'typeHeaders'
,
'searchVent'
,
'entityDefCollection'
,
'enumDefCollection'
,
'searchTableColumns'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'url'
,
'value'
,
'tag'
,
'selectFirst'
,
'classificationDefCollection'
,
'typeHeaders'
,
'searchVent'
,
'entityDefCollection'
,
'enumDefCollection'
,
'searchTableColumns'
,
'searchTableFilters'
));
if
(
Globals
.
taxonomy
)
{
this
.
tabClass
=
"tab col-sm-4"
;
}
else
{
...
...
@@ -128,7 +128,8 @@ define(['require',
entityDefCollection
:
that
.
entityDefCollection
,
enumDefCollection
:
that
.
enumDefCollection
,
classificationDefCollection
:
that
.
classificationDefCollection
,
searchTableColumns
:
that
.
searchTableColumns
searchTableColumns
:
that
.
searchTableColumns
,
searchTableFilters
:
that
.
searchTableFilters
}));
});
},
...
...
dashboardv2/public/js/views/search/QueryBuilderView.js
View file @
6d8c50cc
...
...
@@ -52,7 +52,7 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'attrObj'
,
'value'
,
'typeHeaders'
,
'entityDefCollection'
,
'enumDefCollection'
,
'tag'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'attrObj'
,
'value'
,
'typeHeaders'
,
'entityDefCollection'
,
'enumDefCollection'
,
'tag'
,
'searchTableFilters'
));
this
.
attrObj
=
_
.
sortBy
(
this
.
attrObj
,
'name'
);
this
.
filterType
=
this
.
tag
?
'tagFilters'
:
'entityFilters'
;
},
...
...
@@ -134,7 +134,7 @@ define(['require',
var
that
=
this
,
filters
=
[];
if
(
this
.
value
)
{
var
rules_widgets
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
this
.
value
[
this
.
filterType
]);
var
rules_widgets
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
this
.
searchTableFilters
[
this
.
filterType
][(
this
.
tag
?
this
.
value
.
tag
:
this
.
value
.
type
)
]);
}
_
.
each
(
this
.
attrObj
,
function
(
obj
)
{
var
returnObj
=
that
.
getObjDef
(
obj
,
rules_widgets
);
...
...
dashboardv2/public/js/views/search/SearchLayoutView.js
View file @
6d8c50cc
...
...
@@ -81,7 +81,7 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'typeHeaders'
,
'searchVent'
,
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'searchTableColumns'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'typeHeaders'
,
'searchVent'
,
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'searchTableColumns'
,
'searchTableFilters'
));
this
.
type
=
"basic"
;
var
param
=
Utils
.
getUrlState
.
getQueryParams
();
this
.
query
=
{
...
...
@@ -92,8 +92,6 @@ define(['require',
basic
:
{
query
:
null
,
type
:
null
,
typeFilter
:
null
,
tagFilter
:
null
,
tag
:
null
,
attributes
:
null
}
...
...
@@ -133,51 +131,39 @@ define(['require',
filtertype
=
[
filtertypeParam
];
}
}
var
typeCheck
=
function
(
filterQueryObj
,
type
)
{
var
filterObj
=
filterQueryObj
[
type
];
var
typeCheck
=
function
(
filterObj
,
type
)
{
if
(
that
.
value
.
type
)
{
if
(
filterObj
&&
filterObj
.
length
)
{
that
.
ui
.
typeAttrFilter
.
addClass
(
'active'
);
}
else
{
filterQueryObj
[
type
]
=
null
;
that
.
value
[
type
]
=
null
;
that
.
ui
.
typeAttrFilter
.
removeClass
(
'active'
);
}
that
.
ui
.
typeAttrFilter
.
prop
(
'disabled'
,
false
);
}
else
{
filterQueryObj
[
type
]
=
null
;
that
.
value
[
type
]
=
null
;
that
.
ui
.
typeAttrFilter
.
removeClass
(
'active'
);
that
.
ui
.
typeAttrFilter
.
prop
(
'disabled'
,
true
);
}
}
var
tagCheck
=
function
(
filterQueryObj
,
type
)
{
var
filterObj
=
filterQueryObj
[
type
];
var
tagCheck
=
function
(
filterObj
,
type
)
{
if
(
that
.
value
.
tag
)
{
that
.
ui
.
tagAttrFilter
.
prop
(
'disabled'
,
false
);
if
(
filterObj
&&
filterObj
.
length
)
{
that
.
ui
.
tagAttrFilter
.
addClass
(
'active'
);
}
else
{
filterQueryObj
[
type
]
=
null
;
that
.
value
[
type
]
=
null
;
that
.
ui
.
tagAttrFilter
.
removeClass
(
'active'
);
}
}
else
{
filterQueryObj
[
type
]
=
null
;
that
.
value
[
type
]
=
null
;
that
.
ui
.
tagAttrFilter
.
removeClass
(
'active'
);
that
.
ui
.
tagAttrFilter
.
prop
(
'disabled'
,
true
);
}
}
_
.
each
(
filtertype
,
function
(
type
)
{
var
filterObj
=
that
.
query
[
that
.
type
][
type
],
filterQueryObj
=
that
.
query
[
that
.
type
];
var
filterObj
=
that
.
searchTableFilters
[
type
];
if
(
type
==
"entityFilters"
)
{
typeCheck
(
filter
QueryObj
,
type
)
typeCheck
(
filter
Obj
[
that
.
value
.
type
],
type
);
}
if
(
type
==
"tagFilters"
)
{
tagCheck
(
filter
QueryObj
,
type
)
tagCheck
(
filter
Obj
[
that
.
value
.
tag
],
type
);
}
});
},
...
...
@@ -191,14 +177,19 @@ define(['require',
filterType
=
(
isTagEl
?
'tagFilters'
:
'entityFilters'
),
value
=
value
.
length
?
value
:
null
;
if
(
this
.
value
)
{
if
(
this
.
value
[
key
]
!==
value
||
(
!
value
&&
!
this
.
value
[
key
])
||
(
!
this
.
value
[
filterType
]))
{
//On Change handle
if
(
this
.
value
[
key
]
!==
value
||
(
!
value
&&
!
this
.
value
[
key
]))
{
var
temp
=
{};
temp
[
key
]
=
value
;
_
.
extend
(
this
.
value
,
temp
);
this
.
query
[
this
.
type
][
filterType
]
=
null
;
this
.
value
[
filterType
]
=
null
;
this
.
makeFilterButtonActive
(
filterType
);
}
else
{
// Initial loading handle.
var
filterObj
=
this
.
searchTableFilters
[
filterType
];
if
(
filterObj
&&
this
.
value
[
key
])
{
this
.
searchTableFilters
[
filterType
][
this
.
value
[
key
]]
=
this
.
value
[
filterType
]
?
this
.
value
[
filterType
]
:
null
;
}
}
this
.
makeFilterButtonActive
(
filterType
);
}
else
{
this
.
ui
.
tagAttrFilter
.
prop
(
'disabled'
,
true
);
this
.
ui
.
typeAttrFilter
.
prop
(
'disabled'
,
true
);
...
...
@@ -244,8 +235,6 @@ define(['require',
query
:
null
,
type
:
null
,
tag
:
null
,
entityFilters
:
null
,
tagFilters
:
null
,
attributes
:
null
}),
param
);
},
...
...
@@ -289,7 +278,8 @@ define(['require',
typeHeaders
:
that
.
typeHeaders
,
entityDefCollection
:
that
.
entityDefCollection
,
enumDefCollection
:
that
.
enumDefCollection
,
classificationDefCollection
:
that
.
classificationDefCollection
classificationDefCollection
:
that
.
classificationDefCollection
,
searchTableFilters
:
that
.
searchTableFilters
});
that
.
attrModal
.
on
(
'ok'
,
function
(
scope
,
e
)
{
that
.
okAttrFilterButton
(
e
);
...
...
@@ -297,11 +287,19 @@ define(['require',
});
},
okAttrFilterButton
:
function
(
e
)
{
var
filtertype
=
this
.
attrModal
.
tag
?
'tagFilters'
:
'entityFilters'
,
var
isTag
=
this
.
attrModal
.
tag
?
true
:
false
,
filtertype
=
isTag
?
'tagFilters'
:
'entityFilters'
,
rule
=
this
.
attrModal
.
RQueryBuilder
.
currentView
.
ui
.
builder
.
queryBuilder
(
'getRules'
);
if
(
rule
)
{
this
.
query
[
this
.
type
][
filtertype
]
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
rule
.
rules
);
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
rule
.
rules
);
this
.
searchTableFilters
[
filtertype
][(
isTag
?
this
.
value
.
tag
:
this
.
value
.
type
)]
=
ruleUrl
;
this
.
makeFilterButtonActive
(
filtertype
);
if
(
this
.
value
&&
this
.
searchTableColumns
)
{
if
(
!
this
.
searchTableColumns
[
this
.
value
.
type
])
{
this
.
searchTableColumns
[
this
.
value
.
type
]
=
[
"selected"
,
"name"
,
"owner"
,
"description"
,
"tag"
,
"typeName"
]
}
this
.
searchTableColumns
[
this
.
value
.
type
]
=
_
.
sortBy
(
_
.
union
(
this
.
searchTableColumns
[
this
.
value
.
type
],
_
.
pluck
(
rule
.
rules
,
'id'
)));
}
this
.
attrModal
.
modal
.
close
();
if
(
$
(
e
.
currentTarget
).
hasClass
(
'search'
))
{
this
.
findSearchResult
();
...
...
@@ -342,9 +340,9 @@ define(['require',
this
.
value
=
paramObj
;
}
if
(
this
.
value
)
{
if
(
this
.
value
.
dslChecked
==
"true"
&&
this
.
dsl
==
false
)
{
if
(
this
.
value
.
dslChecked
==
"true"
)
{
this
.
ui
.
searchType
.
prop
(
"checked"
,
true
).
trigger
(
"change"
);
}
else
if
(
this
.
value
.
dslChecked
==
"false"
&&
this
.
dsl
==
true
)
{
}
else
{
this
.
ui
.
searchType
.
prop
(
"checked"
,
false
).
trigger
(
"change"
);
}
this
.
ui
.
typeLov
.
val
(
this
.
value
.
type
);
...
...
@@ -387,6 +385,14 @@ define(['require',
this
.
query
[
this
.
type
].
type
=
this
.
ui
.
typeLov
.
select2
(
'val'
)
||
null
;
if
(
!
this
.
dsl
)
{
this
.
query
[
this
.
type
].
tag
=
this
.
ui
.
tagLov
.
select2
(
'val'
)
||
null
;
var
entityFilterObj
=
this
.
searchTableFilters
[
'entityFilters'
],
tagFilterObj
=
this
.
searchTableFilters
[
'tagFilters'
];
if
(
this
.
value
.
tag
)
{
params
[
'tagFilters'
]
=
tagFilterObj
[
this
.
value
.
tag
]
}
if
(
this
.
value
.
type
)
{
params
[
'entityFilters'
]
=
entityFilterObj
[
this
.
value
.
type
]
}
}
if
(
this
.
dsl
)
{
params
[
'attributes'
]
=
null
;
...
...
@@ -416,9 +422,11 @@ define(['require',
this
.
dsl
=
true
;
this
.
$
(
'.tagBox'
).
hide
();
this
.
$
(
'.temFilterBtn'
).
hide
();
this
.
$
(
'.temFilter'
).
toggleClass
(
'col-sm-10 col-sm-12'
);
this
.
$
(
'.temFilter'
).
addClass
(
'col-sm-12'
);
this
.
$
(
'.temFilter'
).
removeClass
(
'col-sm-10'
);
}
else
{
this
.
$
(
'.temFilter'
).
toggleClass
(
'col-sm-10 col-sm-12'
);
this
.
$
(
'.temFilter'
).
addClass
(
'col-sm-10'
);
this
.
$
(
'.temFilter'
).
removeClass
(
'col-sm-12'
);
this
.
$
(
'.temFilterBtn'
).
show
();
this
.
$
(
'.tagBox'
).
show
();
this
.
dsl
=
false
;
...
...
@@ -427,7 +435,7 @@ define(['require',
if
(
paramObj
&&
this
.
type
==
paramObj
.
searchType
)
{
this
.
updateQueryObject
(
paramObj
);
}
if
(
this
.
type
==
"basic"
)
{
if
(
paramObj
&&
this
.
type
==
"basic"
)
{
this
.
query
[
this
.
type
].
attribute
=
paramObj
.
attributes
?
paramObj
.
attributes
:
null
;
}
Utils
.
setUrl
({
...
...
@@ -448,6 +456,10 @@ define(['require',
this
.
ui
.
typeLov
.
val
(
""
).
trigger
(
"change"
);
this
.
ui
.
tagLov
.
val
(
""
).
trigger
(
"change"
);
this
.
ui
.
searchInput
.
val
(
""
);
if
(
this
.
dsl
)
{
this
.
searchTableFilters
.
tagFilters
=
{};
this
.
searchTableFilters
.
entityFilters
=
{};
}
this
.
checkForButtonVisiblity
();
Utils
.
setUrl
({
url
:
'#!/search/searchResult'
,
...
...
dashboardv2/public/js/views/search/SearchQueryView.js
View file @
6d8c50cc
...
...
@@ -50,7 +50,7 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'entityDefCollection'
,
'typeHeaders'
,
'searchVent'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'tag'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'entityDefCollection'
,
'typeHeaders'
,
'searchVent'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'tag'
,
'searchTableFilters'
));
this
.
bindEvents
();
var
that
=
this
;
this
.
modal
=
new
Modal
({
...
...
@@ -83,7 +83,8 @@ define(['require',
searchVent
:
this
.
searchVent
,
entityDefCollection
:
this
.
entityDefCollection
,
enumDefCollection
:
this
.
enumDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
classificationDefCollection
:
this
.
classificationDefCollection
,
searchTableFilters
:
this
.
searchTableFilters
}
if
(
this
.
tag
)
{
...
...
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