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
9abc89bf
Commit
9abc89bf
authored
7 years ago
by
pratik24mac
Committed by
nixonrodrigues
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2272 : UI - Save the state of dragged columns using save search API.
parent
4516418b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
19 deletions
+61
-19
search.scss
dashboardv2/public/css/scss/search.scss
+9
-0
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+26
-12
Enums.js
dashboardv2/public/js/utils/Enums.js
+3
-0
SearchLayoutView.js
dashboardv2/public/js/views/search/SearchLayoutView.js
+1
-1
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+21
-5
SaveSearchView.js
dashboardv2/public/js/views/search/save/SaveSearchView.js
+1
-1
No files found.
dashboardv2/public/css/scss/search.scss
View file @
9abc89bf
...
@@ -112,9 +112,18 @@ $color_celeste_approx: #1D1F2B;
...
@@ -112,9 +112,18 @@ $color_celeste_approx: #1D1F2B;
}
}
}
}
}
}
.table-responsive
{
position
:
relative
;
}
.sindu_dragger
{
.sindu_dragger
{
@extend
.gu-mirror
;
@extend
.gu-mirror
;
&
.sindu_column
{
li
{
float
:
none
!
important
;
display
:
table-cell
!
important
;
}
}
.gu-transit
{
.gu-transit
{
box-shadow
:
0px
1px
15px
inset
;
box-shadow
:
0px
1px
15px
inset
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
9abc89bf
...
@@ -296,26 +296,34 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -296,26 +296,34 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
CommonViewFunction
.
generateObjectForSaveSearchApi
=
function
(
options
)
{
CommonViewFunction
.
generateObjectForSaveSearchApi
=
function
(
options
)
{
var
obj
=
{
var
obj
=
{
name
:
options
.
name
,
name
:
options
.
name
,
guid
:
options
.
guid
,
guid
:
options
.
guid
searchParameters
:
{}
};
};
var
value
=
options
.
value
;
var
value
=
options
.
value
;
if
(
value
)
{
if
(
value
)
{
_
.
each
(
Enums
.
extractFromUrlForSearch
,
function
(
v
,
k
)
{
_
.
each
(
Enums
.
extractFromUrlForSearch
,
function
(
svalue
,
skey
)
{
if
(
_
.
isObject
(
svalue
))
{
_
.
each
(
svalue
,
function
(
v
,
k
)
{
var
val
=
value
[
k
];
var
val
=
value
[
k
];
if
(
!
_
.
isUndefinedNull
(
val
))
{
if
(
!
_
.
isUndefinedNull
(
val
))
{
if
(
k
==
"attributes"
)
{
if
(
k
==
"attributes"
)
{
val
=
val
.
split
(
','
);
val
=
val
.
split
(
','
);
}
else
if
(
_
.
contains
([
"tagFilters"
,
"entityFilters"
],
k
))
{
}
else
if
(
_
.
contains
([
"tagFilters"
,
"entityFilters"
],
k
))
{
val
=
CommonViewFunction
.
attributeFilter
.
generateAPIObj
(
val
);
val
=
CommonViewFunction
.
attributeFilter
.
generateAPIObj
(
val
);
}
else
if
(
_
.
contains
([
"includeDE"
,
"excludeST"
,
"excludeSC"
],
k
))
{
}
else
if
(
_
.
contains
([
"includeDE"
,
"excludeST"
,
"excludeSC"
],
k
))
{
val
=
val
?
false
:
true
;
val
=
val
?
false
:
true
;
}
}
}
}
if
(
_
.
contains
([
"includeDE"
,
"excludeST"
,
"excludeSC"
],
k
))
{
if
(
_
.
contains
([
"includeDE"
,
"excludeST"
,
"excludeSC"
],
k
))
{
val
=
_
.
isUndefinedNull
(
val
)
?
true
:
val
;
val
=
_
.
isUndefinedNull
(
val
)
?
true
:
val
;
}
}
obj
.
searchParameters
[
v
]
=
val
;
if
(
!
obj
[
skey
])
{
obj
[
skey
]
=
{};
}
obj
[
skey
][
v
]
=
val
;
});
}
else
{
obj
[
skey
]
=
value
[
skey
];
}
});
});
return
obj
;
return
obj
;
}
}
...
@@ -326,14 +334,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -326,14 +334,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
entityDefCollection
=
options
.
entityDefCollection
,
entityDefCollection
=
options
.
entityDefCollection
,
obj
=
{};
obj
=
{};
if
(
value
)
{
if
(
value
)
{
_
.
each
(
Enums
.
extractFromUrlForSearch
,
function
(
v
,
k
)
{
_
.
each
(
Enums
.
extractFromUrlForSearch
,
function
(
svalue
,
skey
)
{
var
val
=
value
[
v
];
if
(
_
.
isObject
(
svalue
))
{
_
.
each
(
svalue
,
function
(
v
,
k
)
{
var
val
=
value
[
skey
][
v
];
if
(
!
_
.
isUndefinedNull
(
val
))
{
if
(
!
_
.
isUndefinedNull
(
val
))
{
if
(
k
==
"attributes"
)
{
if
(
k
==
"attributes"
)
{
val
=
val
.
join
(
','
);
val
=
val
.
join
(
','
);
}
else
if
(
k
==
"tagFilters"
)
{
}
else
if
(
k
==
"tagFilters"
)
{
if
(
classificationDefCollection
)
{
if
(
classificationDefCollection
)
{
var
classificationDef
=
classificationDefCollection
.
fullCollection
.
findWhere
({
'name'
:
value
.
classification
})
var
classificationDef
=
classificationDefCollection
.
fullCollection
.
findWhere
({
'name'
:
value
[
skey
]
.
classification
})
attributeDefs
=
Utils
.
getNestedSuperTypeObj
({
attributeDefs
=
Utils
.
getNestedSuperTypeObj
({
collection
:
classificationDefCollection
,
collection
:
classificationDefCollection
,
attrMerge
:
true
,
attrMerge
:
true
,
...
@@ -350,7 +360,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -350,7 +360,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
"value"
:
val
.
criterion
});
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
"value"
:
val
.
criterion
});
}
else
if
(
k
==
"entityFilters"
)
{
}
else
if
(
k
==
"entityFilters"
)
{
if
(
entityDefCollection
)
{
if
(
entityDefCollection
)
{
var
entityDef
=
entityDefCollection
.
fullCollection
.
findWhere
({
'name'
:
value
.
typeName
}),
var
entityDef
=
entityDefCollection
.
fullCollection
.
findWhere
({
'name'
:
value
[
skey
]
.
typeName
}),
attributeDefs
=
Utils
.
getNestedSuperTypeObj
({
attributeDefs
=
Utils
.
getNestedSuperTypeObj
({
collection
:
entityDefCollection
,
collection
:
entityDefCollection
,
attrMerge
:
true
,
attrMerge
:
true
,
...
@@ -365,12 +375,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -365,12 +375,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
});
});
}
}
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
"value"
:
val
.
criterion
});
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
({
"value"
:
val
.
criterion
});
}
else
if
(
_
.
contains
([
"includeDE"
,
"excludeST"
,
"excludeSC"
],
k
))
{
}
else
if
(
_
.
contains
([
"includeDE"
,
"excludeST"
,
"excludeSC"
],
k
))
{
val
=
val
?
false
:
true
;
val
=
val
?
false
:
true
;
}
}
}
}
obj
[
k
]
=
val
;
obj
[
k
]
=
val
;
});
});
}
else
{
obj
[
skey
]
=
value
[
skey
];
}
});
return
obj
;
return
obj
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/Enums.js
View file @
9abc89bf
...
@@ -57,6 +57,7 @@ define(['require'], function(require) {
...
@@ -57,6 +57,7 @@ define(['require'], function(require) {
'annual'
:
"Annual Distribution"
'annual'
:
"Annual Distribution"
}
}
Enums
.
extractFromUrlForSearch
=
{
Enums
.
extractFromUrlForSearch
=
{
"searchParameters"
:
{
"pageLimit"
:
"limit"
,
"pageLimit"
:
"limit"
,
"type"
:
"typeName"
,
"type"
:
"typeName"
,
"tag"
:
"classification"
,
"tag"
:
"classification"
,
...
@@ -68,6 +69,8 @@ define(['require'], function(require) {
...
@@ -68,6 +69,8 @@ define(['require'], function(require) {
"tagFilters"
:
"tagFilters"
,
"tagFilters"
:
"tagFilters"
,
"entityFilters"
:
"entityFilters"
,
"entityFilters"
:
"entityFilters"
,
"attributes"
:
"attributes"
"attributes"
:
"attributes"
},
"uiParameters"
:
"uiParameters"
}
}
return
Enums
;
return
Enums
;
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/SearchLayoutView.js
View file @
9abc89bf
...
@@ -161,7 +161,7 @@ define(['require',
...
@@ -161,7 +161,7 @@ define(['require',
},
},
applyValue
:
function
(
model
,
searchType
)
{
applyValue
:
function
(
model
,
searchType
)
{
that
.
manualRender
(
_
.
extend
(
searchType
,
CommonViewFunction
.
generateUrlFromSaveSearchObject
({
that
.
manualRender
(
_
.
extend
(
searchType
,
CommonViewFunction
.
generateUrlFromSaveSearchObject
({
value
:
model
.
get
(
'searchParameters'
)
,
value
:
{
"searchParameters"
:
model
.
get
(
'searchParameters'
),
'uiParameters'
:
model
.
get
(
'uiParameters'
)
}
,
classificationDefCollection
:
that
.
classificationDefCollection
,
classificationDefCollection
:
that
.
classificationDefCollection
,
entityDefCollection
:
that
.
entityDefCollection
entityDefCollection
:
that
.
entityDefCollection
})));
})));
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
9abc89bf
...
@@ -211,6 +211,7 @@ define(['require',
...
@@ -211,6 +211,7 @@ define(['require',
this
.
ui
.
columnEmptyInfo
.
hide
();
this
.
ui
.
columnEmptyInfo
.
hide
();
}
}
}
}
this
.
columnOrder
=
this
.
getColumnOrder
(
this
.
REntityTableLayoutView
.
$el
.
find
(
'.colSort th.renderable'
));
this
.
triggerUrl
();
this
.
triggerUrl
();
var
attributes
=
this
.
searchCollection
.
filterObj
.
attributes
;
var
attributes
=
this
.
searchCollection
.
filterObj
.
attributes
;
if
((
excludeDefaultColumn
&&
attributes
)
&&
(
excludeDefaultColumn
.
length
>
attributes
.
length
||
_
.
difference
(
excludeDefaultColumn
,
attributes
).
length
))
{
if
((
excludeDefaultColumn
&&
attributes
)
&&
(
excludeDefaultColumn
.
length
>
attributes
.
length
||
_
.
difference
(
excludeDefaultColumn
,
attributes
).
length
))
{
...
@@ -297,10 +298,16 @@ define(['require',
...
@@ -297,10 +298,16 @@ define(['require',
}
}
}
}
},
},
getColumnOrderWithPosition
:
function
()
{
var
that
=
this
;
return
_
.
map
(
that
.
columnOrder
,
function
(
value
,
key
)
{
return
key
+
"::"
+
value
;
}).
join
(
","
);
},
triggerUrl
:
function
(
options
)
{
triggerUrl
:
function
(
options
)
{
Utils
.
setUrl
(
_
.
extend
({
Utils
.
setUrl
(
_
.
extend
({
url
:
Utils
.
getUrlState
.
getQueryUrl
().
queyParams
[
0
],
url
:
Utils
.
getUrlState
.
getQueryUrl
().
queyParams
[
0
],
urlParams
:
this
.
value
,
urlParams
:
this
.
columnOrder
?
_
.
extend
(
this
.
value
,
{
'uiParameters'
:
this
.
getColumnOrderWithPosition
()
})
:
this
.
value
,
mergeBrowserUrl
:
false
,
mergeBrowserUrl
:
false
,
trigger
:
false
,
trigger
:
false
,
updateTabState
:
true
updateTabState
:
true
...
@@ -502,6 +509,11 @@ define(['require',
...
@@ -502,6 +509,11 @@ define(['require',
var
that
=
this
;
var
that
=
this
;
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
// displayOrder added for column manager
// displayOrder added for column manager
if
(
that
.
value
.
uiParameters
)
{
var
savedColumnOrder
=
_
.
object
(
that
.
value
.
uiParameters
.
split
(
','
).
map
(
function
(
a
)
{
return
a
.
split
(
'::'
);
}));
// get Column position from string to object
}
var
columnCollection
=
Backgrid
.
Columns
.
extend
({
var
columnCollection
=
Backgrid
.
Columns
.
extend
({
sortKey
:
"displayOrder"
,
sortKey
:
"displayOrder"
,
comparator
:
function
(
item
)
{
comparator
:
function
(
item
)
{
...
@@ -509,24 +521,28 @@ define(['require',
...
@@ -509,24 +521,28 @@ define(['require',
},
},
setPositions
:
function
()
{
setPositions
:
function
()
{
_
.
each
(
this
.
models
,
function
(
model
,
index
)
{
_
.
each
(
this
.
models
,
function
(
model
,
index
)
{
model
.
set
(
"displayOrder"
,
(
that
.
columnOrder
==
null
?
index
:
that
.
columnOrder
[
model
.
get
(
'label'
)]
)
+
1
,
{
silent
:
true
});
model
.
set
(
"displayOrder"
,
(
savedColumnOrder
==
null
?
index
:
parseInt
(
savedColumnOrder
[
model
.
get
(
'label'
)])
)
+
1
,
{
silent
:
true
});
});
});
return
this
;
return
this
;
}
}
});
});
var
columns
=
new
columnCollection
((
that
.
searchCollection
.
dynamicTable
?
that
.
getDaynamicColumns
(
that
.
searchCollection
.
toJSON
())
:
that
.
getFixedDslColumn
()));
var
columns
=
new
columnCollection
((
that
.
searchCollection
.
dynamicTable
?
that
.
getDaynamicColumns
(
that
.
searchCollection
.
toJSON
())
:
that
.
getFixedDslColumn
()));
columns
.
setPositions
().
sort
();
columns
.
setPositions
().
sort
();
that
.
REntityTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
var
table
=
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
columns
:
columns
columns
:
columns
})));
}));
that
.
REntityTableLayoutView
.
show
(
table
);
if
(
that
.
value
.
searchType
!==
"dsl"
)
{
if
(
that
.
value
.
searchType
!==
"dsl"
)
{
that
.
ui
.
containerCheckBox
.
show
();
that
.
ui
.
containerCheckBox
.
show
();
}
else
{
}
else
{
that
.
ui
.
containerCheckBox
.
hide
();
that
.
ui
.
containerCheckBox
.
hide
();
}
}
that
.
$
(
".ellipsis .inputAssignTag"
).
hide
();
that
.
$
(
".ellipsis .inputAssignTag"
).
hide
();
table
.
trigger
(
"grid:refresh"
);
/*Event fire when table rendered*/
tableDragger
(
document
.
querySelector
(
".colSort"
)).
on
(
'drop'
,
function
(
from
,
to
,
el
)
{
tableDragger
(
document
.
querySelector
(
".colSort"
)).
on
(
'drop'
,
function
(
from
,
to
,
el
)
{
that
.
columnOrder
=
that
.
getColumnOrder
(
el
.
querySelectorAll
(
'th'
));
that
.
columnOrder
=
that
.
getColumnOrder
(
el
.
querySelectorAll
(
'th.renderable'
));
table
.
trigger
(
"grid:refresh:update"
);
that
.
triggerUrl
();
});
});
that
.
checkTableFetch
();
that
.
checkTableFetch
();
});
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/save/SaveSearchView.js
View file @
9abc89bf
...
@@ -147,7 +147,7 @@ define(['require',
...
@@ -147,7 +147,7 @@ define(['require',
if
(
options
&&
options
.
model
)
{
if
(
options
&&
options
.
model
)
{
var
searchParameters
=
options
.
model
.
toJSON
().
searchParameters
,
var
searchParameters
=
options
.
model
.
toJSON
().
searchParameters
,
params
=
CommonViewFunction
.
generateUrlFromSaveSearchObject
({
params
=
CommonViewFunction
.
generateUrlFromSaveSearchObject
({
value
:
searchParameters
,
value
:
{
"searchParameters"
:
searchParameters
,
"uiParameters"
:
options
.
model
.
get
(
'uiParameters'
)}
,
classificationDefCollection
:
this
.
classificationDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
,
entityDefCollection
:
this
.
entityDefCollection
entityDefCollection
:
this
.
entityDefCollection
});
});
...
...
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