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
506ffc97
Commit
506ffc97
authored
Mar 12, 2020
by
kevalbhatt
Committed by
nixonrodrigues
Mar 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3662 : UI: Business Metadata validation improvements
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
2e69f922
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
181 additions
and
376 deletions
+181
-376
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+3
-2
common.scss
dashboardv3/public/css/scss/common.scss
+10
-0
BusinessMetadataAttributeItemView_tmpl.html
...ness_metadata/BusinessMetadataAttributeItemView_tmpl.html
+3
-3
CreateBusinessMetadataLayoutView_tmpl.html
...iness_metadata/CreateBusinessMetadataLayoutView_tmpl.html
+1
-1
BusinessMetadataAttrTableLayoutView.js
.../business_metadata/BusinessMetadataAttrTableLayoutView.js
+0
-1
BusinessMetadataAttributeItemView.js
...ws/business_metadata/BusinessMetadataAttributeItemView.js
+36
-31
BusinessMetadataContainerLayoutView.js
.../business_metadata/BusinessMetadataContainerLayoutView.js
+1
-27
BusinessMetadataDetailLayoutView.js
...ews/business_metadata/BusinessMetadataDetailLayoutView.js
+4
-8
BusinessMetadataTableLayoutView.js
...iews/business_metadata/BusinessMetadataTableLayoutView.js
+9
-29
CreateBusinessMetadataLayoutView.js
...ews/business_metadata/CreateBusinessMetadataLayoutView.js
+104
-259
EnumCreateUpdateItemView.js
...ic/js/views/business_metadata/EnumCreateUpdateItemView.js
+4
-10
SearchResultLayoutView.js
dashboardv3/public/js/views/search/SearchResultLayoutView.js
+6
-5
No files found.
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
506ffc97
...
@@ -157,6 +157,7 @@ define(['require',
...
@@ -157,6 +157,7 @@ define(['require',
this
.
multiSelectEntity
=
[];
this
.
multiSelectEntity
=
[];
this
.
searchType
=
'Basic Search'
;
this
.
searchType
=
'Basic Search'
;
this
.
columnOrder
=
null
;
this
.
columnOrder
=
null
;
this
.
defaultColumns
=
[
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
];
if
(
this
.
value
)
{
if
(
this
.
value
)
{
if
(
this
.
value
.
searchType
&&
this
.
value
.
searchType
==
'dsl'
)
{
if
(
this
.
value
.
searchType
&&
this
.
value
.
searchType
==
'dsl'
)
{
this
.
searchType
=
'Advanced Search'
;
this
.
searchType
=
'Advanced Search'
;
...
@@ -221,7 +222,7 @@ define(['require',
...
@@ -221,7 +222,7 @@ define(['require',
this
.
updateColumnList
(
state
);
this
.
updateColumnList
(
state
);
var
excludeDefaultColumn
=
[];
var
excludeDefaultColumn
=
[];
if
(
this
.
value
&&
this
.
value
.
type
)
{
if
(
this
.
value
&&
this
.
value
.
type
)
{
excludeDefaultColumn
=
_
.
without
(
this
.
searchTableColumns
[
this
.
value
.
type
],
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
);
excludeDefaultColumn
=
_
.
difference
(
this
.
searchTableColumns
[
this
.
value
.
type
],
this
.
defaultColumns
);
if
(
this
.
searchTableColumns
[
this
.
value
.
type
]
===
null
)
{
if
(
this
.
searchTableColumns
[
this
.
value
.
type
]
===
null
)
{
this
.
ui
.
columnEmptyInfo
.
show
();
this
.
ui
.
columnEmptyInfo
.
show
();
}
else
{
}
else
{
...
@@ -371,7 +372,7 @@ define(['require',
...
@@ -371,7 +372,7 @@ define(['require',
}
}
if
(
isPostMethod
&&
isSearchTab
)
{
if
(
isPostMethod
&&
isSearchTab
)
{
var
excludeDefaultColumn
=
this
.
value
.
type
&&
this
.
searchTableColumns
?
_
.
without
(
this
.
searchTableColumns
[
this
.
value
.
type
],
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
)
:
null
,
var
excludeDefaultColumn
=
this
.
value
.
type
&&
this
.
searchTableColumns
?
_
.
difference
(
this
.
searchTableColumns
[
this
.
value
.
type
],
this
.
defaultColumns
)
:
null
,
filterObj
=
{
filterObj
=
{
'entityFilters'
:
entityFilters
,
'entityFilters'
:
entityFilters
,
'tagFilters'
:
tagFilters
,
'tagFilters'
:
tagFilters
,
...
...
dashboardv3/public/css/scss/common.scss
View file @
506ffc97
...
@@ -276,4 +276,13 @@ pre {
...
@@ -276,4 +276,13 @@ pre {
margin-bottom
:
5px
;
margin-bottom
:
5px
;
margin-left
:
5px
;
margin-left
:
5px
;
float
:
left
;
float
:
left
;
}
.errorValidate
{
border-color
:
red
!
important
;
}
.errorValidate
+
span
.select2-selection
{
border-color
:
red
!
important
;
}
}
\ No newline at end of file
dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
View file @
506ffc97
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3 required"
for=
"name"
>
Name
</label>
<label
class=
"control-label col-sm-3 required"
for=
"name"
>
Name
</label>
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-8"
>
<input
class=
"form-control attributeInput"
data-id=
"attributeInput"
placeholder=
"Attribute name"
>
<input
class=
"form-control attributeInput
require
"
data-id=
"attributeInput"
placeholder=
"Attribute name"
>
</input>
</input>
</div>
</div>
</div>
</div>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<div
class=
""
>
<div
class=
""
>
<label
class=
"control-label col-sm-3 required"
for=
"enumType"
>
Enum Name
</label>
<label
class=
"control-label col-sm-3 required"
for=
"enumType"
>
Enum Name
</label>
<div
class=
"col-sm-5"
>
<div
class=
"col-sm-5"
>
<select
class=
"form-control enumTypeSelector"
data-id=
"enumTypeSelector"
multiple=
"false"
>
<select
class=
"form-control enumTypeSelector
require
"
data-id=
"enumTypeSelector"
multiple=
"false"
>
</select>
</select>
</div>
</div>
<div
class=
"col-sm-3"
>
<div
class=
"col-sm-3"
>
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
<div
class=
"stringlength-container"
>
<div
class=
"stringlength-container"
>
<label
class=
"control-label col-sm-3 required"
for=
"name"
>
Max length
</label>
<label
class=
"control-label col-sm-3 required"
for=
"name"
>
Max length
</label>
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-8"
>
<input
type=
"number"
class=
"form-control stringLengthVal"
data-id=
"stringLength"
placeholder=
"Maximum length"
>
<input
type=
"number"
class=
"form-control stringLengthVal
require
"
data-id=
"stringLength"
placeholder=
"Maximum length"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
dashboardv3/public/js/templates/business_metadata/CreateBusinessMetadataLayoutView_tmpl.html
View file @
506ffc97
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<label
class=
"control-label col-sm-2 {{#if create}}required{{/if}}"
for=
"name"
>
Name
</label>
<label
class=
"control-label col-sm-2 {{#if create}}required{{/if}}"
for=
"name"
>
Name
</label>
{{#if create}}
{{#if create}}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<input
class=
"form-control businessMetadata-name"
data-id=
"name"
placeholder=
"Name(required)"
autofocus
/>
<input
class=
"form-control businessMetadata-name
require
"
data-id=
"name"
placeholder=
"Name(required)"
autofocus
/>
</div>
</div>
{{else}}
{{else}}
<span
class=
"ellipsis-with-margin control-label text-left col-sm-10"
data-id=
"title"
></span>
{{/if}}
<span
class=
"ellipsis-with-margin control-label text-left col-sm-10"
data-id=
"title"
></span>
{{/if}}
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
View file @
506ffc97
...
@@ -72,7 +72,6 @@ define(['require',
...
@@ -72,7 +72,6 @@ define(['require',
filterOpts
:
{},
filterOpts
:
{},
paginatorOpts
:
{}
paginatorOpts
:
{}
};
};
this
.
isFilters
=
null
;
this
.
showDetails
=
true
;
this
.
showDetails
=
true
;
},
},
onRender
:
function
()
{
onRender
:
function
()
{
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
View file @
506ffc97
...
@@ -17,12 +17,8 @@
...
@@ -17,12 +17,8 @@
*/
*/
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/business_metadata/BusinessMetadataAttributeItemView_tmpl'
,
'hbs!tmpl/business_metadata/BusinessMetadataAttributeItemView_tmpl'
'utils/Utils'
,
],
function
(
require
,
Backbone
,
BusinessMetadataAttributeItemViewTmpl
)
{
'utils/UrlLinks'
,
'utils/Messages'
],
function
(
require
,
Backbone
,
BusinessMetadataAttributeItemViewTmpl
,
Utils
,
UrlLinks
,
Messages
)
{
'use strict'
;
'use strict'
;
return
Backbone
.
Marionette
.
ItemView
.
extend
(
return
Backbone
.
Marionette
.
ItemView
.
extend
(
...
@@ -63,27 +59,35 @@ define(['require',
...
@@ -63,27 +59,35 @@ define(['require',
};
};
events
[
"change "
+
this
.
ui
.
dataTypeSelector
]
=
function
(
e
)
{
events
[
"change "
+
this
.
ui
.
dataTypeSelector
]
=
function
(
e
)
{
var
obj
=
{
options
:
this
.
model
.
get
(
'options'
)
||
{}
};
var
obj
=
{
options
:
this
.
model
.
get
(
'options'
)
||
{}
};
debugger
;
delete
obj
.
enumValues
;
delete
obj
.
enumValues
;
delete
obj
.
options
.
maxStrLength
;
delete
obj
.
options
.
maxStrLength
;
if
(
e
.
target
.
value
.
trim
()
===
'enumeration'
||
e
.
target
.
value
.
trim
()
===
'Enumeration'
)
{
if
(
e
.
target
.
value
.
trim
()
===
'enumeration'
||
e
.
target
.
value
.
trim
()
===
'Enumeration'
)
{
this
.
ui
.
enumTypeSelectorContainer
.
show
();
this
.
ui
.
enumTypeSelectorContainer
.
show
();
this
.
ui
.
enumTypeSelector
.
show
();
this
.
emumTypeSelectDisplay
();
this
.
emumTypeSelectDisplay
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthValue
.
hide
();
}
else
{
}
else
{
obj
.
typeName
=
e
.
target
.
value
.
trim
();
obj
.
typeName
=
e
.
target
.
value
.
trim
();
if
(
e
.
target
.
value
.
trim
()
===
'string'
||
e
.
target
.
value
.
trim
()
===
'String'
)
{
if
(
e
.
target
.
value
.
trim
()
===
'string'
||
e
.
target
.
value
.
trim
()
===
'String'
)
{
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthValue
.
show
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelector
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
obj
.
options
[
"maxStrLength"
]
=
e
.
target
.
value
.
trim
();
obj
.
options
[
"maxStrLength"
]
=
e
.
target
.
value
.
trim
();
}
else
{
}
else
{
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelector
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthValue
.
hide
();
}
}
}
}
this
.
model
.
set
(
obj
);
this
.
model
.
set
(
obj
);
if
(
e
.
target
.
value
.
trim
()
!=
'enumeration'
)
{
this
.
ui
.
multiValueSelectStatus
.
trigger
(
'change'
);
}
};
};
events
[
"change "
+
this
.
ui
.
enumTypeSelector
]
=
function
(
e
)
{
events
[
"change "
+
this
.
ui
.
enumTypeSelector
]
=
function
(
e
)
{
this
.
model
.
set
({
"enumValues"
:
e
.
target
.
value
.
trim
()
});
this
.
model
.
set
({
"enumValues"
:
e
.
target
.
value
.
trim
()
});
...
@@ -138,15 +142,14 @@ define(['require',
...
@@ -138,15 +142,14 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
this
.
parentView
=
options
.
parentView
;
_
.
extend
(
this
,
_
.
pick
(
options
,
"typeHeaders"
,
"businessMetadataDefCollection"
,
"enumDefCollection"
,
"isAttrEdit"
,
"attrDetails"
,
"viewId"
,
"collection"
))
;
this
.
viewId
=
options
.
model
?
options
.
model
.
cid
:
this
.
parentView
.
ci
d
;
this
.
viewId
=
options
.
model
?
options
.
model
.
cid
:
this
.
viewI
d
;
},
},
onRender
:
function
()
{
onRender
:
function
()
{
var
that
=
this
,
var
that
=
this
,
entitytypes
=
''
,
entitytypes
=
''
,
enumTypes
=
[];
enumTypes
=
[];
//this.model.set({ "modalID": this.viewId });
this
.
typeHeaders
.
fullCollection
.
each
(
function
(
model
)
{
this
.
parentView
.
typeHeaders
.
fullCollection
.
each
(
function
(
model
)
{
if
(
model
.
toJSON
().
category
==
"ENTITY"
)
{
if
(
model
.
toJSON
().
category
==
"ENTITY"
)
{
that
.
ui
.
entityTypeSelector
.
append
(
"<option>"
+
model
.
get
(
'name'
)
+
"</option>"
);
that
.
ui
.
entityTypeSelector
.
append
(
"<option>"
+
model
.
get
(
'name'
)
+
"</option>"
);
entitytypes
+=
'<option value="'
+
(
model
.
get
(
'name'
))
+
'" data-name="'
+
(
model
.
get
(
'name'
))
+
'">'
+
model
.
get
(
'name'
)
+
'</option>'
;
entitytypes
+=
'<option value="'
+
(
model
.
get
(
'name'
))
+
'" data-name="'
+
(
model
.
get
(
'name'
))
+
'">'
+
model
.
get
(
'name'
)
+
'</option>'
;
...
@@ -167,24 +170,26 @@ define(['require',
...
@@ -167,24 +170,26 @@ define(['require',
this
.
ui
.
enumValueSelector
.
attr
(
"disabled"
,
"false"
);
// cannot edit the values
this
.
ui
.
enumValueSelector
.
attr
(
"disabled"
,
"false"
);
// cannot edit the values
this
.
emumTypeSelectDisplay
();
this
.
emumTypeSelectDisplay
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelector
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
if
(
this
.
parentView
.
isAttrEdit
)
{
if
(
this
.
isAttrEdit
)
{
this
.
ui
.
close
.
hide
();
this
.
ui
.
close
.
hide
();
this
.
ui
.
createNewEnum
.
hide
();
// cannot add new businessMetadata on edit view
this
.
ui
.
createNewEnum
.
hide
();
// cannot add new businessMetadata on edit view
this
.
ui
.
attributeInput
.
val
(
this
.
parentView
.
attrDetails
.
name
);
this
.
ui
.
attributeInput
.
val
(
this
.
attrDetails
.
name
);
this
.
ui
.
attributeInput
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
attributeInput
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
multiValueSelect
.
hide
();
this
.
ui
.
multiValueSelect
.
hide
();
this
.
ui
.
dataTypeSelector
.
val
(
this
.
parentView
.
attrDetails
.
attrTypeName
);
this
.
ui
.
dataTypeSelector
.
val
(
this
.
attrDetails
.
attrTypeName
);
if
(
this
.
parentView
.
attrDetails
.
attrTypeName
==
"string"
)
{
if
(
this
.
attrDetails
.
attrTypeName
==
"string"
)
{
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthValue
.
val
(
this
.
parentView
.
attrDetails
.
maxStrLength
);
this
.
ui
.
stringLengthValue
.
show
();
this
.
ui
.
stringLengthValue
.
val
(
this
.
attrDetails
.
maxStrLength
);
}
else
{
}
else
{
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthValue
.
hide
();
}
}
_
.
each
(
this
.
attrDetails
.
attrEntityType
,
function
(
valName
)
{
_
.
each
(
this
.
parentView
.
attrDetails
.
attrEntityType
,
function
(
valName
)
{
that
.
ui
.
entityTypeSelector
.
find
(
'option'
).
each
(
function
(
o
)
{
that
.
ui
.
entityTypeSelector
.
find
(
'option'
).
each
(
function
(
o
)
{
var
$el
=
$
(
this
)
var
$el
=
$
(
this
)
if
(
$el
.
data
(
"name"
)
===
valName
)
{
if
(
$el
.
data
(
"name"
)
===
valName
)
{
...
@@ -192,16 +197,16 @@ define(['require',
...
@@ -192,16 +197,16 @@ define(['require',
}
}
})
})
});
});
this
.
ui
.
entityTypeSelector
.
val
(
this
.
parentView
.
attrDetails
.
attrEntityType
).
trigger
(
'change'
);
this
.
ui
.
entityTypeSelector
.
val
(
this
.
attrDetails
.
attrEntityType
).
trigger
(
'change'
);
if
(
this
.
parentView
.
attrDetails
&&
this
.
parentView
.
attrDetails
.
attrTypeName
)
{
if
(
this
.
attrDetails
&&
this
.
attrDetails
.
attrTypeName
)
{
var
typeName
=
this
.
parentView
.
attrDetails
.
attrTypeName
;
var
typeName
=
this
.
attrDetails
.
attrTypeName
;
if
(
typeName
!=
"string"
&&
typeName
!=
"boolean"
&&
typeName
!=
"byte"
&&
typeName
!=
"short"
&&
typeName
!=
"int"
&&
typeName
!=
"float"
&&
typeName
!=
"double"
&&
typeName
!=
"long"
&&
typeName
!=
"date"
)
{
if
(
typeName
!=
"string"
&&
typeName
!=
"boolean"
&&
typeName
!=
"byte"
&&
typeName
!=
"short"
&&
typeName
!=
"int"
&&
typeName
!=
"float"
&&
typeName
!=
"double"
&&
typeName
!=
"long"
&&
typeName
!=
"date"
)
{
this
.
ui
.
enumTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
enumTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
val
(
"enumeration"
).
trigger
(
'change'
);
this
.
ui
.
dataTypeSelector
.
val
(
"enumeration"
).
trigger
(
'change'
);
this
.
ui
.
enumTypeSelector
.
val
(
typeName
).
trigger
(
'change'
);
this
.
ui
.
enumTypeSelector
.
val
(
typeName
).
trigger
(
'change'
);
}
}
}
}
if
(
this
.
parentView
.
attrDetails
&&
this
.
parentView
.
attrDetails
.
multiValued
)
{
if
(
this
.
attrDetails
&&
this
.
attrDetails
.
multiValued
)
{
this
.
ui
.
multiValueSelect
.
show
();
this
.
ui
.
multiValueSelect
.
show
();
$
(
this
.
ui
.
multiValueSelectStatus
).
prop
(
'checked'
,
true
).
trigger
(
'change'
);
$
(
this
.
ui
.
multiValueSelectStatus
).
prop
(
'checked'
,
true
).
trigger
(
'change'
);
this
.
ui
.
multiValueSelectStatus
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
multiValueSelectStatus
.
attr
(
"disabled"
,
"false"
);
...
@@ -211,7 +216,7 @@ define(['require',
...
@@ -211,7 +216,7 @@ define(['require',
showEnumValues
:
function
(
enumName
)
{
showEnumValues
:
function
(
enumName
)
{
var
enumValues
=
''
,
var
enumValues
=
''
,
selectedValues
=
[],
selectedValues
=
[],
selectedEnum
=
this
.
parentView
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnum
=
this
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
'elementDefs'
)
:
null
,
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
'elementDefs'
)
:
null
,
savedValues
=
[];
savedValues
=
[];
_
.
each
(
selectedEnumValues
,
function
(
enumVal
,
index
)
{
_
.
each
(
selectedEnumValues
,
function
(
enumVal
,
index
)
{
...
@@ -231,7 +236,7 @@ define(['require',
...
@@ -231,7 +236,7 @@ define(['require',
},
},
emumTypeSelectDisplay
:
function
()
{
emumTypeSelectDisplay
:
function
()
{
var
enumTypes
=
''
;
var
enumTypes
=
''
;
this
.
parentView
.
enumDefCollection
.
fullCollection
.
each
(
function
(
model
,
index
)
{
this
.
enumDefCollection
.
fullCollection
.
each
(
function
(
model
,
index
)
{
enumTypes
+=
"<option>"
+
_
.
escape
(
model
.
get
(
'name'
))
+
"</option>"
;
enumTypes
+=
"<option>"
+
_
.
escape
(
model
.
get
(
'name'
))
+
"</option>"
;
});
});
this
.
ui
.
enumTypeSelector
.
empty
();
this
.
ui
.
enumTypeSelector
.
empty
();
...
@@ -255,14 +260,14 @@ define(['require',
...
@@ -255,14 +260,14 @@ define(['require',
},
},
closeModal
:
function
()
{
closeModal
:
function
()
{
modal
.
trigger
(
"cancel"
);
modal
.
trigger
(
"cancel"
);
that
.
parentView
.
enumDefCollection
.
fetch
({
that
.
enumDefCollection
.
fetch
({
success
:
function
()
{
success
:
function
()
{
that
.
ui
.
enumTypeSelector
.
val
(
that
.
model
.
get
(
'typeName'
)).
trigger
(
'change'
);
that
.
ui
.
enumTypeSelector
.
val
(
that
.
model
.
get
(
'typeName'
)).
trigger
(
'change'
);
}
}
});
});
},
},
enumDefCollection
:
that
.
parentView
.
enumDefCollection
,
enumDefCollection
:
that
.
enumDefCollection
,
businessMetadataDefCollection
:
that
.
parentView
.
options
.
businessMetadataDefCollection
businessMetadataDefCollection
:
that
.
businessMetadataDefCollection
}),
}),
modal
=
new
Modal
({
modal
=
new
Modal
({
title
:
"Create/ Update Enum"
,
title
:
"Create/ Update Enum"
,
...
@@ -279,12 +284,12 @@ define(['require',
...
@@ -279,12 +284,12 @@ define(['require',
});
});
},
},
onCloseButton
:
function
()
{
onCloseButton
:
function
()
{
var
tagName
=
this
.
parentView
.
$el
.
find
(
'[data-id="tagName"]'
).
val
();
var
tagName
=
this
.
$el
.
find
(
'[data-id="tagName"]'
).
val
();
if
(
this
.
parentView
.
collection
.
models
.
length
>
0
)
{
if
(
this
.
collection
.
models
.
length
>
0
)
{
this
.
model
.
destroy
();
this
.
model
.
destroy
();
}
}
if
(
this
.
parentView
.
collection
.
models
.
length
==
0
&&
tagName
!=
""
)
{
if
(
this
.
collection
.
models
.
length
==
0
&&
tagName
!=
""
)
{
this
.
parentView
.
$el
.
parent
().
next
().
find
(
'button.ok'
).
removeAttr
(
"disabled"
);
this
.
$el
.
parent
().
next
().
find
(
'button.ok'
).
removeAttr
(
"disabled"
);
}
}
}
}
});
});
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataContainerLayoutView.js
View file @
506ffc97
...
@@ -47,33 +47,7 @@ define([
...
@@ -47,33 +47,7 @@ define([
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
options
);
_
.
extend
(
this
,
options
);
},
},
bindEvents
:
function
()
{
bindEvents
:
function
()
{},
// this.listenTo(this.businessMetadataDefCollection, 'reset', function() {
// if (!this.model) {
// this.model = this.businessMetadataDefCollection.fullCollection.findWhere({ guid: this.guid });
// if (this.model) {
// this.renderTagDetail();
// } else {
// this.$('.fontLoader').hide();
// Utils.notifyError({
// content: 'Tag Not Found'
// });
// }
// }
// }, this);
// this.listenTo(this.collection, 'error', function(error, response) {
// if (response.responseJSON && response.responseJSON.error) {
// Utils.notifyError({
// content: response.responseJSON.error
// });
// } else {
// Utils.notifyError({
// content: 'Something went wrong'
// });
// }
// this.$('.fontLoader').hide();
// }, this);
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
updateView
();
this
.
updateView
();
},
},
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataDetailLayoutView.js
View file @
506ffc97
...
@@ -32,10 +32,7 @@ define(['require',
...
@@ -32,10 +32,7 @@ define(['require',
/** ui selector cache */
/** ui selector cache */
ui
:
{
ui
:
{
title
:
'[data-id="title"]'
,
title
:
'[data-id="title"]'
,
editBox
:
'[data-id="editBox"]'
,
saveButton
:
"[data-id='saveButton']"
,
description
:
'[data-id="description"]'
,
description
:
'[data-id="description"]'
,
publishButton
:
'[data-id="publishButton"]'
,
backButton
:
'[data-id="backButton"]'
backButton
:
'[data-id="backButton"]'
},
},
/** ui events hash */
/** ui events hash */
...
@@ -51,16 +48,15 @@ define(['require',
...
@@ -51,16 +48,15 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'
guid'
,
'model'
,
'enumDefCollection'
,
'typeHeaders
'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'
model
'
));
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
renderDetail
();
this
.
renderDetail
();
},
},
renderDetail
:
function
()
{
renderDetail
:
function
()
{
var
that
=
this
;
this
.
ui
.
title
.
html
(
'<span>'
+
this
.
model
.
get
(
'name'
)
+
'</span>'
);
this
.
ui
.
title
.
html
(
'<span>'
+
that
.
model
.
get
(
'name'
)
+
'</span>'
);
if
(
this
.
model
.
get
(
'description'
))
{
if
(
that
.
model
.
get
(
'description'
))
{
this
.
ui
.
description
.
text
((
this
.
model
.
get
(
'description'
)));
this
.
ui
.
description
.
text
((
that
.
model
.
get
(
'description'
)));
}
}
}
}
});
});
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
View file @
506ffc97
...
@@ -19,14 +19,9 @@
...
@@ -19,14 +19,9 @@
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/business_metadata/BusinessMetadataTableLayoutView_tmpl'
,
'hbs!tmpl/business_metadata/BusinessMetadataTableLayoutView_tmpl'
,
'collection/VEntityList'
,
'models/VSearch'
,
'utils/Utils'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Messages'
'utils/Enums'
,
],
function
(
require
,
Backbone
,
BusinessMetadataTableLayoutView_tmpl
,
Utils
,
Messages
)
{
'utils/UrlLinks'
,
'utils/CommonViewFunction'
],
function
(
require
,
Backbone
,
BusinessMetadataTableLayoutView_tmpl
,
VEntityList
,
VSearch
,
Utils
,
Messages
,
Enums
,
UrlLinks
,
CommonViewFunction
)
{
'use strict'
;
'use strict'
;
var
BusinessMetadataTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
BusinessMetadataTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
...
@@ -47,18 +42,12 @@ define(['require',
...
@@ -47,18 +42,12 @@ define(['require',
businessMetadataAttrPage
:
"[data-id='businessMetadataAttrPage']"
,
businessMetadataAttrPage
:
"[data-id='businessMetadataAttrPage']"
,
businessMetadataAttrPageTitle
:
"[data-id='businessMetadataAttrPageTitle']"
,
businessMetadataAttrPageTitle
:
"[data-id='businessMetadataAttrPageTitle']"
,
businessMetadataDetailPage
:
"[data-id='businessMetadataDetailPage']"
,
businessMetadataDetailPage
:
"[data-id='businessMetadataDetailPage']"
,
auditCreate
:
"[data-id='auditCreate']"
,
pageRecordText
:
"[data-id='pageRecordText']"
,
activePage
:
"[data-id='activePage']"
,
createBusinessMetadata
:
"[data-id='createBusinessMetadata']"
,
createBusinessMetadata
:
"[data-id='createBusinessMetadata']"
,
attributeEdit
:
"[data-id='attributeEdit']"
,
attributeEdit
:
"[data-id='attributeEdit']"
,
addAttribute
:
'[data-id="addAttribute"]'
,
addAttribute
:
'[data-id="addAttribute"]'
,
businessMetadataAttrPageOk
:
'[data-id="businessMetadataAttrPageOk"]'
,
businessMetadataAttrPageOk
:
'[data-id="businessMetadataAttrPageOk"]'
,
colManager
:
"[data-id='colManager']"
,
colManager
:
"[data-id='colManager']"
,
deleteBusinessMetadata
:
'[data-id="deleteBusinessMetadata"]'
,
deleteBusinessMetadata
:
'[data-id="deleteBusinessMetadata"]'
businessMetadataAttrFontLoader
:
'.business-metadata-attr-fontLoader'
,
businessMetadataAttrTableOverlay
:
'.businessMetadata-attr-tableOverlay'
},
},
/** ui events hash */
/** ui events hash */
events
:
function
()
{
events
:
function
()
{
...
@@ -80,9 +69,6 @@ define(['require',
...
@@ -80,9 +69,6 @@ define(['require',
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'typeHeaders'
,
'businessMetadataDefCollection'
,
'entityDefCollection'
,
'businessMetadataAttr'
,
'selectedBusinessMetadata'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'typeHeaders'
,
'businessMetadataDefCollection'
,
'entityDefCollection'
,
'businessMetadataAttr'
,
'selectedBusinessMetadata'
));
this
.
limit
=
10
;
this
.
limit
=
10
;
this
.
offset
=
0
;
this
.
pervOld
=
[];
this
.
onlyPurge
=
true
;
this
.
newAttr
=
false
;
this
.
newAttr
=
false
;
this
.
commonTableOptions
=
{
this
.
commonTableOptions
=
{
collection
:
this
.
businessMetadataDefCollection
,
collection
:
this
.
businessMetadataDefCollection
,
...
@@ -111,8 +97,6 @@ define(['require',
...
@@ -111,8 +97,6 @@ define(['require',
filterOpts
:
{},
filterOpts
:
{},
paginatorOpts
:
{}
paginatorOpts
:
{}
};
};
this
.
currPage
=
1
;
this
.
isFilters
=
null
;
this
.
guid
=
null
;
this
.
guid
=
null
;
this
.
showDetails
=
true
;
// toggle between sttribute page and detail page
this
.
showDetails
=
true
;
// toggle between sttribute page and detail page
},
},
...
@@ -225,11 +209,10 @@ define(['require',
...
@@ -225,11 +209,10 @@ define(['require',
that
.
toggleBusinessMetadataDetailsAttrView
();
that
.
toggleBusinessMetadataDetailsAttrView
();
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
},
},
tag
Collection
:
that
.
businessMetadataDefCollection
,
businessMetadataDef
Collection
:
that
.
businessMetadataDefCollection
,
enumDefCollection
:
enumDefCollection
,
enumDefCollection
:
enumDefCollection
,
typeHeaders
:
typeHeaders
,
typeHeaders
:
typeHeaders
,
isNewBusinessMetadata
:
isNewBusinessMetadata
,
isNewBusinessMetadata
:
isNewBusinessMetadata
businessMetadataDefCollection
:
businessMetadataDefCollection
});
});
that
.
RModal
.
show
(
that
.
view
);
that
.
RModal
.
show
(
that
.
view
);
});
});
...
@@ -272,7 +255,6 @@ define(['require',
...
@@ -272,7 +255,6 @@ define(['require',
var
applicableEntityTypes
=
''
,
var
applicableEntityTypes
=
''
,
typeName
=
attrObj
.
typeName
;
typeName
=
attrObj
.
typeName
;
if
(
attrObj
.
options
&&
attrObj
.
options
.
applicableEntityTypes
)
{
if
(
attrObj
.
options
&&
attrObj
.
options
.
applicableEntityTypes
)
{
// attrEntityTypes = JSON.parse(attrObj.options.applicableEntityTypes).join(', ');
var
entityTypes
=
JSON
.
parse
(
attrObj
.
options
.
applicableEntityTypes
);
var
entityTypes
=
JSON
.
parse
(
attrObj
.
options
.
applicableEntityTypes
);
_
.
each
(
entityTypes
,
function
(
values
)
{
_
.
each
(
entityTypes
,
function
(
values
)
{
applicableEntityTypes
+=
'<label class="btn btn-action btn-xs btn-blue no-pointer">'
+
values
+
'</label>'
;
applicableEntityTypes
+=
'<label class="btn btn-action btn-xs btn-blue no-pointer">'
+
values
+
'</label>'
;
...
@@ -283,11 +265,11 @@ define(['require',
...
@@ -283,11 +265,11 @@ define(['require',
}
}
attrRow
+=
"<tr> <td style='display:table-cell'>"
+
_
.
escape
(
attrObj
.
name
)
+
"</td><td style='display:table-cell'>"
+
typeName
+
"</td><td style='display:table-cell'>"
+
applicableEntityTypes
+
"</td><td style='display:table-cell'> <div class='btn btn-action btn-sm' style='margin-left:0px;' data-id='attributeEdit' data-guid='"
+
model
.
get
(
'guid'
)
+
"' data-name ='"
+
_
.
escape
(
attrObj
.
name
)
+
"' data-action='attributeEdit' >Edit</div> </td></tr> "
;
attrRow
+=
"<tr> <td style='display:table-cell'>"
+
_
.
escape
(
attrObj
.
name
)
+
"</td><td style='display:table-cell'>"
+
typeName
+
"</td><td style='display:table-cell'>"
+
applicableEntityTypes
+
"</td><td style='display:table-cell'> <div class='btn btn-action btn-sm' style='margin-left:0px;' data-id='attributeEdit' data-guid='"
+
model
.
get
(
'guid'
)
+
"' data-name ='"
+
_
.
escape
(
attrObj
.
name
)
+
"' data-action='attributeEdit' >Edit</div> </td></tr> "
;
});
});
var
purge
Text
=
'<div class="row"><div class="col-sm-12 attr-details"><table style="padding: 50px;">'
+
attrTableHeading
+
attrRow
+
'</table></div></div>'
;
var
admin
Text
=
'<div class="row"><div class="col-sm-12 attr-details"><table style="padding: 50px;">'
+
attrTableHeading
+
attrRow
+
'</table></div></div>'
;
$
(
el
).
append
(
$
(
'<div>'
).
html
(
purge
Text
));
$
(
el
).
append
(
$
(
'<div>'
).
html
(
admin
Text
));
}
else
{
}
else
{
var
purge
Text
=
'<div class="row"><div class="col-sm-12 attr-details"><h5 class="text-center"> No attributes to show.</h5></div></div>'
;
var
admin
Text
=
'<div class="row"><div class="col-sm-12 attr-details"><h5 class="text-center"> No attributes to show.</h5></div></div>'
;
$
(
el
).
append
(
$
(
'<div>'
).
html
(
purge
Text
));
$
(
el
).
append
(
$
(
'<div>'
).
html
(
admin
Text
));
}
}
}
}
...
@@ -364,7 +346,6 @@ define(['require',
...
@@ -364,7 +346,6 @@ define(['require',
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
return
"<button type='button' data-id='addAttribute' data-guid='"
+
model
.
get
(
'guid'
)
+
"'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Add Business Metadata attribute'><i class='fa fa-plus'></i> Attributes</button>"
;
return
"<button type='button' data-id='addAttribute' data-guid='"
+
model
.
get
(
'guid'
)
+
"'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Add Business Metadata attribute'><i class='fa fa-plus'></i> Attributes</button>"
;
// "<button type='button' data-id='deleteBusinessMetadata' data-guid='" + model.get('guid') + "'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Delete BusinessMetadata'><i class='fa fa-trash-o'></i> Delete</button>";
}
}
})
})
}
}
...
@@ -386,7 +367,6 @@ define(['require',
...
@@ -386,7 +367,6 @@ define(['require',
onNotifyDeleteOk
:
function
(
data
)
{
onNotifyDeleteOk
:
function
(
data
)
{
var
that
=
this
,
var
that
=
this
,
deleteBusinessMetadataData
=
that
.
businessMetadataDefCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
guid
});
deleteBusinessMetadataData
=
that
.
businessMetadataDefCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
guid
});
// that.$('.position-relative .fontLoader').addClass('show');
that
.
$
(
'.tableOverlay'
).
show
();
that
.
$
(
'.tableOverlay'
).
show
();
if
(
deleteBusinessMetadataData
)
{
if
(
deleteBusinessMetadataData
)
{
var
businessMetadataName
=
deleteBusinessMetadataData
.
get
(
"name"
);
var
businessMetadataName
=
deleteBusinessMetadataData
.
get
(
"name"
);
...
...
dashboardv3/public/js/views/business_metadata/CreateBusinessMetadataLayoutView.js
View file @
506ffc97
...
@@ -22,11 +22,8 @@ define(['require',
...
@@ -22,11 +22,8 @@ define(['require',
'utils/Utils'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Messages'
,
'views/business_metadata/BusinessMetadataAttributeItemView'
,
'views/business_metadata/BusinessMetadataAttributeItemView'
,
'collection/VTagList'
,
'models/VEntity'
'models/VEntity'
,
],
function
(
require
,
Backbone
,
CreateBusinessMetadataLayoutViewTmpl
,
Utils
,
Messages
,
BusinessMetadataAttributeItemView
,
VEntity
)
{
'utils/UrlLinks'
,
'platform'
],
function
(
require
,
Backbone
,
CreateBusinessMetadataLayoutViewTmpl
,
Utils
,
Messages
,
BusinessMetadataAttributeItemView
,
VTagList
,
VEntity
,
UrlLinks
,
platform
)
{
var
CreateBusinessMetadataLayoutView
=
Backbone
.
Marionette
.
CompositeView
.
extend
(
var
CreateBusinessMetadataLayoutView
=
Backbone
.
Marionette
.
CompositeView
.
extend
(
/** @lends CreateBusinessMetadataLayoutView */
/** @lends CreateBusinessMetadataLayoutView */
...
@@ -53,8 +50,13 @@ define(['require',
...
@@ -53,8 +50,13 @@ define(['require',
childViewOptions
:
function
()
{
childViewOptions
:
function
()
{
return
{
return
{
// saveButton: this.ui.saveButton,
typeHeaders
:
this
.
typeHeaders
,
parentView
:
this
businessMetadataDefCollection
:
this
.
businessMetadataDefCollection
,
enumDefCollection
:
this
.
enumDefCollection
,
isAttrEdit
:
this
.
isAttrEdit
,
attrDetails
:
this
.
attrDetails
,
viewId
:
this
.
cid
,
collection
:
this
.
collection
};
};
},
},
/** ui selector cache */
/** ui selector cache */
...
@@ -76,18 +78,9 @@ define(['require',
...
@@ -76,18 +78,9 @@ define(['require',
var
that
=
this
,
var
that
=
this
,
modal
=
that
.
$el
;
modal
=
that
.
$el
;
if
(
e
.
target
.
dataset
.
action
==
"attributeEdit"
||
e
.
target
.
dataset
.
action
==
"addAttribute"
)
{
if
(
e
.
target
.
dataset
.
action
==
"attributeEdit"
||
e
.
target
.
dataset
.
action
==
"addAttribute"
)
{
// var selectedBusinessMetadata = that.businessMetadataDefCollection.fullCollection.findWhere({ guid: that.guid });
that
.
onUpdateAttr
();
that
.
onUpdateAttr
();
}
else
{
}
else
{
if
(
that
.
$el
.
find
(
'.form-control.businessMetadata-name'
)[
0
].
value
===
""
)
{
that
.
onCreateBusinessMetadata
();
$
(
that
.
$el
.
find
(
'.form-control.businessMetadata-name'
)[
0
]).
css
(
"borderColor"
,
"red"
);
Utils
.
notifyInfo
({
content
:
"Business Metadata name is empty."
});
}
else
{
that
.
onCreateBusinessMetadata
();
}
}
}
};
};
...
@@ -101,7 +94,7 @@ define(['require',
...
@@ -101,7 +94,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'businessMetadataDefCollection'
,
'
enumDefCollection'
,
'model'
,
'descriptionData'
,
'isNewBusinessMetadata'
,
'isAttrEdit'
,
'entityDefCollection
'
,
'typeHeaders'
,
'attrDetails'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'businessMetadataDefCollection'
,
'
selectedBusinessMetadata'
,
'enumDefCollection'
,
'model'
,
'isNewBusinessMetadata'
,
'isAttrEdit
'
,
'typeHeaders'
,
'attrDetails'
));
this
.
fromTable
=
this
.
isNewBusinessMetadata
?
true
:
false
;
this
.
fromTable
=
this
.
isNewBusinessMetadata
?
true
:
false
;
this
.
isEditAttr
=
this
.
isAttrEdit
?
false
:
true
;
this
.
isEditAttr
=
this
.
isAttrEdit
?
false
:
true
;
this
.
businessMetadataModel
=
new
VEntity
();
this
.
businessMetadataModel
=
new
VEntity
();
...
@@ -183,128 +176,56 @@ define(['require',
...
@@ -183,128 +176,56 @@ define(['require',
parent
.
$
(
'.business-metadata-attr-fontLoader'
).
hide
();
parent
.
$
(
'.business-metadata-attr-fontLoader'
).
hide
();
}
}
},
},
validateValues
:
function
()
{
validateValues
:
function
(
attributeDefs
)
{
var
attrNameValidate
=
true
,
var
isValidate
=
true
,
enumValue
=
true
,
isAttrDuplicate
=
true
,
stringValidate
=
true
,
validationFileds
=
this
.
$el
.
find
(
'.require'
),
enumType
=
true
;
attrNames
=
[];
if
(
this
.
$el
.
find
(
".attributeInput"
).
length
>
0
)
{
if
(
attributeDefs
&&
!
this
.
isAttrEdit
)
{
this
.
$el
.
find
(
".attributeInput"
).
each
(
function
()
{
attrNames
=
_
.
map
(
attributeDefs
,
function
(
model
)
{
if
(
$
(
this
).
val
()
===
""
)
{
return
model
.
name
.
toLowerCase
();
$
(
this
).
css
(
"borderColor"
,
"red"
);
attrNameValidate
=
false
;
}
});
});
}
}
if
(
this
.
$el
.
find
(
".enumvalue-container"
).
length
>
0
&&
this
.
$el
.
find
(
".enumvalue-container"
)[
0
].
style
.
display
!=
'none'
)
{
validationFileds
.
each
(
function
(
elements
)
{
this
.
$el
.
find
(
".enumvalue-container"
).
each
(
function
(
index
)
{
$
(
this
).
removeClass
(
'errorValidate'
);
if
(
this
.
style
.
display
!=
'none'
)
{
if
(
validationFileds
[
elements
].
value
==
''
||
validationFileds
[
elements
].
value
==
null
)
{
if
(
$
(
this
).
find
(
".enumValueSelector"
).
length
>
0
)
{
if
(
validationFileds
[
elements
].
style
.
display
!=
'none'
)
{
$
(
this
).
find
(
".enumValueSelector"
).
each
(
function
(
index
)
{
$
(
validationFileds
[
elements
]).
addClass
(
'errorValidate'
);
if
(
$
(
this
).
val
().
length
===
0
)
{
$
(
this
).
addClass
(
'errorValidate'
);
$
(
this
).
css
(
"borderColor"
,
"red"
);
if
(
isValidate
)
{
isValidate
=
false
;
}
enumValue
=
false
;
}
});
}
}
}
})
}
}
});
if
(
this
.
$el
.
find
(
".enumtype-container"
).
length
>
0
&&
this
.
$el
.
find
(
".enumtype-container"
)[
0
].
style
.
display
!=
'none'
)
{
if
(
isValidate
)
{
this
.
$el
.
find
(
".enumtype-container"
).
each
(
function
(
index
)
{
this
.
$el
.
find
(
'.attributeInput'
).
each
(
function
(
element
)
{
if
(
this
.
style
.
display
!=
'none'
)
{
var
attrValue
=
this
.
value
.
toLowerCase
();
if
(
$
(
this
).
find
(
".enumTypeSelector"
).
length
>
0
)
{
if
(
attrNames
.
indexOf
(
attrValue
)
>
-
1
)
{
$
(
this
).
find
(
".enumTypeSelector"
).
each
(
function
(
index
)
{
Utils
.
notifyInfo
({
if
(
$
(
this
).
val
()
==
null
||
$
(
this
).
val
()
==
''
||
$
(
this
).
val
().
length
===
0
)
{
content
:
"Attribute name already exist"
$
(
this
).
css
(
"borderColor"
,
"red"
);
});
enumType
=
false
;
$
(
this
).
addClass
(
'errorValidate'
);
}
if
(
isAttrDuplicate
)
{
isAttrDuplicate
=
false
;
}
});
}
else
{
if
(
attrValue
.
length
)
{
attrNames
.
push
(
attrValue
);
}
}
}
}
})
}
if
(
this
.
$el
.
find
(
".stringlength-container"
).
length
>
0
&&
this
.
$el
.
find
(
".stringlength-container"
)[
0
].
style
.
display
!=
'none'
)
{
this
.
$el
.
find
(
".stringlength-container"
).
each
(
function
(
index
)
{
if
(
this
.
style
.
display
!=
'none'
)
{
if
(
$
(
this
).
find
(
".stringLengthVal"
).
length
>
0
)
{
$
(
this
).
find
(
".stringLengthVal"
).
each
(
function
(
index
)
{
if
(
$
(
this
).
val
().
length
===
0
)
{
$
(
this
).
css
(
"borderColor"
,
"red"
);
stringValidate
=
false
;
}
});
}
};
})
}
this
.
$el
.
find
(
".attributeInput"
).
keyup
(
function
()
{
$
(
this
).
css
(
"borderColor"
,
"#e8e9ee"
);
});
if
(
!
attrNameValidate
)
{
Utils
.
notifyInfo
({
content
:
"Please fill the attributes details"
});
});
return
true
;
}
}
if
(
!
enumType
)
{
Utils
.
notifyInfo
({
if
(
!
isValidate
)
{
content
:
"Please enter the Enumeration Name or select another type"
});
return
true
;
}
if
(
!
enumValue
)
{
Utils
.
notifyInfo
({
Utils
.
notifyInfo
({
content
:
"Please
enter the Enum values or select another type
"
content
:
"Please
fill the details
"
});
});
return
true
;
return
true
;
}
}
if
(
!
stringValidate
)
{
if
(
!
isAttrDuplicate
)
{
Utils
.
notifyInfo
({
content
:
"Please enter the Max Length for string or select another type"
});
return
true
;
return
true
;
}
}
},
businessMetadataAttributes
:
function
(
modelEl
,
attrObj
)
{
var
obj
=
{
options
:
{
"applicableEntityTypes"
:
JSON
.
stringify
(
modelEl
.
find
(
".entityTypeSelector"
).
val
()),
"maxStrLength"
:
modelEl
.
find
(
".stringLengthVal"
).
val
()
?
modelEl
.
find
(
".stringLengthVal"
).
val
()
:
"0"
}
};
// var types = ["string","boolean"];
// if (attrObj.typeName != "string" && attrObj.typeName != "boolean" && attrObj.typeName != "byte" && attrObj.typeName != "short" && attrObj.typeName != "int" && attrObj.typeName != "float" && attrObj.typeName != "double" && attrObj.typeName != "long" && attrObj.typeName != "date") {
// var enumName = enumDefCollection.fullCollection.findWhere({ name: attrObj.typeName });
// if (enumName) {
// return
// }
// }
if
(
obj
.
multiValueSelect
)
{
obj
.
multiValued
=
true
;
obj
.
typeName
=
"array<"
+
obj
.
typeName
+
">"
;
}
return
obj
;
},
highlightAttrinuteName
:
function
(
modelEl
,
obj
)
{
Utils
.
notifyInfo
({
content
:
"Attribute "
+
obj
.
name
+
" already exist"
});
modelEl
.
find
(
".attributeInput"
).
css
(
"borderColor"
,
"red"
);
this
.
loaderStatus
(
false
);
},
createEnumObject
:
function
(
arrayObj
,
obj
,
enumVal
)
{
return
arrayObj
.
push
({
"name"
:
obj
.
typeName
,
"elementDefs"
:
enumVal
});
},
},
onCreateBusinessMetadata
:
function
()
{
onCreateBusinessMetadata
:
function
()
{
var
that
=
this
,
var
that
=
this
;
attrNames
=
[],
isvalidName
=
true
;
if
(
this
.
validateValues
())
{
if
(
this
.
validateValues
())
{
return
;
return
;
};
};
...
@@ -315,163 +236,87 @@ define(['require',
...
@@ -315,163 +236,87 @@ define(['require',
if
(
this
.
collection
.
length
===
1
&&
this
.
collection
.
first
().
get
(
"name"
)
===
""
)
{
if
(
this
.
collection
.
length
===
1
&&
this
.
collection
.
first
().
get
(
"name"
)
===
""
)
{
attributeObj
=
[];
attributeObj
=
[];
}
}
if
(
attributeObj
.
length
)
{
this
.
json
=
{
// _.each(attributeObj, function(obj) {
"enumDefs"
:
[],
// var modelEl = this.$('#' + obj.modalID);
"structDefs"
:
[],
// modelEl.find(".attributeInput").css("borderColor", "transparent");;
"classificationDefs"
:
[],
// if (attrNames.indexOf(obj.name) > -1) {
"entityDefs"
:
[],
// that.highlightAttrinuteName(modelEl, obj);
"businessMetadataDefs"
:
[{
// isvalidName = false;
"category"
:
"BUSINESS_METADATA"
,
// return true;
"createdBy"
:
"admin"
,
// } else {
"updatedBy"
:
"admin"
,
// attrNames.push(obj.name);
"version"
:
1
,
// }
"typeVersion"
:
"1.1"
,
// obj = that.businessMetadataAttributes(modelEl, obj);
"name"
:
name
.
trim
(),
// // if (that.isPostCallEnum) {
"description"
:
description
.
trim
(),
// // that.createEnumObject(enumDefs, obj, elementValues);
"attributeDefs"
:
attributeObj
// // }
}]
// // if (that.isPutCall) {
};
// // that.createEnumObject(putEnumDef, obj, elementValues);
var
apiObj
=
{
// // }
sort
:
false
,
// });
data
:
this
.
json
,
var
notifyObj
=
{
success
:
function
(
model
,
response
)
{
modal
:
true
,
var
nameSpaveDef
=
model
.
businessMetadataDefs
;
confirm
:
{
if
(
nameSpaveDef
)
{
confirm
:
true
,
that
.
businessMetadataDefCollection
.
fullCollection
.
add
(
nameSpaveDef
);
buttons
:
[{
Utils
.
notifySuccess
({
text
:
"Ok"
,
content
:
"Business Metadata "
+
name
+
Messages
.
getAbbreviationMsg
(
false
,
'addSuccessMessage'
)
addClass
:
"btn-atlas btn-md"
,
});
click
:
function
(
notice
)
{
notice
.
remove
();
}
},
null
]
}
}
};
that
.
options
.
onUpdateBusinessMetadata
();
},
silent
:
true
,
reset
:
true
,
complete
:
function
(
model
,
status
)
{
that
.
loaderStatus
(
false
);
}
}
}
if
(
isvalidName
)
{
apiObj
.
type
=
"POST"
;
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
},
onUpdateAttr
:
function
()
{
var
that
=
this
,
selectedBusinessMetadataClone
=
$
.
extend
(
true
,
{},
that
.
selectedBusinessMetadata
.
toJSON
()),
attributeDefs
=
selectedBusinessMetadataClone
[
'attributeDefs'
],
isvalidName
=
true
;
if
(
this
.
validateValues
(
attributeDefs
))
{
return
;
};
if
(
this
.
collection
.
length
>
0
)
{
this
.
loaderStatus
(
true
);
if
(
selectedBusinessMetadataClone
.
attributeDefs
===
undefined
)
{
selectedBusinessMetadataClone
.
attributeDefs
=
[];
}
selectedBusinessMetadataClone
.
attributeDefs
=
selectedBusinessMetadataClone
.
attributeDefs
.
concat
(
this
.
collection
.
toJSON
());
this
.
json
=
{
this
.
json
=
{
"enumDefs"
:
[],
"enumDefs"
:
[],
"structDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[],
"classificationDefs"
:
[],
"entityDefs"
:
[],
"entityDefs"
:
[],
"businessMetadataDefs"
:
[{
"businessMetadataDefs"
:
[
selectedBusinessMetadataClone
]
"category"
:
"BUSINESS_METADATA"
,
"createdBy"
:
"admin"
,
"updatedBy"
:
"admin"
,
"version"
:
1
,
"typeVersion"
:
"1.1"
,
"name"
:
name
.
trim
(),
"description"
:
description
.
trim
(),
"attributeDefs"
:
attributeObj
}]
};
};
var
apiObj
=
{
var
apiObj
=
{
sort
:
false
,
sort
:
false
,
data
:
this
.
json
,
data
:
this
.
json
,
success
:
function
(
model
,
response
)
{
success
:
function
(
model
,
response
)
{
var
nameSpaveDef
=
model
.
businessMetadataDefs
;
Utils
.
notifySuccess
({
if
(
nameSpaveDef
)
{
content
:
"One or more Business Metadada attribute"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
that
.
options
.
businessMetadataDefCollection
.
fullCollection
.
add
(
nameSpaveDef
);
});
Utils
.
notifySuccess
({
if
(
model
.
businessMetadataDefs
&&
model
.
businessMetadataDefs
.
length
)
{
content
:
"Business Metadata "
+
name
+
Messages
.
getAbbreviationMsg
(
false
,
'addSuccessMessage'
)
that
.
selectedBusinessMetadata
.
set
(
model
.
businessMetadataDefs
[
0
]);
});
}
}
that
.
options
.
onEditCallback
();
that
.
options
.
onUpdateBusinessMetadata
();
that
.
options
.
onUpdateBusinessMetadata
();
},
},
silent
:
true
,
silent
:
true
,
reset
:
true
,
reset
:
true
,
complete
:
function
(
model
,
status
)
{
complete
:
function
(
model
,
status
)
{
attrNames
=
[];
that
.
loaderStatus
(
false
);
that
.
loaderStatus
(
false
);
}
}
}
}
apiObj
.
type
=
"P
OS
T"
;
apiObj
.
type
=
"P
U
T"
;
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
}
else
{
}
else
{
attrNames
=
[];
}
},
onUpdateAttr
:
function
()
{
var
that
=
this
,
selectedBusinessMetadata
=
$
.
extend
(
true
,
{},
that
.
options
.
selectedBusinessMetadata
.
toJSON
()),
attributeDefs
=
selectedBusinessMetadata
[
'attributeDefs'
],
isvalidName
=
true
;
if
(
this
.
validateValues
())
{
return
;
};
if
(
this
.
collection
.
length
>
0
)
{
this
.
loaderStatus
(
true
);
if
(
selectedBusinessMetadata
.
attributeDefs
===
undefined
)
{
selectedBusinessMetadata
.
attributeDefs
=
[];
}
selectedBusinessMetadata
.
attributeDefs
=
selectedBusinessMetadata
.
attributeDefs
.
concat
(
this
.
collection
.
toJSON
());
// this.collection.each(function(model) {
// var obj = model.toJSON(),
// modelEl = this.$('#' + obj.modalID);
// modelEl.find(".attributeInput").css("borderColor", "transparent");
// // if (that.options.isNewAttr == true && _.find(attributeDefs, { name: obj.name })) {
// // that.highlightAttrinuteName(modelEl, obj);
// // isvalidName = false;
// // return true;
// // }
// obj = that.businessMetadataAttributes(modelEl, obj);
// // if (that.isPostCallEnum) {
// // that.createEnumObject(postEnumDef, obj, elementValues);
// // } else if (that.isPutCall) {
// // that.createEnumObject(enumDefs, obj, elementValues);
// // }
// // if (that.options.isNewAttr == true) {
// // selectedBusinessMetadata.attributeDefs.push(obj);
// // } else {
// // var attrDef = selectedBusinessMetadata.attributeDefs;
// // _.each(attrDef, function(attrObj) {
// // if (attrObj.name === that.$el.find(".attributeInput")[0].value) {
// // attrObj.name = obj.name;
// // attrObj.typeName = obj.typeName;
// // attrObj.multiValued = obj.multiValueSelect || false;
// // attrObj.options.applicableEntityTypes = obj.options.applicableEntityTypes;
// // attrObj.enumValues = obj.enumValues;
// // attrObj.options.maxStrLength = obj.options.maxStrLength;
// // }
// // });
// // }
// });
if
(
isvalidName
)
{
this
.
json
=
{
"enumDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[],
"entityDefs"
:
[],
"businessMetadataDefs"
:
[
selectedBusinessMetadata
]
};
var
apiObj
=
{
sort
:
false
,
data
:
this
.
json
,
success
:
function
(
model
,
response
)
{
var
selectedBusinessMetadata
=
that
.
options
.
businessMetadataDefCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
options
.
guid
});
Utils
.
notifySuccess
({
content
:
"One or more Business Metadada attribute"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
});
if
(
model
.
businessMetadataDefs
&&
model
.
businessMetadataDefs
.
length
)
{
that
.
options
.
selectedBusinessMetadata
.
set
(
model
.
businessMetadataDefs
[
0
]);
}
that
.
options
.
onEditCallback
();
that
.
options
.
onUpdateBusinessMetadata
();
},
silent
:
true
,
reset
:
true
,
complete
:
function
(
model
,
status
)
{
that
.
loaderStatus
(
false
);
}
}
apiObj
.
type
=
"PUT"
;
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
}
}
else
{
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"No attribute updated"
content
:
"No attribute updated"
});
});
...
...
dashboardv3/public/js/views/business_metadata/EnumCreateUpdateItemView.js
View file @
506ffc97
...
@@ -15,13 +15,12 @@
...
@@ -15,13 +15,12 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
define
([
"require"
,
"backbone"
,
"hbs!tmpl/business_metadata/EnumCreateUpdateItemView_tmpl"
,
"utils/Utils"
,
"utils/UrlLinks"
,
"utils/Messages"
],
function
(
define
([
"require"
,
"backbone"
,
"hbs!tmpl/business_metadata/EnumCreateUpdateItemView_tmpl"
,
"utils/Utils"
,
"utils/UrlLinks"
],
function
(
require
,
require
,
Backbone
,
Backbone
,
EnumCreateUpdateItemViewTmpl
,
EnumCreateUpdateItemViewTmpl
,
Utils
,
Utils
,
UrlLinks
,
UrlLinks
Messages
)
{
)
{
"use strict"
;
"use strict"
;
...
@@ -81,13 +80,9 @@ define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemV
...
@@ -81,13 +80,9 @@ define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemV
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
this
.
enumDefCollection
=
options
.
enumDefCollection
;
_
.
extend
(
this
,
_
.
pick
(
options
,
"businessMetadataDefCollection"
,
"enumDefCollection"
));
this
.
businessMetadataDefCollection
=
options
.
businessMetadataDefCollection
;
},
},
onRender
:
function
()
{
onRender
:
function
()
{
var
that
=
this
,
entitytypes
=
""
,
enumTypes
=
[];
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
bindEvents
();
this
.
bindEvents
();
this
.
emumTypeSelectDisplay
();
this
.
emumTypeSelectDisplay
();
...
@@ -107,8 +102,7 @@ define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemV
...
@@ -107,8 +102,7 @@ define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemV
var
enumValues
=
""
,
var
enumValues
=
""
,
selectedValues
=
[],
selectedValues
=
[],
selectedEnum
=
this
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnum
=
this
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
"elementDefs"
)
:
null
,
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
"elementDefs"
)
:
null
;
savedValues
=
[];
_
.
each
(
selectedEnumValues
,
function
(
enumVal
,
index
)
{
_
.
each
(
selectedEnumValues
,
function
(
enumVal
,
index
)
{
selectedValues
.
push
(
_
.
unescape
(
enumVal
.
value
));
selectedValues
.
push
(
_
.
unescape
(
enumVal
.
value
));
enumValues
+=
"<option>"
+
enumVal
.
value
+
"</option>"
;
enumValues
+=
"<option>"
+
enumVal
.
value
+
"</option>"
;
...
...
dashboardv3/public/js/views/search/SearchResultLayoutView.js
View file @
506ffc97
...
@@ -163,6 +163,7 @@ define(['require',
...
@@ -163,6 +163,7 @@ define(['require',
this
.
multiSelectEntity
=
[];
this
.
multiSelectEntity
=
[];
this
.
searchType
=
'Basic Search'
;
this
.
searchType
=
'Basic Search'
;
this
.
columnOrder
=
null
;
this
.
columnOrder
=
null
;
this
.
defaultColumns
=
[
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
];
if
(
this
.
value
)
{
if
(
this
.
value
)
{
if
(
this
.
value
.
searchType
&&
this
.
value
.
searchType
==
'dsl'
)
{
if
(
this
.
value
.
searchType
&&
this
.
value
.
searchType
==
'dsl'
)
{
this
.
searchType
=
'Advanced Search'
;
this
.
searchType
=
'Advanced Search'
;
...
@@ -227,7 +228,7 @@ define(['require',
...
@@ -227,7 +228,7 @@ define(['require',
this
.
updateColumnList
(
state
);
this
.
updateColumnList
(
state
);
var
excludeDefaultColumn
=
[];
var
excludeDefaultColumn
=
[];
if
(
this
.
value
&&
this
.
value
.
type
)
{
if
(
this
.
value
&&
this
.
value
.
type
)
{
excludeDefaultColumn
=
_
.
without
(
this
.
searchTableColumns
[
this
.
value
.
type
],
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
);
excludeDefaultColumn
=
_
.
difference
(
this
.
searchTableColumns
[
this
.
value
.
type
],
this
.
defaultColumns
);
if
(
this
.
searchTableColumns
[
this
.
value
.
type
]
===
null
)
{
if
(
this
.
searchTableColumns
[
this
.
value
.
type
]
===
null
)
{
this
.
ui
.
columnEmptyInfo
.
show
();
this
.
ui
.
columnEmptyInfo
.
show
();
}
else
{
}
else
{
...
@@ -380,7 +381,7 @@ define(['require',
...
@@ -380,7 +381,7 @@ define(['require',
}
}
if
(
isPostMethod
&&
isSearchTab
)
{
if
(
isPostMethod
&&
isSearchTab
)
{
var
excludeDefaultColumn
=
this
.
value
.
type
&&
this
.
searchTableColumns
?
_
.
without
(
this
.
searchTableColumns
[
this
.
value
.
type
],
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
)
:
null
,
var
excludeDefaultColumn
=
this
.
value
.
type
&&
this
.
searchTableColumns
?
_
.
difference
(
this
.
searchTableColumns
[
this
.
value
.
type
],
this
.
defaultColumns
)
:
null
,
filterObj
=
{
filterObj
=
{
'entityFilters'
:
entityFilters
,
'entityFilters'
:
entityFilters
,
'tagFilters'
:
tagFilters
,
'tagFilters'
:
tagFilters
,
...
@@ -793,14 +794,14 @@ define(['require',
...
@@ -793,14 +794,14 @@ define(['require',
}
}
})
})
};
};
col
[
'businessMeta
D
ata'
]
=
{
col
[
'businessMeta
d
ata'
]
=
{
label
:
"Business Meta
D
ata"
,
label
:
"Business Meta
d
ata"
,
cell
:
"Html"
,
cell
:
"Html"
,
editable
:
false
,
editable
:
false
,
resizeable
:
true
,
resizeable
:
true
,
orderable
:
true
,
orderable
:
true
,
alwaysVisible
:
true
,
//Backgrid.ColumnManager.js -> render() to hide the name in dropdownlist
alwaysVisible
:
true
,
//Backgrid.ColumnManager.js -> render() to hide the name in dropdownlist
renderable
:
_
.
contains
(
columnToShow
,
'businessMeta
D
ata'
),
renderable
:
_
.
contains
(
columnToShow
,
'businessMeta
d
ata'
),
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
obj
=
model
.
toJSON
(),
var
obj
=
model
.
toJSON
(),
...
...
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