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
a6fdfbb7
Commit
a6fdfbb7
authored
7 years ago
by
pratik pandey
Committed by
Madhan Neethiraj
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2285 : UI fix in handling of date attributes during saved searche rename
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
d569e538
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+20
-18
QueryBuilderView.js
dashboardv2/public/js/views/search/QueryBuilderView.js
+1
-1
SearchLayoutView.js
dashboardv2/public/js/views/search/SearchLayoutView.js
+1
-1
No files found.
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
a6fdfbb7
...
...
@@ -259,8 +259,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
return
'<div class="tagList btn-inline btn-fixed-width">'
+
atags
+
addTag
+
'</div>'
;
}
CommonViewFunction
.
generateQueryOfFilter
=
function
(
value
)
{
var
entityFilters
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
value
.
entityFilters
),
tagFilters
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
value
.
tagFilters
),
var
entityFilters
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
{
"value"
:
value
.
entityFilters
,
"formatDate"
:
true
}
),
tagFilters
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
{
"value"
:
value
.
tagFilters
,
"formatDate"
:
true
}
),
queryArray
=
[],
objToString
=
function
(
filterObj
)
{
var
tempObj
=
[];
...
...
@@ -348,14 +348,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
_
.
each
(
val
.
criterion
,
function
(
obj
)
{
var
attributeDef
=
_
.
findWhere
(
attributeDefs
,
{
'name'
:
obj
.
attributeName
});
if
(
attributeDef
)
{
if
(
attributeDef
.
typeName
==
"date"
)
{
obj
.
attributeValue
=
moment
(
parseInt
(
obj
.
attributeValue
)).
format
(
'MM/DD/YYYY h:mm A'
);
}
obj
.
attributeValue
=
obj
.
attributeValue
;
obj
[
'attributeType'
]
=
attributeDef
.
typeName
;
}
});
}
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
val
.
criterion
);
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
{
"value"
:
val
.
criterion
}
);
}
else
if
(
k
==
"entityFilters"
)
{
if
(
entityDefCollection
)
{
var
entityDef
=
entityDefCollection
.
fullCollection
.
findWhere
({
'name'
:
value
.
typeName
}),
...
...
@@ -367,14 +365,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
_
.
each
(
val
.
criterion
,
function
(
obj
)
{
var
attributeDef
=
_
.
findWhere
(
attributeDefs
,
{
'name'
:
obj
.
attributeName
});
if
(
attributeDef
)
{
if
(
attributeDef
.
typeName
==
"date"
)
{
obj
.
attributeValue
=
moment
(
parseInt
(
obj
.
attributeValue
)).
format
(
'MM/DD/YYYY h:mm A'
);
}
obj
.
attributeValue
=
obj
.
attributeValue
;
obj
[
'attributeType'
]
=
attributeDef
.
typeName
;
}
});
}
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
val
.
criterion
);
val
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
{
"value"
:
val
.
criterion
}
);
}
else
if
(
k
==
"includeDE"
)
{
if
(
val
)
{
val
=
false
;
...
...
@@ -389,12 +385,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
}
CommonViewFunction
.
attributeFilter
=
{
generateUrl
:
function
(
attrObj
)
{
var
attrQuery
=
[];
generateUrl
:
function
(
options
)
{
var
attrQuery
=
[],
attrObj
=
options
.
value
,
formatedDateToLong
=
options
.
formatedDateToLong
;
if
(
attrObj
)
{
_
.
each
(
attrObj
,
function
(
obj
)
{
var
url
=
[(
obj
.
id
||
obj
.
attributeName
),
mapApiOperatorToUI
(
obj
.
operator
),
_
.
trim
(
obj
.
value
||
obj
.
attributeValue
)],
type
=
(
obj
.
type
||
obj
.
attributeType
);
var
type
=
(
obj
.
type
||
obj
.
attributeType
),
value
=
_
.
trim
(
obj
.
value
||
obj
.
attributeValue
),
url
=
[(
obj
.
id
||
obj
.
attributeName
),
mapApiOperatorToUI
(
obj
.
operator
),
(
type
===
'date'
&&
formatedDateToLong
?
Date
.
parse
(
value
)
:
value
)];
if
(
type
)
{
url
.
push
(
type
);
}
...
...
@@ -436,8 +435,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
return
oper
;
}
},
extractUrl
:
function
(
urlObj
)
{
var
attrObj
=
[];
extractUrl
:
function
(
options
)
{
var
attrObj
=
[],
urlObj
=
options
.
value
,
formatDate
=
options
.
formatDate
;
if
(
urlObj
&&
urlObj
.
length
)
{
_
.
each
(
urlObj
.
split
(
":,:"
),
function
(
obj
)
{
var
temp
=
obj
.
split
(
"::"
);
...
...
@@ -445,6 +446,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if
(
temp
[
3
])
{
finalObj
[
'type'
]
=
temp
[
3
];
}
finalObj
.
value
=
finalObj
.
type
===
'date'
&&
formatDate
?
moment
(
parseInt
(
finalObj
.
value
)).
format
(
'MM/DD/YYYY h:mm A'
)
:
finalObj
.
value
;
attrObj
.
push
(
finalObj
);
});
return
attrObj
;
...
...
@@ -456,7 +458,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if
(
url
&&
url
.
length
)
{
var
parsObj
=
{
"condition"
:
'AND'
,
"criterion"
:
convertKeyAndExtractObj
(
this
.
extractUrl
(
url
))
"criterion"
:
convertKeyAndExtractObj
(
this
.
extractUrl
(
{
"value"
:
url
}
))
}
return
parsObj
;
}
else
{
...
...
@@ -470,7 +472,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
tempObj
=
{
"attributeName"
:
rulObj
.
id
,
"operator"
:
mapUiOperatorToAPI
(
rulObj
.
operator
),
"attributeValue"
:
_
.
trim
(
rulObj
.
type
===
"date"
?
Date
.
parse
(
rulObj
.
value
)
:
rulObj
.
value
)
"attributeValue"
:
_
.
trim
(
rulObj
.
value
)
}
convertObj
.
push
(
tempObj
);
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/QueryBuilderView.js
View file @
a6fdfbb7
...
...
@@ -137,7 +137,7 @@ define(['require',
var
that
=
this
,
filters
=
[];
if
(
this
.
value
)
{
var
rules_widgets
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
this
.
searchTableFilters
[
this
.
filterType
][(
this
.
tag
?
this
.
value
.
tag
:
this
.
value
.
type
)]
);
var
rules_widgets
=
CommonViewFunction
.
attributeFilter
.
extractUrl
(
{
"value"
:
this
.
searchTableFilters
[
this
.
filterType
][(
this
.
tag
?
this
.
value
.
tag
:
this
.
value
.
type
)],
"formatDate"
:
true
}
);
}
_
.
each
(
this
.
attrObj
,
function
(
obj
)
{
var
returnObj
=
that
.
getObjDef
(
obj
,
rules_widgets
);
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/SearchLayoutView.js
View file @
a6fdfbb7
...
...
@@ -396,7 +396,7 @@ define(['require',
var
rule
=
queryBuilderRef
.
queryBuilder
(
'getRules'
);
}
if
(
rule
)
{
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
rule
.
rules
);
var
ruleUrl
=
CommonViewFunction
.
attributeFilter
.
generateUrl
(
{
"value"
:
rule
.
rules
,
"formatedDateToLong"
:
true
}
);
this
.
searchTableFilters
[
filtertype
][(
isTag
?
this
.
value
.
tag
:
this
.
value
.
type
)]
=
ruleUrl
;
this
.
makeFilterButtonActive
(
filtertype
);
if
(
!
isTag
&&
this
.
value
&&
this
.
value
.
type
&&
this
.
searchTableColumns
)
{
...
...
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