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
cd177f83
Commit
cd177f83
authored
5 years ago
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3623 : Beta UI: Basic search improvement to search for namespace attribute
parent
fd1aad38
master
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
5 deletions
+67
-5
QueryBuilderView.js
dashboardv3/public/js/views/search/QueryBuilderView.js
+25
-0
SearchDefaultLayoutView.js
...boardv3/public/js/views/search/SearchDefaultLayoutView.js
+18
-3
SearchResultLayoutView.js
dashboardv3/public/js/views/search/SearchResultLayoutView.js
+24
-2
No files found.
dashboardv3/public/js/views/search/QueryBuilderView.js
View file @
cd177f83
...
...
@@ -61,6 +61,7 @@ define(['require',
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'nameSpaceCollection'
,
'tag'
,
'searchTableFilters'
,
'systemAttrArr'
));
...
...
@@ -364,6 +365,30 @@ define(['require',
filters
.
push
(
returnObj
);
}
});
if
(
this
.
attrObj
.
length
>
0
)
{
var
sortedNamespaceData
=
_
.
sortBy
(
this
.
nameSpaceCollection
.
models
,
function
(
obj
)
{
return
obj
.
get
(
'name'
)
});
_
.
each
(
sortedNamespaceData
,
function
(
obj
)
{
var
namespaceName
=
obj
.
get
(
'name'
);
var
sortedNamespaceAttr
=
_
.
sortBy
(
obj
.
attributes
.
attributeDefs
,
function
(
obj
)
{
return
obj
.
name
;
});
_
.
each
(
sortedNamespaceAttr
,
function
(
attrDetails
)
{
if
(
attrDetails
.
options
&&
attrDetails
.
options
.
applicableEntityTypes
&&
that
.
options
.
applicableType
&&
(
JSON
.
parse
(
attrDetails
.
options
.
applicableEntityTypes
).
indexOf
(
that
.
options
.
applicableType
)
!=
-
1
))
{
var
returnObj
=
that
.
getObjDef
(
attrDetails
,
rules_widgets
,
isGroupView
,
'Select Namespace Attribute'
,
true
);
if
(
returnObj
)
{
returnObj
.
id
=
namespaceName
+
"."
+
returnObj
.
id
;
returnObj
.
label
=
namespaceName
+
": "
+
returnObj
.
label
;
returnObj
.
data
=
{
'entityType'
:
"namespace"
};
filters
.
push
(
returnObj
);
}
}
})
});
}
filters
=
_
.
uniq
(
filters
,
'id'
);
if
(
filters
&&
!
_
.
isEmpty
(
filters
))
{
this
.
ui
.
builder
.
queryBuilder
({
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
View file @
cd177f83
...
...
@@ -57,9 +57,11 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
events
[
"click "
+
this
.
ui
.
attrFilter
]
=
function
(
e
)
{
if
(
this
.
$
(
'.attribute-filter-container'
).
hasClass
(
"hide"
))
{
this
.
onClickAttrFilter
();
this
.
$
(
'.attributeResultContainer'
).
addClass
(
"overlay"
);
}
else
{
this
.
$
(
'.attributeResultContainer'
).
removeClass
(
"overlay"
);
}
this
.
$
(
'.fa-angle-right'
).
toggleClass
(
'fa-angle-down'
);
this
.
$
(
'.attributeResultContainer'
).
addClass
(
"overlay"
);
this
.
$
(
'.attribute-filter-container, .attr-filter-overlay'
).
toggleClass
(
'hide'
);
};
...
...
@@ -236,6 +238,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
enumDefCollection
:
that
.
options
.
enumDefCollection
,
typeHeaders
:
that
.
options
.
typeHeaders
,
classificationDefCollection
:
that
.
options
.
classificationDefCollection
,
nameSpaceCollection
:
that
.
options
.
nameSpaceCollection
,
searchTableFilters
:
that
.
checkEntityFilter
(
that
.
options
)
};
if
(
that
.
options
.
value
)
{
...
...
@@ -295,7 +298,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
this
.
renderQueryBuilder
(
_
.
extend
({},
obj
,
{
tag
:
false
,
type
:
true
,
attrObj
:
attrTypeObj
attrObj
:
attrTypeObj
,
applicableType
:
that
.
options
.
value
?
that
.
options
.
value
.
type
:
null
}),
this
.
RQueryBuilderEntity
);
this
.
ui
.
entityName
.
html
(
that
.
options
.
value
.
type
);
...
...
@@ -362,13 +366,24 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
return
col
;
},
updateFilterOptions
:
function
(
rule
,
filtertype
,
isTag
)
{
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
value
:
rule
,
formatedDateToLong
:
true
});
var
that
=
this
,
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
)));
if
(
rule
.
rules
)
{
_
.
find
(
rule
.
rules
,
function
(
checkNamespace
)
{
if
(
checkNamespace
.
data
&&
checkNamespace
.
data
.
entityType
&&
checkNamespace
.
data
.
entityType
==
'namespace'
)
{
if
(
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
].
indexOf
(
'namespace'
)
==
-
1
)
{
that
.
options
.
searchTableColumns
[
that
.
options
.
value
.
type
].
push
(
checkNamespace
.
data
.
entityType
);
}
return
true
;
}
});
}
}
},
renderQueryBuilder
:
function
(
obj
,
rQueryBuilder
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/SearchResultLayoutView.js
View file @
cd177f83
...
...
@@ -641,12 +641,12 @@ define(['require',
var
that
=
this
,
nameCheck
=
0
,
columnToShow
=
null
,
col
=
{};
col
=
{},
namespaceRenderable
=
false
;
this
.
value
=
Utils
.
getUrlState
.
getQueryParams
()
||
this
.
value
;
if
(
this
.
value
&&
this
.
value
.
searchType
===
"basic"
&&
this
.
searchTableColumns
&&
(
this
.
searchTableColumns
[
this
.
value
.
type
]
!==
undefined
))
{
columnToShow
=
this
.
searchTableColumns
[
this
.
value
.
type
]
==
null
?
[]
:
this
.
searchTableColumns
[
this
.
value
.
type
];
}
col
[
'Check'
]
=
{
name
:
"selected"
,
label
:
"Select"
,
...
...
@@ -787,6 +787,28 @@ define(['require',
}
})
};
col
[
'Namespaces'
]
=
{
label
:
"Namespaces"
,
cell
:
"Html"
,
editable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
_
.
contains
(
columnToShow
,
'namespace'
),
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
obj
=
model
.
toJSON
(),
namespaceStr
=
''
;
if
(
obj
&&
obj
.
attributes
)
{
_
.
each
(
obj
.
attributes
,
function
(
namespaceValue
,
attributeName
)
{
if
(
attributeName
.
indexOf
(
'.'
)
!=
-
1
)
{
namespaceStr
+=
'<label class="btn btn-action btn-xs btn-blue no-pointer">'
+
attributeName
+
': '
+
namespaceValue
+
'</label>'
;
}
})
return
namespaceStr
;
}
}
})
};
this
.
getTagCol
({
'col'
:
col
,
'columnToShow'
:
columnToShow
});
if
((
!
_
.
contains
([
"glossary"
],
this
.
fromView
)))
{
this
.
getTermCol
({
'col'
:
col
,
'columnToShow'
:
columnToShow
});
...
...
This diff is collapsed.
Click to expand it.
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