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',
this
.
multiSelectEntity
=
[];
this
.
searchType
=
'Basic Search'
;
this
.
columnOrder
=
null
;
this
.
defaultColumns
=
[
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
];
if
(
this
.
value
)
{
if
(
this
.
value
.
searchType
&&
this
.
value
.
searchType
==
'dsl'
)
{
this
.
searchType
=
'Advanced Search'
;
...
...
@@ -221,7 +222,7 @@ define(['require',
this
.
updateColumnList
(
state
);
var
excludeDefaultColumn
=
[];
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
)
{
this
.
ui
.
columnEmptyInfo
.
show
();
}
else
{
...
...
@@ -371,7 +372,7 @@ define(['require',
}
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
=
{
'entityFilters'
:
entityFilters
,
'tagFilters'
:
tagFilters
,
...
...
dashboardv3/public/css/scss/common.scss
View file @
506ffc97
...
...
@@ -276,4 +276,13 @@ pre {
margin-bottom
:
5px
;
margin-left
:
5px
;
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 @@
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3 required"
for=
"name"
>
Name
</label>
<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>
</div>
</div>
...
...
@@ -54,7 +54,7 @@
<div
class=
""
>
<label
class=
"control-label col-sm-3 required"
for=
"enumType"
>
Enum Name
</label>
<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>
</div>
<div
class=
"col-sm-3"
>
...
...
@@ -75,7 +75,7 @@
<div
class=
"stringlength-container"
>
<label
class=
"control-label col-sm-3 required"
for=
"name"
>
Max length
</label>
<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>
...
...
dashboardv3/public/js/templates/business_metadata/CreateBusinessMetadataLayoutView_tmpl.html
View file @
506ffc97
...
...
@@ -23,7 +23,7 @@
<label
class=
"control-label col-sm-2 {{#if create}}required{{/if}}"
for=
"name"
>
Name
</label>
{{#if create}}
<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>
{{else}}
<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',
filterOpts
:
{},
paginatorOpts
:
{}
};
this
.
isFilters
=
null
;
this
.
showDetails
=
true
;
},
onRender
:
function
()
{
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
View file @
506ffc97
...
...
@@ -17,12 +17,8 @@
*/
define
([
'require'
,
'backbone'
,
'hbs!tmpl/business_metadata/BusinessMetadataAttributeItemView_tmpl'
,
'utils/Utils'
,
'utils/UrlLinks'
,
'utils/Messages'
],
function
(
require
,
Backbone
,
BusinessMetadataAttributeItemViewTmpl
,
Utils
,
UrlLinks
,
Messages
)
{
'hbs!tmpl/business_metadata/BusinessMetadataAttributeItemView_tmpl'
],
function
(
require
,
Backbone
,
BusinessMetadataAttributeItemViewTmpl
)
{
'use strict'
;
return
Backbone
.
Marionette
.
ItemView
.
extend
(
...
...
@@ -63,27 +59,35 @@ define(['require',
};
events
[
"change "
+
this
.
ui
.
dataTypeSelector
]
=
function
(
e
)
{
var
obj
=
{
options
:
this
.
model
.
get
(
'options'
)
||
{}
};
debugger
;
delete
obj
.
enumValues
;
delete
obj
.
options
.
maxStrLength
;
if
(
e
.
target
.
value
.
trim
()
===
'enumeration'
||
e
.
target
.
value
.
trim
()
===
'Enumeration'
)
{
this
.
ui
.
enumTypeSelectorContainer
.
show
();
this
.
ui
.
enumTypeSelector
.
show
();
this
.
emumTypeSelectDisplay
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthValue
.
hide
();
}
else
{
obj
.
typeName
=
e
.
target
.
value
.
trim
();
if
(
e
.
target
.
value
.
trim
()
===
'string'
||
e
.
target
.
value
.
trim
()
===
'String'
)
{
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthValue
.
show
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelector
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
obj
.
options
[
"maxStrLength"
]
=
e
.
target
.
value
.
trim
();
}
else
{
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelector
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthValue
.
hide
();
}
}
this
.
model
.
set
(
obj
);
if
(
e
.
target
.
value
.
trim
()
!=
'enumeration'
)
{
this
.
ui
.
multiValueSelectStatus
.
trigger
(
'change'
);
}
};
events
[
"change "
+
this
.
ui
.
enumTypeSelector
]
=
function
(
e
)
{
this
.
model
.
set
({
"enumValues"
:
e
.
target
.
value
.
trim
()
});
...
...
@@ -138,15 +142,14 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
this
.
parentView
=
options
.
parentView
;
this
.
viewId
=
options
.
model
?
options
.
model
.
cid
:
this
.
parentView
.
ci
d
;
_
.
extend
(
this
,
_
.
pick
(
options
,
"typeHeaders"
,
"businessMetadataDefCollection"
,
"enumDefCollection"
,
"isAttrEdit"
,
"attrDetails"
,
"viewId"
,
"collection"
))
;
this
.
viewId
=
options
.
model
?
options
.
model
.
cid
:
this
.
viewI
d
;
},
onRender
:
function
()
{
var
that
=
this
,
entitytypes
=
''
,
enumTypes
=
[];
//this.model.set({ "modalID": this.viewId });
this
.
parentView
.
typeHeaders
.
fullCollection
.
each
(
function
(
model
)
{
this
.
typeHeaders
.
fullCollection
.
each
(
function
(
model
)
{
if
(
model
.
toJSON
().
category
==
"ENTITY"
)
{
that
.
ui
.
entityTypeSelector
.
append
(
"<option>"
+
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',
this
.
ui
.
enumValueSelector
.
attr
(
"disabled"
,
"false"
);
// cannot edit the values
this
.
emumTypeSelectDisplay
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelector
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
if
(
this
.
parentView
.
isAttrEdit
)
{
if
(
this
.
isAttrEdit
)
{
this
.
ui
.
close
.
hide
();
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
.
dataTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
multiValueSelect
.
hide
();
this
.
ui
.
dataTypeSelector
.
val
(
this
.
parentView
.
attrDetails
.
attrTypeName
);
if
(
this
.
parentView
.
attrDetails
.
attrTypeName
==
"string"
)
{
this
.
ui
.
dataTypeSelector
.
val
(
this
.
attrDetails
.
attrTypeName
);
if
(
this
.
attrDetails
.
attrTypeName
==
"string"
)
{
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthValue
.
val
(
this
.
parentView
.
attrDetails
.
maxStrLength
);
this
.
ui
.
stringLengthValue
.
show
();
this
.
ui
.
stringLengthValue
.
val
(
this
.
attrDetails
.
maxStrLength
);
}
else
{
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthValue
.
hide
();
}
_
.
each
(
this
.
parentView
.
attrDetails
.
attrEntityType
,
function
(
valName
)
{
_
.
each
(
this
.
attrDetails
.
attrEntityType
,
function
(
valName
)
{
that
.
ui
.
entityTypeSelector
.
find
(
'option'
).
each
(
function
(
o
)
{
var
$el
=
$
(
this
)
if
(
$el
.
data
(
"name"
)
===
valName
)
{
...
...
@@ -192,16 +197,16 @@ define(['require',
}
})
});
this
.
ui
.
entityTypeSelector
.
val
(
this
.
parentView
.
attrDetails
.
attrEntityType
).
trigger
(
'change'
);
if
(
this
.
parentView
.
attrDetails
&&
this
.
parentView
.
attrDetails
.
attrTypeName
)
{
var
typeName
=
this
.
parentView
.
attrDetails
.
attrTypeName
;
this
.
ui
.
entityTypeSelector
.
val
(
this
.
attrDetails
.
attrEntityType
).
trigger
(
'change'
);
if
(
this
.
attrDetails
&&
this
.
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"
)
{
this
.
ui
.
enumTypeSelector
.
attr
(
"disabled"
,
"false"
);
this
.
ui
.
dataTypeSelector
.
val
(
"enumeration"
).
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
.
multiValueSelectStatus
).
prop
(
'checked'
,
true
).
trigger
(
'change'
);
this
.
ui
.
multiValueSelectStatus
.
attr
(
"disabled"
,
"false"
);
...
...
@@ -211,7 +216,7 @@ define(['require',
showEnumValues
:
function
(
enumName
)
{
var
enumValues
=
''
,
selectedValues
=
[],
selectedEnum
=
this
.
parentView
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnum
=
this
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
'elementDefs'
)
:
null
,
savedValues
=
[];
_
.
each
(
selectedEnumValues
,
function
(
enumVal
,
index
)
{
...
...
@@ -231,7 +236,7 @@ define(['require',
},
emumTypeSelectDisplay
:
function
()
{
var
enumTypes
=
''
;
this
.
parentView
.
enumDefCollection
.
fullCollection
.
each
(
function
(
model
,
index
)
{
this
.
enumDefCollection
.
fullCollection
.
each
(
function
(
model
,
index
)
{
enumTypes
+=
"<option>"
+
_
.
escape
(
model
.
get
(
'name'
))
+
"</option>"
;
});
this
.
ui
.
enumTypeSelector
.
empty
();
...
...
@@ -255,14 +260,14 @@ define(['require',
},
closeModal
:
function
()
{
modal
.
trigger
(
"cancel"
);
that
.
parentView
.
enumDefCollection
.
fetch
({
that
.
enumDefCollection
.
fetch
({
success
:
function
()
{
that
.
ui
.
enumTypeSelector
.
val
(
that
.
model
.
get
(
'typeName'
)).
trigger
(
'change'
);
}
});
},
enumDefCollection
:
that
.
parentView
.
enumDefCollection
,
businessMetadataDefCollection
:
that
.
parentView
.
options
.
businessMetadataDefCollection
enumDefCollection
:
that
.
enumDefCollection
,
businessMetadataDefCollection
:
that
.
businessMetadataDefCollection
}),
modal
=
new
Modal
({
title
:
"Create/ Update Enum"
,
...
...
@@ -279,12 +284,12 @@ define(['require',
});
},
onCloseButton
:
function
()
{
var
tagName
=
this
.
parentView
.
$el
.
find
(
'[data-id="tagName"]'
).
val
();
if
(
this
.
parentView
.
collection
.
models
.
length
>
0
)
{
var
tagName
=
this
.
$el
.
find
(
'[data-id="tagName"]'
).
val
();
if
(
this
.
collection
.
models
.
length
>
0
)
{
this
.
model
.
destroy
();
}
if
(
this
.
parentView
.
collection
.
models
.
length
==
0
&&
tagName
!=
""
)
{
this
.
parentView
.
$el
.
parent
().
next
().
find
(
'button.ok'
).
removeAttr
(
"disabled"
);
if
(
this
.
collection
.
models
.
length
==
0
&&
tagName
!=
""
)
{
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([
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
options
);
},
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);
},
bindEvents
:
function
()
{},
onRender
:
function
()
{
this
.
updateView
();
},
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataDetailLayoutView.js
View file @
506ffc97
...
...
@@ -32,10 +32,7 @@ define(['require',
/** ui selector cache */
ui
:
{
title
:
'[data-id="title"]'
,
editBox
:
'[data-id="editBox"]'
,
saveButton
:
"[data-id='saveButton']"
,
description
:
'[data-id="description"]'
,
publishButton
:
'[data-id="publishButton"]'
,
backButton
:
'[data-id="backButton"]'
},
/** ui events hash */
...
...
@@ -51,16 +48,15 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'
guid'
,
'model'
,
'enumDefCollection'
,
'typeHeaders
'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'
model
'
));
},
onRender
:
function
()
{
this
.
renderDetail
();
},
renderDetail
:
function
()
{
var
that
=
this
;
this
.
ui
.
title
.
html
(
'<span>'
+
that
.
model
.
get
(
'name'
)
+
'</span>'
);
if
(
that
.
model
.
get
(
'description'
))
{
this
.
ui
.
description
.
text
((
that
.
model
.
get
(
'description'
)));
this
.
ui
.
title
.
html
(
'<span>'
+
this
.
model
.
get
(
'name'
)
+
'</span>'
);
if
(
this
.
model
.
get
(
'description'
))
{
this
.
ui
.
description
.
text
((
this
.
model
.
get
(
'description'
)));
}
}
});
...
...
dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
View file @
506ffc97
...
...
@@ -19,14 +19,9 @@
define
([
'require'
,
'backbone'
,
'hbs!tmpl/business_metadata/BusinessMetadataTableLayoutView_tmpl'
,
'collection/VEntityList'
,
'models/VSearch'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Enums'
,
'utils/UrlLinks'
,
'utils/CommonViewFunction'
],
function
(
require
,
Backbone
,
BusinessMetadataTableLayoutView_tmpl
,
VEntityList
,
VSearch
,
Utils
,
Messages
,
Enums
,
UrlLinks
,
CommonViewFunction
)
{
'utils/Messages'
],
function
(
require
,
Backbone
,
BusinessMetadataTableLayoutView_tmpl
,
Utils
,
Messages
)
{
'use strict'
;
var
BusinessMetadataTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
...
...
@@ -47,18 +42,12 @@ define(['require',
businessMetadataAttrPage
:
"[data-id='businessMetadataAttrPage']"
,
businessMetadataAttrPageTitle
:
"[data-id='businessMetadataAttrPageTitle']"
,
businessMetadataDetailPage
:
"[data-id='businessMetadataDetailPage']"
,
auditCreate
:
"[data-id='auditCreate']"
,
pageRecordText
:
"[data-id='pageRecordText']"
,
activePage
:
"[data-id='activePage']"
,
createBusinessMetadata
:
"[data-id='createBusinessMetadata']"
,
attributeEdit
:
"[data-id='attributeEdit']"
,
addAttribute
:
'[data-id="addAttribute"]'
,
businessMetadataAttrPageOk
:
'[data-id="businessMetadataAttrPageOk"]'
,
colManager
:
"[data-id='colManager']"
,
deleteBusinessMetadata
:
'[data-id="deleteBusinessMetadata"]'
,
businessMetadataAttrFontLoader
:
'.business-metadata-attr-fontLoader'
,
businessMetadataAttrTableOverlay
:
'.businessMetadata-attr-tableOverlay'
deleteBusinessMetadata
:
'[data-id="deleteBusinessMetadata"]'
},
/** ui events hash */
events
:
function
()
{
...
...
@@ -80,9 +69,6 @@ define(['require',
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'typeHeaders'
,
'businessMetadataDefCollection'
,
'entityDefCollection'
,
'businessMetadataAttr'
,
'selectedBusinessMetadata'
));
this
.
limit
=
10
;
this
.
offset
=
0
;
this
.
pervOld
=
[];
this
.
onlyPurge
=
true
;
this
.
newAttr
=
false
;
this
.
commonTableOptions
=
{
collection
:
this
.
businessMetadataDefCollection
,
...
...
@@ -111,8 +97,6 @@ define(['require',
filterOpts
:
{},
paginatorOpts
:
{}
};
this
.
currPage
=
1
;
this
.
isFilters
=
null
;
this
.
guid
=
null
;
this
.
showDetails
=
true
;
// toggle between sttribute page and detail page
},
...
...
@@ -225,11 +209,10 @@ define(['require',
that
.
toggleBusinessMetadataDetailsAttrView
();
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
},
tag
Collection
:
that
.
businessMetadataDefCollection
,
businessMetadataDef
Collection
:
that
.
businessMetadataDefCollection
,
enumDefCollection
:
enumDefCollection
,
typeHeaders
:
typeHeaders
,
isNewBusinessMetadata
:
isNewBusinessMetadata
,
businessMetadataDefCollection
:
businessMetadataDefCollection
isNewBusinessMetadata
:
isNewBusinessMetadata
});
that
.
RModal
.
show
(
that
.
view
);
});
...
...
@@ -272,7 +255,6 @@ define(['require',
var
applicableEntityTypes
=
''
,
typeName
=
attrObj
.
typeName
;
if
(
attrObj
.
options
&&
attrObj
.
options
.
applicableEntityTypes
)
{
// attrEntityTypes = JSON.parse(attrObj.options.applicableEntityTypes).join(', ');
var
entityTypes
=
JSON
.
parse
(
attrObj
.
options
.
applicableEntityTypes
);
_
.
each
(
entityTypes
,
function
(
values
)
{
applicableEntityTypes
+=
'<label class="btn btn-action btn-xs btn-blue no-pointer">'
+
values
+
'</label>'
;
...
...
@@ -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> "
;
});
var
purge
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
));
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
(
admin
Text
));
}
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>'
;
$
(
el
).
append
(
$
(
'<div>'
).
html
(
purge
Text
));
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
(
admin
Text
));
}
}
...
...
@@ -364,7 +346,6 @@ define(['require',
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
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>"
;
// "<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',
onNotifyDeleteOk
:
function
(
data
)
{
var
that
=
this
,
deleteBusinessMetadataData
=
that
.
businessMetadataDefCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
guid
});
// that.$('.position-relative .fontLoader').addClass('show');
that
.
$
(
'.tableOverlay'
).
show
();
if
(
deleteBusinessMetadataData
)
{
var
businessMetadataName
=
deleteBusinessMetadataData
.
get
(
"name"
);
...
...
dashboardv3/public/js/views/business_metadata/CreateBusinessMetadataLayoutView.js
View file @
506ffc97
...
...
@@ -22,11 +22,8 @@ define(['require',
'utils/Utils'
,
'utils/Messages'
,
'views/business_metadata/BusinessMetadataAttributeItemView'
,
'collection/VTagList'
,
'models/VEntity'
,
'utils/UrlLinks'
,
'platform'
],
function
(
require
,
Backbone
,
CreateBusinessMetadataLayoutViewTmpl
,
Utils
,
Messages
,
BusinessMetadataAttributeItemView
,
VTagList
,
VEntity
,
UrlLinks
,
platform
)
{
'models/VEntity'
],
function
(
require
,
Backbone
,
CreateBusinessMetadataLayoutViewTmpl
,
Utils
,
Messages
,
BusinessMetadataAttributeItemView
,
VEntity
)
{
var
CreateBusinessMetadataLayoutView
=
Backbone
.
Marionette
.
CompositeView
.
extend
(
/** @lends CreateBusinessMetadataLayoutView */
...
...
@@ -53,8 +50,13 @@ define(['require',
childViewOptions
:
function
()
{
return
{
// saveButton: this.ui.saveButton,
parentView
:
this
typeHeaders
:
this
.
typeHeaders
,
businessMetadataDefCollection
:
this
.
businessMetadataDefCollection
,
enumDefCollection
:
this
.
enumDefCollection
,
isAttrEdit
:
this
.
isAttrEdit
,
attrDetails
:
this
.
attrDetails
,
viewId
:
this
.
cid
,
collection
:
this
.
collection
};
},
/** ui selector cache */
...
...
@@ -76,18 +78,9 @@ define(['require',
var
that
=
this
,
modal
=
that
.
$el
;
if
(
e
.
target
.
dataset
.
action
==
"attributeEdit"
||
e
.
target
.
dataset
.
action
==
"addAttribute"
)
{
// var selectedBusinessMetadata = that.businessMetadataDefCollection.fullCollection.findWhere({ guid: that.guid });
that
.
onUpdateAttr
();
}
else
{
if
(
that
.
$el
.
find
(
'.form-control.businessMetadata-name'
)[
0
].
value
===
""
)
{
$
(
that
.
$el
.
find
(
'.form-control.businessMetadata-name'
)[
0
]).
css
(
"borderColor"
,
"red"
);
Utils
.
notifyInfo
({
content
:
"Business Metadata name is empty."
});
}
else
{
that
.
onCreateBusinessMetadata
();
}
that
.
onCreateBusinessMetadata
();
}
};
...
...
@@ -101,7 +94,7 @@ define(['require',
* @constructs
*/
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
.
isEditAttr
=
this
.
isAttrEdit
?
false
:
true
;
this
.
businessMetadataModel
=
new
VEntity
();
...
...
@@ -183,128 +176,56 @@ define(['require',
parent
.
$
(
'.business-metadata-attr-fontLoader'
).
hide
();
}
},
validateValues
:
function
()
{
var
attrNameValidate
=
true
,
enumValue
=
true
,
stringValidate
=
true
,
enumType
=
true
;
if
(
this
.
$el
.
find
(
".attributeInput"
).
length
>
0
)
{
this
.
$el
.
find
(
".attributeInput"
).
each
(
function
()
{
if
(
$
(
this
).
val
()
===
""
)
{
$
(
this
).
css
(
"borderColor"
,
"red"
);
attrNameValidate
=
false
;
}
validateValues
:
function
(
attributeDefs
)
{
var
isValidate
=
true
,
isAttrDuplicate
=
true
,
validationFileds
=
this
.
$el
.
find
(
'.require'
),
attrNames
=
[];
if
(
attributeDefs
&&
!
this
.
isAttrEdit
)
{
attrNames
=
_
.
map
(
attributeDefs
,
function
(
model
)
{
return
model
.
name
.
toLowerCase
();
});
}
if
(
this
.
$el
.
find
(
".enumvalue-container"
).
length
>
0
&&
this
.
$el
.
find
(
".enumvalue-container"
)[
0
].
style
.
display
!=
'none'
)
{
this
.
$el
.
find
(
".enumvalue-container"
).
each
(
function
(
index
)
{
if
(
this
.
style
.
display
!=
'none'
)
{
if
(
$
(
this
).
find
(
".enumValueSelector"
).
length
>
0
)
{
$
(
this
).
find
(
".enumValueSelector"
).
each
(
function
(
index
)
{
if
(
$
(
this
).
val
().
length
===
0
)
{
$
(
this
).
css
(
"borderColor"
,
"red"
);
enumValue
=
false
;
}
});
}
validationFileds
.
each
(
function
(
elements
)
{
$
(
this
).
removeClass
(
'errorValidate'
);
if
(
validationFileds
[
elements
].
value
==
''
||
validationFileds
[
elements
].
value
==
null
)
{
if
(
validationFileds
[
elements
].
style
.
display
!=
'none'
)
{
$
(
validationFileds
[
elements
]).
addClass
(
'errorValidate'
);
$
(
this
).
addClass
(
'errorValidate'
);
if
(
isValidate
)
{
isValidate
=
false
;
}
}
})
}
if
(
this
.
$el
.
find
(
".enumtype-container"
).
length
>
0
&&
this
.
$el
.
find
(
".enumtype-container"
)[
0
].
style
.
display
!=
'none'
)
{
this
.
$el
.
find
(
".enumtype-container"
).
each
(
function
(
index
)
{
if
(
this
.
style
.
display
!=
'none'
)
{
if
(
$
(
this
).
find
(
".enumTypeSelector"
).
length
>
0
)
{
$
(
this
).
find
(
".enumTypeSelector"
).
each
(
function
(
index
)
{
if
(
$
(
this
).
val
()
==
null
||
$
(
this
).
val
()
==
''
||
$
(
this
).
val
().
length
===
0
)
{
$
(
this
).
css
(
"borderColor"
,
"red"
);
enumType
=
false
;
}
});
}
});
if
(
isValidate
)
{
this
.
$el
.
find
(
'.attributeInput'
).
each
(
function
(
element
)
{
var
attrValue
=
this
.
value
.
toLowerCase
();
if
(
attrNames
.
indexOf
(
attrValue
)
>
-
1
)
{
Utils
.
notifyInfo
({
content
:
"Attribute name already exist"
});
$
(
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
({
content
:
"Please enter the Enumeration Name or select another type"
});
return
true
;
}
if
(
!
enumValue
)
{
if
(
!
isValidate
)
{
Utils
.
notifyInfo
({
content
:
"Please
enter the Enum values or select another type
"
content
:
"Please
fill the details
"
});
return
true
;
}
if
(
!
stringValidate
)
{
Utils
.
notifyInfo
({
content
:
"Please enter the Max Length for string or select another type"
});
if
(
!
isAttrDuplicate
)
{
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
()
{
var
that
=
this
,
attrNames
=
[],
isvalidName
=
true
;
var
that
=
this
;
if
(
this
.
validateValues
())
{
return
;
};
...
...
@@ -315,163 +236,87 @@ define(['require',
if
(
this
.
collection
.
length
===
1
&&
this
.
collection
.
first
().
get
(
"name"
)
===
""
)
{
attributeObj
=
[];
}
if
(
attributeObj
.
length
)
{
// _.each(attributeObj, function(obj) {
// var modelEl = this.$('#' + obj.modalID);
// modelEl.find(".attributeInput").css("borderColor", "transparent");;
// if (attrNames.indexOf(obj.name) > -1) {
// that.highlightAttrinuteName(modelEl, obj);
// isvalidName = false;
// return true;
// } else {
// attrNames.push(obj.name);
// }
// obj = that.businessMetadataAttributes(modelEl, obj);
// // if (that.isPostCallEnum) {
// // that.createEnumObject(enumDefs, obj, elementValues);
// // }
// // if (that.isPutCall) {
// // that.createEnumObject(putEnumDef, obj, elementValues);
// // }
// });
var
notifyObj
=
{
modal
:
true
,
confirm
:
{
confirm
:
true
,
buttons
:
[{
text
:
"Ok"
,
addClass
:
"btn-atlas btn-md"
,
click
:
function
(
notice
)
{
notice
.
remove
();
}
},
null
]
this
.
json
=
{
"enumDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[],
"entityDefs"
:
[],
"businessMetadataDefs"
:
[{
"category"
:
"BUSINESS_METADATA"
,
"createdBy"
:
"admin"
,
"updatedBy"
:
"admin"
,
"version"
:
1
,
"typeVersion"
:
"1.1"
,
"name"
:
name
.
trim
(),
"description"
:
description
.
trim
(),
"attributeDefs"
:
attributeObj
}]
};
var
apiObj
=
{
sort
:
false
,
data
:
this
.
json
,
success
:
function
(
model
,
response
)
{
var
nameSpaveDef
=
model
.
businessMetadataDefs
;
if
(
nameSpaveDef
)
{
that
.
businessMetadataDefCollection
.
fullCollection
.
add
(
nameSpaveDef
);
Utils
.
notifySuccess
({
content
:
"Business Metadata "
+
name
+
Messages
.
getAbbreviationMsg
(
false
,
'addSuccessMessage'
)
});
}
};
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
=
{
"enumDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[],
"entityDefs"
:
[],
"businessMetadataDefs"
:
[{
"category"
:
"BUSINESS_METADATA"
,
"createdBy"
:
"admin"
,
"updatedBy"
:
"admin"
,
"version"
:
1
,
"typeVersion"
:
"1.1"
,
"name"
:
name
.
trim
(),
"description"
:
description
.
trim
(),
"attributeDefs"
:
attributeObj
}]
"businessMetadataDefs"
:
[
selectedBusinessMetadataClone
]
};
var
apiObj
=
{
sort
:
false
,
data
:
this
.
json
,
success
:
function
(
model
,
response
)
{
var
nameSpaveDef
=
model
.
businessMetadataDefs
;
if
(
nameSpaveDef
)
{
that
.
options
.
businessMetadataDefCollection
.
fullCollection
.
add
(
nameSpaveDef
);
Utils
.
notifySuccess
({
content
:
"Business Metadata "
+
name
+
Messages
.
getAbbreviationMsg
(
false
,
'addSuccessMessage'
)
});
Utils
.
notifySuccess
({
content
:
"One or more Business Metadada attribute"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
});
if
(
model
.
businessMetadataDefs
&&
model
.
businessMetadataDefs
.
length
)
{
that
.
selectedBusinessMetadata
.
set
(
model
.
businessMetadataDefs
[
0
]);
}
that
.
options
.
onEditCallback
();
that
.
options
.
onUpdateBusinessMetadata
();
},
silent
:
true
,
reset
:
true
,
complete
:
function
(
model
,
status
)
{
attrNames
=
[];
that
.
loaderStatus
(
false
);
}
}
apiObj
.
type
=
"P
OS
T"
;
apiObj
.
type
=
"P
U
T"
;
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
}
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
({
content
:
"No attribute updated"
});
...
...
dashboardv3/public/js/views/business_metadata/EnumCreateUpdateItemView.js
View file @
506ffc97
...
...
@@ -15,13 +15,12 @@
* See the License for the specific language governing permissions and
* 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
,
Backbone
,
EnumCreateUpdateItemViewTmpl
,
Utils
,
UrlLinks
,
Messages
UrlLinks
)
{
"use strict"
;
...
...
@@ -81,13 +80,9 @@ define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemV
* @constructs
*/
initialize
:
function
(
options
)
{
this
.
enumDefCollection
=
options
.
enumDefCollection
;
this
.
businessMetadataDefCollection
=
options
.
businessMetadataDefCollection
;
_
.
extend
(
this
,
_
.
pick
(
options
,
"businessMetadataDefCollection"
,
"enumDefCollection"
));
},
onRender
:
function
()
{
var
that
=
this
,
entitytypes
=
""
,
enumTypes
=
[];
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
bindEvents
();
this
.
emumTypeSelectDisplay
();
...
...
@@ -107,8 +102,7 @@ define(["require", "backbone", "hbs!tmpl/business_metadata/EnumCreateUpdateItemV
var
enumValues
=
""
,
selectedValues
=
[],
selectedEnum
=
this
.
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
enumName
}),
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
"elementDefs"
)
:
null
,
savedValues
=
[];
selectedEnumValues
=
selectedEnum
?
selectedEnum
.
get
(
"elementDefs"
)
:
null
;
_
.
each
(
selectedEnumValues
,
function
(
enumVal
,
index
)
{
selectedValues
.
push
(
_
.
unescape
(
enumVal
.
value
));
enumValues
+=
"<option>"
+
enumVal
.
value
+
"</option>"
;
...
...
dashboardv3/public/js/views/search/SearchResultLayoutView.js
View file @
506ffc97
...
...
@@ -163,6 +163,7 @@ define(['require',
this
.
multiSelectEntity
=
[];
this
.
searchType
=
'Basic Search'
;
this
.
columnOrder
=
null
;
this
.
defaultColumns
=
[
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
];
if
(
this
.
value
)
{
if
(
this
.
value
.
searchType
&&
this
.
value
.
searchType
==
'dsl'
)
{
this
.
searchType
=
'Advanced Search'
;
...
...
@@ -227,7 +228,7 @@ define(['require',
this
.
updateColumnList
(
state
);
var
excludeDefaultColumn
=
[];
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
)
{
this
.
ui
.
columnEmptyInfo
.
show
();
}
else
{
...
...
@@ -380,7 +381,7 @@ define(['require',
}
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
=
{
'entityFilters'
:
entityFilters
,
'tagFilters'
:
tagFilters
,
...
...
@@ -793,14 +794,14 @@ define(['require',
}
})
};
col
[
'businessMeta
D
ata'
]
=
{
label
:
"Business Meta
D
ata"
,
col
[
'businessMeta
d
ata'
]
=
{
label
:
"Business Meta
d
ata"
,
cell
:
"Html"
,
editable
:
false
,
resizeable
:
true
,
orderable
:
true
,
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
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
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