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
3d0fcedb
Commit
3d0fcedb
authored
5 years ago
by
kevalbhatt
Committed by
Sarath Subramanian
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3656 : UI: Rename type Namespace to BusinessMetadata
Signed-off-by:
Sarath Subramanian
<
sarath@apache.org
>
parent
aa4bbb08
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
734 additions
and
893 deletions
+734
-893
business-metadata.scss
dashboardv3/public/css/scss/business-metadata.scss
+13
-13
style.scss
dashboardv3/public/css/scss/style.scss
+2
-1
BaseCollection.js
dashboardv3/public/js/collection/BaseCollection.js
+3
-0
main.js
dashboardv3/public/js/main.js
+8
-8
BaseModel.js
dashboardv3/public/js/models/BaseModel.js
+3
-0
VEntity.js
dashboardv3/public/js/models/VEntity.js
+7
-7
Router.js
dashboardv3/public/js/router/Router.js
+8
-8
AdministratorLayoutView_tmpl.html
...templates/administrator/AdministratorLayoutView_tmpl.html
+3
-3
BusinessMetadataAttrTableLayoutView_tmpl.html
...ss_metadata/BusinessMetadataAttrTableLayoutView_tmpl.html
+12
-11
BusinessMetadataAttributeItemView_tmpl.html
...ness_metadata/BusinessMetadataAttributeItemView_tmpl.html
+2
-2
BusinessMetadataContainerLayoutView_tmpl.html
...ss_metadata/BusinessMetadataContainerLayoutView_tmpl.html
+3
-2
BusinessMetadataDetailLayoutView_tmpl.html
...iness_metadata/BusinessMetadataDetailLayoutView_tmpl.html
+0
-0
BusinessMetadataTableLayoutView_tmpl.html
...siness_metadata/BusinessMetadataTableLayoutView_tmpl.html
+14
-13
CreateBusinessMetadataLayoutView_tmpl.html
...iness_metadata/CreateBusinessMetadataLayoutView_tmpl.html
+6
-5
EnumCreateUpdateItemView_tmpl.html
...ates/business_metadata/EnumCreateUpdateItemView_tmpl.html
+0
-0
DetailPageLayoutView_tmpl.html
...c/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+1
-1
EntityBusinessMetaDataItemView_tmpl.html
...templates/entity/EntityBusinessMetaDataItemView_tmpl.html
+5
-4
EntityBusinessMetaDataView_tmpl.html
.../js/templates/entity/EntityBusinessMetaDataView_tmpl.html
+8
-8
SearchFilterBrowseLayoutView_tmpl.html
...s/templates/search/SearchFilterBrowseLayoutView_tmpl.html
+1
-1
BusinessMetadataTreeLayoutView_tmpl.html
...ates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
+7
-16
UrlLinks.js
dashboardv3/public/js/utils/UrlLinks.js
+5
-28
Utils.js
dashboardv3/public/js/utils/Utils.js
+1
-1
AdministratorLayoutView.js
.../public/js/views/administrator/AdministratorLayoutView.js
+8
-8
BusinessMetadataAttrTableLayoutView.js
.../business_metadata/BusinessMetadataAttrTableLayoutView.js
+45
-61
BusinessMetadataAttributeItemView.js
...ws/business_metadata/BusinessMetadataAttributeItemView.js
+39
-15
BusinessMetadataContainerLayoutView.js
.../business_metadata/BusinessMetadataContainerLayoutView.js
+120
-0
BusinessMetadataDetailLayoutView.js
...ews/business_metadata/BusinessMetadataDetailLayoutView.js
+12
-53
BusinessMetadataTableLayoutView.js
...iews/business_metadata/BusinessMetadataTableLayoutView.js
+86
-87
CreateBusinessMetadataLayoutView.js
...ews/business_metadata/CreateBusinessMetadataLayoutView.js
+130
-221
EnumCreateUpdateItemView.js
...ic/js/views/business_metadata/EnumCreateUpdateItemView.js
+5
-5
DetailPageLayoutView.js
...ardv3/public/js/views/detail_page/DetailPageLayoutView.js
+8
-8
EntityBusinessMetaDataItemView.js
.../public/js/views/entity/EntityBusinessMetaDataItemView.js
+31
-31
EntityBusinessMetaDataView.js
...rdv3/public/js/views/entity/EntityBusinessMetaDataView.js
+47
-47
NameSpaceContainerLayoutView.js
...ublic/js/views/name_space/NameSpaceContainerLayoutView.js
+0
-118
QueryBuilderView.js
dashboardv3/public/js/views/search/QueryBuilderView.js
+7
-18
SearchDefaultLayoutView.js
...boardv3/public/js/views/search/SearchDefaultLayoutView.js
+4
-4
SearchFilterBrowseLayoutView.js
...v3/public/js/views/search/SearchFilterBrowseLayoutView.js
+10
-10
SearchResultLayoutView.js
dashboardv3/public/js/views/search/SearchResultLayoutView.js
+13
-14
BusinessMetadataTreeLayoutView.js
...ic/js/views/search/tree/BusinessMetadataTreeLayoutView.js
+57
-61
No files found.
dashboardv3/public/css/scss/
namespace
.scss
→
dashboardv3/public/css/scss/
business-metadata
.scss
View file @
3d0fcedb
...
@@ -15,15 +15,15 @@
...
@@ -15,15 +15,15 @@
// limitations under the License.
// limitations under the License.
/*
namespace
*/
/*
business-metadata
*/
.
namespace
-tree-parent
{
.
business-metadata
-tree-parent
{
padding
:
0px
;
padding
:
0px
;
>
li
:first-child
{
>
li
:first-child
{
font-weight
:
600
;
font-weight
:
600
;
}
}
.
namespace
-tree-child
{
.
business-metadata
-tree-child
{
&
.entity-detail-table
table
{
&
.entity-detail-table
table
{
td
{
td
{
&
:nth-child
(
1
)
{
&
:nth-child
(
1
)
{
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
}
}
}
}
.
namespace
-options.dropdown
{
.
business-metadata
-options.dropdown
{
.dropdown-menu
{
.dropdown-menu
{
min-width
:
100px
;
min-width
:
100px
;
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
}
}
}
}
.
namespace
-options.dropdown.open
{
.
business-metadata
-options.dropdown.open
{
.btn-action
{
.btn-action
{
background-color
:
$color_jungle_green_approx
;
background-color
:
$color_jungle_green_approx
;
border
:
1px
solid
$color_jungle_green_approx
;
border
:
1px
solid
$color_jungle_green_approx
;
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
}
}
}
}
.
namespace
-details
{
.
business-metadata
-details
{
.expandable
.attr-details
{
.expandable
.attr-details
{
max-height
:
300px
;
max-height
:
300px
;
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
}
}
.tab-pane
{
.tab-pane
{
.
namespace
-attr-page
{
.
business-metadata
-attr-page
{
position
:
absolute
;
position
:
absolute
;
top
:
0px
;
top
:
0px
;
left
:
0px
;
left
:
0px
;
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
}
}
}
}
.
namespace
-attr-page
{
.
business-metadata
-attr-page
{
.form-horizontal
{
.form-horizontal
{
padding
:
10px
22px
;
padding
:
10px
22px
;
// border: 1px solid #DEDEDE;
// border: 1px solid #DEDEDE;
...
@@ -108,21 +108,21 @@
...
@@ -108,21 +108,21 @@
padding-right
:
10px
;
padding-right
:
10px
;
}
}
.
namespace
-attr
{
.
business-metadata
-attr
{
border
:
1px
solid
#DEDEDE
;
border
:
1px
solid
#DEDEDE
;
padding
:
10px
20px
padding
:
10px
20px
}
}
}
}
}
}
.
namespace
-attr-fontLoader
{
.
business-metadata
-attr-fontLoader
{
position
:
absolute
;
position
:
absolute
;
top
:
50%
;
top
:
50%
;
left
:
50%
;
left
:
50%
;
display
:
none
;
display
:
none
;
}
}
.
namespace
-attr-tableOverlay
{
.
business-metadata
-attr-tableOverlay
{
position
:
absolute
;
position
:
absolute
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
@@ -132,7 +132,7 @@
...
@@ -132,7 +132,7 @@
opacity
:
0
.2
;
opacity
:
0
.2
;
}
}
.
name-space
-details
{
.
business-metadata
-details
{
.backgrid
{
.backgrid
{
td
.expandable-content
{
td
.expandable-content
{
max-width
:
none
;
max-width
:
none
;
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
}
}
}
}
.
namespace
-attr-page
{
.
business-metadata
-attr-page
{
.modal-footer
{
.modal-footer
{
text-align
:
center
;
text-align
:
center
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/css/scss/style.scss
View file @
3d0fcedb
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
@import
"profile-table.scss"
;
@import
"profile-table.scss"
;
@import
"glossary.scss"
;
@import
"glossary.scss"
;
@import
"wizard.scss"
;
@import
"wizard.scss"
;
@import
"
namespace
.scss"
;
@import
"
business-metadata
.scss"
;
@import
"stats.scss"
;
@import
"stats.scss"
;
@import
"override.scss"
;
@import
"override.scss"
;
@import
"leftsidebar.scss"
@import
"leftsidebar.scss"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/collection/BaseCollection.js
View file @
3d0fcedb
...
@@ -129,6 +129,9 @@ define(['require',
...
@@ -129,6 +129,9 @@ define(['require',
nonCrudOperation
:
function
(
url
,
requestMethod
,
options
)
{
nonCrudOperation
:
function
(
url
,
requestMethod
,
options
)
{
var
that
=
this
;
var
that
=
this
;
options
[
'beforeSend'
]
=
CommonViewFunction
.
addRestCsrfCustomHeader
;
options
[
'beforeSend'
]
=
CommonViewFunction
.
addRestCsrfCustomHeader
;
if
(
options
.
data
&&
typeof
options
.
data
===
"object"
)
{
options
.
data
=
JSON
.
stringify
(
options
.
data
);
}
return
Backbone
.
sync
.
call
(
this
,
null
,
this
,
_
.
extend
({
return
Backbone
.
sync
.
call
(
this
,
null
,
this
,
_
.
extend
({
url
:
url
,
url
:
url
,
type
:
requestMethod
type
:
requestMethod
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/main.js
View file @
3d0fcedb
...
@@ -219,10 +219,10 @@ require(['App',
...
@@ -219,10 +219,10 @@ require(['App',
this
.
metricCollection
=
new
VTagList
();
this
.
metricCollection
=
new
VTagList
();
this
.
metricCollection
.
url
=
UrlLinks
.
metricsApiUrl
();
this
.
metricCollection
.
url
=
UrlLinks
.
metricsApiUrl
();
this
.
metricCollection
.
modelAttrName
=
"data"
;
this
.
metricCollection
.
modelAttrName
=
"data"
;
//
nameSpace
//
businessMetadata
this
.
nameSpace
Collection
=
new
VEntityList
();
this
.
businessMetadataDef
Collection
=
new
VEntityList
();
this
.
nameSpaceCollection
.
url
=
UrlLinks
.
nameSpace
ApiUrl
();
this
.
businessMetadataDefCollection
.
url
=
UrlLinks
.
businessMetadataDef
ApiUrl
();
this
.
nameSpaceCollection
.
modelAttrName
=
"namespace
Defs"
;
this
.
businessMetadataDefCollection
.
modelAttrName
=
"businessMetadata
Defs"
;
App
.
appRouter
=
new
Router
({
App
.
appRouter
=
new
Router
({
entityDefCollection
:
this
.
entityDefCollection
,
entityDefCollection
:
this
.
entityDefCollection
,
...
@@ -230,7 +230,7 @@ require(['App',
...
@@ -230,7 +230,7 @@ require(['App',
enumDefCollection
:
this
.
enumDefCollection
,
enumDefCollection
:
this
.
enumDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
,
metricCollection
:
this
.
metricCollection
,
metricCollection
:
this
.
metricCollection
,
nameSpaceCollection
:
this
.
nameSpace
Collection
businessMetadataDefCollection
:
this
.
businessMetadataDef
Collection
});
});
var
startApp
=
function
()
{
var
startApp
=
function
()
{
...
@@ -318,12 +318,12 @@ require(['App',
...
@@ -318,12 +318,12 @@ require(['App',
}
}
});
});
this
.
nameSpace
Collection
.
fetch
({
this
.
businessMetadataDef
Collection
.
fetch
({
complete
:
function
()
{
complete
:
function
()
{
that
.
nameSpace
Collection
.
fullCollection
.
comparator
=
function
(
model
)
{
that
.
businessMetadataDef
Collection
.
fullCollection
.
comparator
=
function
(
model
)
{
return
model
.
get
(
'name'
).
toLowerCase
();
return
model
.
get
(
'name'
).
toLowerCase
();
};
};
that
.
nameSpace
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
businessMetadataDef
Collection
.
fullCollection
.
sort
({
silent
:
true
});
--
that
.
asyncFetchCounter
;
--
that
.
asyncFetchCounter
;
startApp
();
startApp
();
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/models/BaseModel.js
View file @
3d0fcedb
...
@@ -57,6 +57,9 @@ define(['require', 'utils/Utils', 'backbone', 'utils/CommonViewFunction'], funct
...
@@ -57,6 +57,9 @@ define(['require', 'utils/Utils', 'backbone', 'utils/CommonViewFunction'], funct
nonCrudOperation
:
function
(
url
,
requestMethod
,
options
)
{
nonCrudOperation
:
function
(
url
,
requestMethod
,
options
)
{
var
that
=
this
;
var
that
=
this
;
options
[
'beforeSend'
]
=
CommonViewFunction
.
addRestCsrfCustomHeader
;
options
[
'beforeSend'
]
=
CommonViewFunction
.
addRestCsrfCustomHeader
;
if
(
options
.
data
&&
typeof
options
.
data
===
"object"
)
{
options
.
data
=
JSON
.
stringify
(
options
.
data
);
}
return
Backbone
.
sync
.
call
(
this
,
null
,
this
,
_
.
extend
({
return
Backbone
.
sync
.
call
(
this
,
null
,
this
,
_
.
extend
({
url
:
url
,
url
:
url
,
type
:
requestMethod
type
:
requestMethod
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/models/VEntity.js
View file @
3d0fcedb
...
@@ -96,20 +96,20 @@ define(['require',
...
@@ -96,20 +96,20 @@ define(['require',
},
options
);
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
"POST"
,
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
"POST"
,
options
);
},
},
save
NameSpaceAttribute
:
function
(
options
)
{
save
BusinessMetadata
:
function
(
options
)
{
var
url
=
UrlLinks
.
nameSpaceUpdate
Url
();
var
url
=
UrlLinks
.
businessMetadataDefApi
Url
();
options
=
_
.
extend
({
options
=
_
.
extend
({
contentType
:
'application/json'
,
contentType
:
'application/json'
,
dataType
:
'json'
dataType
:
'json'
},
options
);
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'
PUT
'
,
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
''
,
options
);
},
},
delete
NameSpace
:
function
(
options
)
{
delete
BusinessMetadata
:
function
(
options
)
{
var
url
=
UrlLinks
.
nameSpaceUpdate
Url
(
options
.
typeName
);
var
url
=
UrlLinks
.
businessMetadataDefApi
Url
(
options
.
typeName
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'DELETE'
,
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'DELETE'
,
options
);
},
},
save
Namespace
Entity
:
function
(
guid
,
options
)
{
save
BusinessMetadata
Entity
:
function
(
guid
,
options
)
{
var
url
=
UrlLinks
.
entities
Namespace
ApiUrl
(
guid
);
var
url
=
UrlLinks
.
entities
BusinessMetadata
ApiUrl
(
guid
);
options
=
_
.
extend
({
options
=
_
.
extend
({
contentType
:
'application/json'
,
contentType
:
'application/json'
,
dataType
:
'json'
dataType
:
'json'
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/router/Router.js
View file @
3d0fcedb
...
@@ -49,14 +49,14 @@ define([
...
@@ -49,14 +49,14 @@ define([
"!/detailPage/:id"
:
"detailPage"
,
"!/detailPage/:id"
:
"detailPage"
,
//Audit table
//Audit table
'!/administrator'
:
'administrator'
,
'!/administrator'
:
'administrator'
,
'!/administrator/
namespace/:id'
:
'nameSpace
DetailPage'
,
'!/administrator/
businessMetadata/:id'
:
'businessMetadata
DetailPage'
,
// Default
// Default
"*actions"
:
"defaultAction"
"*actions"
:
"defaultAction"
},
},
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
_
.
extend
(
this
,
this
,
_
.
pick
(
options
,
"entityDefCollection"
,
"typeHeaders"
,
"enumDefCollection"
,
"classificationDefCollection"
,
"metricCollection"
,
"
nameSpace
Collection"
)
_
.
pick
(
options
,
"entityDefCollection"
,
"typeHeaders"
,
"enumDefCollection"
,
"classificationDefCollection"
,
"metricCollection"
,
"
businessMetadataDef
Collection"
)
);
);
this
.
showRegions
();
this
.
showRegions
();
this
.
bindCommonEvents
();
this
.
bindCommonEvents
();
...
@@ -75,7 +75,7 @@ define([
...
@@ -75,7 +75,7 @@ define([
classificationDefCollection
:
this
.
classificationDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
,
glossaryCollection
:
this
.
glossaryCollection
,
glossaryCollection
:
this
.
glossaryCollection
,
metricCollection
:
this
.
metricCollection
,
metricCollection
:
this
.
metricCollection
,
nameSpaceCollection
:
this
.
nameSpace
Collection
businessMetadataDefCollection
:
this
.
businessMetadataDef
Collection
};
};
this
.
sharedObj
=
{
this
.
sharedObj
=
{
searchTableColumns
:
{},
searchTableColumns
:
{},
...
@@ -486,7 +486,7 @@ define([
...
@@ -486,7 +486,7 @@ define([
var
that
=
this
;
var
that
=
this
;
require
([
"views/site/Header"
,
"views/site/SideNavLayoutView"
,
'views/administrator/AdministratorLayoutView'
],
function
(
Header
,
SideNavLayoutView
,
AdministratorLayoutView
)
{
require
([
"views/site/Header"
,
"views/site/SideNavLayoutView"
,
'views/administrator/AdministratorLayoutView'
],
function
(
Header
,
SideNavLayoutView
,
AdministratorLayoutView
)
{
var
value
=
Utils
.
getUrlState
.
getQueryParams
(),
var
value
=
Utils
.
getUrlState
.
getQueryParams
(),
paramObj
=
_
.
extend
({
value
:
value
,
namespaceID
:
null
},
that
.
preFetchedCollectionLists
);
paramObj
=
_
.
extend
({
value
:
value
,
guid
:
null
},
that
.
preFetchedCollectionLists
);
that
.
renderViewIfNotExists
(
that
.
getHeaderOptions
(
Header
));
that
.
renderViewIfNotExists
(
that
.
getHeaderOptions
(
Header
));
that
.
renderViewIfNotExists
({
that
.
renderViewIfNotExists
({
view
:
App
.
rSideNav
,
view
:
App
.
rSideNav
,
...
@@ -502,13 +502,13 @@ define([
...
@@ -502,13 +502,13 @@ define([
App
.
rContent
.
show
(
new
AdministratorLayoutView
(
paramObj
));
App
.
rContent
.
show
(
new
AdministratorLayoutView
(
paramObj
));
});
});
},
},
nameSpaceDetailPage
:
function
(
namespaceG
uid
)
{
businessMetadataDetailPage
:
function
(
g
uid
)
{
var
that
=
this
;
var
that
=
this
;
require
([
"views/site/Header"
,
"views/site/SideNavLayoutView"
,
"views/
name_space/NameSpaceContainerLayoutView"
,
],
function
(
Header
,
SideNavLayoutView
,
NameSpace
ContainerLayoutView
)
{
require
([
"views/site/Header"
,
"views/site/SideNavLayoutView"
,
"views/
business_metadata/BusinessMetadataContainerLayoutView"
,
],
function
(
Header
,
SideNavLayoutView
,
BusinessMetadata
ContainerLayoutView
)
{
var
paramObj
=
Utils
.
getUrlState
.
getQueryParams
();
var
paramObj
=
Utils
.
getUrlState
.
getQueryParams
();
that
.
renderViewIfNotExists
(
that
.
getHeaderOptions
(
Header
));
that
.
renderViewIfNotExists
(
that
.
getHeaderOptions
(
Header
));
var
options
=
_
.
extend
({
var
options
=
_
.
extend
({
namespaceID
:
namespaceG
uid
,
guid
:
g
uid
,
value
:
paramObj
,
value
:
paramObj
,
searchVent
:
that
.
searchVent
,
searchVent
:
that
.
searchVent
,
categoryEvent
:
that
.
categoryEvent
categoryEvent
:
that
.
categoryEvent
...
@@ -525,7 +525,7 @@ define([
...
@@ -525,7 +525,7 @@ define([
return
new
SideNavLayoutView
(
options
);
return
new
SideNavLayoutView
(
options
);
}
}
});
});
App
.
rContent
.
show
(
new
NameSpace
ContainerLayoutView
(
options
));
App
.
rContent
.
show
(
new
BusinessMetadata
ContainerLayoutView
(
options
));
});
});
},
},
defaultAction
:
function
(
actions
)
{
defaultAction
:
function
(
actions
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/administrator/AdministratorLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -20,15 +20,15 @@
...
@@ -20,15 +20,15 @@
</div> -->
</div> -->
<div
class=
"col-sm-12 default-tab"
>
<div
class=
"col-sm-12 default-tab"
>
<ul
class=
"nav nav-tabs"
data-id=
"tab-list"
>
<ul
class=
"nav nav-tabs"
data-id=
"tab-list"
>
<li
role=
"
namespace"
class=
"tab active"
><a
href=
"#tab-namespace"
aria-controls=
"tab-namespace"
role=
"tab"
data-toggle=
"tab"
>
Namespaces
</a></li>
<li
role=
"
businessMetadata"
class=
"tab active"
><a
href=
"#tab-businessMetadata"
aria-controls=
"tab-businessMetadata"
role=
"tab"
data-toggle=
"tab"
>
Business Metadata
</a></li>
<li
role=
"enum"
><a
href=
"#tab-enum"
aria-controls=
"tab-enum"
role=
"tab"
data-toggle=
"tab"
>
Enumerations
</a></li>
<li
role=
"enum"
><a
href=
"#tab-enum"
aria-controls=
"tab-enum"
role=
"tab"
data-toggle=
"tab"
>
Enumerations
</a></li>
</ul>
</ul>
</div>
</div>
</div>
</div>
<div>
<div>
<div
class=
"tab-content purge-details"
>
<div
class=
"tab-content purge-details"
>
<div
id=
"tab-
namespace"
role=
"namespace
"
class=
"tab-pane active animated fadeIn"
>
<div
id=
"tab-
businessMetadata"
role=
"businessMetadata
"
class=
"tab-pane active animated fadeIn"
>
<div
id=
"r_
namespace
TableLayoutView"
>
<div
id=
"r_
businessMetadata
TableLayoutView"
>
</div>
</div>
</div>
</div>
<div
id=
"tab-enum"
role=
"enum"
class=
"tab-pane animated fadeIn"
>
<div
id=
"tab-enum"
role=
"enum"
class=
"tab-pane animated fadeIn"
>
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space/NameSpace
AttrTableLayoutView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata/BusinessMetadata
AttrTableLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -14,34 +14,34 @@
...
@@ -14,34 +14,34 @@
* 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.
-->
-->
<div
class=
"
namespace-attr-page"
data-id=
"namespace
AttrPage"
>
<div
class=
"
business-metadata-attr-page"
data-id=
"businessMetadata
AttrPage"
>
<div
class=
"
namespace
-attr-tableOverlay"
></div>
<div
class=
"
business-metadata
-attr-tableOverlay"
></div>
<div
class=
" modal-header"
data-id=
"
namespace
AttrPageHeader"
>
<div
class=
" modal-header"
data-id=
"
businessMetadata
AttrPageHeader"
>
<h4
class=
"modal-title"
data-id=
"
namespace
AttrPageTitle"
></h4>
<h4
class=
"modal-title"
data-id=
"
businessMetadata
AttrPageTitle"
></h4>
</div>
</div>
<div
id=
"r_modal"
>
<div
id=
"r_modal"
>
</div>
</div>
<div
class=
"
namespace
-attr-fontLoader"
>
<div
class=
"
business-metadata
-attr-fontLoader"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
</div>
<!-- <div class="modal-footer " data-id="modalFooter">
<!-- <div class="modal-footer " data-id="modalFooter">
<button type="button" class="btn btn-action cancel" data-id="
namespace
AttrPageCancle">Cancel</button>
<button type="button" class="btn btn-action cancel" data-id="
businessMetadata
AttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="
namespace
AttrPageOk">Ok</button>
<button type="button" class="btn btn-atlas ok" data-id="
businessMetadata
AttrPageOk">Ok</button>
</div> -->
</div> -->
</div>
</div>
<div
class=
"
namespace-details"
data-id=
"namespace
DetailPage"
>
<div
class=
"
business-metadata-details"
data-id=
"businessMetadata
DetailPage"
>
<div
class=
"position-relative"
>
<div
class=
"position-relative"
>
<div
class=
"pull-right inline-content-fr no-padding-left"
>
<div
class=
"pull-right inline-content-fr no-padding-left"
>
<div
class=
"inline"
data-id=
"colManager"
></div>
<div
class=
"inline"
data-id=
"colManager"
></div>
<div
class=
"inline"
>
<div
class=
"inline"
>
<button
type=
"button"
data-id=
"addAttribute"
title=
"Create
Namespace"
class=
"btn btn-action btn-sm pull-right btn-loader"
style=
"margin-bottom: 10px;"
data-action=
"createNamespace
"
>
<button
type=
"button"
data-id=
"addAttribute"
title=
"Create
Business Metadata Attribute"
class=
"btn btn-action btn-sm pull-right btn-loader"
style=
"margin-bottom: 10px;"
data-action=
"createBusinessMetadata
"
>
<i
class=
'fa fa-plus'
></i>
Attributes
<i
class=
'fa fa-plus'
></i>
Attributes
</button></div>
</button></div>
</div>
</div>
<div
class=
"tableOverlay"
></div>
<div
class=
"tableOverlay"
></div>
<div
class=
'attr-filter-overlay hide'
></div>
<div
class=
'attr-filter-overlay hide'
></div>
<div
class=
"auditTable
name-space
-details"
>
<div
class=
"auditTable
business-metadata
-details"
>
<div
id=
"r_
nameSpace
AttrTableLayoutView"
></div>
<div
id=
"r_
businessMetadata
AttrTableLayoutView"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space/NameSpace
AttributeItemView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata/BusinessMetadata
AttributeItemView_tmpl.html
View file @
3d0fcedb
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* 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.
-->
-->
<div
id=
"{{modalID}}"
class=
"form-group clearfix
namespace
-attr"
>
<div
id=
"{{modalID}}"
class=
"form-group clearfix
business-metadata
-attr"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-12 attributePlusData "
align=
"right"
>
<div
class=
"col-sm-12 attributePlusData "
align=
"right"
>
<button
type=
"button"
class=
"btn btn-danger btn-sm closeInput"
data-id=
"close"
><i
class=
"fa fa-times"
></i></button>
<button
type=
"button"
class=
"btn btn-danger btn-sm closeInput"
data-id=
"close"
><i
class=
"fa fa-times"
></i></button>
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"form-group entity-
namespace
-selector"
>
<div
class=
"form-group entity-
businessMetadata
-selector"
>
<label
class=
"control-label col-sm-3"
for=
"name"
>
Applicable Types
</label>
<label
class=
"control-label col-sm-3"
for=
"name"
>
Applicable Types
</label>
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-8"
>
<select
class=
"form-control entityTypeSelector"
data-id=
"entityTypeSelector"
multiple=
"multiple"
>
<select
class=
"form-control entityTypeSelector"
data-id=
"entityTypeSelector"
multiple=
"multiple"
>
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space/NameSpace
ContainerLayoutView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata/BusinessMetadata
ContainerLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -15,6 +15,6 @@
...
@@ -15,6 +15,6 @@
* limitations under the License.
* limitations under the License.
-->
-->
<div>
<div>
<div
id=
"r_
nameSpace
DetailContainer"
class=
"sidebar-fixed-filter"
></div>
<div
id=
"r_
businessMetadata
DetailContainer"
class=
"sidebar-fixed-filter"
></div>
<div
id=
"r_
nameSpace
AttrContainer"
class=
"col-sm-12"
></div>
<div
id=
"r_
businessMetadata
AttrContainer"
class=
"col-sm-12"
></div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space/NameSpace
DetailLayoutView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata/BusinessMetadata
DetailLayoutView_tmpl.html
View file @
3d0fcedb
File moved
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space/NameSpace
TableLayoutView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata/BusinessMetadata
TableLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -14,34 +14,34 @@
...
@@ -14,34 +14,34 @@
* 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.
-->
-->
<div
class=
"
namespace-attr-page"
data-id=
"namespace
AttrPage"
>
<div
class=
"
business-metadata-attr-page"
data-id=
"businessMetadata
AttrPage"
>
<div
class=
"
namespace
-attr-tableOverlay"
></div>
<div
class=
"
business-metadata
-attr-tableOverlay"
></div>
<div
class=
" modal-header"
data-id=
"
namespace
AttrPageHeader"
>
<div
class=
" modal-header"
data-id=
"
businessMetadata
AttrPageHeader"
>
<h4
class=
"modal-title"
data-id=
"
namespace
AttrPageTitle"
></h4>
<h4
class=
"modal-title"
data-id=
"
businessMetadata
AttrPageTitle"
></h4>
</div>
</div>
<div
id=
"r_modal"
>
<div
id=
"r_modal"
>
</div>
</div>
<div
class=
"
namespace
-attr-fontLoader"
>
<div
class=
"
business-metadata
-attr-fontLoader"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
</div>
<!-- <div class="modal-footer " data-id="modalFooter">
<!-- <div class="modal-footer " data-id="modalFooter">
<button type="button" class="btn btn-action cancel" data-id="
namespace
AttrPageCancle">Cancel</button>
<button type="button" class="btn btn-action cancel" data-id="
businessMetadata
AttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="
namespace
AttrPageOk">Ok</button>
<button type="button" class="btn btn-atlas ok" data-id="
businessMetadata
AttrPageOk">Ok</button>
</div> -->
</div> -->
</div>
</div>
<div
class=
"
namespace-details"
data-id=
"namespace
DetailPage"
>
<div
class=
"
business-metadata-details"
data-id=
"businessMetadata
DetailPage"
>
<div
class=
"position-relative"
>
<div
class=
"position-relative"
>
<div
class=
"pull-right inline-content-fr no-padding-left"
>
<div
class=
"pull-right inline-content-fr no-padding-left"
>
<div
class=
"inline"
data-id=
"colManager"
></div>
<div
class=
"inline"
data-id=
"colManager"
></div>
<div
class=
"inline"
>
<div
class=
"inline"
>
<button
type=
"button"
data-id=
"create
NameSpace"
title=
"Create Namespace"
class=
"btn btn-action btn-sm pull-right btn-loader"
style=
"margin-bottom: 10px;"
data-action=
"createNamespace
"
>
<button
type=
"button"
data-id=
"create
BusinessMetadata"
title=
"Create Business Metadata"
class=
"btn btn-action btn-sm pull-right btn-loader"
style=
"margin-bottom: 10px;"
data-action=
"createBusinessMetadata
"
>
<i
class=
'fa fa-plus'
></i>
Create
Namespace
<i
class=
'fa fa-plus'
></i>
Create
Business Metadata
</button></div>
</button></div>
</div>
</div>
<div
class=
"tableOverlay"
></div>
<div
class=
"tableOverlay"
></div>
<div
class=
'attr-filter-overlay hide'
></div>
<div
class=
'attr-filter-overlay hide'
></div>
<div
class=
"auditTable
name-space
-details"
>
<div
class=
"auditTable
business-metadata
-details"
>
<div
id=
"r_
nameSpace
TableLayoutView"
></div>
<div
id=
"r_
businessMetadata
TableLayoutView"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space/CreateNameSpace
LayoutView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata/CreateBusinessMetadata
LayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -17,13 +17,13 @@
...
@@ -17,13 +17,13 @@
<div
class=
"fontLoader"
>
<div
class=
"fontLoader"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
</div>
<form
name=
"tagDefinitionform"
class=
"hide form-horizontal"
data-id=
"createTag
Form"
style=
"width: 70%;margin: 0 auto;"
>
<form
class=
"hide form-horizontal"
data-id=
"create
Form"
style=
"width: 70%;margin: 0 auto;"
>
{{#if fromTable}}
{{#if fromTable}}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<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
namespace-name"
data-id=
"tagN
ame"
placeholder=
"Name(required)"
autofocus
/>
<input
class=
"form-control
businessMetadata-name"
data-id=
"n
ame"
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}}
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<!-- <h4 class="col-sm-6">Attributes</h4> -->
<!-- <h4 class="col-sm-6">Attributes</h4> -->
{{#if isEditAttr}}
{{#if isEditAttr}}
<div
class=
"col-sm-12 no-padding-left"
>
<div
class=
"col-sm-12 no-padding-left"
>
<button
title=
"Add
Namespace attribute"
type=
"button"
class=
"btn btn-action btn-sm pull-left"
data-id=
"attributeData"
><i
class=
"fa fa-plus"
></i>
Add Namespace
attribute
</button>
<button
title=
"Add
Business Metadata attribute"
type=
"button"
class=
"btn btn-action btn-sm pull-left"
data-id=
"attributeData"
><i
class=
"fa fa-plus"
></i>
Add Business Metadata
attribute
</button>
</div>
</div>
{{/if}}
{{/if}}
</div>
</div>
...
@@ -48,6 +48,6 @@
...
@@ -48,6 +48,6 @@
</div>
</div>
</form>
</form>
<div
class=
"modal-footer "
data-id=
"modalFooter"
>
<div
class=
"modal-footer "
data-id=
"modalFooter"
>
<button
type=
"button"
class=
"btn btn-action cancel"
data-id=
"
namespace
AttrPageCancle"
>
Cancel
</button>
<button
type=
"button"
class=
"btn btn-action cancel"
data-id=
"
businessMetadata
AttrPageCancle"
>
Cancel
</button>
<button
type=
"button"
class=
"btn btn-atlas ok"
data-id=
"
namespace
AttrPageOk"
>
Ok
</button>
<button
type=
"button"
class=
"btn btn-atlas ok"
data-id=
"
businessMetadata
AttrPageOk"
>
Ok
</button>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/
name_space
/EnumCreateUpdateItemView_tmpl.html
→
dashboardv3/public/js/templates/
business_metadata
/EnumCreateUpdateItemView_tmpl.html
View file @
3d0fcedb
File moved
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
</div>
</div>
</div>
</div>
<div
id=
"r_entityLabelDefineView"
></div>
<div
id=
"r_entityLabelDefineView"
></div>
<div
id=
"r_entity
NameSpace
View"
></div>
<div
id=
"r_entity
BusinessMetadata
View"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/entity/Entity
NameSpace
ItemView_tmpl.html
→
dashboardv3/public/js/templates/entity/Entity
BusinessMetaData
ItemView_tmpl.html
View file @
3d0fcedb
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<table
class=
"custom-table"
style=
"font-weight: 100;"
>
<table
class=
"custom-table"
style=
"font-weight: 100;"
>
<tr
class=
"custom-tr"
>
<tr
class=
"custom-tr"
>
<td
class=
"custom-col-1"
>
<td
class=
"custom-col-1"
>
{{{callmyfunction get
NamespaceDroupdown nameSpace
Collection}}}
{{{callmyfunction get
BusinessMetadataDroupdown businessMetadata
Collection}}}
</td>
</td>
<td
class=
"custom-col-0"
>
:
</td>
<td
class=
"custom-col-0"
>
:
</td>
<td
class=
"custom-col-1"
data-id=
"value"
>
<td
class=
"custom-col-1"
data-id=
"value"
>
...
@@ -36,9 +36,9 @@
...
@@ -36,9 +36,9 @@
</table>
</table>
{{else}}
{{else}}
<hr
/>
<hr
/>
<ul
class=
"
namespace
-tree-parent"
>
<ul
class=
"
business-metadata
-tree-parent"
>
<li>
{{model.__internal_UI_
nameSpace
Name}}
</li>
<li>
{{model.__internal_UI_
businessMetadata
Name}}
</li>
<li
class=
"
namespace-tree-child"
data-id=
"namespace
TreeChild"
>
<li
class=
"
business-metadata-tree-child"
data-id=
"businessMetadata
TreeChild"
>
</li>
</li>
</ul>
</ul>
{{/ifCond}}
{{/ifCond}}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/entity/Entity
NameSpace
View_tmpl.html
→
dashboardv3/public/js/templates/entity/Entity
BusinessMetaData
View_tmpl.html
View file @
3d0fcedb
...
@@ -14,28 +14,28 @@
...
@@ -14,28 +14,28 @@
* 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.
-->
-->
<div
class=
"panel panel-default custom-panel expand_collapse_panel-icon"
data-id=
"namespace"
>
<div
class=
"panel panel-default custom-panel expand_collapse_panel-icon"
>
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#
namespace
Collapse"
aria-expanded=
"false"
style=
"width: 70%;"
>
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#
businessMetadata
Collapse"
aria-expanded=
"false"
style=
"width: 70%;"
>
<h4
class=
"panel-title"
>
<h4
class=
"panel-title"
>
<a>
Namespaces
</a>
<a>
Business Metadata
</a>
</h4>
</h4>
<div
class=
"btn-group pull-left"
>
<div
class=
"btn-group pull-left"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
</div>
</div>
<div
class=
"panel-actions"
>
<div
class=
"panel-actions"
>
<button
class=
"btn btn-action btn-sm"
data-id=
"add
NameSpace
"
>
Add
</button>
<button
class=
"btn btn-action btn-sm"
data-id=
"add
BusinessMetadata
"
>
Add
</button>
<button
class=
"btn btn-action btn-sm"
style=
"display: none;"
data-id=
"save
NameSpace
"
>
Save
</button>
<button
class=
"btn btn-action btn-sm"
style=
"display: none;"
data-id=
"save
BusinessMetadata
"
>
Save
</button>
<button
class=
"btn btn-action btn-sm"
style=
"display: none;"
data-id=
"cancel"
>
Cancel
</button>
<button
class=
"btn btn-action btn-sm"
style=
"display: none;"
data-id=
"cancel"
>
Cancel
</button>
</div>
</div>
<div
id=
"
namespace
Collapse"
class=
"panel-collapse collapse"
>
<div
id=
"
businessMetadata
Collapse"
class=
"panel-collapse collapse"
>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<div
data-id=
"
namespace
Tree"
></div>
<div
data-id=
"
businessMetadata
Tree"
></div>
<div
class=
"editBox"
style=
"display: none;"
>
<div
class=
"editBox"
style=
"display: none;"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<a
href=
"javascript:void(0)"
class=
"btn btn-action btn-sm"
data-id=
"addItem"
data-type=
"addAttrButton"
>
Add New Attribute
</a>
<a
href=
"javascript:void(0)"
class=
"btn btn-action btn-sm"
data-id=
"addItem"
data-type=
"addAttrButton"
>
Add New Attribute
</a>
</div>
</div>
<ul
class=
"
namespace
-tree-parent"
data-id=
"itemView"
></ul>
<ul
class=
"
business-metadata
-tree-parent"
data-id=
"itemView"
></ul>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/search/SearchFilterBrowseLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<div
data-id=
"r_classificationTreeRender"
></div>
<div
data-id=
"r_classificationTreeRender"
></div>
</div>
</div>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
>
<div
data-id=
"r_
nameSpace
TreeRender"
></div>
<div
data-id=
"r_
businessMetadata
TreeRender"
></div>
</div>
</div>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
>
<div
data-id=
"r_glossaryTreeRender"
></div>
<div
data-id=
"r_glossaryTreeRender"
></div>
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/search/tree/
NameSpace
TreeLayoutView_tmpl.html
→
dashboardv3/public/js/templates/search/tree/
BusinessMetadata
TreeLayoutView_tmpl.html
View file @
3d0fcedb
...
@@ -15,31 +15,21 @@
...
@@ -15,31 +15,21 @@
* limitations under the License.
* limitations under the License.
-->
-->
<div
class=
"panel panel-default expand_collapse_panel-icon right-icons"
>
<div
class=
"panel panel-default expand_collapse_panel-icon right-icons"
>
<div
class=
"panel-heading dash-button-icon clearfix"
data-toggle=
"collapse"
aria-expanded=
"true"
href=
"#
c_namespac
e"
>
<div
class=
"panel-heading dash-button-icon clearfix"
data-toggle=
"collapse"
aria-expanded=
"true"
href=
"#
businessMetadataTre
e"
>
<i
class=
"ec-icon fa"
></i>
<i
class=
"ec-icon fa"
></i>
<h4
class=
"panel-title"
>
Namespaces
</h4>
<h4
class=
"panel-title"
>
Business Metadata
</h4>
<div
class=
"btn-group pull-right"
>
<div
class=
"btn-group pull-right"
>
<button
type=
"button"
class=
"typeRefresh drop-down-menu-view"
data-id=
"refreshTree"
data-type=
"classification"
title=
"Refresh"
>
<button
type=
"button"
class=
"typeRefresh drop-down-menu-view"
data-id=
"refreshTree"
title=
"Refresh"
>
<i
class=
"fa fa-refresh"
></i>
<i
class=
"fa fa-refresh"
></i>
</button>
</button>
<button
type=
"button"
class=
"typeRefresh drop-down-menu-view"
data-id=
"create
NameSpace"
data-type=
"classification"
title=
"Open Namespaces
"
>
<button
type=
"button"
class=
"typeRefresh drop-down-menu-view"
data-id=
"create
BusinessMetadata"
title=
"Open Business Metadata
"
>
<i
class=
"fa fa-external-link"
></i>
<i
class=
"fa fa-external-link"
></i>
</button>
</button>
<!-- <button type="button" class="typeRefresh dropdown">
<div class=" btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-v"></i>
</div>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<li data-id="groupOrFlatTreeView" data-type="classification"> <i class="fa fa-list-ul"></i><span>Show flat tree</span>
</li>
<li data-id="createNameSpace" data-type="classification"> <i class="fa fa-plus"></i><span>Create Namespace</span>
</li>
</button> -->
</ul>
</ul>
</button>
</button>
</div>
</div>
</div>
</div>
<div
id=
"
c_namespac
e"
class=
"panel-collapse collapse jstree-with-action in"
>
<div
id=
"
businessMetadataTre
e"
class=
"panel-collapse collapse jstree-with-action in"
>
<div
data-id=
"
nameSpace
SearchTree"
></div>
<div
data-id=
"
businessMetadata
SearchTree"
></div>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/utils/UrlLinks.js
View file @
3d0fcedb
...
@@ -37,6 +37,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
...
@@ -37,6 +37,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
classificationDefApiUrl
:
function
(
name
)
{
classificationDefApiUrl
:
function
(
name
)
{
return
this
.
getDefApiUrl
(
'classification'
,
name
);
return
this
.
getDefApiUrl
(
'classification'
,
name
);
},
},
businessMetadataDefApiUrl
:
function
(
name
)
{
return
this
.
getDefApiUrl
(
'business_metadata'
,
name
);
},
enumDefApiUrl
:
function
(
name
)
{
enumDefApiUrl
:
function
(
name
)
{
return
this
.
getDefApiUrl
(
'enum'
,
name
);
return
this
.
getDefApiUrl
(
'enum'
,
name
);
},
},
...
@@ -99,9 +102,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
...
@@ -99,9 +102,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return
this
.
baseUrlV2
+
'/entity/bulk/classification'
;
return
this
.
baseUrlV2
+
'/entity/bulk/classification'
;
}
}
},
},
entities
Namespace
ApiUrl
:
function
(
guid
)
{
entities
BusinessMetadata
ApiUrl
:
function
(
guid
)
{
if
(
guid
)
{
if
(
guid
)
{
return
this
.
baseUrlV2
+
'/entity/guid/'
+
guid
+
'/
namespaces
?isOverwrite=true'
;
return
this
.
baseUrlV2
+
'/entity/guid/'
+
guid
+
'/
businessmetata
?isOverwrite=true'
;
}
}
},
},
entityCollectionaudit
:
function
(
guid
)
{
entityCollectionaudit
:
function
(
guid
)
{
...
@@ -130,14 +133,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
...
@@ -130,14 +133,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
}
}
return
url
;
return
url
;
},
},
classicationApiUrl
:
function
(
name
,
guid
)
{
var
typeUrl
=
this
.
typedefsUrl
();
if
(
name
)
{
return
typeUrl
.
def
+
'/name/'
+
name
+
'?type=classification'
;
}
else
if
(
guid
)
{
return
typeUrl
.
def
+
'/guid/'
+
guid
+
'?type=classification'
;
}
},
typesApiUrl
:
function
()
{
typesApiUrl
:
function
()
{
return
this
.
typedefsUrl
().
defs
+
'/headers?excludeInternalTypesAndReferences=true'
return
this
.
typedefsUrl
().
defs
+
'/headers?excludeInternalTypesAndReferences=true'
},
},
...
@@ -234,24 +229,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
...
@@ -234,24 +229,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
},
},
purgeApiUrl
:
function
()
{
purgeApiUrl
:
function
()
{
return
this
.
baseUrl
+
'/admin/audit'
;
return
this
.
baseUrl
+
'/admin/audit'
;
},
nameSpaceApiUrl
:
function
()
{
return
this
.
typedefsUrl
().
defs
+
'?type=namespace'
;
},
nameSpaceGuidApiUrl
:
function
(
guid
)
{
var
lineageUrl
=
this
.
baseUrlV2
+
'/types/namespacedef/guid'
;
if
(
guid
)
{
return
lineageUrl
+
'/'
+
guid
;
}
else
{
return
lineageUrl
}
},
nameSpaceUpdateUrl
:
function
(
name
)
{
if
(
name
)
{
return
this
.
typedefsUrl
().
def
+
'/name/'
+
name
;
}
else
{
return
this
.
typedefsUrl
().
defs
+
'?type=namespace'
;
}
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/utils/Utils.js
View file @
3d0fcedb
...
@@ -567,7 +567,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
...
@@ -567,7 +567,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
urlPath
=
"tagUrl"
;
urlPath
=
"tagUrl"
;
}
else
if
(
queryParams
.
from
==
"glossary"
)
{
}
else
if
(
queryParams
.
from
==
"glossary"
)
{
urlPath
=
"glossaryUrl"
;
urlPath
=
"glossaryUrl"
;
}
else
if
(
queryParams
.
from
==
"
namespace
"
)
{
}
else
if
(
queryParams
.
from
==
"
bm
"
)
{
urlPath
=
"administratorUrl"
;
urlPath
=
"administratorUrl"
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/administrator/AdministratorLayoutView.js
View file @
3d0fcedb
...
@@ -37,7 +37,7 @@ define(['require',
...
@@ -37,7 +37,7 @@ define(['require',
/** Layout sub regions */
/** Layout sub regions */
regions
:
{
regions
:
{
R
NamespaceTableLayoutView
:
"#r_namespace
TableLayoutView"
,
R
BusinessMetadataTableLayoutView
:
"#r_businessMetadata
TableLayoutView"
,
REnumTableLayoutView
:
'#r_enumTableLayoutView'
REnumTableLayoutView
:
'#r_enumTableLayoutView'
},
},
...
@@ -67,7 +67,7 @@ define(['require',
...
@@ -67,7 +67,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'guid'
,
'entity
'
,
'entityName'
,
'attributeDefs'
,
'entityDefCollection'
,
'nameSpace
Collection'
,
'enumDefCollection'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'guid'
,
'entity
DefCollection'
,
'businessMetadataDef
Collection'
,
'enumDefCollection'
));
},
},
onShow
:
function
()
{
onShow
:
function
()
{
...
@@ -81,21 +81,21 @@ define(['require',
...
@@ -81,21 +81,21 @@ define(['require',
this
.
renderEnumLayoutView
();
this
.
renderEnumLayoutView
();
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
render
NameSpace
LayoutView
();
this
.
render
BusinessMetadata
LayoutView
();
this
.
bindEvents
();
this
.
bindEvents
();
},
},
render
NameSpace
LayoutView
:
function
(
obj
)
{
render
BusinessMetadata
LayoutView
:
function
(
obj
)
{
var
that
=
this
;
var
that
=
this
;
require
([
'views/
name_space/NameSpaceTableLayoutView'
],
function
(
NameSpace
TableLayoutView
)
{
require
([
'views/
business_metadata/BusinessMetadataTableLayoutView'
],
function
(
BusinessMetadata
TableLayoutView
)
{
that
.
R
NamespaceTableLayoutView
.
show
(
new
NameSpaceTableLayoutView
({
nameSpaceCollection
:
that
.
nameSpace
Collection
,
entityDefCollection
:
that
.
entityDefCollection
}));
that
.
R
BusinessMetadataTableLayoutView
.
show
(
new
BusinessMetadataTableLayoutView
({
businessMetadataDefCollection
:
that
.
businessMetadataDef
Collection
,
entityDefCollection
:
that
.
entityDefCollection
}));
});
});
},
},
renderEnumLayoutView
:
function
(
obj
)
{
renderEnumLayoutView
:
function
(
obj
)
{
var
that
=
this
;
var
that
=
this
;
require
([
"views/
name_space
/EnumCreateUpdateItemView"
],
function
(
EnumCreateUpdateItemView
)
{
require
([
"views/
business_metadata
/EnumCreateUpdateItemView"
],
function
(
EnumCreateUpdateItemView
)
{
var
view
=
new
EnumCreateUpdateItemView
({
var
view
=
new
EnumCreateUpdateItemView
({
enumDefCollection
:
that
.
enumDefCollection
,
enumDefCollection
:
that
.
enumDefCollection
,
nameSpaceCollection
:
that
.
nameSpace
Collection
businessMetadataDefCollection
:
that
.
businessMetadataDef
Collection
});
});
that
.
REnumTableLayoutView
.
show
(
view
);
that
.
REnumTableLayoutView
.
show
(
view
);
});
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/
name_space/NameSpace
AttrTableLayoutView.js
→
dashboardv3/public/js/views/
business_metadata/BusinessMetadata
AttrTableLayoutView.js
View file @
3d0fcedb
...
@@ -18,28 +18,21 @@
...
@@ -18,28 +18,21 @@
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/name_space/NameSpaceAttrTableLayoutView_tmpl'
,
'hbs!tmpl/business_metadata/BusinessMetadataAttrTableLayoutView_tmpl'
,
'collection/VEntityList'
,
'collection/VEntityList'
'collection/VTagList'
,
],
function
(
require
,
Backbone
,
BusinessMetadataAttrTableLayoutView_tmpl
,
VEntityList
)
{
'models/VSearch'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Enums'
,
'utils/UrlLinks'
,
'utils/CommonViewFunction'
],
function
(
require
,
Backbone
,
NameSpaceAttrTableLayoutView_tmpl
,
VEntityList
,
VTagList
,
VSearch
,
Utils
,
Messages
,
Enums
,
UrlLinks
,
CommonViewFunction
)
{
'use strict'
;
'use strict'
;
var
NameSpace
AttrTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
BusinessMetadata
AttrTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends
NameSpace
AttrTableLayoutView */
/** @lends
BusinessMetadata
AttrTableLayoutView */
{
{
_viewName
:
'
NameSpace
AttrTableLayoutView'
,
_viewName
:
'
BusinessMetadata
AttrTableLayoutView'
,
template
:
NameSpace
AttrTableLayoutView_tmpl
,
template
:
BusinessMetadata
AttrTableLayoutView_tmpl
,
/** Layout sub regions */
/** Layout sub regions */
regions
:
{
regions
:
{
R
NameSpaceAttrTableLayoutView
:
"#r_nameSpace
AttrTableLayoutView"
,
R
BusinessMetadataAttrTableLayoutView
:
"#r_businessMetadata
AttrTableLayoutView"
,
RModal
:
"#r_modal"
RModal
:
"#r_modal"
},
},
...
@@ -47,9 +40,9 @@ define(['require',
...
@@ -47,9 +40,9 @@ define(['require',
ui
:
{
ui
:
{
attributeEdit
:
"[data-id='attributeEdit']"
,
attributeEdit
:
"[data-id='attributeEdit']"
,
addAttribute
:
'[data-id="addAttribute"]'
,
addAttribute
:
'[data-id="addAttribute"]'
,
namespaceAttrPage
:
"[data-id='namespace
AttrPage']"
,
businessMetadataAttrPage
:
"[data-id='businessMetadata
AttrPage']"
,
namespaceAttrPageTitle
:
"[data-id='namespace
AttrPageTitle']"
,
businessMetadataAttrPageTitle
:
"[data-id='businessMetadata
AttrPageTitle']"
,
namespaceDetailPage
:
"[data-id='namespace
DetailPage']"
,
businessMetadataDetailPage
:
"[data-id='businessMetadata
DetailPage']"
,
},
},
/** ui events hash */
/** ui events hash */
events
:
function
()
{
events
:
function
()
{
...
@@ -59,13 +52,14 @@ define(['require',
...
@@ -59,13 +52,14 @@ define(['require',
return
events
;
return
events
;
},
},
/**
/**
* intialize a new
NameSpace
AttrTableLayoutView Layout
* intialize a new
BusinessMetadata
AttrTableLayoutView Layout
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'typeHeaders'
,
'nameSpaceCollection'
,
'nameSpaceAttr'
,
'entityDefCollection'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'model'
,
'typeHeaders'
,
'businessMetadataDefCollection'
,
'entityDefCollection'
));
this
.
businessMetadataAttr
=
new
VEntityList
(
this
.
model
.
get
(
"attributeDefs"
)
||
[]);
this
.
commonTableOptions
=
{
this
.
commonTableOptions
=
{
collection
:
this
.
nameSpace
Attr
,
collection
:
this
.
businessMetadata
Attr
,
includeFilter
:
false
,
includeFilter
:
false
,
includePagination
:
false
,
includePagination
:
false
,
includePageSize
:
false
,
includePageSize
:
false
,
...
@@ -82,35 +76,31 @@ define(['require',
...
@@ -82,35 +76,31 @@ define(['require',
this
.
showDetails
=
true
;
this
.
showDetails
=
true
;
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
toggleNamespaceDetailsAttrView
();
if
(
this
.
nameSpaceCollection
.
models
.
length
&&
!
this
.
model
)
{
this
.
model
=
this
.
nameSpaceCollection
.
fullCollection
.
findWhere
({
guid
:
this
.
guid
});
Utils
.
showTitleLoader
(
this
.
$
(
'.page-title .fontLoader'
),
this
.
$
(
'.tagDetail'
));
this
.
renderTableLayoutView
();
this
.
renderTableLayoutView
();
}
this
.
toggleBusinessMetadataDetailsAttrView
();
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
toggle
Namespace
DetailsAttrView
:
function
()
{
toggle
BusinessMetadata
DetailsAttrView
:
function
()
{
var
that
=
this
;
var
that
=
this
;
if
(
that
.
showDetails
)
{
if
(
that
.
showDetails
)
{
that
.
ui
.
namespace
AttrPage
.
hide
();
that
.
ui
.
businessMetadata
AttrPage
.
hide
();
that
.
ui
.
namespace
DetailPage
.
show
();
that
.
ui
.
businessMetadata
DetailPage
.
show
();
}
else
{
}
else
{
that
.
ui
.
namespace
AttrPage
.
show
();
that
.
ui
.
businessMetadata
AttrPage
.
show
();
that
.
ui
.
namespace
DetailPage
.
hide
();
that
.
ui
.
businessMetadata
DetailPage
.
hide
();
}
}
},
},
onEditAttr
:
function
(
e
)
{
onEditAttr
:
function
(
e
)
{
var
that
=
this
,
var
that
=
this
,
isAttrEdit
=
false
,
isAttrEdit
=
false
,
selected
Namespace
=
that
.
nameSpaceCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
guid
})
,
selected
BusinessMetadata
=
that
.
model
,
attrributes
=
selected
Namespace
?
selectedNamespace
.
get
(
'attributeDefs'
)
:
null
,
attrributes
=
selected
BusinessMetadata
?
selectedBusinessMetadata
.
get
(
'attributeDefs'
)
:
null
,
attrName
=
e
.
target
.
dataset
.
name
?
e
.
target
.
dataset
.
name
:
null
,
attrName
=
e
.
target
.
dataset
.
name
?
e
.
target
.
dataset
.
name
:
null
,
attrDetails
=
{
name
:
attrName
};
attrDetails
=
{
name
:
attrName
};
if
(
e
.
target
.
dataset
.
action
==
'attributeEdit'
)
{
if
(
e
.
target
.
dataset
.
action
==
'attributeEdit'
)
{
isAttrEdit
=
true
isAttrEdit
=
true
}
}
if
(
selected
Namespace
)
{
if
(
selected
BusinessMetadata
)
{
that
.
newAttr
=
isAttrEdit
?
false
:
true
;
that
.
newAttr
=
isAttrEdit
?
false
:
true
;
_
.
each
(
attrributes
,
function
(
attrObj
)
{
_
.
each
(
attrributes
,
function
(
attrObj
)
{
if
(
attrObj
.
name
===
attrName
)
{
if
(
attrObj
.
name
===
attrName
)
{
...
@@ -125,39 +115,32 @@ define(['require',
...
@@ -125,39 +115,32 @@ define(['require',
}
}
});
});
this
.
showDetails
=
false
;
this
.
showDetails
=
false
;
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
require
([
"views/
name_space/CreateNameSpaceLayoutView"
],
function
(
CreateNameSpace
LayoutView
)
{
require
([
"views/
business_metadata/CreateBusinessMetadataLayoutView"
],
function
(
CreateBusinessMetadata
LayoutView
)
{
that
.
view
=
new
Create
NameSpace
LayoutView
({
that
.
view
=
new
Create
BusinessMetadata
LayoutView
({
onEditCallback
:
function
()
{
onEditCallback
:
function
()
{
enumDefCollection
.
fetch
({
reset
:
true
});
enumDefCollection
.
fetch
({
reset
:
true
});
that
.
nameSpaceAttr
.
fullCollection
.
reset
();
that
.
businessMetadataAttr
.
reset
(
that
.
model
.
get
(
"attributeDefs"
));
that
.
options
.
selectedNameSpace
.
fetch
({
complete
:
function
(
model
,
status
)
{
that
.
nameSpaceAttr
.
fullCollection
.
add
(
model
.
responseJSON
.
attributeDefs
);
}
});
},
},
onUpdateNamespace
:
function
()
{
onUpdateBusinessMetadata
:
function
()
{
that
.
renderTableLayoutView
();
that
.
showDetails
=
true
;
that
.
showDetails
=
true
;
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
},
},
parent
:
that
.
$el
,
parent
:
that
.
$el
,
tagCollection
:
that
.
nameSpace
Collection
,
businessMetadataDefCollection
:
that
.
businessMetadataDef
Collection
,
enumDefCollection
:
enumDefCollection
,
enumDefCollection
:
enumDefCollection
,
isAttrEdit
:
isAttrEdit
,
isAttrEdit
:
isAttrEdit
,
attrDetails
:
attrDetails
,
attrDetails
:
attrDetails
,
typeHeaders
:
typeHeaders
,
typeHeaders
:
typeHeaders
,
selectedNamespace
:
selectedNamespace
,
selectedBusinessMetadata
:
that
.
model
,
nameSpaceCollection
:
nameSpaceCollection
,
guid
:
that
.
guid
,
guid
:
that
.
guid
,
isNewAttr
:
that
.
newAttr
isNewAttr
:
that
.
newAttr
});
});
if
(
isAttrEdit
)
{
if
(
isAttrEdit
)
{
that
.
ui
.
namespaceAttrPageTitle
.
text
(
"Update Attribute of: "
+
selectedNamespace
.
get
(
'name'
));
that
.
ui
.
businessMetadataAttrPageTitle
.
text
(
"Update Attribute of: "
+
selectedBusinessMetadata
.
get
(
'name'
));
}
else
{
}
else
{
that
.
ui
.
namespaceAttrPageTitle
.
text
(
"Add Namespace Attribute for: "
+
selectedNamespace
.
get
(
'name'
));
that
.
ui
.
businessMetadataAttrPageTitle
.
text
(
"Add Business Metadata Attribute for: "
+
selectedBusinessMetadata
.
get
(
'name'
));
}
}
that
.
RModal
.
show
(
that
.
view
);
that
.
RModal
.
show
(
that
.
view
);
});
});
...
@@ -167,18 +150,15 @@ define(['require',
...
@@ -167,18 +150,15 @@ define(['require',
renderTableLayoutView
:
function
()
{
renderTableLayoutView
:
function
()
{
var
that
=
this
;
var
that
=
this
;
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
var
cols
=
new
Backgrid
.
Columns
(
that
.
get
Namespace
TableColumns
());
var
cols
=
new
Backgrid
.
Columns
(
that
.
get
BusinessMetadata
TableColumns
());
that
.
R
NameSpace
AttrTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
that
.
R
BusinessMetadata
AttrTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
columns
:
cols
columns
:
cols
})));
})));
if
(
!
(
that
.
nameSpaceAttr
.
models
.
length
<
that
.
limit
))
{
// that.RNameSpaceAttrTableLayoutView.$el.find('table tr').last().hide();
}
});
});
},
},
get
Namespace
TableColumns
:
function
()
{
get
BusinessMetadata
TableColumns
:
function
()
{
var
that
=
this
;
var
that
=
this
;
return
this
.
nameSpace
Attr
.
constructor
.
getTableCols
({
return
this
.
businessMetadata
Attr
.
constructor
.
getTableCols
({
name
:
{
name
:
{
label
:
"Attribute Name"
,
label
:
"Attribute Name"
,
cell
:
"html"
,
cell
:
"html"
,
...
@@ -205,13 +185,16 @@ define(['require',
...
@@ -205,13 +185,16 @@ define(['require',
editable
:
false
,
editable
:
false
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
options
=
model
.
get
(
'options'
)
if
(
options
&&
options
.
applicableEntityTypes
)
{
var
applicableEntityTypes
=
''
,
var
applicableEntityTypes
=
''
,
attrEntityTypes
=
JSON
.
parse
(
model
.
get
(
'options'
)
.
applicableEntityTypes
);
attrEntityTypes
=
JSON
.
parse
(
options
.
applicableEntityTypes
);
_
.
each
(
attrEntityTypes
,
function
(
values
)
{
_
.
each
(
attrEntityTypes
,
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>'
;
});
});
return
applicableEntityTypes
;
return
applicableEntityTypes
;
}
}
}
})
})
},
},
tool
:
{
tool
:
{
...
@@ -225,8 +208,8 @@ define(['require',
...
@@ -225,8 +208,8 @@ define(['require',
}
}
})
})
}
}
},
this
.
nameSpace
Attr
);
},
this
.
businessMetadata
Attr
);
}
}
});
});
return
NameSpace
AttrTableLayoutView
;
return
BusinessMetadata
AttrTableLayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/
name_space/NameSpace
AttributeItemView.js
→
dashboardv3/public/js/views/
business_metadata/BusinessMetadata
AttributeItemView.js
View file @
3d0fcedb
...
@@ -17,19 +17,19 @@
...
@@ -17,19 +17,19 @@
*/
*/
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/
name_space/NameSpace
AttributeItemView_tmpl'
,
'hbs!tmpl/
business_metadata/BusinessMetadata
AttributeItemView_tmpl'
,
'utils/Utils'
,
'utils/Utils'
,
'utils/UrlLinks'
,
'utils/UrlLinks'
,
'utils/Messages'
'utils/Messages'
],
function
(
require
,
Backbone
,
NameSpace
AttributeItemViewTmpl
,
Utils
,
UrlLinks
,
Messages
)
{
],
function
(
require
,
Backbone
,
BusinessMetadata
AttributeItemViewTmpl
,
Utils
,
UrlLinks
,
Messages
)
{
'use strict'
;
'use strict'
;
return
Backbone
.
Marionette
.
ItemView
.
extend
(
return
Backbone
.
Marionette
.
ItemView
.
extend
(
/** @lends GlobalExclusionListView */
/** @lends GlobalExclusionListView */
{
{
template
:
NameSpace
AttributeItemViewTmpl
,
template
:
BusinessMetadata
AttributeItemViewTmpl
,
templateHelpers
:
function
()
{
templateHelpers
:
function
()
{
return
{
return
{
modalID
:
this
.
viewId
modalID
:
this
.
viewId
...
@@ -62,34 +62,47 @@ define(['require',
...
@@ -62,34 +62,47 @@ define(['require',
this
.
model
.
set
({
"name"
:
e
.
target
.
value
.
trim
()
});
this
.
model
.
set
({
"name"
:
e
.
target
.
value
.
trim
()
});
};
};
events
[
"change "
+
this
.
ui
.
dataTypeSelector
]
=
function
(
e
)
{
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'
)
{
if
(
e
.
target
.
value
.
trim
()
===
'enumeration'
||
e
.
target
.
value
.
trim
()
===
'Enumeration'
)
{
this
.
ui
.
enumTypeSelectorContainer
.
show
();
this
.
ui
.
enumTypeSelectorContainer
.
show
();
this
.
emumTypeSelectDisplay
();
this
.
emumTypeSelectDisplay
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
}
else
if
(
e
.
target
.
value
.
trim
()
===
'string'
||
e
.
target
.
value
.
trim
()
===
'String'
)
{
}
else
{
this
.
model
.
set
({
"typeName"
:
e
.
target
.
value
.
trim
()
}
);
obj
.
typeName
=
e
.
target
.
value
.
trim
(
);
this
.
model
.
set
({
"enumValues"
:
null
});
if
(
e
.
target
.
value
.
trim
()
===
'string'
||
e
.
target
.
value
.
trim
()
===
'String'
)
{
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
stringLengthContainer
.
show
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
obj
.
options
[
"maxStrLength"
]
=
e
.
target
.
value
.
trim
();
}
else
{
}
else
{
this
.
model
.
set
({
"typeName"
:
e
.
target
.
value
.
trim
()
});
this
.
model
.
set
({
"enumValues"
:
null
});
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumTypeSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
this
.
ui
.
stringLengthContainer
.
hide
();
}
}
}
this
.
model
.
set
(
obj
);
};
};
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
()
});
};
};
events
[
"change "
+
this
.
ui
.
stringLengthContainer
]
=
function
(
e
)
{
events
[
"change "
+
this
.
ui
.
stringLengthContainer
]
=
function
(
e
)
{
this
.
model
.
set
({
"maxStrLength"
:
e
.
target
.
value
.
trim
()
});
var
options
=
this
.
model
.
get
(
'options'
)
||
{};
if
(
this
.
ui
.
dataTypeSelector
.
val
()
==
'string'
)
{
options
[
"maxStrLength"
]
=
e
.
target
.
value
.
trim
();
}
this
.
model
.
set
({
"options"
:
options
});
};
};
events
[
"change "
+
this
.
ui
.
enumTypeSelector
]
=
function
(
e
)
{
events
[
"change "
+
this
.
ui
.
enumTypeSelector
]
=
function
(
e
)
{
var
emumValue
=
this
.
ui
.
enumTypeSelector
.
select2
(
'data'
)[
0
]
?
this
.
ui
.
enumTypeSelector
.
select2
(
'data'
)[
0
].
text
:
this
.
ui
.
enumTypeSelector
.
val
();
var
emumValue
=
this
.
ui
.
enumTypeSelector
.
select2
(
'data'
)[
0
]
?
this
.
ui
.
enumTypeSelector
.
select2
(
'data'
)[
0
].
text
:
this
.
ui
.
enumTypeSelector
.
val
();
this
.
model
.
set
({
"typeName"
:
emumValue
});
this
.
model
.
set
({
"typeName"
:
emumValue
});
if
(
this
.
model
.
get
(
"multiValueSelect"
))
{
this
.
model
.
set
({
"typeName"
:
"array<"
+
emumValue
+
">"
});
}
if
(
emumValue
==
''
||
emumValue
==
null
)
{
if
(
emumValue
==
''
||
emumValue
==
null
)
{
this
.
ui
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
}
else
{
}
else
{
...
@@ -102,7 +115,19 @@ define(['require',
...
@@ -102,7 +115,19 @@ define(['require',
};
};
events
[
"change "
+
this
.
ui
.
multiValueSelectStatus
]
=
function
(
e
)
{
events
[
"change "
+
this
.
ui
.
multiValueSelectStatus
]
=
function
(
e
)
{
this
.
model
.
set
({
"multiValueSelect"
:
e
.
target
.
checked
});
this
.
model
.
set
({
"multiValueSelect"
:
e
.
target
.
checked
});
var
typename
=
this
.
model
.
get
(
'typeName'
);
if
(
e
.
target
.
checked
)
{
typename
=
"array<"
+
typename
+
">"
;
}
else
{
typename
=
typename
.
replace
(
'array<'
,
''
).
replace
(
'>'
,
''
);
}
this
.
model
.
set
({
"typeName"
:
typename
});
};
};
events
[
"change "
+
this
.
ui
.
entityTypeSelector
]
=
function
(
e
)
{
var
options
=
this
.
model
.
get
(
'options'
)
||
{};
options
.
applicableEntityTypes
=
JSON
.
stringify
(
this
.
ui
.
entityTypeSelector
.
val
());
this
.
model
.
set
({
"options"
:
options
});
}
events
[
"click "
+
this
.
ui
.
close
]
=
'onCloseButton'
;
events
[
"click "
+
this
.
ui
.
close
]
=
'onCloseButton'
;
events
[
"click "
+
this
.
ui
.
createNewEnum
]
=
'onCreateUpdateEnum'
;
events
[
"click "
+
this
.
ui
.
createNewEnum
]
=
'onCreateUpdateEnum'
;
return
events
;
return
events
;
...
@@ -115,13 +140,12 @@ define(['require',
...
@@ -115,13 +140,12 @@ define(['require',
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
this
.
parentView
=
options
.
parentView
;
this
.
parentView
=
options
.
parentView
;
this
.
viewId
=
options
.
model
?
options
.
model
.
cid
:
this
.
parentView
.
cid
;
this
.
viewId
=
options
.
model
?
options
.
model
.
cid
:
this
.
parentView
.
cid
;
},
},
onRender
:
function
()
{
onRender
:
function
()
{
var
that
=
this
,
var
that
=
this
,
entitytypes
=
''
,
entitytypes
=
''
,
enumTypes
=
[];
enumTypes
=
[];
this
.
model
.
set
({
"modalID"
:
this
.
viewId
});
//
this.model.set({ "modalID": this.viewId });
this
.
parentView
.
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>"
);
...
@@ -139,14 +163,14 @@ define(['require',
...
@@ -139,14 +163,14 @@ define(['require',
this
.
ui
.
entityTypeSelector
.
on
(
'select2:open'
,
function
(
e
)
{
// to make selected option disable in dropdown added remove-from-list class
this
.
ui
.
entityTypeSelector
.
on
(
'select2:open'
,
function
(
e
)
{
// to make selected option disable in dropdown added remove-from-list class
$
(
'.select2-dropdown--below'
).
addClass
(
'remove-from-list'
);
$
(
'.select2-dropdown--below'
).
addClass
(
'remove-from-list'
);
});
});
this
.
ui
.
stringLengthValue
.
val
(
'50'
);
//default length for string is 50
this
.
ui
.
stringLengthValue
.
val
(
'50'
)
.
trigger
(
'change'
)
;
//default length for string is 50
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
.
enumValueSelectorContainer
.
hide
();
this
.
ui
.
enumValueSelectorContainer
.
hide
();
if
(
this
.
parentView
.
isAttrEdit
)
{
if
(
this
.
parentView
.
isAttrEdit
)
{
this
.
ui
.
close
.
hide
();
this
.
ui
.
close
.
hide
();
this
.
ui
.
createNewEnum
.
hide
();
// cannot add new
namespace
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
.
parentView
.
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"
);
...
@@ -222,7 +246,7 @@ define(['require',
...
@@ -222,7 +246,7 @@ define(['require',
},
},
onCreateUpdateEnum
:
function
(
e
)
{
onCreateUpdateEnum
:
function
(
e
)
{
var
that
=
this
;
var
that
=
this
;
require
([
"views/
name_space
/EnumCreateUpdateItemView"
,
"modules/Modal"
],
function
(
EnumCreateUpdateItemView
,
Modal
)
{
require
([
"views/
business_metadata
/EnumCreateUpdateItemView"
,
"modules/Modal"
],
function
(
EnumCreateUpdateItemView
,
Modal
)
{
var
view
=
new
EnumCreateUpdateItemView
({
var
view
=
new
EnumCreateUpdateItemView
({
onUpdateEnum
:
function
()
{
onUpdateEnum
:
function
()
{
that
.
ui
.
enumValueSelectorContainer
.
hide
();
that
.
ui
.
enumValueSelectorContainer
.
hide
();
...
@@ -238,7 +262,7 @@ define(['require',
...
@@ -238,7 +262,7 @@ define(['require',
});
});
},
},
enumDefCollection
:
that
.
parentView
.
enumDefCollection
,
enumDefCollection
:
that
.
parentView
.
enumDefCollection
,
nameSpaceCollection
:
that
.
parentView
.
options
.
nameSpace
Collection
businessMetadataDefCollection
:
that
.
parentView
.
options
.
businessMetadataDef
Collection
}),
}),
modal
=
new
Modal
({
modal
=
new
Modal
({
title
:
"Create/ Update Enum"
,
title
:
"Create/ Update Enum"
,
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/business_metadata/BusinessMetadataContainerLayoutView.js
0 → 100644
View file @
3d0fcedb
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define
([
"require"
,
"backbone"
,
"hbs!tmpl/business_metadata/BusinessMetadataContainerLayoutView_tmpl"
],
function
(
require
,
Backbone
,
BusinessMetadataContainerLayoutViewTmpl
)
{
"use strict"
;
var
BusinessMetadataContainerLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends BusinessMetadataContainerLayoutView */
{
_viewName
:
"BusinessMetadataContainerLayoutView"
,
template
:
BusinessMetadataContainerLayoutViewTmpl
,
/** Layout sub regions */
regions
:
{
RBusinessMetadataDetailContainer
:
"#r_businessMetadataDetailContainer"
,
RBusinessMetadataAttrContainer
:
"#r_businessMetadataAttrContainer"
},
/** ui selector cache */
ui
:
{},
/** ui events hash */
events
:
function
()
{},
/**
* intialize a new TagLayoutView Layout
* @constructs
*/
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);
},
onRender
:
function
()
{
this
.
updateView
();
},
updateView
:
function
()
{
this
.
model
=
this
.
businessMetadataDefCollection
.
fullCollection
.
findWhere
({
guid
:
this
.
guid
});
this
.
renderBusinessMetadataDetailLayoutView
();
this
.
renderBusinessMetadataAttrLayoutView
();
},
renderBusinessMetadataDetailLayoutView
:
function
()
{
var
that
=
this
;
require
([
"views/business_metadata/BusinessMetadataDetailLayoutView"
],
function
(
BusinessMetadataDetailLayoutView
)
{
if
(
that
.
isDestroyed
)
{
return
;
}
that
.
RBusinessMetadataDetailContainer
.
show
(
new
BusinessMetadataDetailLayoutView
({
businessMetadataDefCollection
:
that
.
businessMetadataDefCollection
,
guid
:
that
.
guid
,
model
:
that
.
model
,
enumDefCollection
:
that
.
enumDefCollection
,
typeHeaders
:
that
.
typeHeaders
}));
});
},
renderBusinessMetadataAttrLayoutView
:
function
()
{
var
that
=
this
;
require
([
"views/business_metadata/BusinessMetadataAttrTableLayoutView"
],
function
(
BusinessMetadataAttrTableLayoutView
)
{
if
(
that
.
isDestroyed
)
{
return
;
}
that
.
RBusinessMetadataAttrContainer
.
show
(
new
BusinessMetadataAttrTableLayoutView
({
businessMetadataDefCollection
:
that
.
businessMetadataDefCollection
,
model
:
that
.
model
,
guid
:
that
.
guid
,
typeHeaders
:
that
.
typeHeaders
,
enumDefCollection
:
that
.
enumDefCollection
,
entityDefCollection
:
that
.
entityDefCollection
}));
});
}
}
);
return
BusinessMetadataContainerLayoutView
;
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/
name_space/NameSpace
DetailLayoutView.js
→
dashboardv3/public/js/views/
business_metadata/BusinessMetadata
DetailLayoutView.js
View file @
3d0fcedb
...
@@ -18,21 +18,15 @@
...
@@ -18,21 +18,15 @@
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/
name_space/NameSpace
DetailLayoutView_tmpl'
,
'hbs!tmpl/
business_metadata/BusinessMetadata
DetailLayoutView_tmpl'
,
'utils/Utils'
,
'utils/Utils'
,
'views/tag/AddTagAttributeView'
,
],
function
(
require
,
Backbone
,
BusinessMetadataDetailLayoutViewTmpl
,
Utils
)
{
'collection/VTagList'
,
'models/VTag'
,
'utils/Messages'
,
'utils/UrlLinks'
,
"utils/Globals"
,
],
function
(
require
,
Backbone
,
NameSpaceDetailLayoutViewTmpl
,
Utils
,
AddTagAttributeView
,
VTagList
,
VTag
,
Messages
,
UrlLinks
,
Globals
)
{
'use strict'
;
'use strict'
;
var
NameSpace
DetailLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
BusinessMetadata
DetailLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends
NameSpace
DetailLayoutView */
/** @lends
BusinessMetadata
DetailLayoutView */
{
{
template
:
NameSpace
DetailLayoutViewTmpl
,
template
:
BusinessMetadata
DetailLayoutViewTmpl
,
/** Layout sub regions */
/** Layout sub regions */
regions
:
{},
regions
:
{},
/** ui selector cache */
/** ui selector cache */
...
@@ -53,58 +47,22 @@ define(['require',
...
@@ -53,58 +47,22 @@ define(['require',
return
events
;
return
events
;
},
},
/**
/**
* intialize a new
NameSpace
DetailLayoutView Layout
* intialize a new
BusinessMetadata
DetailLayoutView Layout
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'enumDefCollection'
,
'typeHeaders'
,
'nameSpaceCollection'
,
'selectedNameSpace'
,
'nameSpaceAttr'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'model'
,
'enumDefCollection'
,
'typeHeaders'
));
},
bindEvents
:
function
()
{
this
.
listenTo
(
this
.
nameSpaceCollection
,
'reset'
,
function
()
{
if
(
!
this
.
model
)
{
this
.
model
=
this
.
nameSpaceCollection
.
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
()
{
if
(
this
.
nameSpaceCollection
.
models
.
length
&&
!
this
.
model
)
{
this
.
renderDetail
();
this
.
model
=
this
.
nameSpaceCollection
.
fullCollection
.
findWhere
({
guid
:
this
.
guid
});
Utils
.
showTitleLoader
(
this
.
$
(
'.page-title .fontLoader'
),
this
.
$
(
'.tagDetail'
));
this
.
renderTagDetail
();
}
this
.
bindEvents
();
},
},
renderTagDetail
:
function
()
{
renderDetail
:
function
()
{
var
that
=
this
,
var
that
=
this
;
attributeData
=
""
;
this
.
attributeDefs
=
this
.
model
.
get
(
'attributeDefs'
);
this
.
ui
.
title
.
html
(
'<span>'
+
that
.
model
.
get
(
'name'
)
+
'</span>'
);
this
.
ui
.
title
.
html
(
'<span>'
+
that
.
model
.
get
(
'name'
)
+
'</span>'
);
if
(
that
.
model
.
get
(
'description'
))
{
if
(
that
.
model
.
get
(
'description'
))
{
this
.
ui
.
description
.
text
((
that
.
model
.
get
(
'description'
)));
this
.
ui
.
description
.
text
((
that
.
model
.
get
(
'description'
)));
}
}
Utils
.
hideTitleLoader
(
this
.
$
(
'.fontLoader'
),
this
.
$
(
'.tagDetail'
));
}
}
});
});
return
NameSpace
DetailLayoutView
;
return
BusinessMetadata
DetailLayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/
name_space/NameSpace
TableLayoutView.js
→
dashboardv3/public/js/views/
business_metadata/BusinessMetadata
TableLayoutView.js
View file @
3d0fcedb
...
@@ -18,75 +18,74 @@
...
@@ -18,75 +18,74 @@
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/
name_space/NameSpace
TableLayoutView_tmpl'
,
'hbs!tmpl/
business_metadata/BusinessMetadata
TableLayoutView_tmpl'
,
'collection/VEntityList'
,
'collection/VEntityList'
,
'collection/VTagList'
,
'models/VSearch'
,
'models/VSearch'
,
'utils/Utils'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Messages'
,
'utils/Enums'
,
'utils/Enums'
,
'utils/UrlLinks'
,
'utils/UrlLinks'
,
'utils/CommonViewFunction'
'utils/CommonViewFunction'
],
function
(
require
,
Backbone
,
NameSpaceTableLayoutView_tmpl
,
VEntityList
,
VTag
List
,
VSearch
,
Utils
,
Messages
,
Enums
,
UrlLinks
,
CommonViewFunction
)
{
],
function
(
require
,
Backbone
,
BusinessMetadataTableLayoutView_tmpl
,
VEntity
List
,
VSearch
,
Utils
,
Messages
,
Enums
,
UrlLinks
,
CommonViewFunction
)
{
'use strict'
;
'use strict'
;
var
NameSpace
TableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
BusinessMetadata
TableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends
NameSpace
TableLayoutView */
/** @lends
BusinessMetadata
TableLayoutView */
{
{
_viewName
:
'
NameSpace
TableLayoutView'
,
_viewName
:
'
BusinessMetadata
TableLayoutView'
,
template
:
NameSpace
TableLayoutView_tmpl
,
template
:
BusinessMetadata
TableLayoutView_tmpl
,
/** Layout sub regions */
/** Layout sub regions */
regions
:
{
regions
:
{
R
NameSpaceTableLayoutView
:
"#r_nameSpace
TableLayoutView"
,
R
BusinessMetadataTableLayoutView
:
"#r_businessMetadata
TableLayoutView"
,
RModal
:
"#r_modal"
RModal
:
"#r_modal"
},
},
/** ui selector cache */
/** ui selector cache */
ui
:
{
ui
:
{
namespaceAttrPage
:
"[data-id='namespace
AttrPage']"
,
businessMetadataAttrPage
:
"[data-id='businessMetadata
AttrPage']"
,
namespaceAttrPageTitle
:
"[data-id='namespace
AttrPageTitle']"
,
businessMetadataAttrPageTitle
:
"[data-id='businessMetadata
AttrPageTitle']"
,
namespaceDetailPage
:
"[data-id='namespace
DetailPage']"
,
businessMetadataDetailPage
:
"[data-id='businessMetadata
DetailPage']"
,
auditCreate
:
"[data-id='auditCreate']"
,
auditCreate
:
"[data-id='auditCreate']"
,
pageRecordText
:
"[data-id='pageRecordText']"
,
pageRecordText
:
"[data-id='pageRecordText']"
,
activePage
:
"[data-id='activePage']"
,
activePage
:
"[data-id='activePage']"
,
create
NameSpace
:
"[data-id='createNameSpace
']"
,
create
BusinessMetadata
:
"[data-id='createBusinessMetadata
']"
,
attributeEdit
:
"[data-id='attributeEdit']"
,
attributeEdit
:
"[data-id='attributeEdit']"
,
addAttribute
:
'[data-id="addAttribute"]'
,
addAttribute
:
'[data-id="addAttribute"]'
,
namespaceAttrPageOk
:
'[data-id="namespace
AttrPageOk"]'
,
businessMetadataAttrPageOk
:
'[data-id="businessMetadata
AttrPageOk"]'
,
colManager
:
"[data-id='colManager']"
,
colManager
:
"[data-id='colManager']"
,
delete
Namespace
:
'[data-id="deleteNamespace
"]'
,
delete
BusinessMetadata
:
'[data-id="deleteBusinessMetadata
"]'
,
namespaceAttrFontLoader
:
'.namespace
-attr-fontLoader'
,
businessMetadataAttrFontLoader
:
'.business-metadata
-attr-fontLoader'
,
namespaceAttrTableOverlay
:
'.namespace
-attr-tableOverlay'
businessMetadataAttrTableOverlay
:
'.businessMetadata
-attr-tableOverlay'
},
},
/** ui events hash */
/** ui events hash */
events
:
function
()
{
events
:
function
()
{
var
events
=
{},
var
events
=
{},
that
=
this
;
that
=
this
;
events
[
"click "
+
this
.
ui
.
create
NameSpace
]
=
"onClickCreateNamespace
"
;
events
[
"click "
+
this
.
ui
.
create
BusinessMetadata
]
=
"onClickCreateBusinessMetadata
"
;
events
[
"click "
+
this
.
ui
.
addAttribute
]
=
"onEditAttr"
;
events
[
"click "
+
this
.
ui
.
addAttribute
]
=
"onEditAttr"
;
events
[
"click "
+
this
.
ui
.
attributeEdit
]
=
"onEditAttr"
;
events
[
"click "
+
this
.
ui
.
attributeEdit
]
=
"onEditAttr"
;
events
[
"click "
+
this
.
ui
.
delete
Namespace
]
=
function
(
e
)
{
events
[
"click "
+
this
.
ui
.
delete
BusinessMetadata
]
=
function
(
e
)
{
that
.
guid
=
e
.
target
.
dataset
.
guid
;
that
.
guid
=
e
.
target
.
dataset
.
guid
;
that
.
delete
Namespace
Element
();
that
.
delete
BusinessMetadata
Element
();
};
};
return
events
;
return
events
;
},
},
/**
/**
* intialize a new
NameSpace
TableLayoutView Layout
* intialize a new
BusinessMetadata
TableLayoutView Layout
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'typeHeaders'
,
'
nameSpaceCollection'
,
'entityDefCollection'
,
'nameSpaceAttr'
,
'selectedNameSpace
'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'attributeDefs'
,
'typeHeaders'
,
'
businessMetadataDefCollection'
,
'entityDefCollection'
,
'businessMetadataAttr'
,
'selectedBusinessMetadata
'
));
this
.
limit
=
10
;
this
.
limit
=
10
;
this
.
offset
=
0
;
this
.
offset
=
0
;
this
.
pervOld
=
[];
this
.
pervOld
=
[];
this
.
onlyPurge
=
true
;
this
.
onlyPurge
=
true
;
this
.
newAttr
=
false
;
this
.
newAttr
=
false
;
this
.
commonTableOptions
=
{
this
.
commonTableOptions
=
{
collection
:
this
.
nameSpace
Collection
,
collection
:
this
.
businessMetadataDef
Collection
,
includeFilter
:
false
,
includeFilter
:
false
,
includePagination
:
true
,
includePagination
:
true
,
includeFooterRecords
:
true
,
includeFooterRecords
:
true
,
...
@@ -118,47 +117,47 @@ define(['require',
...
@@ -118,47 +117,47 @@ define(['require',
this
.
showDetails
=
true
;
// toggle between sttribute page and detail page
this
.
showDetails
=
true
;
// toggle between sttribute page and detail page
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
toggle
Namespace
DetailsAttrView
();
this
.
toggle
BusinessMetadata
DetailsAttrView
();
$
.
extend
(
this
.
nameSpace
Collection
.
queryParams
,
{
count
:
this
.
limit
});
$
.
extend
(
this
.
businessMetadataDef
Collection
.
queryParams
,
{
count
:
this
.
limit
});
this
.
nameSpace
Collection
.
fullCollection
.
sort
({
silent
:
true
});
this
.
businessMetadataDef
Collection
.
fullCollection
.
sort
({
silent
:
true
});
this
.
renderTableLayoutView
();
this
.
renderTableLayoutView
();
this
.
$
(
'.tableOverlay'
).
hide
();
this
.
$
(
'.tableOverlay'
).
hide
();
this
.
$
(
'.auditTable'
).
show
();
// Only for first time table show because we never hide after first render.
this
.
$
(
'.auditTable'
).
show
();
// Only for first time table show because we never hide after first render.
this
.
nameSpace
Collection
.
comparator
=
function
(
model
)
{
this
.
businessMetadataDef
Collection
.
comparator
=
function
(
model
)
{
return
-
model
.
get
(
'timestamp'
);
return
-
model
.
get
(
'timestamp'
);
}
}
},
},
toggle
Namespace
DetailsAttrView
:
function
()
{
toggle
BusinessMetadata
DetailsAttrView
:
function
()
{
var
that
=
this
;
var
that
=
this
;
if
(
that
.
showDetails
)
{
if
(
that
.
showDetails
)
{
that
.
ui
.
namespace
AttrPage
.
hide
();
that
.
ui
.
businessMetadata
AttrPage
.
hide
();
that
.
ui
.
namespace
DetailPage
.
show
();
that
.
ui
.
businessMetadata
DetailPage
.
show
();
}
else
{
}
else
{
that
.
ui
.
namespace
AttrPage
.
show
();
that
.
ui
.
businessMetadata
AttrPage
.
show
();
that
.
ui
.
namespace
DetailPage
.
hide
();
that
.
ui
.
businessMetadata
DetailPage
.
hide
();
}
}
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
loaderStatus
:
function
(
isActive
)
{
loaderStatus
:
function
(
isActive
)
{
var
that
=
this
;
var
that
=
this
;
if
(
isActive
)
{
if
(
isActive
)
{
that
.
$
(
'.
namespace
-attr-tableOverlay'
).
show
();
that
.
$
(
'.
businessMetadata
-attr-tableOverlay'
).
show
();
that
.
$
(
'.
namespace
-attr-fontLoader'
).
show
();
that
.
$
(
'.
business-metadata
-attr-fontLoader'
).
show
();
}
else
{
}
else
{
that
.
$
(
'.
namespace
-attr-tableOverlay'
).
hide
();
that
.
$
(
'.
businessMetadata
-attr-tableOverlay'
).
hide
();
that
.
$
(
'.
namespace
-attr-fontLoader'
).
hide
();
that
.
$
(
'.
business-metadata
-attr-fontLoader'
).
hide
();
}
}
},
},
onEditAttr
:
function
(
e
)
{
onEditAttr
:
function
(
e
)
{
var
that
=
this
,
var
that
=
this
,
isAttrEdit
=
e
.
currentTarget
.
dataset
&&
e
.
currentTarget
.
dataset
.
id
===
'attributeEdit'
?
true
:
false
,
isAttrEdit
=
e
.
currentTarget
.
dataset
&&
e
.
currentTarget
.
dataset
.
id
===
'attributeEdit'
?
true
:
false
,
guid
=
e
.
currentTarget
.
dataset
&&
e
.
currentTarget
.
dataset
.
guid
?
e
.
currentTarget
.
dataset
.
guid
:
null
,
guid
=
e
.
currentTarget
.
dataset
&&
e
.
currentTarget
.
dataset
.
guid
?
e
.
currentTarget
.
dataset
.
guid
:
null
,
selected
Namespace
=
that
.
nameSpace
Collection
.
fullCollection
.
findWhere
({
guid
:
guid
}),
selected
BusinessMetadata
=
that
.
businessMetadataDef
Collection
.
fullCollection
.
findWhere
({
guid
:
guid
}),
attrributes
=
selected
Namespace
?
selectedNamespace
.
get
(
'attributeDefs'
)
:
null
,
attrributes
=
selected
BusinessMetadata
?
selectedBusinessMetadata
.
get
(
'attributeDefs'
)
:
null
,
attrName
=
e
.
currentTarget
.
dataset
.
name
?
e
.
currentTarget
.
dataset
.
name
:
null
,
attrName
=
e
.
currentTarget
.
dataset
.
name
?
e
.
currentTarget
.
dataset
.
name
:
null
,
attrDetails
=
{
name
:
attrName
};
attrDetails
=
{
name
:
attrName
};
if
(
selected
Namespace
)
{
if
(
selected
BusinessMetadata
)
{
that
.
ui
.
namespace
AttrPageOk
.
text
(
"Save"
);
that
.
ui
.
businessMetadata
AttrPageOk
.
text
(
"Save"
);
that
.
newAttr
=
e
.
currentTarget
&&
e
.
currentTarget
.
dataset
.
action
===
"createAttr"
?
true
:
false
;
that
.
newAttr
=
e
.
currentTarget
&&
e
.
currentTarget
.
dataset
.
action
===
"createAttr"
?
true
:
false
;
that
.
guid
=
guid
;
that
.
guid
=
guid
;
_
.
each
(
attrributes
,
function
(
attrObj
)
{
_
.
each
(
attrributes
,
function
(
attrObj
)
{
...
@@ -175,63 +174,62 @@ define(['require',
...
@@ -175,63 +174,62 @@ define(['require',
});
});
that
.
showDetails
=
false
;
that
.
showDetails
=
false
;
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
that
.
ui
.
namespace
AttrPageOk
.
attr
(
'data-action'
,
e
.
currentTarget
.
dataset
.
id
);
that
.
ui
.
businessMetadata
AttrPageOk
.
attr
(
'data-action'
,
e
.
currentTarget
.
dataset
.
id
);
require
([
"views/
name_space/CreateNameSpaceLayoutView"
],
function
(
CreateNameSpace
LayoutView
)
{
require
([
"views/
business_metadata/CreateBusinessMetadataLayoutView"
],
function
(
CreateBusinessMetadata
LayoutView
)
{
that
.
view
=
new
Create
NameSpace
LayoutView
({
that
.
view
=
new
Create
BusinessMetadata
LayoutView
({
onEditCallback
:
function
()
{
onEditCallback
:
function
()
{
that
.
nameSpace
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
businessMetadataDef
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
renderTableLayoutView
();
that
.
renderTableLayoutView
();
},
},
onUpdate
Namespace
:
function
()
{
onUpdate
BusinessMetadata
:
function
()
{
enumDefCollection
.
fetch
({
reset
:
true
});
enumDefCollection
.
fetch
({
reset
:
true
});
that
.
showDetails
=
true
;
that
.
showDetails
=
true
;
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
},
},
parent
:
that
.
$el
,
parent
:
that
.
$el
,
tagCollection
:
that
.
nameSpace
Collection
,
businessMetadataDefCollection
:
that
.
businessMetadataDef
Collection
,
enumDefCollection
:
enumDefCollection
,
enumDefCollection
:
enumDefCollection
,
isAttrEdit
:
isAttrEdit
,
isAttrEdit
:
isAttrEdit
,
typeHeaders
:
typeHeaders
,
typeHeaders
:
typeHeaders
,
attrDetails
:
attrDetails
,
attrDetails
:
attrDetails
,
selectedNamespace
:
selectedNamespace
,
selectedBusinessMetadata
:
selectedBusinessMetadata
,
nameSpaceCollection
:
nameSpaceCollection
,
guid
:
that
.
guid
,
guid
:
that
.
guid
,
isNewAttr
:
that
.
newAttr
isNewAttr
:
that
.
newAttr
});
});
if
(
isAttrEdit
)
{
if
(
isAttrEdit
)
{
that
.
ui
.
namespaceAttrPageTitle
.
text
(
"Update Attribute of: "
+
selectedNamespace
.
get
(
'name'
));
that
.
ui
.
businessMetadataAttrPageTitle
.
text
(
"Update Attribute of: "
+
selectedBusinessMetadata
.
get
(
'name'
));
}
else
{
}
else
{
that
.
ui
.
namespaceAttrPageTitle
.
text
(
"Add Namespace Attribute for: "
+
selectedNamespace
.
get
(
'name'
));
that
.
ui
.
businessMetadataAttrPageTitle
.
text
(
"Add Business Metadata Attribute for: "
+
selectedBusinessMetadata
.
get
(
'name'
));
}
}
that
.
RModal
.
show
(
that
.
view
);
that
.
RModal
.
show
(
that
.
view
);
});
});
}
}
},
},
onClickCreate
Namespace
:
function
(
e
)
{
onClickCreate
BusinessMetadata
:
function
(
e
)
{
var
that
=
this
,
var
that
=
this
,
isNew
NameSpace
=
true
;
isNew
BusinessMetadata
=
true
;
that
.
showDetails
=
false
;
that
.
showDetails
=
false
;
that
.
ui
.
namespace
AttrPageOk
.
text
(
"Create"
);
that
.
ui
.
businessMetadata
AttrPageOk
.
text
(
"Create"
);
that
.
ui
.
namespaceAttrPageOk
.
attr
(
'data-action'
,
'createNamespace
'
);
that
.
ui
.
businessMetadataAttrPageOk
.
attr
(
'data-action'
,
'createBusinessMetadata
'
);
that
.
ui
.
namespaceAttrPageTitle
.
text
(
"Create Namespace
"
);
that
.
ui
.
businessMetadataAttrPageTitle
.
text
(
"Create Business Metadata
"
);
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
require
([
"views/
name_space/CreateNameSpaceLayoutView"
],
function
(
CreateNameSpace
LayoutView
)
{
require
([
"views/
business_metadata/CreateBusinessMetadataLayoutView"
],
function
(
CreateBusinessMetadata
LayoutView
)
{
that
.
view
=
new
Create
NameSpace
LayoutView
({
that
.
view
=
new
Create
BusinessMetadata
LayoutView
({
onUpdate
Namespace
:
function
()
{
onUpdate
BusinessMetadata
:
function
()
{
enumDefCollection
.
fetch
({
reset
:
true
});
enumDefCollection
.
fetch
({
reset
:
true
});
that
.
showDetails
=
true
;
that
.
showDetails
=
true
;
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
that
.
entityDefCollection
.
fetch
({
silent
:
true
});
},
},
tagCollection
:
that
.
nameSpace
Collection
,
tagCollection
:
that
.
businessMetadataDef
Collection
,
enumDefCollection
:
enumDefCollection
,
enumDefCollection
:
enumDefCollection
,
typeHeaders
:
typeHeaders
,
typeHeaders
:
typeHeaders
,
isNew
NameSpace
:
isNewNameSpace
,
isNew
BusinessMetadata
:
isNewBusinessMetadata
,
nameSpaceCollection
:
nameSpace
Collection
businessMetadataDefCollection
:
businessMetadataDef
Collection
});
});
that
.
RModal
.
show
(
that
.
view
);
that
.
RModal
.
show
(
that
.
view
);
});
});
...
@@ -239,19 +237,19 @@ define(['require',
...
@@ -239,19 +237,19 @@ define(['require',
renderTableLayoutView
:
function
()
{
renderTableLayoutView
:
function
()
{
var
that
=
this
;
var
that
=
this
;
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
var
cols
=
new
Backgrid
.
Columns
(
that
.
get
Namespace
TableColumns
());
var
cols
=
new
Backgrid
.
Columns
(
that
.
get
BusinessMetadata
TableColumns
());
that
.
R
NameSpace
TableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
that
.
R
BusinessMetadata
TableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
columns
:
cols
columns
:
cols
})));
})));
if
(
!
(
that
.
nameSpace
Collection
.
models
.
length
<
that
.
limit
))
{
if
(
!
(
that
.
businessMetadataDef
Collection
.
models
.
length
<
that
.
limit
))
{
that
.
R
NameSpace
TableLayoutView
.
$el
.
find
(
'table tr'
).
last
().
hide
();
that
.
R
BusinessMetadata
TableLayoutView
.
$el
.
find
(
'table tr'
).
last
().
hide
();
}
}
});
});
},
},
get
Namespace
TableColumns
:
function
()
{
get
BusinessMetadata
TableColumns
:
function
()
{
var
that
=
this
;
var
that
=
this
;
return
this
.
nameSpace
Collection
.
constructor
.
getTableCols
({
return
this
.
businessMetadataDef
Collection
.
constructor
.
getTableCols
({
attributeDefs
:
{
attributeDefs
:
{
label
:
""
,
label
:
""
,
cell
:
"html"
,
cell
:
"html"
,
...
@@ -273,7 +271,7 @@ define(['require',
...
@@ -273,7 +271,7 @@ define(['require',
_
.
each
(
model
.
attributes
.
attributeDefs
,
function
(
attrObj
)
{
_
.
each
(
model
.
attributes
.
attributeDefs
,
function
(
attrObj
)
{
var
applicableEntityTypes
=
''
,
var
applicableEntityTypes
=
''
,
typeName
=
attrObj
.
typeName
;
typeName
=
attrObj
.
typeName
;
if
(
attrObj
.
options
)
{
if
(
attrObj
.
options
&&
attrObj
.
options
.
applicableEntityTypes
)
{
// attrEntityTypes = JSON.parse(attrObj.options.applicableEntityTypes).join(', ');
// 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
)
{
...
@@ -300,7 +298,7 @@ define(['require',
...
@@ -300,7 +298,7 @@ define(['require',
editable
:
false
,
editable
:
false
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
return
'<a title= "'
+
model
.
get
(
'name'
)
+
'" href ="#!/administrator/
namespace/'
+
model
.
get
(
'guid'
)
+
'?from=namespace
">'
+
model
.
get
(
'name'
)
+
'</a>'
;
return
'<a title= "'
+
model
.
get
(
'name'
)
+
'" href ="#!/administrator/
businessMetadata/'
+
model
.
get
(
'guid'
)
+
'?from=bm
">'
+
model
.
get
(
'name'
)
+
'</a>'
;
}
}
})
})
},
},
...
@@ -365,14 +363,14 @@ define(['require',
...
@@ -365,14 +363,14 @@ define(['require',
editable
:
false
,
editable
:
false
,
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
Namespace
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='delete
Namespace' data-guid='" + model.get('guid') + "'' title='' class='btn btn-action btn-xs ' style='margin-bottom: 10px;' data-action='createAttr' data-original-title='Delete Namespace
'><i class='fa fa-trash-o'></i> Delete</button>";
// "<button type='button' data-id='delete
BusinessMetadata' 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>";
}
}
})
})
}
}
},
this
.
nameSpace
Collection
);
},
this
.
businessMetadataDef
Collection
);
},
},
delete
NamespaceElement
:
function
(
nameSpace
Name
)
{
delete
BusinessMetadataElement
:
function
(
businessMetadata
Name
)
{
var
that
=
this
,
var
that
=
this
,
notifyObj
=
{
notifyObj
=
{
modal
:
true
,
modal
:
true
,
...
@@ -381,28 +379,28 @@ define(['require',
...
@@ -381,28 +379,28 @@ define(['require',
},
},
cancel
:
function
(
argument
)
{}
cancel
:
function
(
argument
)
{}
};
};
var
text
=
"Are you sure you want to delete the
namespace
"
;
var
text
=
"Are you sure you want to delete the
business metadata
"
;
notifyObj
[
"text"
]
=
text
;
notifyObj
[
"text"
]
=
text
;
Utils
.
notifyConfirm
(
notifyObj
);
Utils
.
notifyConfirm
(
notifyObj
);
},
},
onNotifyDeleteOk
:
function
(
data
)
{
onNotifyDeleteOk
:
function
(
data
)
{
var
that
=
this
,
var
that
=
this
,
delete
NamespaceData
=
that
.
nameSpace
Collection
.
fullCollection
.
findWhere
({
guid
:
that
.
guid
});
delete
BusinessMetadataData
=
that
.
businessMetadataDef
Collection
.
fullCollection
.
findWhere
({
guid
:
that
.
guid
});
// that.$('.position-relative .fontLoader').addClass('show');
// that.$('.position-relative .fontLoader').addClass('show');
that
.
$
(
'.tableOverlay'
).
show
();
that
.
$
(
'.tableOverlay'
).
show
();
if
(
delete
Namespace
Data
)
{
if
(
delete
BusinessMetadata
Data
)
{
var
nameSpaceName
=
deleteNamespace
Data
.
get
(
"name"
);
var
businessMetadataName
=
deleteBusinessMetadata
Data
.
get
(
"name"
);
delete
NamespaceData
.
deleteNameSpace
({
delete
BusinessMetadataData
.
deleteBusinessMetadata
({
typeName
:
nameSpace
Name
,
typeName
:
businessMetadata
Name
,
success
:
function
()
{
success
:
function
()
{
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"
Namespace "
+
nameSpace
Name
+
Messages
.
getAbbreviationMsg
(
false
,
'deleteSuccessMessage'
)
content
:
"
Business Metadata "
+
businessMetadata
Name
+
Messages
.
getAbbreviationMsg
(
false
,
'deleteSuccessMessage'
)
});
});
that
.
nameSpaceCollection
.
fullCollection
.
remove
(
deleteNamespace
Data
);
that
.
businessMetadataDefCollection
.
fullCollection
.
remove
(
deleteBusinessMetadata
Data
);
that
.
nameSpace
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
businessMetadataDef
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
renderTableLayoutView
();
that
.
renderTableLayoutView
();
that
.
showDetails
=
true
;
that
.
showDetails
=
true
;
that
.
toggle
Namespace
DetailsAttrView
();
that
.
toggle
BusinessMetadata
DetailsAttrView
();
that
.
loaderStatus
(
false
);
that
.
loaderStatus
(
false
);
},
},
complete
:
function
()
{
complete
:
function
()
{
...
@@ -417,5 +415,5 @@ define(['require',
...
@@ -417,5 +415,5 @@ define(['require',
}
}
}
}
});
});
return
NameSpace
TableLayoutView
;
return
BusinessMetadata
TableLayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/
name_space/CreateNameSpace
LayoutView.js
→
dashboardv3/public/js/views/
business_metadata/CreateBusinessMetadata
LayoutView.js
View file @
3d0fcedb
...
@@ -18,21 +18,22 @@
...
@@ -18,21 +18,22 @@
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/
name_space/CreateNameSpace
LayoutView_tmpl'
,
'hbs!tmpl/
business_metadata/CreateBusinessMetadata
LayoutView_tmpl'
,
'utils/Utils'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Messages'
,
'views/
name_space/NameSpace
AttributeItemView'
,
'views/
business_metadata/BusinessMetadata
AttributeItemView'
,
'collection/VTagList'
,
'collection/VTagList'
,
'models/VEntity'
,
'utils/UrlLinks'
,
'utils/UrlLinks'
,
'platform'
'platform'
],
function
(
require
,
Backbone
,
Create
NameSpaceLayoutViewTmpl
,
Utils
,
Messages
,
NameSpaceAttributeItemView
,
VTagList
,
UrlLinks
,
platform
)
{
],
function
(
require
,
Backbone
,
Create
BusinessMetadataLayoutViewTmpl
,
Utils
,
Messages
,
BusinessMetadataAttributeItemView
,
VTagList
,
VEntity
,
UrlLinks
,
platform
)
{
var
Create
NameSpace
LayoutView
=
Backbone
.
Marionette
.
CompositeView
.
extend
(
var
Create
BusinessMetadata
LayoutView
=
Backbone
.
Marionette
.
CompositeView
.
extend
(
/** @lends Create
NameSpace
LayoutView */
/** @lends Create
BusinessMetadata
LayoutView */
{
{
_viewName
:
'Create
NameSpace
LayoutView'
,
_viewName
:
'Create
BusinessMetadata
LayoutView'
,
template
:
Create
NameSpace
LayoutViewTmpl
,
template
:
Create
BusinessMetadata
LayoutViewTmpl
,
templateHelpers
:
function
()
{
templateHelpers
:
function
()
{
return
{
return
{
...
@@ -46,7 +47,7 @@ define(['require',
...
@@ -46,7 +47,7 @@ define(['require',
/** Layout sub regions */
/** Layout sub regions */
regions
:
{},
regions
:
{},
childView
:
NameSpace
AttributeItemView
,
childView
:
BusinessMetadata
AttributeItemView
,
childViewContainer
:
"[data-id='addAttributeDiv']"
,
childViewContainer
:
"[data-id='addAttributeDiv']"
,
...
@@ -58,57 +59,58 @@ define(['require',
...
@@ -58,57 +59,58 @@ define(['require',
},
},
/** ui selector cache */
/** ui selector cache */
ui
:
{
ui
:
{
tagName
:
"[data-id='tagN
ame']"
,
name
:
"[data-id='n
ame']"
,
description
:
"[data-id='description']"
,
description
:
"[data-id='description']"
,
title
:
"[data-id='title']"
,
title
:
"[data-id='title']"
,
attributeData
:
"[data-id='attributeData']"
,
attributeData
:
"[data-id='attributeData']"
,
addAttributeDiv
:
"[data-id='addAttributeDiv']"
,
addAttributeDiv
:
"[data-id='addAttributeDiv']"
,
create
TagForm
:
'[data-id="createTag
Form"]'
,
create
Form
:
'[data-id="create
Form"]'
,
namespaceAttrPageCancle
:
'[data-id="namespace
AttrPageCancle"]'
,
businessMetadataAttrPageCancle
:
'[data-id="businessMetadata
AttrPageCancle"]'
,
namespaceAttrPageOk
:
'[data-id="namespace
AttrPageOk"]'
businessMetadataAttrPageOk
:
'[data-id="businessMetadata
AttrPageOk"]'
},
},
/** ui events hash */
/** ui events hash */
events
:
function
()
{
events
:
function
()
{
var
events
=
{};
var
events
=
{};
events
[
"click "
+
this
.
ui
.
attributeData
]
=
"onClickAddAttriBtn"
;
events
[
"click "
+
this
.
ui
.
attributeData
]
=
"onClickAddAttriBtn"
;
events
[
"click "
+
this
.
ui
.
namespace
AttrPageOk
]
=
function
(
e
)
{
events
[
"click "
+
this
.
ui
.
businessMetadata
AttrPageOk
]
=
function
(
e
)
{
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 selected
Namespace = that.nameSpace
Collection.fullCollection.findWhere({ guid: that.guid });
// var selected
BusinessMetadata = that.businessMetadataDef
Collection.fullCollection.findWhere({ guid: that.guid });
that
.
onUpdateAttr
();
that
.
onUpdateAttr
();
}
else
{
}
else
{
if
(
that
.
$el
.
find
(
'.form-control.
namespace
-name'
)[
0
].
value
===
""
)
{
if
(
that
.
$el
.
find
(
'.form-control.
businessMetadata
-name'
)[
0
].
value
===
""
)
{
$
(
that
.
$el
.
find
(
'.form-control.
namespace
-name'
)[
0
]).
css
(
"borderColor"
,
"red"
);
$
(
that
.
$el
.
find
(
'.form-control.
businessMetadata
-name'
)[
0
]).
css
(
"borderColor"
,
"red"
);
Utils
.
notifyInfo
({
Utils
.
notifyInfo
({
content
:
"
Namespace
name is empty."
content
:
"
Business Metadata
name is empty."
});
});
}
else
{
}
else
{
that
.
onCreate
NameSpace
();
that
.
onCreate
BusinessMetadata
();
}
}
}
}
};
};
events
[
"click "
+
this
.
ui
.
namespace
AttrPageCancle
]
=
function
(
e
)
{
events
[
"click "
+
this
.
ui
.
businessMetadata
AttrPageCancle
]
=
function
(
e
)
{
this
.
options
.
onUpdate
Namespace
();
this
.
options
.
onUpdate
BusinessMetadata
();
};
};
return
events
;
return
events
;
},
},
/**
/**
* intialize a new Create
NameSpace
LayoutView Layout
* intialize a new Create
BusinessMetadata
LayoutView Layout
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'
tagCollection'
,
'enumDefCollection'
,
'model'
,
'tag'
,
'descriptionData'
,
'selectedTag'
,
'isNewNameSpace
'
,
'isAttrEdit'
,
'entityDefCollection'
,
'typeHeaders'
,
'attrDetails'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'
businessMetadataDefCollection'
,
'enumDefCollection'
,
'model'
,
'descriptionData'
,
'isNewBusinessMetadata
'
,
'isAttrEdit'
,
'entityDefCollection'
,
'typeHeaders'
,
'attrDetails'
));
this
.
fromTable
=
this
.
isNew
NameSpace
?
true
:
false
;
this
.
fromTable
=
this
.
isNew
BusinessMetadata
?
true
:
false
;
this
.
isEditAttr
=
this
.
isAttrEdit
?
false
:
true
;
this
.
isEditAttr
=
this
.
isAttrEdit
?
false
:
true
;
this
.
businessMetadataModel
=
new
VEntity
();
if
(
this
.
model
)
{
if
(
this
.
model
)
{
this
.
description
=
this
.
model
.
get
(
'description'
);
this
.
description
=
this
.
model
.
get
(
'description'
);
}
else
{
}
else
{
this
.
create
=
true
;
this
.
create
=
true
;
}
}
if
(
!
this
.
isNew
NameSpace
)
{
if
(
!
this
.
isNew
BusinessMetadata
)
{
this
.
collection
=
this
.
isAttrEdit
?
new
Backbone
.
Collection
([{
this
.
collection
=
this
.
isAttrEdit
?
new
Backbone
.
Collection
([{
"name"
:
this
.
attrDetails
.
name
,
"name"
:
this
.
attrDetails
.
name
,
"typeName"
:
this
.
attrDetails
.
attrTypeName
,
"typeName"
:
this
.
attrDetails
.
attrTypeName
,
...
@@ -137,31 +139,18 @@ define(['require',
...
@@ -137,31 +139,18 @@ define(['require',
onRender
:
function
()
{
onRender
:
function
()
{
var
that
=
this
;
var
that
=
this
;
this
.
$
(
'.fontLoader'
).
show
();
this
.
$
(
'.fontLoader'
).
show
();
if
(
this
.
create
)
{
this
.
tagCollectionList
();
}
else
{
this
.
ui
.
title
.
html
(
'<span>'
+
_
.
escape
(
this
.
tag
)
+
'</span>'
);
}
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
this
.
ui
.
create
Tag
Form
.
find
(
'input,textarea'
).
placeholder
();
this
.
ui
.
createForm
.
find
(
'input,textarea'
).
placeholder
();
}
}
if
(
this
.
isNew
NameSpace
==
true
)
{
if
(
this
.
isNew
BusinessMetadata
==
true
)
{
that
.
ui
.
namespace
AttrPageOk
.
text
(
"Create"
);
that
.
ui
.
businessMetadata
AttrPageOk
.
text
(
"Create"
);
that
.
ui
.
namespaceAttrPageOk
.
attr
(
'data-action'
,
'newNamespace
'
);
that
.
ui
.
businessMetadataAttrPageOk
.
attr
(
'data-action'
,
'newBusinessMetadata
'
);
}
else
{
}
else
{
that
.
ui
.
namespace
AttrPageOk
.
text
(
"Save"
);
that
.
ui
.
businessMetadata
AttrPageOk
.
text
(
"Save"
);
that
.
ui
.
namespace
AttrPageOk
.
attr
(
'data-action'
,
'attributeEdit'
);
that
.
ui
.
businessMetadata
AttrPageOk
.
attr
(
'data-action'
,
'attributeEdit'
);
}
}
this
.
hideLoader
();
this
.
hideLoader
();
},
},
tagCollectionList
:
function
()
{
var
that
=
this
,
str
=
''
;
this
.
tagCollection
.
fullCollection
.
each
(
function
(
val
)
{
var
name
=
Utils
.
getName
(
val
.
toJSON
());
str
+=
'<option '
+
(
name
==
that
.
selectedTag
?
'selected'
:
''
)
+
'>'
+
(
name
)
+
'</option>'
;
});
},
hideLoader
:
function
()
{
hideLoader
:
function
()
{
this
.
$
(
'.fontLoader'
).
hide
();
this
.
$
(
'.fontLoader'
).
hide
();
this
.
$
(
'.hide'
).
removeClass
(
'hide'
);
this
.
$
(
'.hide'
).
removeClass
(
'hide'
);
...
@@ -183,16 +172,15 @@ define(['require',
...
@@ -183,16 +172,15 @@ define(['require',
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
this
.
ui
.
addAttributeDiv
.
find
(
'input,textarea'
).
placeholder
();
this
.
ui
.
addAttributeDiv
.
find
(
'input,textarea'
).
placeholder
();
}
}
},
},
loaderStatus
:
function
(
isActive
)
{
loaderStatus
:
function
(
isActive
)
{
var
that
=
this
;
var
that
=
this
;
if
(
isActive
)
{
if
(
isActive
)
{
parent
.
$
(
'.
namespace
-attr-tableOverlay'
).
show
();
parent
.
$
(
'.
business-metadata
-attr-tableOverlay'
).
show
();
parent
.
$
(
'.
namespace
-attr-fontLoader'
).
show
();
parent
.
$
(
'.
business-metadata
-attr-fontLoader'
).
show
();
}
else
{
}
else
{
parent
.
$
(
'.
namespace
-attr-tableOverlay'
).
hide
();
parent
.
$
(
'.
business-metadata
-attr-tableOverlay'
).
hide
();
parent
.
$
(
'.
namespace
-attr-fontLoader'
).
hide
();
parent
.
$
(
'.
business-metadata
-attr-fontLoader'
).
hide
();
}
}
},
},
validateValues
:
function
()
{
validateValues
:
function
()
{
...
@@ -200,8 +188,6 @@ define(['require',
...
@@ -200,8 +188,6 @@ define(['require',
enumValue
=
true
,
enumValue
=
true
,
stringValidate
=
true
,
stringValidate
=
true
,
enumType
=
true
;
enumType
=
true
;
this
.
ui
;
if
(
this
.
$el
.
find
(
".attributeInput"
).
length
>
0
)
{
if
(
this
.
$el
.
find
(
".attributeInput"
).
length
>
0
)
{
this
.
$el
.
find
(
".attributeInput"
).
each
(
function
()
{
this
.
$el
.
find
(
".attributeInput"
).
each
(
function
()
{
if
(
$
(
this
).
val
()
===
""
)
{
if
(
$
(
this
).
val
()
===
""
)
{
...
@@ -281,40 +267,25 @@ define(['require',
...
@@ -281,40 +267,25 @@ define(['require',
return
true
;
return
true
;
}
}
},
},
namespaceAttributes
:
function
(
modelEl
,
obj
,
elementValues
)
{
businessMetadataAttributes
:
function
(
modelEl
,
attrObj
)
{
obj
.
options
=
{
var
obj
=
{
options
:
{
"applicableEntityTypes"
:
JSON
.
stringify
(
modelEl
.
find
(
".entityTypeSelector"
).
val
()),
"applicableEntityTypes"
:
JSON
.
stringify
(
modelEl
.
find
(
".entityTypeSelector"
).
val
()),
"maxStrLength"
:
modelEl
.
find
(
".stringLengthVal"
).
val
()
?
modelEl
.
find
(
".stringLengthVal"
).
val
()
:
"0"
"maxStrLength"
:
modelEl
.
find
(
".stringLengthVal"
).
val
()
?
modelEl
.
find
(
".stringLengthVal"
).
val
()
:
"0"
};
if
(
obj
.
typeName
!=
"string"
&&
obj
.
typeName
!=
"boolean"
&&
obj
.
typeName
!=
"byte"
&&
obj
.
typeName
!=
"short"
&&
obj
.
typeName
!=
"int"
&&
obj
.
typeName
!=
"float"
&&
obj
.
typeName
!=
"double"
&&
obj
.
typeName
!=
"long"
&&
obj
.
typeName
!=
"date"
)
{
var
enumName
=
enumDefCollection
.
fullCollection
.
findWhere
({
name
:
obj
.
typeName
});
if
(
enumName
)
{
var
enumDef
=
enumName
.
get
(
'elementDefs'
);
if
(
enumDef
.
length
===
obj
.
enumValues
.
length
)
{
_
.
each
(
enumDef
,
function
(
enumVal
,
index
)
{
if
(
obj
.
enumValues
.
indexOf
(
enumVal
.
value
)
===
-
1
)
{
this
.
isPutCall
=
true
;
};
})
}
else
{
this
.
isPutCall
=
true
;
}
}
else
{
this
.
isPostCallEnum
=
true
;
}
_
.
each
(
obj
.
enumValues
,
function
(
inputEnumVal
,
index
)
{
elementValues
.
push
({
"ordinal"
:
index
+
1
,
"value"
:
inputEnumVal
})
});
}
}
};
// 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
)
{
if
(
obj
.
multiValueSelect
)
{
obj
.
multiValued
=
true
;
obj
.
multiValued
=
true
;
obj
.
typeName
=
"array<"
+
obj
.
typeName
+
">"
;
obj
.
typeName
=
"array<"
+
obj
.
typeName
+
">"
;
}
}
return
obj
;
},
},
highlightAttrinuteName
:
function
(
modelEl
,
obj
)
{
highlightAttrinuteName
:
function
(
modelEl
,
obj
)
{
Utils
.
notifyInfo
({
Utils
.
notifyInfo
({
...
@@ -329,50 +300,40 @@ define(['require',
...
@@ -329,50 +300,40 @@ define(['require',
"elementDefs"
:
enumVal
"elementDefs"
:
enumVal
});
});
},
},
onCreate
NameSpace
:
function
()
{
onCreate
BusinessMetadata
:
function
()
{
var
that
=
this
,
var
that
=
this
,
validate
=
true
,
attrNameValidate
=
true
,
enumValue
=
true
,
stringValidate
=
true
,
enumDefs
=
[],
putEnumDef
=
[],
attrNames
=
[],
attrNames
=
[],
isvalidName
=
true
;
isvalidName
=
true
;
this
.
checkLoader
=
0
;
this
.
isPutCall
=
false
;
this
.
isPostCallEnum
=
false
;
if
(
this
.
validateValues
())
{
if
(
this
.
validateValues
())
{
return
;
return
;
};
};
this
.
loaderStatus
(
true
);
this
.
loaderStatus
(
true
);
var
name
=
this
.
ui
.
tagN
ame
.
val
(),
var
name
=
this
.
ui
.
n
ame
.
val
(),
description
=
_
.
escape
(
this
.
ui
.
description
.
val
());
description
=
_
.
escape
(
this
.
ui
.
description
.
val
());
var
attributeObj
=
this
.
collection
.
toJSON
();
var
attributeObj
=
this
.
collection
.
toJSON
();
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
)
{
if
(
attributeObj
.
length
)
{
_
.
each
(
attributeObj
,
function
(
obj
)
{
// _.each(attributeObj, function(obj) {
var
modelEl
=
this
.
$
(
'#'
+
obj
.
modalID
);
// var modelEl = this.$('#' + obj.modalID);
modelEl
.
find
(
".attributeInput"
).
css
(
"borderColor"
,
"transparent"
);;
// modelEl.find(".attributeInput").css("borderColor", "transparent");;
if
(
attrNames
.
indexOf
(
obj
.
name
)
>
-
1
)
{
// if (attrNames.indexOf(obj.name) > -1) {
that
.
highlightAttrinuteName
(
modelEl
,
obj
);
// that.highlightAttrinuteName(modelEl, obj);
isvalidName
=
false
;
// isvalidName = false;
return
true
;
// return true;
}
else
{
// } else {
attrNames
.
push
(
obj
.
name
);
// attrNames.push(obj.name);
}
// }
var
elementValues
=
[];
// obj = that.businessMetadataAttributes(modelEl, obj);
that
.
namespaceAttributes
(
modelEl
,
obj
,
elementValues
);
// // if (that.isPostCallEnum) {
if
(
that
.
isPostCallEnum
)
{
// // that.createEnumObject(enumDefs, obj, elementValues);
that
.
createEnumObject
(
enumDefs
,
obj
,
elementValues
);
// // }
}
// // if (that.isPutCall) {
if
(
that
.
isPutCall
)
{
// // that.createEnumObject(putEnumDef, obj, elementValues);
that
.
createEnumObject
(
putEnumDef
,
obj
,
elementValues
);
// // }
}
// });
});
var
notifyObj
=
{
var
notifyObj
=
{
modal
:
true
,
modal
:
true
,
confirm
:
{
confirm
:
{
...
@@ -391,12 +352,12 @@ define(['require',
...
@@ -391,12 +352,12 @@ define(['require',
}
}
if
(
isvalidName
)
{
if
(
isvalidName
)
{
this
.
json
=
{
this
.
json
=
{
"enumDefs"
:
enumDefs
,
"enumDefs"
:
[]
,
"structDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[],
"classificationDefs"
:
[],
"entityDefs"
:
[],
"entityDefs"
:
[],
"
namespace
Defs"
:
[{
"
businessMetadata
Defs"
:
[{
"category"
:
"
NAMESPACE
"
,
"category"
:
"
BUSINESS_METADATA
"
,
"createdBy"
:
"admin"
,
"createdBy"
:
"admin"
,
"updatedBy"
:
"admin"
,
"updatedBy"
:
"admin"
,
"version"
:
1
,
"version"
:
1
,
...
@@ -408,18 +369,16 @@ define(['require',
...
@@ -408,18 +369,16 @@ define(['require',
};
};
var
apiObj
=
{
var
apiObj
=
{
sort
:
false
,
sort
:
false
,
data
:
this
.
json
,
success
:
function
(
model
,
response
)
{
success
:
function
(
model
,
response
)
{
var
nameSpaveDef
=
model
.
namespace
Defs
;
var
nameSpaveDef
=
model
.
businessMetadata
Defs
;
if
(
nameSpaveDef
)
{
if
(
nameSpaveDef
)
{
that
.
options
.
nameSpace
Collection
.
fullCollection
.
add
(
nameSpaveDef
);
that
.
options
.
businessMetadataDef
Collection
.
fullCollection
.
add
(
nameSpaveDef
);
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"
Namespace
"
+
name
+
Messages
.
getAbbreviationMsg
(
false
,
'addSuccessMessage'
)
content
:
"
Business Metadata
"
+
name
+
Messages
.
getAbbreviationMsg
(
false
,
'addSuccessMessage'
)
});
});
}
}
that
.
checkLoader
--
;
that
.
options
.
onUpdateBusinessMetadata
();
if
(
that
.
checkLoader
==
0
)
{
that
.
options
.
onUpdateNamespace
();
}
},
},
silent
:
true
,
silent
:
true
,
reset
:
true
,
reset
:
true
,
...
@@ -428,122 +387,79 @@ define(['require',
...
@@ -428,122 +387,79 @@ define(['require',
that
.
loaderStatus
(
false
);
that
.
loaderStatus
(
false
);
}
}
}
}
that
.
checkLoader
++
;
apiObj
.
type
=
"POST"
;
$
.
extend
(
apiObj
,
{
contentType
:
'application/json'
,
dataType
:
'json'
,
data
:
JSON
.
stringify
(
that
.
json
)
})
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
this
.
options
.
nameSpaceCollection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
nameSpaceApiUrl
(),
"POST"
,
apiObj
);
if
(
that
.
isPutCall
)
{
var
putData
=
{
"enumDefs"
:
putEnumDef
};
that
.
checkLoader
++
;
$
.
extend
(
apiObj
,
{
contentType
:
'application/json'
,
dataType
:
'json'
,
data
:
JSON
.
stringify
(
putData
)
})
this
.
options
.
nameSpaceCollection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
typedefsUrl
().
defs
,
"PUT"
,
apiObj
);
}
}
else
{
}
else
{
attrNames
=
[];
attrNames
=
[];
}
}
},
},
onUpdateAttr
:
function
()
{
onUpdateAttr
:
function
()
{
var
that
=
this
,
var
that
=
this
,
attrNameValidate
=
true
,
selectedBusinessMetadata
=
$
.
extend
(
true
,
{},
that
.
options
.
selectedBusinessMetadata
.
toJSON
()),
enumValue
=
true
,
attributeDefs
=
selectedBusinessMetadata
[
'attributeDefs'
],
stringValidate
=
true
,
enumDefs
=
[],
postEnumDef
=
[],
selectedNamespace
=
$
.
extend
(
true
,
{},
that
.
options
.
selectedNamespace
.
toJSON
()),
attributeDefs
=
selectedNamespace
[
'attributeDefs'
],
isvalidName
=
true
;
isvalidName
=
true
;
this
.
checkLoader
=
0
;
this
.
isPutCall
=
false
;
this
.
isPostCallEnum
=
false
;
if
(
this
.
validateValues
())
{
if
(
this
.
validateValues
())
{
return
;
return
;
};
};
if
(
this
.
$el
.
find
(
".namespace-attr"
).
length
>
0
&&
this
.
collection
.
length
>
0
)
{
this
.
loaderStatus
(
true
);
if
(
this
.
collection
.
length
>
0
)
{
if
(
this
.
collection
.
length
>
0
)
{
this
.
collection
.
each
(
function
(
model
)
{
this
.
loaderStatus
(
true
);
var
obj
=
model
.
toJSON
(),
if
(
selectedBusinessMetadata
.
attributeDefs
===
undefined
)
{
modelEl
=
this
.
$
(
'#'
+
obj
.
modalID
);
selectedBusinessMetadata
.
attributeDefs
=
[];
modelEl
.
find
(
".attributeInput"
).
css
(
"borderColor"
,
"transparent"
);
}
if
(
that
.
options
.
isNewAttr
==
true
&&
_
.
find
(
attributeDefs
,
{
name
:
obj
.
name
}))
{
selectedBusinessMetadata
.
attributeDefs
=
selectedBusinessMetadata
.
attributeDefs
.
concat
(
this
.
collection
.
toJSON
());
that
.
highlightAttrinuteName
(
modelEl
,
obj
);
// this.collection.each(function(model) {
isvalidName
=
false
;
// var obj = model.toJSON(),
return
true
;
// modelEl = this.$('#' + obj.modalID);
}
// modelEl.find(".attributeInput").css("borderColor", "transparent");
var
elementValues
=
[];
// // if (that.options.isNewAttr == true && _.find(attributeDefs, { name: obj.name })) {
that
.
namespaceAttributes
(
modelEl
,
obj
,
elementValues
);
// // that.highlightAttrinuteName(modelEl, obj);
if
(
that
.
isPostCallEnum
)
{
// // isvalidName = false;
that
.
createEnumObject
(
postEnumDef
,
obj
,
elementValues
);
// // return true;
}
else
if
(
that
.
isPutCall
)
{
// // }
that
.
createEnumObject
(
enumDefs
,
obj
,
elementValues
);
// 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
)
{
// //
if (that.options.isNewAttr == true) {
selectedNamespace
.
attributeDefs
.
push
(
obj
);
// // selectedBusinessMetadata
.attributeDefs.push(obj);
}
else
{
// //
} else {
var
attrDef
=
selectedNamespace
.
attributeDefs
;
// // var attrDef = selectedBusinessMetadata
.attributeDefs;
_
.
each
(
attrDef
,
function
(
attrObj
)
{
// //
_.each(attrDef, function(attrObj) {
if
(
attrObj
.
name
===
that
.
$el
.
find
(
".attributeInput"
)[
0
].
value
)
{
// //
if (attrObj.name === that.$el.find(".attributeInput")[0].value) {
attrObj
.
name
=
obj
.
name
;
// //
attrObj.name = obj.name;
attrObj
.
typeName
=
obj
.
typeName
;
// //
attrObj.typeName = obj.typeName;
attrObj
.
multiValued
=
obj
.
multiValueSelect
||
false
;
// //
attrObj.multiValued = obj.multiValueSelect || false;
attrObj
.
options
.
applicableEntityTypes
=
obj
.
options
.
applicableEntityTypes
;
// //
attrObj.options.applicableEntityTypes = obj.options.applicableEntityTypes;
attrObj
.
enumValues
=
obj
.
enumValues
;
// //
attrObj.enumValues = obj.enumValues;
attrObj
.
options
.
maxStrLength
=
obj
.
options
.
maxStrLength
;
// //
attrObj.options.maxStrLength = obj.options.maxStrLength;
}
// //
}
});
// //
});
}
// //
}
});
//
});
if
(
isvalidName
)
{
if
(
isvalidName
)
{
var
notifyObj
=
{
modal
:
true
,
confirm
:
{
confirm
:
true
,
buttons
:
[{
text
:
"Ok"
,
addClass
:
"btn-atlas btn-md"
,
click
:
function
(
notice
)
{
notice
.
remove
();
}
},
null
]
}
};
var
putNameSpace
=
function
()
{
that
.
checkLoader
++
;
$
.
extend
(
apiObj
,
{
contentType
:
'application/json'
,
dataType
:
'json'
,
data
:
JSON
.
stringify
(
that
.
json
)
})
that
.
options
.
nameSpaceCollection
.
constructor
.
nonCrudOperation
.
call
(
that
,
UrlLinks
.
nameSpaceUpdateUrl
(),
"PUT"
,
apiObj
);
}
this
.
json
=
{
this
.
json
=
{
"enumDefs"
:
enumDefs
,
"enumDefs"
:
[]
,
"structDefs"
:
[],
"structDefs"
:
[],
"classificationDefs"
:
[],
"classificationDefs"
:
[],
"entityDefs"
:
[],
"entityDefs"
:
[],
"namespaceDefs"
:
that
.
options
.
isNewAttr
?
[
selectedNamespace
]
:
[
selectedNamespace
]
"businessMetadataDefs"
:
[
selectedBusinessMetadata
]
};
};
var
apiObj
=
{
var
apiObj
=
{
sort
:
false
,
sort
:
false
,
data
:
this
.
json
,
success
:
function
(
model
,
response
)
{
success
:
function
(
model
,
response
)
{
if
(
model
.
namespaceDefs
.
length
===
0
&&
model
.
enumDefs
.
length
)
{
var
selectedBusinessMetadata
=
that
.
options
.
businessMetadataDefCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
options
.
guid
});
putNameSpace
();
}
else
{
var
selectedNameSpace
=
that
.
options
.
nameSpaceCollection
.
fullCollection
.
findWhere
({
guid
:
that
.
options
.
guid
});
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"One or more Namespace
attribute"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
content
:
"One or more Business Metadada
attribute"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
});
});
if
(
model
.
namespaceDefs
&&
model
.
namespace
Defs
.
length
)
{
if
(
model
.
businessMetadataDefs
&&
model
.
businessMetadata
Defs
.
length
)
{
that
.
options
.
selectedNamespace
.
set
(
model
.
namespace
Defs
[
0
]);
that
.
options
.
selectedBusinessMetadata
.
set
(
model
.
businessMetadata
Defs
[
0
]);
}
}
that
.
options
.
onEditCallback
();
that
.
options
.
onEditCallback
();
}
that
.
options
.
onUpdateBusinessMetadata
();
that
.
checkLoader
--
;
if
(
that
.
checkLoader
==
0
)
{
that
.
options
.
onUpdateNamespace
();
}
},
},
silent
:
true
,
silent
:
true
,
reset
:
true
,
reset
:
true
,
...
@@ -551,26 +467,18 @@ define(['require',
...
@@ -551,26 +467,18 @@ define(['require',
that
.
loaderStatus
(
false
);
that
.
loaderStatus
(
false
);
}
}
}
}
if
(
that
.
isPostCallEnum
)
{
apiObj
.
type
=
"PUT"
;
var
postData
=
{
that
.
businessMetadataModel
.
saveBusinessMetadata
(
apiObj
);
"enumDefs"
:
postEnumDef
};
this
.
checkLoader
++
;
$
.
extend
(
apiObj
,
{
contentType
:
'application/json'
,
dataType
:
'json'
,
data
:
JSON
.
stringify
(
postData
)
})
this
.
options
.
nameSpaceCollection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
typedefsUrl
().
defs
,
"POST"
,
apiObj
);
}
else
{
putNameSpace
();
}
}
}
}
}
else
{
}
else
{
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"No attribute updated"
content
:
"No attribute updated"
});
});
this
.
loaderStatus
(
false
);
this
.
loaderStatus
(
false
);
that
.
options
.
onUpdate
Namespace
();
that
.
options
.
onUpdate
BusinessMetadata
();
}
}
}
}
});
});
return
Create
NameSpace
LayoutView
;
return
Create
BusinessMetadata
LayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/
name_space
/EnumCreateUpdateItemView.js
→
dashboardv3/public/js/views/
business_metadata
/EnumCreateUpdateItemView.js
View file @
3d0fcedb
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* 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/
name_space
/EnumCreateUpdateItemView_tmpl"
,
"utils/Utils"
,
"utils/UrlLinks"
,
"utils/Messages"
],
function
(
define
([
"require"
,
"backbone"
,
"hbs!tmpl/
business_metadata
/EnumCreateUpdateItemView_tmpl"
,
"utils/Utils"
,
"utils/UrlLinks"
,
"utils/Messages"
],
function
(
require
,
require
,
Backbone
,
Backbone
,
EnumCreateUpdateItemViewTmpl
,
EnumCreateUpdateItemViewTmpl
,
...
@@ -82,7 +82,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
...
@@ -82,7 +82,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
this
.
enumDefCollection
=
options
.
enumDefCollection
;
this
.
enumDefCollection
=
options
.
enumDefCollection
;
this
.
nameSpaceCollection
=
options
.
nameSpace
Collection
;
this
.
businessMetadataDefCollection
=
options
.
businessMetadataDef
Collection
;
},
},
onRender
:
function
()
{
onRender
:
function
()
{
var
that
=
this
,
var
that
=
this
,
...
@@ -234,7 +234,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
...
@@ -234,7 +234,7 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
});
});
}
}
that
.
enumDefCollection
.
fetch
({
reset
:
true
});
that
.
enumDefCollection
.
fetch
({
reset
:
true
});
if
(
that
.
options
.
onUpdateEnum
)
{
//callback from
namespacea
ttributeItemView
if
(
that
.
options
.
onUpdateEnum
)
{
//callback from
BusinessMetadataA
ttributeItemView
that
.
options
.
onUpdateEnum
();
that
.
options
.
onUpdateEnum
();
}
}
that
.
ui
.
enumCancleBtn
.
attr
(
"disabled"
,
"true"
);
that
.
ui
.
enumCancleBtn
.
attr
(
"disabled"
,
"true"
);
...
@@ -253,9 +253,9 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
...
@@ -253,9 +253,9 @@ define(["require", "backbone", "hbs!tmpl/name_space/EnumCreateUpdateItemView_tmp
};
};
$
.
extend
(
apiObj
,
{
contentType
:
"application/json"
,
dataType
:
"json"
,
data
:
JSON
.
stringify
(
this
.
json
)
});
$
.
extend
(
apiObj
,
{
contentType
:
"application/json"
,
dataType
:
"json"
,
data
:
JSON
.
stringify
(
this
.
json
)
});
if
(
isPostCallEnum
)
{
if
(
isPostCallEnum
)
{
this
.
nameSpace
Collection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
typedefsUrl
().
defs
,
"POST"
,
apiObj
);
this
.
businessMetadataDef
Collection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
typedefsUrl
().
defs
,
"POST"
,
apiObj
);
}
else
if
(
isPutCall
)
{
}
else
if
(
isPutCall
)
{
this
.
nameSpace
Collection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
typedefsUrl
().
defs
,
"PUT"
,
apiObj
);
this
.
businessMetadataDef
Collection
.
constructor
.
nonCrudOperation
.
call
(
this
,
UrlLinks
.
typedefsUrl
().
defs
,
"PUT"
,
apiObj
);
}
else
{
}
else
{
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"No updated values"
content
:
"No updated values"
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
View file @
3d0fcedb
...
@@ -47,7 +47,7 @@ define(['require',
...
@@ -47,7 +47,7 @@ define(['require',
RRelationshipLayoutView
:
"#r_relationshipLayoutView"
,
RRelationshipLayoutView
:
"#r_relationshipLayoutView"
,
REntityUserDefineView
:
"#r_entityUserDefineView"
,
REntityUserDefineView
:
"#r_entityUserDefineView"
,
REntityLabelDefineView
:
"#r_entityLabelDefineView"
,
REntityLabelDefineView
:
"#r_entityLabelDefineView"
,
REntity
NameSpaceView
:
"#r_entityNameSpace
View"
REntity
BusinessMetadataView
:
"#r_entityBusinessMetadata
View"
},
},
/** ui selector cache */
/** ui selector cache */
ui
:
{
ui
:
{
...
@@ -121,7 +121,7 @@ define(['require',
...
@@ -121,7 +121,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'collection'
,
'id'
,
'entityDefCollection'
,
'typeHeaders'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'glossaryCollection'
,
'
nameSpace
Collection'
,
'searchVent'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'collection'
,
'id'
,
'entityDefCollection'
,
'typeHeaders'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'glossaryCollection'
,
'
businessMetadataDef
Collection'
,
'searchVent'
));
$
(
'body'
).
addClass
(
"detail-page"
);
$
(
'body'
).
addClass
(
"detail-page"
);
},
},
bindEvents
:
function
()
{
bindEvents
:
function
()
{
...
@@ -245,7 +245,7 @@ define(['require',
...
@@ -245,7 +245,7 @@ define(['require',
enumDefCollection
:
this
.
enumDefCollection
,
enumDefCollection
:
this
.
enumDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
,
glossaryCollection
:
this
.
glossaryCollection
,
glossaryCollection
:
this
.
glossaryCollection
,
nameSpaceCollection
:
this
.
activeEntityDef
.
get
(
'namespace
AttributeDefs'
),
businessMetadataCollection
:
this
.
activeEntityDef
.
get
(
'business
AttributeDefs'
),
searchVent
:
this
.
searchVent
,
searchVent
:
this
.
searchVent
,
attributeDefs
:
(
function
()
{
attributeDefs
:
(
function
()
{
return
that
.
getEntityDef
(
collectionJSON
);
return
that
.
getEntityDef
(
collectionJSON
);
...
@@ -255,8 +255,8 @@ define(['require',
...
@@ -255,8 +255,8 @@ define(['require',
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderEntityUserDefineView
(
obj
);
this
.
renderEntityUserDefineView
(
obj
);
this
.
renderEntityLabelDefineView
(
obj
);
this
.
renderEntityLabelDefineView
(
obj
);
if
(
obj
.
nameSpace
Collection
)
{
if
(
obj
.
businessMetadata
Collection
)
{
this
.
renderEntity
NameSpace
View
(
obj
);
this
.
renderEntity
BusinessMetadata
View
(
obj
);
}
}
this
.
renderRelationshipLayoutView
(
obj
);
this
.
renderRelationshipLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
...
@@ -517,10 +517,10 @@ define(['require',
...
@@ -517,10 +517,10 @@ define(['require',
that
.
REntityLabelDefineView
.
show
(
new
EntityLabelDefineView
(
obj
));
that
.
REntityLabelDefineView
.
show
(
new
EntityLabelDefineView
(
obj
));
});
});
},
},
renderEntity
NameSpace
View
:
function
(
obj
)
{
renderEntity
BusinessMetadata
View
:
function
(
obj
)
{
var
that
=
this
;
var
that
=
this
;
require
([
'views/entity/Entity
NameSpaceView'
],
function
(
EntityNameSpace
View
)
{
require
([
'views/entity/Entity
BusinessMetaDataView'
],
function
(
EntityBusinessMetaData
View
)
{
that
.
REntity
NameSpaceView
.
show
(
new
EntityNameSpace
View
(
obj
));
that
.
REntity
BusinessMetadataView
.
show
(
new
EntityBusinessMetaData
View
(
obj
));
});
});
},
},
renderTagTableLayoutView
:
function
(
obj
)
{
renderTagTableLayoutView
:
function
(
obj
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/entity/Entity
NameSpace
ItemView.js
→
dashboardv3/public/js/views/entity/Entity
BusinessMetaData
ItemView.js
View file @
3d0fcedb
...
@@ -17,29 +17,29 @@
...
@@ -17,29 +17,29 @@
*/
*/
define
([
'require'
,
define
([
'require'
,
'backbone'
,
'backbone'
,
'hbs!tmpl/entity/Entity
NameSpace
ItemView_tmpl'
,
'hbs!tmpl/entity/Entity
BusinessMetaData
ItemView_tmpl'
,
'moment'
,
'moment'
,
'daterangepicker'
'daterangepicker'
],
function
(
require
,
Backbone
,
Entity
NameSpace
ItemViewTmpl
,
moment
)
{
],
function
(
require
,
Backbone
,
Entity
BusinessMetaData
ItemViewTmpl
,
moment
)
{
'use strict'
;
'use strict'
;
return
Backbone
.
Marionette
.
ItemView
.
extend
({
return
Backbone
.
Marionette
.
ItemView
.
extend
({
_viewName
:
'Entity
NameSpace
ItemView'
,
_viewName
:
'Entity
BusinessMetaData
ItemView'
,
template
:
Entity
NameSpace
ItemViewTmpl
,
template
:
Entity
BusinessMetaData
ItemViewTmpl
,
templateHelpers
:
function
()
{
templateHelpers
:
function
()
{
return
{
return
{
editMode
:
this
.
editMode
,
editMode
:
this
.
editMode
,
entity
:
this
.
entity
,
entity
:
this
.
entity
,
getValue
:
this
.
getValue
.
bind
(
this
),
getValue
:
this
.
getValue
.
bind
(
this
),
get
NamespaceDroupdown
:
this
.
getNamespace
Droupdown
.
bind
(
this
),
get
BusinessMetadataDroupdown
:
this
.
getBusinessMetadata
Droupdown
.
bind
(
this
),
nameSpaceCollection
:
this
.
nameSpace
Collection
,
businessMetadataCollection
:
this
.
businessMetadata
Collection
,
model
:
this
.
model
.
toJSON
()
model
:
this
.
model
.
toJSON
()
}
}
},
},
tagName
:
'li'
,
tagName
:
'li'
,
className
:
"
namespace
-tree-child"
,
className
:
"
business-metadata
-tree-child"
,
/** Layout sub regions */
/** Layout sub regions */
regions
:
{},
regions
:
{},
...
@@ -61,7 +61,7 @@ define(['require',
...
@@ -61,7 +61,7 @@ define(['require',
},
},
/**
/**
* intialize a new Entity
NameSpace
ItemView Layout
* intialize a new Entity
BusinessMetaData
ItemView Layout
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
...
@@ -73,7 +73,7 @@ define(['require',
...
@@ -73,7 +73,7 @@ define(['require',
this
.
ui
.
keyEl
.
select2
({
placeholder
:
"Select Attribute"
});
this
.
ui
.
keyEl
.
select2
({
placeholder
:
"Select Attribute"
});
if
(
this
.
editMode
&&
(
!
this
.
model
.
has
(
"isNew"
)))
{
if
(
this
.
editMode
&&
(
!
this
.
model
.
has
(
"isNew"
)))
{
this
.
getEdit
Namespace
El
();
this
.
getEdit
BusinessMetadata
El
();
}
}
this
.
initializeElement
();
this
.
initializeElement
();
this
.
bindEvent
();
this
.
bindEvent
();
...
@@ -100,7 +100,7 @@ define(['require',
...
@@ -100,7 +100,7 @@ define(['require',
});
});
this
.
$el
.
off
(
"change"
,
".custom-col-1[data-id='value']>[data-key]"
).
on
(
"change"
,
".custom-col-1[data-id='value']>[data-key]"
,
function
(
e
)
{
this
.
$el
.
off
(
"change"
,
".custom-col-1[data-id='value']>[data-key]"
).
on
(
"change"
,
".custom-col-1[data-id='value']>[data-key]"
,
function
(
e
)
{
var
key
=
$
(
this
).
data
(
"key"
),
var
key
=
$
(
this
).
data
(
"key"
),
namespace
=
$
(
this
).
data
(
"namespace
"
),
businessMetadata
=
$
(
this
).
data
(
"businessMetadata
"
),
typeName
=
$
(
this
).
data
(
"typename"
),
typeName
=
$
(
this
).
data
(
"typename"
),
multi
=
$
(
this
).
data
(
"multi"
),
multi
=
$
(
this
).
data
(
"multi"
),
updateObj
=
that
.
model
.
toJSON
();
updateObj
=
that
.
model
.
toJSON
();
...
@@ -111,8 +111,8 @@ define(['require',
...
@@ -111,8 +111,8 @@ define(['require',
if
(
multi
&&
typeName
.
indexOf
(
"date"
)
==
-
1
)
{
if
(
multi
&&
typeName
.
indexOf
(
"date"
)
==
-
1
)
{
updateObj
[
key
].
value
=
$
(
this
).
select2
(
"val"
);
updateObj
[
key
].
value
=
$
(
this
).
select2
(
"val"
);
}
}
if
(
!
that
.
model
.
has
(
"__internal_UI_
nameSpace
Name"
))
{
if
(
!
that
.
model
.
has
(
"__internal_UI_
businessMetadata
Name"
))
{
updateObj
[
"__internal_UI_
nameSpaceName"
]
=
namespace
;
updateObj
[
"__internal_UI_
businessMetadataName"
]
=
businessMetadata
;
}
}
if
(
typeName
.
indexOf
(
"date"
)
>
-
1
)
{
if
(
typeName
.
indexOf
(
"date"
)
>
-
1
)
{
if
(
multi
&&
updateObj
[
key
].
value
)
{
if
(
multi
&&
updateObj
[
key
].
value
)
{
...
@@ -151,7 +151,7 @@ define(['require',
...
@@ -151,7 +151,7 @@ define(['require',
typeName
=
options
.
val
.
typeName
||
""
,
typeName
=
options
.
val
.
typeName
||
""
,
val
=
options
.
val
.
value
,
val
=
options
.
val
.
value
,
isMultiValued
=
typeName
&&
typeName
.
indexOf
(
"array<"
)
===
0
,
isMultiValued
=
typeName
&&
typeName
.
indexOf
(
"array<"
)
===
0
,
namespace
=
options
.
namespace
,
businessMetadata
=
options
.
businessMetadata
,
allowOnlyNum
=
false
;
allowOnlyNum
=
false
;
var
elType
=
isMultiValued
?
"select"
:
"input"
;
var
elType
=
isMultiValued
?
"select"
:
"input"
;
if
(
!
isMultiValued
&&
!
_
.
isEmpty
(
val
))
{
if
(
!
isMultiValued
&&
!
_
.
isEmpty
(
val
))
{
...
@@ -174,11 +174,11 @@ define(['require',
...
@@ -174,11 +174,11 @@ define(['require',
}
}
}
}
if
(
typeName
.
indexOf
(
"string"
)
>
-
1
)
{
if
(
typeName
.
indexOf
(
"string"
)
>
-
1
)
{
returnEL
=
'<'
+
elType
+
' type="text" data-key="'
+
key
+
'" data-
namespace="'
+
namespace
+
'" data-typename="'
+
typeName
+
'" data-multi="'
+
isMultiValued
+
'" data-tags="true" placeholder="Enter String" class="form-control" '
+
(
!
_
.
isUndefinedNull
(
val
)
?
'value="'
+
val
+
'"'
:
""
)
+
'></'
+
elType
+
'>'
;
returnEL
=
'<'
+
elType
+
' type="text" data-key="'
+
key
+
'" data-
businessMetadata="'
+
businessMetadata
+
'" data-typename="'
+
typeName
+
'" data-multi="'
+
isMultiValued
+
'" data-tags="true" placeholder="Enter String" class="form-control" '
+
(
!
_
.
isUndefinedNull
(
val
)
?
'value="'
+
val
+
'"'
:
""
)
+
'></'
+
elType
+
'>'
;
}
else
if
(
typeName
.
indexOf
(
"boolean"
)
>
-
1
)
{
}
else
if
(
typeName
.
indexOf
(
"boolean"
)
>
-
1
)
{
returnEL
=
'<select data-key="'
+
key
+
'" data-
namespace="'
+
namespace
+
'" data-typename="'
+
typeName
+
'" data-multi="'
+
isMultiValued
+
'" class="form-control">'
+
(
isMultiValued
?
""
:
'<option value="">--Select Value--</option>'
)
+
'<option value="true" '
+
(
!
_
.
isUndefinedNull
(
val
)
&&
val
==
"true"
?
"selected"
:
""
)
+
'>true</option><option value="false" '
+
(
!
_
.
isUndefinedNull
(
val
)
&&
val
==
"false"
?
"selected"
:
""
)
+
'>false</option></select>'
;
returnEL
=
'<select data-key="'
+
key
+
'" data-
businessMetadata="'
+
businessMetadata
+
'" data-typename="'
+
typeName
+
'" data-multi="'
+
isMultiValued
+
'" class="form-control">'
+
(
isMultiValued
?
""
:
'<option value="">--Select Value--</option>'
)
+
'<option value="true" '
+
(
!
_
.
isUndefinedNull
(
val
)
&&
val
==
"true"
?
"selected"
:
""
)
+
'>true</option><option value="false" '
+
(
!
_
.
isUndefinedNull
(
val
)
&&
val
==
"false"
?
"selected"
:
""
)
+
'>false</option></select>'
;
}
else
if
(
typeName
.
indexOf
(
"date"
)
>
-
1
)
{
}
else
if
(
typeName
.
indexOf
(
"date"
)
>
-
1
)
{
returnEL
=
'<'
+
(
isMultiValued
?
"textarea"
:
"input"
)
+
' type="text" data-key="'
+
key
+
'" data-
namespace="'
+
namespace
+
'" data-typename="'
+
typeName
+
'"data-multi="'
+
isMultiValued
+
'" data-type="date" class="form-control" '
+
(
isMultiValued
===
false
&&
!
_
.
isUndefinedNull
(
val
)
?
'value="'
+
val
+
'"'
:
""
)
+
'>'
+
(
isMultiValued
===
true
&&
!
_
.
isUndefinedNull
(
val
)
?
val
:
""
)
+
(
isMultiValued
?
"</textarea>"
:
""
);
returnEL
=
'<'
+
(
isMultiValued
?
"textarea"
:
"input"
)
+
' type="text" data-key="'
+
key
+
'" data-
businessMetadata="'
+
businessMetadata
+
'" data-typename="'
+
typeName
+
'"data-multi="'
+
isMultiValued
+
'" data-type="date" class="form-control" '
+
(
isMultiValued
===
false
&&
!
_
.
isUndefinedNull
(
val
)
?
'value="'
+
val
+
'"'
:
""
)
+
'>'
+
(
isMultiValued
===
true
&&
!
_
.
isUndefinedNull
(
val
)
?
val
:
""
)
+
(
isMultiValued
?
"</textarea>"
:
""
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
dateObj
=
{
"singleDatePicker"
:
true
,
autoUpdateInput
:
isMultiValued
?
false
:
true
},
var
dateObj
=
{
"singleDatePicker"
:
true
,
autoUpdateInput
:
isMultiValued
?
false
:
true
},
dateEl
=
that
.
$el
.
find
(
'[data-type="date"][data-key="'
+
key
+
'"]'
).
daterangepicker
(
dateObj
);
dateEl
=
that
.
$el
.
find
(
'[data-type="date"][data-key="'
+
key
+
'"]'
).
daterangepicker
(
dateObj
);
...
@@ -195,7 +195,7 @@ define(['require',
...
@@ -195,7 +195,7 @@ define(['require',
},
0
);
},
0
);
}
else
if
(
typeName
.
indexOf
(
"byte"
)
>
-
1
||
typeName
.
indexOf
(
"short"
)
>
-
1
||
typeName
.
indexOf
(
"int"
)
>
-
1
||
typeName
.
indexOf
(
"float"
)
>
-
1
||
typeName
.
indexOf
(
"double"
)
>
-
1
||
typeName
.
indexOf
(
"long"
)
>
-
1
)
{
}
else
if
(
typeName
.
indexOf
(
"byte"
)
>
-
1
||
typeName
.
indexOf
(
"short"
)
>
-
1
||
typeName
.
indexOf
(
"int"
)
>
-
1
||
typeName
.
indexOf
(
"float"
)
>
-
1
||
typeName
.
indexOf
(
"double"
)
>
-
1
||
typeName
.
indexOf
(
"long"
)
>
-
1
)
{
allowOnlyNum
=
true
;
allowOnlyNum
=
true
;
returnEL
=
'<'
+
elType
+
' data-key="'
+
key
+
'" data-
namespace="'
+
namespace
+
'" data-typename="'
+
typeName
+
'" type="number" data-multi="'
+
isMultiValued
+
'" data-tags="true" placeholder="Enter Number" class="form-control" '
+
(
!
_
.
isUndefinedNull
(
val
)
?
'value="'
+
val
+
'"'
:
""
)
+
'></'
+
elType
+
'>'
;
returnEL
=
'<'
+
elType
+
' data-key="'
+
key
+
'" data-
businessMetadata="'
+
businessMetadata
+
'" data-typename="'
+
typeName
+
'" type="number" data-multi="'
+
isMultiValued
+
'" data-tags="true" placeholder="Enter Number" class="form-control" '
+
(
!
_
.
isUndefinedNull
(
val
)
?
'value="'
+
val
+
'"'
:
""
)
+
'></'
+
elType
+
'>'
;
}
else
if
(
typeName
)
{
}
else
if
(
typeName
)
{
var
modTypeName
=
typeName
;
var
modTypeName
=
typeName
;
if
(
isMultiValued
)
{
if
(
isMultiValued
)
{
...
@@ -210,7 +210,7 @@ define(['require',
...
@@ -210,7 +210,7 @@ define(['require',
_
.
forEach
(
foundEnumType
.
get
(
"elementDefs"
),
function
(
obj
)
{
_
.
forEach
(
foundEnumType
.
get
(
"elementDefs"
),
function
(
obj
)
{
enumOptions
+=
'<option value="'
+
obj
.
value
+
'">'
+
obj
.
value
+
'</option>'
enumOptions
+=
'<option value="'
+
obj
.
value
+
'">'
+
obj
.
value
+
'</option>'
});
});
returnEL
=
'<select data-key="'
+
key
+
'" data-
namespace="'
+
namespace
+
'" data-typename="'
+
typeName
+
'" data-multi="'
+
isMultiValued
+
'" >'
+
enumOptions
+
'</select>'
;
returnEL
=
'<select data-key="'
+
key
+
'" data-
businessMetadata="'
+
businessMetadata
+
'" data-typename="'
+
typeName
+
'" data-multi="'
+
isMultiValued
+
'" >'
+
enumOptions
+
'</select>'
;
}
}
setTimeout
(
function
()
{
setTimeout
(
function
()
{
if
(
!
isMultiValued
)
{
if
(
!
isMultiValued
)
{
...
@@ -245,7 +245,7 @@ define(['require',
...
@@ -245,7 +245,7 @@ define(['require',
hasModalData
=
this
.
model
.
get
(
key
[
1
]);
hasModalData
=
this
.
model
.
get
(
key
[
1
]);
if
(
!
hasModalData
)
{
if
(
!
hasModalData
)
{
var
tempObj
=
{
var
tempObj
=
{
"__internal_UI_
nameSpace
Name"
:
key
[
0
]
"__internal_UI_
businessMetadata
Name"
:
key
[
0
]
};
};
if
(
this
.
model
.
has
(
"isNew"
))
{
if
(
this
.
model
.
has
(
"isNew"
))
{
tempObj
[
"isNew"
]
=
true
;
tempObj
[
"isNew"
]
=
true
;
...
@@ -253,13 +253,13 @@ define(['require',
...
@@ -253,13 +253,13 @@ define(['require',
tempObj
[
key
[
1
]]
=
null
;
tempObj
[
key
[
1
]]
=
null
;
this
.
model
.
clear
({
silent
:
true
}).
set
(
tempObj
)
this
.
model
.
clear
({
silent
:
true
}).
set
(
tempObj
)
}
}
valEl
.
html
(
this
.
getAttrElement
({
namespace
:
key
[
0
],
key
:
key
[
1
],
val
:
hasModalData
?
hasModalData
:
{
typeName
:
key
[
2
]
}
}));
valEl
.
html
(
this
.
getAttrElement
({
businessMetadata
:
key
[
0
],
key
:
key
[
1
],
val
:
hasModalData
?
hasModalData
:
{
typeName
:
key
[
2
]
}
}));
if
(
manual
===
undefined
)
{
if
(
manual
===
undefined
)
{
this
.
model
.
collection
.
trigger
(
"selected:attr"
,
e
.
currentTarget
.
value
,
this
.
model
);
this
.
model
.
collection
.
trigger
(
"selected:attr"
,
e
.
currentTarget
.
value
,
this
.
model
);
}
}
}
}
},
},
getValue
:
function
(
value
,
key
,
namespace
Name
)
{
getValue
:
function
(
value
,
key
,
businessMetadata
Name
)
{
var
typeName
=
value
.
typeName
,
var
typeName
=
value
.
typeName
,
value
=
value
.
value
;
value
=
value
.
value
;
if
(
typeName
===
"date"
)
{
if
(
typeName
===
"date"
)
{
...
@@ -268,24 +268,24 @@ define(['require',
...
@@ -268,24 +268,24 @@ define(['require',
return
value
;
return
value
;
}
}
},
},
get
NamespaceDroupdown
:
function
(
nameSpace
Collection
)
{
get
BusinessMetadataDroupdown
:
function
(
businessMetadata
Collection
)
{
var
optgroup
=
""
;
var
optgroup
=
""
;
var
that
=
this
;
var
that
=
this
;
var
model
=
that
.
model
.
omit
([
"isNew"
,
"__internal_UI_
nameSpace
Name"
]),
var
model
=
that
.
model
.
omit
([
"isNew"
,
"__internal_UI_
businessMetadata
Name"
]),
keys
=
_
.
keys
(
model
),
keys
=
_
.
keys
(
model
),
isSelected
=
false
,
isSelected
=
false
,
selectdVal
=
null
;
selectdVal
=
null
;
if
(
keys
.
length
===
1
)
{
if
(
keys
.
length
===
1
)
{
isSelected
=
true
;
isSelected
=
true
;
}
}
_
.
each
(
nameSpace
Collection
,
function
(
obj
,
key
)
{
_
.
each
(
businessMetadata
Collection
,
function
(
obj
,
key
)
{
var
options
=
""
;
var
options
=
""
;
if
(
obj
.
length
)
{
if
(
obj
.
length
)
{
_
.
each
(
obj
,
function
(
attrObj
)
{
_
.
each
(
obj
,
function
(
attrObj
)
{
var
entity
Namespace
=
that
.
model
.
collection
.
filter
({
__internal_UI_nameSpace
Name
:
key
}),
var
entity
BusinessMetadata
=
that
.
model
.
collection
.
filter
({
__internal_UI_businessMetadata
Name
:
key
}),
hasAttr
=
false
;
hasAttr
=
false
;
if
(
entity
Namespace
)
{
if
(
entity
BusinessMetadata
)
{
var
found
=
entity
Namespace
.
find
(
function
(
eObj
)
{
var
found
=
entity
BusinessMetadata
.
find
(
function
(
eObj
)
{
return
eObj
.
attributes
.
hasOwnProperty
(
attrObj
.
name
);
return
eObj
.
attributes
.
hasOwnProperty
(
attrObj
.
name
);
});
});
if
(
found
)
{
if
(
found
)
{
...
@@ -313,12 +313,12 @@ define(['require',
...
@@ -313,12 +313,12 @@ define(['require',
},
0
);
},
0
);
return
'<select data-id="key">'
+
optgroup
+
'</select>'
;
return
'<select data-id="key">'
+
optgroup
+
'</select>'
;
},
},
getEdit
Namespace
El
:
function
()
{
getEdit
BusinessMetadata
El
:
function
()
{
var
that
=
this
,
var
that
=
this
,
trs
=
""
;
trs
=
""
;
_
.
each
(
this
.
model
.
attributes
,
function
(
val
,
key
)
{
_
.
each
(
this
.
model
.
attributes
,
function
(
val
,
key
)
{
if
(
key
!==
"__internal_UI_
nameSpace
Name"
&&
key
!==
"isNew"
)
{
if
(
key
!==
"__internal_UI_
businessMetadata
Name"
&&
key
!==
"isNew"
)
{
var
td
=
'<td class="custom-col-1" data-key='
+
key
+
'>'
+
key
+
' ('
+
_
.
escape
(
val
.
typeName
)
+
')</td><td class="custom-col-0">:</td><td class="custom-col-1" data-id="value">'
+
that
.
getAttrElement
({
namespace
:
that
.
model
.
get
(
"__internal_UI_nameSpace
Name"
),
key
:
key
,
val
:
val
})
+
'</td>'
;
var
td
=
'<td class="custom-col-1" data-key='
+
key
+
'>'
+
key
+
' ('
+
_
.
escape
(
val
.
typeName
)
+
')</td><td class="custom-col-0">:</td><td class="custom-col-1" data-id="value">'
+
that
.
getAttrElement
({
businessMetadata
:
that
.
model
.
get
(
"__internal_UI_businessMetadata
Name"
),
key
:
key
,
val
:
val
})
+
'</td>'
;
td
+=
'<td class="custom-col-2 btn-group">'
+
td
+=
'<td class="custom-col-2 btn-group">'
+
'<button class="btn btn-default btn-sm" data-key="'
+
key
+
'" data-id="deleteItem">'
+
'<button class="btn btn-default btn-sm" data-key="'
+
key
+
'" data-id="deleteItem">'
+
...
@@ -327,7 +327,7 @@ define(['require',
...
@@ -327,7 +327,7 @@ define(['require',
trs
+=
"<tr class='custom-tr'>"
+
td
+
"</tr>"
;
trs
+=
"<tr class='custom-tr'>"
+
td
+
"</tr>"
;
}
}
})
})
this
.
$
(
"[data-id='
namespace
TreeChild']"
).
html
(
"<table class='custom-table'>"
+
trs
+
"</table>"
);
this
.
$
(
"[data-id='
businessMetadata
TreeChild']"
).
html
(
"<table class='custom-table'>"
+
trs
+
"</table>"
);
},
},
onDeleteItem
:
function
(
e
)
{
onDeleteItem
:
function
(
e
)
{
var
key
=
$
(
e
.
currentTarget
).
data
(
"key"
);
var
key
=
$
(
e
.
currentTarget
).
data
(
"key"
);
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/entity/Entity
NameSpace
View.js
→
dashboardv3/public/js/views/entity/Entity
BusinessMetaData
View.js
View file @
3d0fcedb
...
@@ -19,57 +19,56 @@
...
@@ -19,57 +19,56 @@
define
([
define
([
"require"
,
"require"
,
"backbone"
,
"backbone"
,
"hbs!tmpl/entity/Entity
NameSpace
View_tmpl"
,
"hbs!tmpl/entity/Entity
BusinessMetaData
View_tmpl"
,
"views/entity/Entity
NameSpace
ItemView"
,
"views/entity/Entity
BusinessMetaData
ItemView"
,
"models/VEntity"
,
"models/VEntity"
,
"utils/Utils"
,
"utils/Utils"
,
"utils/Enums"
,
"utils/Messages"
,
"utils/Messages"
,
"utils/CommonViewFunction"
,
"utils/CommonViewFunction"
,
'moment'
'moment'
],
function
(
require
,
Backbone
,
Entity
NameSpaceViewTmpl
,
EntityNameSpaceItemView
,
VEntity
,
Utils
,
Enum
s
,
Messages
,
CommonViewFunction
,
moment
)
{
],
function
(
require
,
Backbone
,
Entity
BusinessMetaDataView_tmpl
,
EntityBusinessMetaDataItemView
,
VEntity
,
Util
s
,
Messages
,
CommonViewFunction
,
moment
)
{
"use strict"
;
"use strict"
;
return
Backbone
.
Marionette
.
CompositeView
.
extend
({
return
Backbone
.
Marionette
.
CompositeView
.
extend
({
_viewName
:
"Entity
NameSpace
View"
,
_viewName
:
"Entity
BusinessMetaData
View"
,
template
:
Entity
NameSpaceViewT
mpl
,
template
:
Entity
BusinessMetaDataView_t
mpl
,
childView
:
Entity
NameSpace
ItemView
,
childView
:
Entity
BusinessMetaData
ItemView
,
childViewContainer
:
"[data-id='itemView']"
,
childViewContainer
:
"[data-id='itemView']"
,
childViewOptions
:
function
()
{
childViewOptions
:
function
()
{
return
{
return
{
editMode
:
this
.
editMode
,
editMode
:
this
.
editMode
,
entity
:
this
.
entity
,
entity
:
this
.
entity
,
nameSpaceCollection
:
this
.
nameSpace
Collection
,
businessMetadataCollection
:
this
.
businessMetadata
Collection
,
enumDefCollection
:
this
.
enumDefCollection
enumDefCollection
:
this
.
enumDefCollection
};
};
},
},
/** ui selector cache */
/** ui selector cache */
ui
:
{
ui
:
{
addItem
:
"[data-id='addItem']"
,
addItem
:
"[data-id='addItem']"
,
add
NameSpace
:
"[data-id='addNameSpace
']"
,
add
BusinessMetadata
:
"[data-id='addBusinessMetadata
']"
,
save
NameSpace
:
"[data-id='saveNameSpace
']"
,
save
BusinessMetadata
:
"[data-id='saveBusinessMetadata
']"
,
namespaceTree
:
"[data-id='namespace
Tree']"
,
businessMetadataTree
:
"[data-id='businessMetadata
Tree']"
,
cancel
:
"[data-id='cancel']"
cancel
:
"[data-id='cancel']"
},
},
events
:
function
()
{
events
:
function
()
{
var
events
=
{};
var
events
=
{};
events
[
"click "
+
this
.
ui
.
addItem
]
=
'createNameElement'
;
events
[
"click "
+
this
.
ui
.
addItem
]
=
'createNameElement'
;
events
[
"click "
+
this
.
ui
.
add
NameSpace
]
=
"onAddNameSpace
"
;
events
[
"click "
+
this
.
ui
.
add
BusinessMetadata
]
=
"onAddBusinessMetadata
"
;
events
[
"click "
+
this
.
ui
.
save
NameSpace
]
=
"onSaveNameSpace
"
;
events
[
"click "
+
this
.
ui
.
save
BusinessMetadata
]
=
"onSaveBusinessMetadata
"
;
events
[
"click "
+
this
.
ui
.
cancel
]
=
"onCancel"
;
events
[
"click "
+
this
.
ui
.
cancel
]
=
"onCancel"
;
return
events
;
return
events
;
},
},
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
var
that
=
this
;
var
that
=
this
;
_
.
extend
(
this
,
_
.
pick
(
options
,
"entity"
,
"
nameSpace
Collection"
,
"enumDefCollection"
,
"guid"
,
"fetchCollection"
));
_
.
extend
(
this
,
_
.
pick
(
options
,
"entity"
,
"
businessMetadata
Collection"
,
"enumDefCollection"
,
"guid"
,
"fetchCollection"
));
this
.
editMode
=
false
;
this
.
editMode
=
false
;
this
.
$
(
"editBox"
).
hide
();
this
.
$
(
"editBox"
).
hide
();
this
.
actualCollection
=
new
Backbone
.
Collection
(
this
.
actualCollection
=
new
Backbone
.
Collection
(
_
.
map
(
this
.
entity
.
namespace
Attributes
,
function
(
val
,
key
)
{
_
.
map
(
this
.
entity
.
business
Attributes
,
function
(
val
,
key
)
{
var
found
NameSpace
=
that
.
nameSpace
Collection
[
key
];
var
found
BusinessMetadata
=
that
.
businessMetadata
Collection
[
key
];
if
(
found
NameSpace
)
{
if
(
found
BusinessMetadata
)
{
_
.
each
(
val
,
function
(
aVal
,
aKey
)
{
_
.
each
(
val
,
function
(
aVal
,
aKey
)
{
var
foundAttr
=
_
.
find
(
found
NameSpace
,
function
(
o
)
{
var
foundAttr
=
_
.
find
(
found
BusinessMetadata
,
function
(
o
)
{
return
o
.
name
===
aKey
return
o
.
name
===
aKey
});
});
if
(
foundAttr
)
{
if
(
foundAttr
)
{
...
@@ -77,7 +76,7 @@ define([
...
@@ -77,7 +76,7 @@ define([
}
}
})
})
}
}
return
_
.
extend
({},
val
,
{
__internal_UI_
nameSpace
Name
:
key
});
return
_
.
extend
({},
val
,
{
__internal_UI_
businessMetadata
Name
:
key
});
}));
}));
this
.
collection
=
new
Backbone
.
Collection
();
this
.
collection
=
new
Backbone
.
Collection
();
this
.
entityModel
=
new
VEntity
();
this
.
entityModel
=
new
VEntity
();
...
@@ -86,12 +85,12 @@ define([
...
@@ -86,12 +85,12 @@ define([
var
silent
=
options
&&
options
.
silent
||
false
;
var
silent
=
options
&&
options
.
silent
||
false
;
this
.
collection
.
reset
(
this
.
actualCollection
.
toJSON
(),
{
silent
:
silent
});
this
.
collection
.
reset
(
this
.
actualCollection
.
toJSON
(),
{
silent
:
silent
});
},
},
onAdd
NameSpace
:
function
()
{
onAdd
BusinessMetadata
:
function
()
{
this
.
ui
.
add
NameSpace
.
hide
();
this
.
ui
.
add
BusinessMetadata
.
hide
();
this
.
ui
.
save
NameSpace
.
show
();
this
.
ui
.
save
BusinessMetadata
.
show
();
this
.
ui
.
cancel
.
show
();
this
.
ui
.
cancel
.
show
();
this
.
editMode
=
true
;
this
.
editMode
=
true
;
this
.
ui
.
namespace
Tree
.
hide
();
this
.
ui
.
businessMetadata
Tree
.
hide
();
this
.
$
(
".editBox"
).
show
();
this
.
$
(
".editBox"
).
show
();
this
.
updateToActualData
({
silent
:
true
});
this
.
updateToActualData
({
silent
:
true
});
if
(
this
.
collection
.
length
===
0
)
{
if
(
this
.
collection
.
length
===
0
)
{
...
@@ -103,10 +102,10 @@ define([
...
@@ -103,10 +102,10 @@ define([
},
},
onCancel
:
function
()
{
onCancel
:
function
()
{
this
.
ui
.
cancel
.
hide
();
this
.
ui
.
cancel
.
hide
();
this
.
ui
.
save
NameSpace
.
hide
();
this
.
ui
.
save
BusinessMetadata
.
hide
();
this
.
ui
.
add
NameSpace
.
show
();
this
.
ui
.
add
BusinessMetadata
.
show
();
this
.
editMode
=
false
;
this
.
editMode
=
false
;
this
.
ui
.
namespace
Tree
.
show
();
this
.
ui
.
businessMetadata
Tree
.
show
();
this
.
$
(
".editBox"
).
hide
();
this
.
$
(
".editBox"
).
hide
();
this
.
updateToActualData
();
this
.
updateToActualData
();
this
.
panelOpenClose
();
this
.
panelOpenClose
();
...
@@ -116,9 +115,9 @@ define([
...
@@ -116,9 +115,9 @@ define([
if
(
collection
&&
collection
.
length
===
0
)
{
if
(
collection
&&
collection
.
length
===
0
)
{
this
.
$el
.
find
(
".panel-heading"
).
addClass
(
"collapsed"
);
this
.
$el
.
find
(
".panel-heading"
).
addClass
(
"collapsed"
);
this
.
$el
.
find
(
".panel-collapse.collapse"
).
removeClass
(
"in"
);
this
.
$el
.
find
(
".panel-collapse.collapse"
).
removeClass
(
"in"
);
this
.
ui
.
add
NameSpace
.
text
(
"Add"
);
this
.
ui
.
add
BusinessMetadata
.
text
(
"Add"
);
}
else
{
}
else
{
this
.
ui
.
add
NameSpace
.
text
(
"Edit"
);
this
.
ui
.
add
BusinessMetadata
.
text
(
"Edit"
);
this
.
$el
.
find
(
".panel-heading"
).
removeClass
(
"collapsed"
);
this
.
$el
.
find
(
".panel-heading"
).
removeClass
(
"collapsed"
);
this
.
$el
.
find
(
".panel-collapse.collapse"
).
addClass
(
"in"
);
this
.
$el
.
find
(
".panel-collapse.collapse"
).
addClass
(
"in"
);
}
}
...
@@ -150,7 +149,7 @@ define([
...
@@ -150,7 +149,7 @@ define([
});
});
return
validation
;
return
validation
;
},
},
onSave
NameSpace
:
function
()
{
onSave
BusinessMetadata
:
function
()
{
var
that
=
this
;
var
that
=
this
;
if
(
!
this
.
validate
())
{
if
(
!
this
.
validate
())
{
return
;
return
;
...
@@ -160,14 +159,14 @@ define([
...
@@ -160,14 +159,14 @@ define([
this
.
onCancel
();
this
.
onCancel
();
return
;
return
;
}
}
this
.
entityModel
.
save
Namespace
Entity
(
this
.
guid
,
{
this
.
entityModel
.
save
BusinessMetadata
Entity
(
this
.
guid
,
{
data
:
JSON
.
stringify
(
nData
),
data
:
JSON
.
stringify
(
nData
),
type
:
"POST"
,
type
:
"POST"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"One or more
namespace
attributes"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
content
:
"One or more
Business Metadada
attributes"
+
Messages
.
getAbbreviationMsg
(
false
,
'editSuccessMessage'
)
});
});
that
.
entity
.
namespace
Attributes
=
data
;
that
.
entity
.
business
Attributes
=
data
;
this
.
editMode
=
false
;
this
.
editMode
=
false
;
that
.
fetchCollection
();
that
.
fetchCollection
();
that
.
onCancel
();
that
.
onCancel
();
...
@@ -181,10 +180,10 @@ define([
...
@@ -181,10 +180,10 @@ define([
var
finalObj
=
{};
var
finalObj
=
{};
this
.
collection
.
forEach
(
function
(
model
)
{
this
.
collection
.
forEach
(
function
(
model
)
{
if
(
!
model
.
has
(
"addAttrButton"
))
{
if
(
!
model
.
has
(
"addAttrButton"
))
{
var
nameSpaceName
=
model
.
get
(
"__internal_UI_nameSpace
Name"
),
var
businessMetadataName
=
model
.
get
(
"__internal_UI_businessMetadata
Name"
),
modelObj
=
model
.
toJSON
();
modelObj
=
model
.
toJSON
();
_
.
each
(
modelObj
,
function
(
o
,
k
)
{
_
.
each
(
modelObj
,
function
(
o
,
k
)
{
if
(
k
===
"isNew"
&&
k
===
"__internal_UI_nameSpace
Name"
)
{
if
(
k
===
"isNew"
||
k
===
"__internal_UI_businessMetadata
Name"
)
{
delete
modelObj
[
k
];
delete
modelObj
[
k
];
return
;
return
;
}
}
...
@@ -192,20 +191,20 @@ define([
...
@@ -192,20 +191,20 @@ define([
modelObj
[
k
]
=
o
.
value
;
modelObj
[
k
]
=
o
.
value
;
}
}
})
})
if
(
nameSpace
Name
!==
undefined
)
{
if
(
businessMetadata
Name
!==
undefined
)
{
if
(
finalObj
[
nameSpace
Name
])
{
if
(
finalObj
[
businessMetadata
Name
])
{
finalObj
[
nameSpaceName
]
=
_
.
extend
(
finalObj
[
nameSpace
Name
],
modelObj
);
finalObj
[
businessMetadataName
]
=
_
.
extend
(
finalObj
[
businessMetadata
Name
],
modelObj
);
}
else
{
}
else
{
finalObj
[
nameSpace
Name
]
=
modelObj
;
finalObj
[
businessMetadata
Name
]
=
modelObj
;
}
}
}
}
}
}
});
});
if
(
_
.
isEmpty
(
finalObj
))
{
if
(
_
.
isEmpty
(
finalObj
))
{
this
.
actualCollection
.
forEach
(
function
(
model
)
{
this
.
actualCollection
.
forEach
(
function
(
model
)
{
var
nameSpaceName
=
model
.
get
(
"__internal_UI_nameSpace
Name"
);
var
businessMetadataName
=
model
.
get
(
"__internal_UI_businessMetadata
Name"
);
if
(
nameSpace
Name
)
{
if
(
businessMetadata
Name
)
{
finalObj
[
nameSpace
Name
]
=
{};
finalObj
[
businessMetadata
Name
]
=
{};
}
}
})
})
}
}
...
@@ -215,12 +214,12 @@ define([
...
@@ -215,12 +214,12 @@ define([
var
modelObj
=
{
isNew
:
true
};
var
modelObj
=
{
isNew
:
true
};
this
.
collection
.
unshift
(
modelObj
);
this
.
collection
.
unshift
(
modelObj
);
},
},
render
Namespace
:
function
()
{
render
BusinessMetadata
:
function
()
{
var
li
=
""
var
li
=
""
this
.
actualCollection
.
forEach
(
function
(
obj
)
{
this
.
actualCollection
.
forEach
(
function
(
obj
)
{
var
attrLi
=
""
;
var
attrLi
=
""
;
_
.
each
(
obj
.
attributes
,
function
(
val
,
key
)
{
_
.
each
(
obj
.
attributes
,
function
(
val
,
key
)
{
if
(
key
!==
"__internal_UI_
nameSpace
Name"
)
{
if
(
key
!==
"__internal_UI_
businessMetadata
Name"
)
{
var
newVal
=
val
;
var
newVal
=
val
;
if
(
_
.
isObject
(
val
)
&&
!
_
.
isUndefinedNull
(
val
.
value
))
{
if
(
_
.
isObject
(
val
)
&&
!
_
.
isUndefinedNull
(
val
.
value
))
{
newVal
=
val
.
value
;
newVal
=
val
.
value
;
...
@@ -237,16 +236,16 @@ define([
...
@@ -237,16 +236,16 @@ define([
attrLi
+=
"<tr><td>"
+
_
.
escape
(
key
)
+
" ("
+
_
.
escape
(
val
.
typeName
)
+
")</td><td>"
+
_
.
escape
(
newVal
)
+
"</td></tr>"
;
attrLi
+=
"<tr><td>"
+
_
.
escape
(
key
)
+
" ("
+
_
.
escape
(
val
.
typeName
)
+
")</td><td>"
+
_
.
escape
(
newVal
)
+
"</td></tr>"
;
}
}
});
});
li
+=
"<ul class='
namespace-tree-parent'><li class='table'>"
+
_
.
escape
(
obj
.
get
(
"__internal_UI_nameSpace
Name"
))
+
"</li>"
+
li
+=
"<ul class='
business-metadata-tree-parent'><li class='table'>"
+
_
.
escape
(
obj
.
get
(
"__internal_UI_businessMetadata
Name"
))
+
"</li>"
+
"<li class='
namespace
-tree-child entity-detail-table'>"
+
"<li class='
business-metadata
-tree-child entity-detail-table'>"
+
"<table class='table'>"
+
attrLi
+
"</table>"
+
"<table class='table'>"
+
attrLi
+
"</table>"
+
"</li></ul>"
;
"</li></ul>"
;
});
});
this
.
ui
.
namespace
Tree
.
html
(
li
);
this
.
ui
.
businessMetadata
Tree
.
html
(
li
);
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
panelOpenClose
();
this
.
panelOpenClose
();
this
.
render
Namespace
();
this
.
render
BusinessMetadata
();
}
}
});
});
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/name_space/NameSpaceContainerLayoutView.js
deleted
100644 → 0
View file @
aa4bbb08
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define
([
"require"
,
"backbone"
,
"hbs!tmpl/name_space/NameSpaceContainerLayoutView_tmpl"
,
'collection/VEntityList'
,
"utils/Utils"
,
"utils/Messages"
,
"utils/Globals"
,
"utils/UrlLinks"
,
"models/VTag"
],
function
(
require
,
Backbone
,
NameSpaceContainerLayoutViewTmpl
,
VEntityList
,
Utils
,
Messages
,
Globals
,
UrlLinks
,
VTag
)
{
"use strict"
;
var
NameSpaceContainerLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends NameSpaceContainerLayoutView */
{
_viewName
:
"NameSpaceContainerLayoutView"
,
template
:
NameSpaceContainerLayoutViewTmpl
,
/** Layout sub regions */
regions
:
{
RNameSpaceDetailContainer
:
"#r_nameSpaceDetailContainer"
,
RNameSpaceAttrContainer
:
"#r_nameSpaceAttrContainer"
},
/** ui selector cache */
ui
:
{},
/** ui events hash */
events
:
function
()
{},
/**
* intialize a new TagLayoutView Layout
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
.
options
,
options
);
this
.
selectedNameSpace
=
new
VEntityList
();
this
.
selectedNameSpace
.
url
=
UrlLinks
.
nameSpaceGuidApiUrl
(
this
.
options
.
namespaceID
);
this
.
nameSpaceAttr
=
new
VEntityList
();
},
bindEvents
:
function
()
{},
onRender
:
function
()
{
this
.
fetchNameSpaceGuid
();
this
.
options
.
nameSpaceCollection
.
fullCollection
.
sort
({
silent
:
true
});
this
.
options
.
nameSpaceCollection
.
comparator
=
function
(
model
)
{
return
-
model
.
get
(
'timestamp'
);
}
this
.
renderNameSpaceDetailLayoutView
(
this
.
options
);
this
.
renderNameSpaceAttrLayoutView
(
this
.
options
);
},
fetchNameSpaceGuid
:
function
()
{
var
that
=
this
;
this
.
selectedNameSpace
.
fetch
({
complete
:
function
(
model
,
status
)
{
that
.
nameSpaceAttr
.
fullCollection
.
add
(
model
.
responseJSON
.
attributeDefs
);
}
});
},
renderNameSpaceDetailLayoutView
:
function
(
options
)
{
var
that
=
this
;
require
([
"views/name_space/NameSpaceDetailLayoutView"
],
function
(
NameSpaceDetailLayoutView
)
{
if
(
that
.
isDestroyed
)
{
return
;
}
that
.
RNameSpaceDetailContainer
.
show
(
new
NameSpaceDetailLayoutView
({
nameSpaceVent
:
that
.
options
.
nameSpaceVent
,
nameSpaceCollection
:
that
.
options
.
nameSpaceCollection
,
nameSpaceAttr
:
that
.
nameSpaceAttr
,
guid
:
that
.
options
.
namespaceID
,
enumDefCollection
:
that
.
enumDefCollection
,
typeHeaders
:
that
.
typeHeaders
})
);
});
},
renderNameSpaceAttrLayoutView
:
function
(
options
)
{
var
that
=
this
;
require
([
'views/name_space/NameSpaceAttrTableLayoutView'
],
function
(
NameSpaceAttrTableLayoutView
)
{
if
(
that
.
isDestroyed
)
{
return
;
}
that
.
RNameSpaceAttrContainer
.
show
(
new
NameSpaceAttrTableLayoutView
({
nameSpaceVent
:
that
.
options
.
nameSpaceVent
,
nameSpaceCollection
:
that
.
options
.
nameSpaceCollection
,
nameSpaceAttr
:
that
.
nameSpaceAttr
,
guid
:
that
.
options
.
namespaceID
,
typeHeaders
:
that
.
typeHeaders
,
enumDefCollection
:
that
.
enumDefCollection
,
selectedNameSpace
:
that
.
selectedNameSpace
,
entityDefCollection
:
that
.
options
.
entityDefCollection
}));
});
}
}
);
return
NameSpaceContainerLayoutView
;
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/QueryBuilderView.js
View file @
3d0fcedb
...
@@ -54,18 +54,7 @@ define(['require',
...
@@ -54,18 +54,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
_
.
extend
(
this
,
_
.
pick
(
options
,
'attrObj'
,
'value'
,
'typeHeaders'
,
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'tag'
,
'type'
,
'searchTableFilters'
,
'systemAttrArr'
));
'attrObj'
,
'value'
,
'typeHeaders'
,
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'nameSpaceCollection'
,
'tag'
,
'type'
,
'searchTableFilters'
,
'systemAttrArr'
));
this
.
attrObj
=
_
.
sortBy
(
this
.
attrObj
,
'name'
);
this
.
attrObj
=
_
.
sortBy
(
this
.
attrObj
,
'name'
);
//this.systemAttrArr = _.sortBy(this.systemAttrArr, 'name');
//this.systemAttrArr = _.sortBy(this.systemAttrArr, 'name');
this
.
filterType
=
this
.
tag
?
'tagFilters'
:
'entityFilters'
;
this
.
filterType
=
this
.
tag
?
'tagFilters'
:
'entityFilters'
;
...
@@ -368,21 +357,21 @@ define(['require',
...
@@ -368,21 +357,21 @@ define(['require',
});
});
if
(
this
.
type
)
{
if
(
this
.
type
)
{
var
entityDef
=
this
.
entityDefCollection
.
fullCollection
.
find
({
name
:
that
.
options
.
applicableType
}),
var
entityDef
=
this
.
entityDefCollection
.
fullCollection
.
find
({
name
:
that
.
options
.
applicableType
}),
namespace
AttributeDefs
=
null
;
businessMetadata
AttributeDefs
=
null
;
if
(
entityDef
)
{
if
(
entityDef
)
{
namespaceAttributeDefs
=
entityDef
.
get
(
"namespace
AttributeDefs"
);
BusinessMetadataAttributeDefs
=
entityDef
.
get
(
"business
AttributeDefs"
);
}
}
if
(
namespace
AttributeDefs
)
{
if
(
BusinessMetadata
AttributeDefs
)
{
_
.
each
(
namespace
AttributeDefs
,
function
(
attributes
,
key
)
{
_
.
each
(
BusinessMetadata
AttributeDefs
,
function
(
attributes
,
key
)
{
var
sortedAttributes
=
_
.
sortBy
(
attributes
,
function
(
obj
)
{
var
sortedAttributes
=
_
.
sortBy
(
attributes
,
function
(
obj
)
{
return
obj
.
name
;
return
obj
.
name
;
});
});
_
.
each
(
sortedAttributes
,
function
(
attrDetails
)
{
_
.
each
(
sortedAttributes
,
function
(
attrDetails
)
{
var
returnObj
=
that
.
getObjDef
(
attrDetails
,
rules_widgets
,
isGroupView
,
'Select
Namespace
Attribute'
,
true
);
var
returnObj
=
that
.
getObjDef
(
attrDetails
,
rules_widgets
,
isGroupView
,
'Select
Business Metadata
Attribute'
,
true
);
if
(
returnObj
)
{
if
(
returnObj
)
{
returnObj
.
id
=
key
+
"."
+
returnObj
.
id
;
returnObj
.
id
=
key
+
"."
+
returnObj
.
id
;
returnObj
.
label
=
key
+
": "
+
returnObj
.
label
;
returnObj
.
label
=
key
+
": "
+
returnObj
.
label
;
returnObj
.
data
=
{
'entityType'
:
"
namespace
"
};
returnObj
.
data
=
{
'entityType'
:
"
businessMetadata
"
};
filters
.
push
(
returnObj
);
filters
.
push
(
returnObj
);
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
View file @
3d0fcedb
...
@@ -243,7 +243,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
...
@@ -243,7 +243,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
enumDefCollection
:
that
.
options
.
enumDefCollection
,
enumDefCollection
:
that
.
options
.
enumDefCollection
,
typeHeaders
:
that
.
options
.
typeHeaders
,
typeHeaders
:
that
.
options
.
typeHeaders
,
classificationDefCollection
:
that
.
options
.
classificationDefCollection
,
classificationDefCollection
:
that
.
options
.
classificationDefCollection
,
nameSpaceCollection
:
that
.
options
.
nameSpace
Collection
,
businessMetadataDefCollection
:
that
.
options
.
businessMetadataDef
Collection
,
searchTableFilters
:
that
.
checkEntityFilter
(
that
.
options
)
searchTableFilters
:
that
.
checkEntityFilter
(
that
.
options
)
};
};
if
(
that
.
options
.
value
)
{
if
(
that
.
options
.
value
)
{
...
@@ -365,8 +365,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
...
@@ -365,8 +365,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if
(
_
.
has
(
obj
,
"condition"
))
{
if
(
_
.
has
(
obj
,
"condition"
))
{
return
that
.
getIdFromRuleObj
(
obj
);
return
that
.
getIdFromRuleObj
(
obj
);
}
else
{
}
else
{
if
((
obj
&&
obj
.
data
&&
obj
.
data
.
entityType
===
"
namespace
"
)
||
obj
.
id
.
indexOf
(
"."
)
>
-
1
)
{
if
((
obj
&&
obj
.
data
&&
obj
.
data
.
entityType
===
"
businessMetadata
"
)
||
obj
.
id
.
indexOf
(
"."
)
>
-
1
)
{
return
col
.
add
(
"
namespace
"
);
return
col
.
add
(
"
businessMetadata
"
);
}
else
{
}
else
{
return
col
.
add
(
obj
.
id
);
return
col
.
add
(
obj
.
id
);
}
}
...
@@ -382,7 +382,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
...
@@ -382,7 +382,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if
(
!
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
])
{
if
(
!
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
])
{
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
]
=
[
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
];
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
]
=
[
"selected"
,
"name"
,
"description"
,
"typeName"
,
"owner"
,
"tag"
,
"term"
];
}
}
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
]
=
_
.
sortBy
(
_
.
union
(
_
.
without
(
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
],
"
namespace
"
),
this
.
getIdFromRuleObj
(
rule
)));
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
]
=
_
.
sortBy
(
_
.
union
(
_
.
without
(
this
.
options
.
searchTableColumns
[
this
.
options
.
value
.
type
],
"
businessMetadata
"
),
this
.
getIdFromRuleObj
(
rule
)));
}
}
},
},
renderQueryBuilder
:
function
(
obj
,
rQueryBuilder
)
{
renderQueryBuilder
:
function
(
obj
,
rQueryBuilder
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
View file @
3d0fcedb
...
@@ -37,7 +37,7 @@ define([
...
@@ -37,7 +37,7 @@ define([
RClassificationTreeRender
:
'[data-id="r_classificationTreeRender"]'
,
RClassificationTreeRender
:
'[data-id="r_classificationTreeRender"]'
,
REntityTreeRender
:
'[data-id="r_entityTreeRender"]'
,
REntityTreeRender
:
'[data-id="r_entityTreeRender"]'
,
RCustomFilterTreeRender
:
'[data-id="r_customFilterTreeRender"]'
,
RCustomFilterTreeRender
:
'[data-id="r_customFilterTreeRender"]'
,
R
NameSpaceTreeRender
:
'[data-id="r_nameSpace
TreeRender"]'
R
BusinessMetadataTreeRender
:
'[data-id="r_businessMetadata
TreeRender"]'
},
},
ui
:
{
ui
:
{
//search
//search
...
@@ -82,7 +82,7 @@ define([
...
@@ -82,7 +82,7 @@ define([
this
.
classificationSearchTree
=
this
.
$
(
'[data-id="classificationSearchTree"]'
);
this
.
classificationSearchTree
=
this
.
$
(
'[data-id="classificationSearchTree"]'
);
this
.
termSearchTree
=
this
.
$
(
'[data-id="termSearchTree"]'
);
this
.
termSearchTree
=
this
.
$
(
'[data-id="termSearchTree"]'
);
this
.
customFilterSearchTree
=
this
.
$
(
'[data-id="customFilterSearchTree"]'
);
this
.
customFilterSearchTree
=
this
.
$
(
'[data-id="customFilterSearchTree"]'
);
this
.
nameSpaceSearchTree
=
this
.
$
(
'[data-id="nameSpace
SearchTree"]'
);
this
.
businessMetadataSearchTree
=
this
.
$
(
'[data-id="businessMetadata
SearchTree"]'
);
this
.
entitySearchTree
.
jstree
(
true
).
show_all
();
this
.
entitySearchTree
.
jstree
(
true
).
show_all
();
this
.
entitySearchTree
.
jstree
(
"search"
,
searchString
);
this
.
entitySearchTree
.
jstree
(
"search"
,
searchString
);
this
.
classificationSearchTree
.
jstree
(
true
).
show_all
();
this
.
classificationSearchTree
.
jstree
(
true
).
show_all
();
...
@@ -91,8 +91,8 @@ define([
...
@@ -91,8 +91,8 @@ define([
this
.
termSearchTree
.
jstree
(
"search"
,
searchString
);
this
.
termSearchTree
.
jstree
(
"search"
,
searchString
);
this
.
customFilterSearchTree
.
jstree
(
true
).
show_all
();
this
.
customFilterSearchTree
.
jstree
(
true
).
show_all
();
this
.
customFilterSearchTree
.
jstree
(
"search"
,
searchString
);
this
.
customFilterSearchTree
.
jstree
(
"search"
,
searchString
);
this
.
nameSpace
SearchTree
.
jstree
(
true
).
show_all
();
this
.
businessMetadata
SearchTree
.
jstree
(
true
).
show_all
();
this
.
nameSpace
SearchTree
.
jstree
(
"search"
,
searchString
);
this
.
businessMetadata
SearchTree
.
jstree
(
"search"
,
searchString
);
};
};
...
@@ -128,7 +128,7 @@ define([
...
@@ -128,7 +128,7 @@ define([
this
.
renderClassificationTree
(
opt
);
this
.
renderClassificationTree
(
opt
);
this
.
renderGlossaryTree
(
opt
);
this
.
renderGlossaryTree
(
opt
);
this
.
renderCustomFilterTree
();
this
.
renderCustomFilterTree
();
this
.
render
NameSpace
Tree
();
this
.
render
BusinessMetadata
Tree
();
this
.
showHideGlobalFilter
();
this
.
showHideGlobalFilter
();
this
.
showDefaultPage
();
this
.
showDefaultPage
();
},
},
...
@@ -201,8 +201,8 @@ define([
...
@@ -201,8 +201,8 @@ define([
if
(
options
)
{
if
(
options
)
{
_
.
extend
(
this
.
options
,
options
);
_
.
extend
(
this
.
options
,
options
);
this
.
showHideGlobalFilter
();
this
.
showHideGlobalFilter
();
if
(
this
.
R
NameSpace
TreeRender
.
currentView
)
{
if
(
this
.
R
BusinessMetadata
TreeRender
.
currentView
)
{
this
.
R
NameSpace
TreeRender
.
currentView
.
manualRender
(
this
.
options
);
this
.
R
BusinessMetadata
TreeRender
.
currentView
.
manualRender
(
this
.
options
);
}
}
if
(
this
.
RCustomFilterTreeRender
.
currentView
)
{
if
(
this
.
RCustomFilterTreeRender
.
currentView
)
{
this
.
RCustomFilterTreeRender
.
currentView
.
manualRender
(
this
.
options
);
this
.
RCustomFilterTreeRender
.
currentView
.
manualRender
(
this
.
options
);
...
@@ -242,10 +242,10 @@ define([
...
@@ -242,10 +242,10 @@ define([
that
.
RCustomFilterTreeRender
.
show
(
new
CustomFilterTreeLayoutView
(
_
.
extend
({
query
:
that
.
query
},
that
.
options
)));
that
.
RCustomFilterTreeRender
.
show
(
new
CustomFilterTreeLayoutView
(
_
.
extend
({
query
:
that
.
query
},
that
.
options
)));
});
});
},
},
render
NameSpace
Tree
:
function
()
{
render
BusinessMetadata
Tree
:
function
()
{
var
that
=
this
;
var
that
=
this
;
require
([
"views/search/tree/
NameSpaceTreeLayoutView"
],
function
(
NameSpace
TreeLayoutView
)
{
require
([
"views/search/tree/
BusinessMetadataTreeLayoutView"
],
function
(
BusinessMetadata
TreeLayoutView
)
{
that
.
R
NameSpaceTreeRender
.
show
(
new
NameSpace
TreeLayoutView
(
_
.
extend
({
query
:
that
.
query
},
that
.
options
)));
that
.
R
BusinessMetadataTreeRender
.
show
(
new
BusinessMetadata
TreeLayoutView
(
_
.
extend
({
query
:
that
.
query
},
that
.
options
)));
});
});
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/SearchResultLayoutView.js
View file @
3d0fcedb
...
@@ -365,7 +365,7 @@ define(['require',
...
@@ -365,7 +365,7 @@ define(['require',
this
.
searchTableColumns
[
this
.
value
.
type
]
=
listOfColumns
.
length
?
listOfColumns
:
null
;
this
.
searchTableColumns
[
this
.
value
.
type
]
=
listOfColumns
.
length
?
listOfColumns
:
null
;
}
}
}
else
if
(
this
.
value
&&
this
.
value
.
type
&&
this
.
searchTableColumns
&&
this
.
value
.
attributes
)
{
}
else
if
(
this
.
value
&&
this
.
value
.
type
&&
this
.
searchTableColumns
&&
this
.
value
.
attributes
)
{
this
.
searchTableColumns
[
this
.
value
.
type
]
=
this
.
value
.
entityFilters
?
this
.
value
.
attributes
.
split
(
","
)
:
this
.
value
.
attributes
.
replace
(
"
namespace
,"
,
""
).
split
(
","
);
this
.
searchTableColumns
[
this
.
value
.
type
]
=
this
.
value
.
entityFilters
?
this
.
value
.
attributes
.
split
(
","
)
:
this
.
value
.
attributes
.
replace
(
"
businessMetadata
,"
,
""
).
split
(
","
);
}
}
},
},
fetchCollection
:
function
(
value
,
options
)
{
fetchCollection
:
function
(
value
,
options
)
{
...
@@ -648,8 +648,7 @@ define(['require',
...
@@ -648,8 +648,7 @@ define(['require',
var
that
=
this
,
var
that
=
this
,
nameCheck
=
0
,
nameCheck
=
0
,
columnToShow
=
null
,
columnToShow
=
null
,
col
=
{},
col
=
{};
namespaceRenderable
=
false
;
this
.
value
=
Utils
.
getUrlState
.
getQueryParams
()
||
this
.
value
;
this
.
value
=
Utils
.
getUrlState
.
getQueryParams
()
||
this
.
value
;
if
(
this
.
value
&&
this
.
value
.
searchType
===
"basic"
&&
this
.
searchTableColumns
&&
(
this
.
searchTableColumns
[
this
.
value
.
type
]
!==
undefined
))
{
if
(
this
.
value
&&
this
.
value
.
searchType
===
"basic"
&&
this
.
searchTableColumns
&&
(
this
.
searchTableColumns
[
this
.
value
.
type
]
!==
undefined
))
{
columnToShow
=
this
.
searchTableColumns
[
this
.
value
.
type
]
==
null
?
[]
:
this
.
searchTableColumns
[
this
.
value
.
type
];
columnToShow
=
this
.
searchTableColumns
[
this
.
value
.
type
]
==
null
?
[]
:
this
.
searchTableColumns
[
this
.
value
.
type
];
...
@@ -794,25 +793,25 @@ define(['require',
...
@@ -794,25 +793,25 @@ define(['require',
}
}
})
})
};
};
col
[
'
namespace
'
]
=
{
col
[
'
businessMetaData
'
]
=
{
label
:
"
Namespaces
"
,
label
:
"
Business MetaData
"
,
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
,
'
namespace
'
),
renderable
:
_
.
contains
(
columnToShow
,
'
businessMetaData
'
),
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
(),
namespace
Str
=
''
;
businessMetadata
Str
=
''
;
if
(
obj
&&
obj
.
attributes
)
{
if
(
obj
&&
obj
.
attributes
)
{
_
.
each
(
obj
.
attributes
,
function
(
namespace
Value
,
attributeName
)
{
_
.
each
(
obj
.
attributes
,
function
(
businessMetadata
Value
,
attributeName
)
{
if
(
attributeName
.
indexOf
(
'.'
)
!=
-
1
)
{
if
(
attributeName
.
indexOf
(
'.'
)
!=
-
1
)
{
var
isDate
=
false
,
var
isDate
=
false
,
namespace
=
that
.
options
.
nameSpace
Collection
.
fullCollection
.
find
({
"name"
:
attributeName
.
split
(
'.'
)[
0
]
});
businessMetadata
=
that
.
options
.
businessMetadataDef
Collection
.
fullCollection
.
find
({
"name"
:
attributeName
.
split
(
'.'
)[
0
]
});
if
(
namespace
)
{
if
(
businessMetadata
)
{
var
getAttributes
=
namespace
.
get
(
'attributeDefs'
);
var
getAttributes
=
businessMetadata
.
get
(
'attributeDefs'
);
getAttributes
.
every
(
function
(
attrTypeCheck
)
{
getAttributes
.
every
(
function
(
attrTypeCheck
)
{
if
(
attributeName
.
split
(
'.'
)[
1
]
===
attrTypeCheck
.
name
&&
attrTypeCheck
.
typeName
.
indexOf
(
"date"
)
>
-
1
)
{
if
(
attributeName
.
split
(
'.'
)[
1
]
===
attrTypeCheck
.
name
&&
attrTypeCheck
.
typeName
.
indexOf
(
"date"
)
>
-
1
)
{
isDate
=
true
;
isDate
=
true
;
...
@@ -821,12 +820,12 @@ define(['require',
...
@@ -821,12 +820,12 @@ define(['require',
});
});
}
}
if
(
isDate
)
{
if
(
isDate
)
{
namespaceValue
=
moment
(
namespace
Value
).
format
(
"MM/DD/YYYY"
)
businessMetadataValue
=
moment
(
businessMetadata
Value
).
format
(
"MM/DD/YYYY"
)
}
}
namespaceStr
+=
'<label class="btn btn-action btn-xs btn-blue no-pointer">'
+
attributeName
+
': '
+
namespace
Value
+
'</label>'
;
businessMetadataStr
+=
'<label class="btn btn-action btn-xs btn-blue no-pointer">'
+
attributeName
+
': '
+
businessMetadata
Value
+
'</label>'
;
}
}
})
})
return
namespace
Str
;
return
businessMetadata
Str
;
}
}
}
}
})
})
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/tree/
NameSpace
TreeLayoutView.js
→
dashboardv3/public/js/views/search/tree/
BusinessMetadata
TreeLayoutView.js
View file @
3d0fcedb
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*/
*/
define
([
define
([
"require"
,
"require"
,
"hbs!tmpl/search/tree/
NameSpace
TreeLayoutView_tmpl"
,
"hbs!tmpl/search/tree/
BusinessMetadata
TreeLayoutView_tmpl"
,
"utils/Utils"
,
"utils/Utils"
,
"utils/Messages"
,
"utils/Messages"
,
"utils/Globals"
,
"utils/Globals"
,
...
@@ -27,11 +27,11 @@ define([
...
@@ -27,11 +27,11 @@ define([
"collection/VGlossaryList"
,
"collection/VGlossaryList"
,
"utils/Enums"
,
"utils/Enums"
,
"jstree"
"jstree"
],
function
(
require
,
NameSpace
TreeLayoutViewTmpl
,
Utils
,
Messages
,
Globals
,
UrlLinks
,
CommonViewFunction
,
VSearchList
,
VGlossaryList
,
Enums
)
{
],
function
(
require
,
BusinessMetadata
TreeLayoutViewTmpl
,
Utils
,
Messages
,
Globals
,
UrlLinks
,
CommonViewFunction
,
VSearchList
,
VGlossaryList
,
Enums
)
{
"use strict"
;
"use strict"
;
var
NameSpace
TreeLayoutView
=
Marionette
.
LayoutView
.
extend
({
var
BusinessMetadata
TreeLayoutView
=
Marionette
.
LayoutView
.
extend
({
template
:
NameSpace
TreeLayoutViewTmpl
,
template
:
BusinessMetadata
TreeLayoutViewTmpl
,
regions
:
{},
regions
:
{},
ui
:
{
ui
:
{
...
@@ -39,10 +39,10 @@ define([
...
@@ -39,10 +39,10 @@ define([
refreshTree
:
'[data-id="refreshTree"]'
,
refreshTree
:
'[data-id="refreshTree"]'
,
// tree el
// tree el
nameSpaceSearchTree
:
'[data-id="nameSpace
SearchTree"]'
,
businessMetadataSearchTree
:
'[data-id="businessMetadata
SearchTree"]'
,
// Create
// Create
create
NameSpace
:
'[data-id="createNameSpace
"]'
create
BusinessMetadata
:
'[data-id="createBusinessMetadata
"]'
},
},
templateHelpers
:
function
()
{
templateHelpers
:
function
()
{
return
{
return
{
...
@@ -54,14 +54,13 @@ define([
...
@@ -54,14 +54,13 @@ define([
that
=
this
;
that
=
this
;
// refresh individual tree
// refresh individual tree
events
[
"click "
+
this
.
ui
.
refreshTree
]
=
function
(
e
)
{
events
[
"click "
+
this
.
ui
.
refreshTree
]
=
function
(
e
)
{
var
type
=
$
(
e
.
currentTarget
).
data
(
"type"
);
e
.
stopPropagation
();
e
.
stopPropagation
();
that
.
refresh
(
{
type
:
type
}
);
that
.
refresh
();
};
};
events
[
"click "
+
this
.
ui
.
create
NameSpace
]
=
function
(
e
)
{
events
[
"click "
+
this
.
ui
.
create
BusinessMetadata
]
=
function
(
e
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
that
.
triggerUrl
(
"#!/administrator?tabActive=
namespace
"
);
that
.
triggerUrl
(
"#!/administrator?tabActive=
bm
"
);
};
};
return
events
;
return
events
;
...
@@ -73,52 +72,48 @@ define([
...
@@ -73,52 +72,48 @@ define([
_
.
pick
(
_
.
pick
(
options
,
options
,
"typeHeaders"
,
"typeHeaders"
,
"
namespaceID
"
,
"
guid
"
,
"searchVent"
,
"searchVent"
,
"entityDefCollection"
,
"entityDefCollection"
,
"enumDefCollection"
,
"enumDefCollection"
,
"
nameSpace
Collection"
,
"
businessMetadataDef
Collection"
,
"searchTableColumns"
,
"searchTableColumns"
,
"searchTableFilters"
,
"searchTableFilters"
,
"metricCollection"
,
"metricCollection"
"nameSpaceCollection"
)
)
);
);
this
.
bindEvents
();
this
.
bindEvents
();
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
render
NameSpace
Tree
();
this
.
render
BusinessMetadata
Tree
();
//this.create
NameSpace
Action();
//this.create
BusinessMetadata
Action();
},
},
bindEvents
:
function
()
{
bindEvents
:
function
()
{
var
that
=
this
;
var
that
=
this
;
this
.
listenTo
(
this
.
listenTo
(
this
.
nameSpace
Collection
.
fullCollection
,
this
.
businessMetadataDef
Collection
.
fullCollection
,
"reset add remove"
,
"reset add remove"
,
function
()
{
function
()
{
if
(
this
.
ui
.
nameSpace
SearchTree
.
jstree
(
true
))
{
if
(
this
.
ui
.
businessMetadata
SearchTree
.
jstree
(
true
))
{
that
.
ui
.
nameSpace
SearchTree
.
jstree
(
true
).
refresh
();
that
.
ui
.
businessMetadata
SearchTree
.
jstree
(
true
).
refresh
();
}
else
{
}
else
{
this
.
render
NameSpace
Tree
();
this
.
render
BusinessMetadata
Tree
();
}
}
},
},
this
this
);
);
// this.options.nameSpaceVent.on("Save:NamespaceAttribute", function(data) {
$
(
"body"
).
on
(
"click"
,
".businessMetadataPopoverOptions li"
,
function
(
e
)
{
// that.ui.nameSpaceSearchTree.jstree(true).refresh();
that
.
$
(
".businessMetadataPopover"
).
popover
(
"hide"
);
// });
that
[
$
(
this
).
find
(
"a"
).
data
(
"fn"
)
+
"BusinessMetadata"
](
e
);
$
(
"body"
).
on
(
"click"
,
".namespacePopoverOptions li"
,
function
(
e
)
{
that
.
$
(
".nameSpacePopover"
).
popover
(
"hide"
);
that
[
$
(
this
).
find
(
"a"
).
data
(
"fn"
)
+
"NameSpace"
](
e
);
});
});
},
},
create
NameSpace
Action
:
function
()
{
create
BusinessMetadata
Action
:
function
()
{
var
that
=
this
;
var
that
=
this
;
Utils
.
generatePopover
({
Utils
.
generatePopover
({
el
:
this
.
$el
,
el
:
this
.
$el
,
contentClass
:
"
namespace
PopoverOptions"
,
contentClass
:
"
businessMetadata
PopoverOptions"
,
popoverOptions
:
{
popoverOptions
:
{
selector
:
".
nameSpace
Popover"
,
selector
:
".
businessMetadata
Popover"
,
content
:
function
()
{
content
:
function
()
{
var
type
=
$
(
this
).
data
(
"detail"
),
var
type
=
$
(
this
).
data
(
"detail"
),
liString
=
liString
=
...
@@ -128,25 +123,25 @@ define([
...
@@ -128,25 +123,25 @@ define([
}
}
});
});
},
},
render
NameSpace
Tree
:
function
()
{
render
BusinessMetadata
Tree
:
function
()
{
this
.
generateSearchTree
({
this
.
generateSearchTree
({
$el
:
this
.
ui
.
nameSpace
SearchTree
$el
:
this
.
ui
.
businessMetadata
SearchTree
});
});
},
},
manualRender
:
function
(
options
)
{
manualRender
:
function
(
options
)
{
var
that
=
this
;
var
that
=
this
;
_
.
extend
(
this
,
options
);
_
.
extend
(
this
,
options
);
if
(
Utils
.
getUrlState
.
isAdministratorTab
()
&&
this
.
namespaceID
)
{
if
(
Utils
.
getUrlState
.
isAdministratorTab
()
&&
this
.
guid
)
{
this
.
ui
.
nameSpaceSearchTree
.
jstree
(
true
).
select_node
(
this
.
namespaceID
);
this
.
ui
.
businessMetadataSearchTree
.
jstree
(
true
).
select_node
(
this
.
guid
);
}
else
{
}
else
{
this
.
ui
.
nameSpace
SearchTree
.
jstree
(
true
).
deselect_all
();
this
.
ui
.
businessMetadata
SearchTree
.
jstree
(
true
).
deselect_all
();
this
.
namespaceID
=
null
;
this
.
guid
=
null
;
}
}
},
},
onNodeSelect
:
function
(
nodeData
)
{
onNodeSelect
:
function
(
nodeData
)
{
var
that
=
this
,
var
that
=
this
,
options
=
nodeData
.
node
.
original
,
options
=
nodeData
.
node
.
original
,
url
=
"#!/administrator/
namespace
"
,
url
=
"#!/administrator/
businessMetadata
"
,
trigger
=
true
,
trigger
=
true
,
queryParams
=
Utils
.
getUrlState
.
getQueryParams
();
queryParams
=
Utils
.
getUrlState
.
getQueryParams
();
...
@@ -154,7 +149,7 @@ define([
...
@@ -154,7 +149,7 @@ define([
url
+=
"/"
+
options
.
id
;
url
+=
"/"
+
options
.
id
;
}
}
if
(
queryParams
&&
queryParams
.
from
===
"
namespace
"
&&
Utils
.
getUrlState
.
getQueryUrl
().
queyParams
[
0
]
===
url
)
{
if
(
queryParams
&&
queryParams
.
from
===
"
bm
"
&&
Utils
.
getUrlState
.
getQueryUrl
().
queyParams
[
0
]
===
url
)
{
trigger
=
false
;
trigger
=
false
;
}
}
if
(
trigger
)
{
if
(
trigger
)
{
...
@@ -162,11 +157,11 @@ define([
...
@@ -162,11 +157,11 @@ define([
}
}
},
},
onViewEdit
NameSpace
:
function
()
{
onViewEdit
BusinessMetadata
:
function
()
{
var
selectedNode
=
this
.
ui
.
nameSpace
SearchTree
.
jstree
(
"get_selected"
,
true
);
var
selectedNode
=
this
.
ui
.
businessMetadata
SearchTree
.
jstree
(
"get_selected"
,
true
);
if
(
selectedNode
&&
selectedNode
[
0
])
{
if
(
selectedNode
&&
selectedNode
[
0
])
{
selectedNode
=
selectedNode
[
0
];
selectedNode
=
selectedNode
[
0
];
var
url
=
"#!/administrator?tabActive=
namespace
"
;
var
url
=
"#!/administrator?tabActive=
bm
"
;
if
(
selectedNode
.
parent
&&
selectedNode
.
original
&&
selectedNode
.
original
.
name
)
{
if
(
selectedNode
.
parent
&&
selectedNode
.
original
&&
selectedNode
.
original
.
name
)
{
url
+=
"&ns="
+
selectedNode
.
parent
+
"&nsa="
+
selectedNode
.
original
.
name
;
url
+=
"&ns="
+
selectedNode
.
parent
+
"&nsa="
+
selectedNode
.
original
.
name
;
this
.
triggerUrl
(
url
);
this
.
triggerUrl
(
url
);
...
@@ -183,22 +178,22 @@ define([
...
@@ -183,22 +178,22 @@ define([
},
},
refresh
:
function
(
options
)
{
refresh
:
function
(
options
)
{
var
that
=
this
;
var
that
=
this
;
this
.
nameSpace
Collection
.
fetch
({
this
.
businessMetadataDef
Collection
.
fetch
({
silent
:
true
,
silent
:
true
,
complete
:
function
()
{
complete
:
function
()
{
that
.
nameSpace
Collection
.
fullCollection
.
comparator
=
function
(
model
)
{
that
.
businessMetadataDef
Collection
.
fullCollection
.
comparator
=
function
(
model
)
{
return
model
.
get
(
"name"
).
toLowerCase
();
return
model
.
get
(
"name"
).
toLowerCase
();
};
};
that
.
nameSpace
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
businessMetadataDef
Collection
.
fullCollection
.
sort
({
silent
:
true
});
that
.
ui
.
nameSpace
SearchTree
.
jstree
(
true
).
refresh
();
that
.
ui
.
businessMetadata
SearchTree
.
jstree
(
true
).
refresh
();
}
}
});
});
},
},
get
NameSpace
Tree
:
function
(
options
)
{
get
BusinessMetadata
Tree
:
function
(
options
)
{
var
that
=
this
,
var
that
=
this
,
nameSpace
List
=
[],
businessMetadata
List
=
[],
allCustomFilter
=
[],
allCustomFilter
=
[],
namsSpaceTreeData
=
that
.
nameSpace
Collection
.
fullCollection
.
models
,
namsSpaceTreeData
=
that
.
businessMetadataDef
Collection
.
fullCollection
.
models
,
openClassificationNodesState
=
function
(
treeDate
)
{
openClassificationNodesState
=
function
(
treeDate
)
{
if
(
treeDate
.
length
==
1
)
{
if
(
treeDate
.
length
==
1
)
{
_
.
each
(
treeDate
,
function
(
model
)
{
_
.
each
(
treeDate
,
function
(
model
)
{
...
@@ -211,31 +206,31 @@ define([
...
@@ -211,31 +206,31 @@ define([
nodeStructure
=
{
nodeStructure
=
{
text
:
attrNode
?
_
.
escape
(
nodeOptions
.
name
)
:
_
.
escape
(
nodeOptions
.
get
(
"name"
)),
text
:
attrNode
?
_
.
escape
(
nodeOptions
.
name
)
:
_
.
escape
(
nodeOptions
.
get
(
"name"
)),
name
:
attrNode
?
_
.
escape
(
nodeOptions
.
name
)
:
_
.
escape
(
nodeOptions
.
get
(
"name"
)),
name
:
attrNode
?
_
.
escape
(
nodeOptions
.
name
)
:
_
.
escape
(
nodeOptions
.
get
(
"name"
)),
type
:
"
nameSpace
"
,
type
:
"
businessMetadata
"
,
id
:
attrNode
?
_
.
escape
(
nodeOptions
.
name
)
:
nodeOptions
.
get
(
"guid"
),
id
:
attrNode
?
_
.
escape
(
nodeOptions
.
name
)
:
nodeOptions
.
get
(
"guid"
),
icon
:
attrNode
?
"fa fa-file-o"
:
"fa fa-folder-o"
,
icon
:
attrNode
?
"fa fa-file-o"
:
"fa fa-folder-o"
,
children
:
[],
children
:
[],
state
:
{
selected
:
nodeOptions
.
get
(
"guid"
)
===
that
.
namespaceID
},
state
:
{
selected
:
nodeOptions
.
get
(
"guid"
)
===
that
.
guid
},
gType
:
"
NameSpace
"
,
gType
:
"
BusinessMetadata
"
,
model
:
nodeOptions
model
:
nodeOptions
};
};
return
nodeStructure
;
return
nodeStructure
;
};
};
_
.
each
(
namsSpaceTreeData
,
function
(
filterNode
)
{
_
.
each
(
namsSpaceTreeData
,
function
(
filterNode
)
{
nameSpace
List
.
push
(
generateNode
(
filterNode
));
businessMetadata
List
.
push
(
generateNode
(
filterNode
));
});
});
var
treeView
=
[{
var
treeView
=
[{
icon
:
"fa fa-folder-o"
,
icon
:
"fa fa-folder-o"
,
gType
:
"
nameSpace
"
,
gType
:
"
businessMetadata
"
,
type
:
"
nameSpace
Folder"
,
type
:
"
businessMetadata
Folder"
,
children
:
nameSpace
List
,
children
:
businessMetadata
List
,
text
:
"
Namespace
"
,
text
:
"
BusinessMetadata
"
,
name
:
"
Namespace
"
,
name
:
"
BusinessMetadata
"
,
state
:
{
opened
:
true
}
state
:
{
opened
:
true
}
}];
}];
var
customFilterList
=
treeView
;
var
customFilterList
=
treeView
;
return
nameSpace
List
;
return
businessMetadata
List
;
},
},
generateSearchTree
:
function
(
options
)
{
generateSearchTree
:
function
(
options
)
{
var
$el
=
options
&&
options
.
$el
,
var
$el
=
options
&&
options
.
$el
,
...
@@ -246,7 +241,7 @@ define([
...
@@ -246,7 +241,7 @@ define([
plugins
:
[
"search"
,
"core"
,
"sort"
,
"conditionalselect"
,
"changed"
,
"wholerow"
,
"node_customize"
],
plugins
:
[
"search"
,
"core"
,
"sort"
,
"conditionalselect"
,
"changed"
,
"wholerow"
,
"node_customize"
],
conditionalselect
:
function
(
node
)
{
conditionalselect
:
function
(
node
)
{
var
type
=
node
.
original
.
type
;
var
type
=
node
.
original
.
type
;
if
(
type
==
"
nameSpace
Folder"
)
{
if
(
type
==
"
businessMetadata
Folder"
)
{
if
(
node
.
children
.
length
)
{
if
(
node
.
children
.
length
)
{
return
false
;
return
false
;
}
else
{
}
else
{
...
@@ -268,7 +263,7 @@ define([
...
@@ -268,7 +263,7 @@ define([
if
(
node
.
parent
===
"#"
)
{
if
(
node
.
parent
===
"#"
)
{
$
(
el
).
append
(
'<div class="tools"><i class="fa"></i></div>'
);
$
(
el
).
append
(
'<div class="tools"><i class="fa"></i></div>'
);
}
else
{
}
else
{
$
(
el
).
append
(
'<div class="tools"><i class="fa fa-ellipsis-h
nameSpace
Popover" rel="popover"></i></div>'
);
$
(
el
).
append
(
'<div class="tools"><i class="fa fa-ellipsis-h
businessMetadata
Popover" rel="popover"></i></div>'
);
}
}
}
}
},
},
...
@@ -276,7 +271,7 @@ define([
...
@@ -276,7 +271,7 @@ define([
multiple
:
false
,
multiple
:
false
,
data
:
function
(
node
,
cb
)
{
data
:
function
(
node
,
cb
)
{
if
(
node
.
id
===
"#"
)
{
if
(
node
.
id
===
"#"
)
{
cb
(
that
.
get
NameSpace
Tree
());
cb
(
that
.
get
BusinessMetadata
Tree
());
}
}
}
}
}
}
...
@@ -322,5 +317,5 @@ define([
...
@@ -322,5 +317,5 @@ define([
});
});
}
}
});
});
return
NameSpace
TreeLayoutView
;
return
BusinessMetadata
TreeLayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment