Commit bcb9ea24 by kevalbhatt

ATLAS-3607 : UI: changes to create namespace type definitions and define namespace attributes

parent 8f6cb0e9
......@@ -254,6 +254,7 @@ pre {
text-align: center;
width: 17%;
margin-left: 1%;
margin-bottom: 10px;
}
}
}
......
......@@ -30,6 +30,7 @@
@extend .control-label-sm;
padding-right: 10px;
}
}
.form-group {
......@@ -245,6 +246,10 @@ button:focus {
padding: 2px 6px;
}
&.btn-xs {
padding: 0px 5px;
}
&.btn-md {
padding: 6px 10px;
}
......@@ -305,6 +310,10 @@ button:focus {
padding: 2px 6px;
}
&.btn-xs {
padding: 0px 5px;
}
&.btn-md {
padding: 5px 10px;
}
......
......@@ -36,6 +36,10 @@
background: $color_jungle_green_approx !important;
}
.jstree-custom-filter {
background: #beebff !important;
}
.jstree-hovered {
background: $color_star_dust_approx;
}
......
// 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.
/* namespace */
.namespace-tree-parent {
padding: 0px;
>li:first-child {
font-weight: 600;
}
.namespace-tree-child {
padding-left: 20px;
margin-top: 10px;
}
}
.namespace-options.dropdown {
.dropdown-menu {
min-width: 100px;
.dropdown-item {
display: block;
width: 100%;
padding: .25rem 1.5rem;
clear: both;
font-weight: 400;
color: $color_jungle_green_approx;
text-align: inherit;
white-space: nowrap;
background-color: transparent;
border: 0;
}
}
}
.namespace-options.dropdown.open {
.btn-action {
background-color: $color_jungle_green_approx;
border: 1px solid $color_jungle_green_approx;
color: #fff !important;
}
}
.namespace-details {
.expandable .attr-details {
max-height: 300px;
overflow: auto;
margin-left: 100px;
width: calc(100% - 100px);
}
}
.tab-pane {
.namespace-attr-page {
position: absolute;
top: 0px;
left: 0px;
padding: 20px;
background-color: $white;
width: 100%;
height: inherit;
}
}
.namespace-attr-page {
.form-horizontal {
padding: 10px 22px;
// border: 1px solid #DEDEDE;
.control-label-sm {
padding-top: 3px;
}
.control-label-sm-pl {
@extend .control-label-sm;
padding-left: 10px;
}
.control-label-sm-pr {
@extend .control-label-sm;
padding-right: 10px;
}
.namespace-attr {
border: 1px solid #DEDEDE;
padding: 10px 20px
}
}
}
.namespace-attr-fontLoader {
position: absolute;
top: 50%;
left: 50%;
display: none;
}
.namespace-attr-tableOverlay {
position: absolute;
width: 100%;
height: 100%;
background: #808080;
z-index: 99;
display: none;
opacity: 0.2;
}
.name-space-details {
.backgrid {
td.expandable-content {
width: 100%;
max-width: none;
background: #f8f8f8;
div {
table {
width: 100%;
}
}
}
tbody>tr:last-child>td {
border-bottom: none;
}
}
}
.namespace-attr-page {
.modal-footer {
text-align: center;
}
}
.remove-from-list {
.select2-results__option[aria-selected=true] {
display: none;
}
}
\ No newline at end of file
......@@ -76,6 +76,17 @@
}
}
.modal-full-screen {
width: 80%;
height: 80vh;
.modal-content {
height: inherit;
width: 100%;
}
}
.switch.pull-left {
margin-right: 8px;
}
......@@ -238,6 +249,13 @@
overflow-x: hidden;
}
.purge-details {
.tab-pane.active {
min-height: 400px;
}
}
.advancedInfo {
margin-left: 5px;
cursor: pointer;
......@@ -356,6 +374,10 @@ div.columnmanager-visibilitycontrol {
}
div.columnmanager-dropdown-container {
.columnmanager-dropdown-item {
padding: 2px 13px;
}
&.open {
overflow: auto;
width: auto;
......@@ -452,4 +474,24 @@ div.columnmanager-dropdown-container {
.query-builder .error-container {
cursor: pointer;
}
.renderable {
.glyphicon {
color: $color_jungle_green_approx;
font-size: large;
font-weight: bold;
}
}
.backgrid-internal-table {
th,
td {
display: table-cell;
}
}
.table-hover>tbody>tr:hover {
background-color: #fafafa;
}
\ No newline at end of file
......@@ -62,6 +62,7 @@
.panel {
&.panel-default {
padding: 5px;
margin: 5px;
}
.panel-body {
......@@ -81,6 +82,12 @@
.table {
&.stat-table {
width: 100%;
td {
display: table-cell;
}
&.notification-table {
&.table-striped>tbody>tr:nth-of-type(odd) {
background-color: $color_white_lilac_approx;
......
......@@ -34,6 +34,7 @@
@import "profile-table.scss";
@import "glossary.scss";
@import "wizard.scss";
@import "namespace.scss";
@import "stats.scss";
@import "override.scss";
@import "leftsidebar.scss"
\ No newline at end of file
......@@ -55,7 +55,7 @@ tr.empty {
.entity-detail-table-toggle {
position: absolute;
right: 0;
top: 18px;
top: 7px;
}
table {
......@@ -183,26 +183,36 @@ tr.empty {
}
}
>thead>tr>th {
border-width: thin;
border-color: $color_jungle_green_approx;
border-bottom-style: solid;
box-shadow: none;
padding: 12px 15px !important;
background-color: transparent;
text-align: left;
font-weight: 800;
border-top: 0;
font-size: 14px;
letter-spacing: 0.25px;
color: rgba(52, 52, 52, 1);
>thead>tr {
background: #eeeeee;
&>th {
border-width: thin;
// border-color: $color_jungle_green_approx;
border-bottom-style: solid;
box-shadow: none;
padding: 6px 15px !important;
background-color: transparent;
text-align: left;
font-weight: 800;
border-top: 0;
font-size: 14px;
letter-spacing: 0.25px;
color: #6a6a6a;
}
>td {
border-color: $color_gallery_approx;
color: #333333;
font-weight: 100;
padding: 9px 15px;
}
}
>tbody>tr>td {
border-color: $color_gallery_approx;
color: #333333;
font-weight: 100;
padding: 9px 15px;
&.select-row-cell {
text-align: center;
}
}
}
......@@ -240,4 +250,13 @@ td {
float: left;
}
}
}
.auditStatusContainer {
display: flex;
justify-content: center;
}
.auditStatusContainer>div {
flex-grow: 1;
}
\ No newline at end of file
......@@ -205,4 +205,8 @@
.addtag-propagte-box {
border: 1px solid #ddd;
border-radius: 7px;
}
.entityTypeSelector {
margin: 10px 0px;
}
\ No newline at end of file
......@@ -158,6 +158,14 @@ header.atlas-header {
position: relative;
transition: width 0.3s !important;
.admin-icon {
background-color: $color_ironside_gray_approx;
width: 24px;
height: 20px;
-webkit-mask: url(../img/support.svg) no-repeat center;
mask: url(../img/support.svg) no-repeat center;
}
.search-box {
width: 50%;
margin: 0 auto;
......@@ -172,7 +180,8 @@ header.atlas-header {
left: auto;
}
&>li>a {
&>li>a,
{
color: $color_ironside_gray_approx;
&:hover {
......@@ -188,19 +197,23 @@ header.atlas-header {
td {
>a {
display: inline-block;
color: $color_ironside_gray_approx;
color: $color_ironside_gray_approx !important;
padding: 13px 14px;
border-bottom: 2px solid transparent;
}
>a,
>table {
padding: 15px 14px;
padding: 14px 14px;
&:hover {
border-bottom: 2px solid $color_jungle_green_approx;
padding: 14px 14px;
color: $color_jungle_green_approx;
color: $color_jungle_green_approx !important;
.admin-icon {
background-color: $color_jungle_green_approx;
}
a {
color: $color_jungle_green_approx;
......@@ -776,4 +789,44 @@ td.searchTableName:hover {
z-index: 1;
left: calc(50% - 8px);
}
}
.dropdown-menu.multi-level {
.dropdown-submenu {
position: relative;
&>a:after {
display: none;
content: " ";
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 5px 5px 0px;
border-right-color: #ccc;
position: absolute;
left: 8px;
top: calc(50% - 5px);
}
&>a:hover:after {
display: block;
}
&>.dropdown-menu {
top: 0;
left: -100%;
width: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;
}
&:hover>.dropdown-menu {
display: block;
}
}
}
\ No newline at end of file
......@@ -202,25 +202,35 @@ require(['App',
'select2'
], function(App, Router, Helper, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList, Enums) {
var that = this;
this.asyncFetchCounter = 6 + (Enums.addOnEntities.length + 1);
this.asyncFetchCounter = 7 + (Enums.addOnEntities.length + 1);
// entity
this.entityDefCollection = new VEntityList();
this.entityDefCollection.url = UrlLinks.entitiesDefApiUrl();
// typeHeaders
this.typeHeaders = new VTagList();
this.typeHeaders.url = UrlLinks.typesApiUrl();
// enum
this.enumDefCollection = new VTagList();
this.enumDefCollection.url = UrlLinks.enumDefApiUrl();
this.enumDefCollection.modelAttrName = "enumDefs";
// classfication
this.classificationDefCollection = new VTagList();
// metric
this.metricCollection = new VTagList();
this.metricCollection.url = UrlLinks.metricsApiUrl();
this.metricCollection.modelAttrName = "data";
// nameSpace
this.nameSpaceCollection = new VEntityList();
this.nameSpaceCollection.url = UrlLinks.nameSpaceApiUrl();
this.nameSpaceCollection.modelAttrName = "namespaceDefs";
App.appRouter = new Router({
entityDefCollection: this.entityDefCollection,
typeHeaders: this.typeHeaders,
enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection,
metricCollection: this.metricCollection
metricCollection: this.metricCollection,
nameSpaceCollection: this.nameSpaceCollection
});
var startApp = function() {
......@@ -310,6 +320,18 @@ require(['App',
}
});
this.nameSpaceCollection.fetch({
skipDefaultError: true,
complete: function() {
that.nameSpaceCollection.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase();
};
that.nameSpaceCollection.fullCollection.sort({ silent: true });
--that.asyncFetchCounter;
startApp();
}
});
Enums.addOnEntities.forEach(function(addOnEntity) {
CommonViewFunction.fetchRootEntityAttributes({
url: UrlLinks.rootEntityDefUrl(addOnEntity),
......
......@@ -95,6 +95,18 @@ define(['require',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, "POST", options);
},
saveNameSpaceAttribute: function(options) {
var url = UrlLinks.nameSpaceUpdateUrl();
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'PUT', options);
},
deleteNameSpace: function(options) {
var url = UrlLinks.nameSpaceUpdateUrl(options.typeName);
return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
}
}, {});
return VEntity;
......
<!--
* 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.
-->
<div class="clearfix">
<!-- <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div> -->
<div class="col-sm-12 default-tab">
<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="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li>
</ul>
</div>
</div>
<div>
<div class="tab-content purge-details">
<div id="tab-namespace" role="namespace" class="tab-pane active animated fadeIn">
<div id="r_namespaceTableLayoutView">
</div>
</div>
<div id="tab-enum" role="enum" class="tab-pane animated fadeIn">
<div id="r_enumTableLayoutView">
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="page-title clearfix">
<!-- <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div> -->
<div class="row">
<div class="col-sm-12 default-tab">
<ul class="nav nav-tabs" data-id="tab-list">
<li role="purgeaudit" class="tab active"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="namespace"><a href="#tab-namespace" aria-controls="tab-namespace" role="tab" data-toggle="tab">Namespace</a></li>
</ul>
</div>
</div>
</div>
<div>
<div class="tab-content purge-details">
<div id="tab-audit" role="purgeaudit" class="tab-pane active animated fadeIn">
<div id="r_auditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="position-relative">
<div class="tableOverlay"></div>
<!-- Not for table Loader its only for initial loading -->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="attributeResultContainer form-group ">
<button class="btn-action btn-sm attribute-filter-text" data-id='purgeAttrFilter'> <i class="fa fa-angle-right"></i> Filters</button>
<div class="attribute-filter-container hide">
<div class="panel panel-default expand_collapse_panel-icon" data-id="purgeRegion">
<div class="panel-heading" data-toggle="collapse" href="#collapsePurge" aria-expanded="true">
<h4 class="panel-title">
<a>Purge</a>
</h4>
<div class="btn-group pull-right">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div>
<div id="collapsePurge" class="panel-collapse collapse in">
<div class="panel-body">
<div id='r_attributeQueryBuilderPurge' class='attribute-querybuilder'>
<div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div>
</div>
</div>
</div>
</div>
<div class='attribute-result-footer'>
<div type="ok" class="btn btn-atlas ok search" data-id='attrApply'>Apply</div>
<div type="ok" class="btn btn-atlas ok" data-id='attrClose'>Close</div>
</div>
</div>
<div class="pull-right">
<select class="pull-right form-controlrow-margin-bottom" data-id="purgeType"></select>
</div>
</div>
<div class='attr-filter-overlay hide'></div>
<div class="auditTable" style="display: none">
<div id="r_purgeAuditTableLayoutView"></div>
<div>
<span class="labelShowRecord pull-left" data-id="pageRecordText"></span>
</div>
<div class="pagination-box">
<div class="backgrid-paginator pull-right">
<ul>
<li>
<button type="button" data-id="previousAuditData" title="Previous" disabled=true>
<i class="fa fa-angle-left" aria-hidden="true"></i>
</button>
</li>
<li class="active">
<a href="javascript:void(0)" data-id="activePage"></a>
</li>
<li>
<button type="button" data-id="nextAuditData" title="Next">
<i class="fa fa-angle-right" aria-hidden="true"></i>
</button>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="no-data" data-id="showDefault">
<div class="position-relative thick-border">
<div style="padding-top: 20px; " class="table-responsive tableBorder">
<table class="table table-hover backgrid table-quickMenu">
<tbody>
<tr class="empty">
<td colspan="16"><span>No Records found!</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="tab-namespace" role="namespace" class="tab-pane animated fadeIn">
<div id="r_namespaceTableLayoutView">
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<h4 style="word-break: break-word;">Name: <span data-id="name"></span></h4>
<div class="panel-group server-stats-container statsContainer " id="accordion">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide" data-id="detailsAttribute">
<h4 class="entity-name" style="word-break: break-word;">Name: <span data-id="name"></span></h4>
<div class="panel-group server-stats-container auditStatusContainer clearfix" id="accordion">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide col-sm-5" data-id="detailsAttribute">
<div class="panel-heading" data-toggle="collapse" href="#detailAttributeTableCollapse" aria-expanded="true">
<h4 class="panel-title">
<a>Properties </a>
......@@ -37,7 +37,7 @@
</div>
</div>
</div>
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide" data-id="attributeDetails">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide col-sm-5" data-id="attributeDetails">
<div class="panel-heading" data-toggle="collapse" href="#attributeTableCollapse" aria-expanded="true">
<h4 class="panel-title">
<a data-id="panel-attr-heading">Technical properties </a>
......@@ -58,7 +58,7 @@
</div>
</div>
</div>
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide" data-id="relationShipAttributeDetails">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide col-sm-5" data-id="relationShipAttributeDetails">
<div class="panel-heading" data-toggle="collapse" href="#relationShipAttributeTableCollapse" aria-expanded="true">
<h4 class="panel-title">
<a>Relationship properties </a>
......@@ -79,7 +79,7 @@
</div>
</div>
</div>
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide" data-id="customAttributeDetails">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide col-sm-5" data-id="customAttributeDetails">
<div class="panel-heading" data-toggle="collapse" href="#customAttributeCollapse" aria-expanded="true">
<h4 class="panel-title">
<a>User-defined properties </a>
......@@ -100,7 +100,7 @@
</div>
</div>
</div>
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide" data-id="labelsDetails">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide col-sm-5" data-id="labelsDetails">
<div class="panel-heading" data-toggle="collapse" href="#labelsTableCollapse" aria-expanded="true">
<h4 class="panel-title">
<a>Labels</a>
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="modal-dialog {{mainClass}} " style="width:{{width}}" role="document">
<div class="modal-dialog {{mainClass}}{{modal-full-screen}}" style="width:{{width}}" role="document">
<div class="modal-content">
{{#if title}}
<div class="modal-header">
......
<!--
* 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.
-->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<form name="tagDefinitionform" class="hide form-horizontal" data-id="createTagForm" style="width: 70%;margin: 0 auto;">
{{#if fromTable}}
<div class="form-group">
<label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label>
{{#if create}}
<div class="col-sm-10">
<input class="form-control namespace-name" data-id="tagName" placeholder="Name(required)" autofocus />
</div>
{{else}}
<span class="ellipsis-with-margin control-label text-left col-sm-10" data-id="title"></span> {{/if}}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="description">Description</label>
<div class="col-sm-10">
<input class="form-control" data-id="description" value="{{description}}" placeholder="Description" />
</div>
</div>
{{/if}}
<div class="form-group">
<!-- <h4 class="col-sm-6">Attributes</h4> -->
{{#if isEditAttr}}
<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>
</div>
{{/if}}
</div>
<div data-id="addAttributeDiv">
</div>
</div>
</form>
<div class="modal-footer " data-id="modalFooter">
<button type="button" class="btn btn-action cancel" data-id="namespaceAttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="form-horizontal form-group clearfix enum-attr">
<div class="form-group" data-id="enumTypeSelectorContainer">
<label class="control-label col-sm-3 required" for="enumType">Enum Name</label>
<div class="col-sm-8">
<select class="form-control enumTypeSelector" data-id="enumSelector">
</select>
</div>
</div>
<div class="form-group " data-id="enumValueSelectorContainer">
<label class="control-label col-sm-3 required" for="enumVal">Enum Value</label>
<div class="col-sm-8">
<select class="form-control enumValueSelector" data-id="valueSelector" multiple="multiple">
</select>
</div>
</div>
<div class="form-group " data-id="enumFooter">
<label class="control-label col-sm-3" for="enumVal"></label>
<div class="col-sm-8">
<button type="button" data-id="enumCancleBtn" class="btn btn-action cancel">Cancel</button>
<button type="button" data-id="enumOkBtn" class="btn btn-atlas ok">Update</button>
</div>
</div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="namespace-attr-page" data-id="namespaceAttrPage">
<div class="namespace-attr-tableOverlay"></div>
<div class=" modal-header" data-id="namespaceAttrPageHeader">
<h4 class="modal-title" data-id="namespaceAttrPageTitle"></h4>
</div>
<div id="r_modal">
</div>
<div class="namespace-attr-fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<!-- <div class="modal-footer " data-id="modalFooter">
<button type="button" class="btn btn-action cancel" data-id="namespaceAttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button>
</div> -->
</div>
<div class="namespace-details" data-id="namespaceDetailPage">
<div class="position-relative">
<div class="pull-right inline-content-fr no-padding-left">
<div class="inline" data-id="colManager"></div>
<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">
<i class='fa fa-plus'></i> Attributes
</button></div>
</div>
<div class="tableOverlay"></div>
<div class='attr-filter-overlay hide'></div>
<div class="auditTable name-space-details">
<div id="r_nameSpaceAttrTableLayoutView"></div>
</div>
</div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="form-group clearfix namespace-attr">
<div class="form-group">
<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>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3 required" for="name">Name</label>
<div class="col-sm-8">
<input class="form-control attributeInput" data-id="attributeInput" placeholder="Attribute name">
</input>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3 required" for="type">Type</label>
<div class="col-sm-8">
<select class="form-control dataTypeSelector" data-id="dataTypeSelector">
<option selected="selected">string</option>
<option>boolean</option>
<option>byte</option>
<option>short</option>
<option>int</option>
<option>float</option>
<option>double</option>
<option>long</option>
<option>date</option>
<option>enumeration</option>
</select>
</div>
</div>
<!-- <div class="form-group" data-id="multiValueSelect">
<label class="control-label col-sm-3" for="multiValSelect">Enable Multivalues</label>
<div class="col-sm-8">
<input type="checkbox" class="form-check-input multi-value-select" data-id="multiValueSelectStatus">
</div>
</div> -->
<div class="form-group enumtype-container" data-id="enumTypeSelectorContainer">
<div class="">
<label class="control-label col-sm-3 required" for="enumType">Enum Name</label>
<div class="col-sm-5">
<select class="form-control enumTypeSelector" data-id="enumTypeSelector" multiple="false">
</select>
</div>
<div class="col-sm-3">
<button type="button" class="btn btn-action btn-sm" data-id="createNewEnum" data-action="" title="Create/Update Enum"> <i class="fa fa-pencil"></i> Enum</button>
</div>
</div>
</div>
<div class="form-group enumvalue-container" data-id="enumValueSelectorContainer">
<div class="">
<label class="control-label col-sm-3 required" for="enumVal">Enum Value</label>
<div class="col-sm-8">
<select class="form-control enumValueSelector" data-id="enumValueSelector" multiple="true">
</select>
</div>
</div>
</div>
<div class="form-group" data-id="stringLengthContainer">
<div class="stringlength-container">
<label class="control-label col-sm-3 required" for="name">Max length</label>
<div class="col-sm-8">
<input type="number" class="form-control stringLengthVal" data-id="stringLength" placeholder="Maximum length">
</div>
</div>
</div>
<div class="form-group entity-namespace-selector">
<label class="control-label col-sm-3" for="name">Applicable Types</label>
<div class="col-sm-8">
<select class="form-control entityTypeSelector" data-id="entityTypeSelector" multiple="multiple">
</select>
</div>
</div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div>
<div id="r_nameSpaceDetailContainer" class="sidebar-fixed-filter"></div>
<div id="r_nameSpaceAttrContainer" class="col-sm-12"></div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="page-title clearfix">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="back-button" title="Back to search page" style="top:15px">
<i class="fa fa-angle-left" data-id="backButton"></i>
</div>
<div class="tagDetail clearfix form-horizontal col-sm-12">
<h1 class="title"><span data-id="title"></span></h1>
<p class="form-group col-sm-12" data-id="description"></p>
</div>
</div>
</div>
\ No newline at end of file
<!--
* 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.
-->
<div class="namespace-attr-page" data-id="namespaceAttrPage">
<div class="namespace-attr-tableOverlay"></div>
<div class=" modal-header" data-id="namespaceAttrPageHeader">
<h4 class="modal-title" data-id="namespaceAttrPageTitle"></h4>
</div>
<div id="r_modal">
</div>
<div class="namespace-attr-fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<!-- <div class="modal-footer " data-id="modalFooter">
<button type="button" class="btn btn-action cancel" data-id="namespaceAttrPageCancle">Cancel</button>
<button type="button" class="btn btn-atlas ok" data-id="namespaceAttrPageOk">Ok</button>
</div> -->
</div>
<div class="namespace-details" data-id="namespaceDetailPage">
<div class="position-relative">
<div class="pull-right inline-content-fr no-padding-left">
<div class="inline" data-id="colManager"></div>
<div class="inline">
<button type="button" data-id="createNameSpace" title="Create Namespace" class="btn btn-action btn-sm pull-right btn-loader" style="margin-bottom: 10px;" data-action="createNamespace">
<i class='fa fa-plus'></i> Create Namespace
</button></div>
</div>
<div class="tableOverlay"></div>
<div class='attr-filter-overlay hide'></div>
<div class="auditTable name-space-details">
<div id="r_nameSpaceTableLayoutView"></div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -39,19 +39,13 @@
<div data-id="r_classificationTreeRender"></div>
</div>
<div class="col-sm-12">
<div data-id="r_nameSpaceTreeRender"></div>
</div>
<div class="col-sm-12">
<div data-id="r_glossaryTreeRender"></div>
</div>
<div class="col-sm-12">
<div data-id="r_customFilterTreeRender"></div>
<!-- <div class="panel panel-default expand_collapse_panel-icon right-icons">
<div class="panel-heading dash-button-icon" data-toggle="collapse" aria-expanded="false" href="#c_saveSearch">
<i class="ec-icon fa"></i>
<h4 class="panel-title">Custom Filters</h4>
</div>
<div id="c_saveSearch" class="panel-collapse collapse">
<div class="basicSaveSearch" data-id="r_saveSearchBasic"></div>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -20,29 +20,21 @@
<h4 class="panel-title">Glossaries</h4>
<div class="btn-group pull-right">
<button type="button" class="typeRefresh" data-id="refreshTree" data-type="term" title="Refresh"><i class="fa fa-refresh"></i></button>
<!-- <ul class="dropdown-menu right-align tree-menu">
<li data-id="createGlossary"><i class="fa fa-plus"></i> <a>Create Glossary</a></li>
</ul> -->
<button type="button" class="typeRefresh" data-id="showGlossaryType" title="Show Category">
<i class="fa fa-toggle-on switch-button"></i>
</button>
<!-- <button title="Create Glossary" type="button" data-id="createGlossary">
<button title="Create Glossary" type="button" data-id="createGlossary">
<i class="fa fa-plus"></i>
</button> -->
<!-- <button data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" type="button" data-id="termMenu"><i class="fa fa-ellipsis-v"></i></button> -->
<button type="button" class="typeRefresh dropdown">
</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="showGlossaryType" data-type="term"> <i class="fa fa-toggle-on switch-button"></i><span>Show Category</span>
</li> -->
<!-- <li data-id="refreshTree" data-type="term"><i class="fa fa-refresh"></i><span>Refresh</span>
</li> -->
<li data-id="createGlossary" data-type="term"> <i class="fa fa-plus"></i><span>Create Glossary</span>
</li>
</ul>
</button>
</button> -->
</div>
</div>
<div id="c_term" class="panel-collapse collapse jstree-with-action in">
......
<!--
* 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.
-->
<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_namespace">
<i class="ec-icon fa"></i>
<h4 class="panel-title">Namespaces</h4>
<div class="btn-group pull-right">
<button type="button" class="typeRefresh drop-down-menu-view" data-id="refreshTree" data-type="classification" title="Refresh">
<i class="fa fa-refresh"></i>
</button>
<button type="button" class="typeRefresh drop-down-menu-view" data-id="createNameSpace" data-type="classification" title="Open Namespaces">
<i class="fa fa-external-link"></i>
</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>
</button>
</div>
</div>
<div id="c_namespace" class="panel-collapse collapse jstree-with-action in">
<div data-id="nameSpaceSearchTree"></div>
</div>
</div>
\ No newline at end of file
......@@ -29,8 +29,6 @@
<div class="btn-group pull-right header-menu">
<table class="header-menu">
<tr>
<!-- <td><a class="show-classification" href="javascript:void(0);" title="Clasification"><i class="fa fa-tag"></i></a></td>
<td><a class="show-glossary" href="javascript:void(0);" title="Glossary"><i class="fa fa-folder"></i></a></td> -->
<td><a class="show-stat" href="javascript:void(0);" title="Statistics"><i class="fa fa-bar-chart"></i></a></td>
<td class="user-dropdown">
<table data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
......@@ -43,13 +41,17 @@
</td>
</tr>
</table>
<ul class="dropdown-menu right-align">
<li class="aboutAtlas"><a href="javascript:void(0)">About</a></li>
<li class="aboutAtlas"><a target="_blank" href="http://atlas.apache.org/">Help</a></li>
<li role="separator" class="divider"></li>
<li>
<a data-id="signOut" href="javascript:void(0)"><i class="fa fa-sign-out"></i>Logout</a>
<ul class="dropdown-menu pull-right multi-level" role="menu" aria-labelledby="dropdownMenu">
<li><a href="#!/administrator" data-id="purgeSearch">Administration</a></li>
<li class="dropdown-submenu">
<a tabindex="-1" href="javascript:void(0)"> Help </span></a>
<ul class="dropdown-menu">
<li><a target="_blank" href="http://atlas.apache.org/">Documentation</a></li>
<li class="aboutAtlas"><a href="javascript:void(0)">About</a></li>
</ul>
</li>
<li class="divider"></li>
<li><a data-id="signOut" href="javascript:void(0)"><i class="fa fa-sign-out"></i>Logout</a></li>
</ul>
</td>
</tr>
......
......@@ -112,10 +112,90 @@ define(['require',
$("body").on('click', '.dropdown-menu.dropdown-changetitle li a', function() {
$(this).parents('li').find(".btn:first-child").html($(this).text() + ' <span class="caret"></span>');
});
$("body").on('click', '.dropdown-menu.multi-level .dropdown-submenu>a', function(e) {
e.stopPropagation();
e.preventDefault();
});
$("body").on('click', '.btn', function() {
$(this).blur();
});
$.fn.select2.amd.define("TagHideDeleteButtonAdapter", [
"select2/utils",
"select2/selection/multiple",
"select2/selection/placeholder",
"select2/selection/eventRelay",
"select2/selection/search",
],
function(Utils, MultipleSelection, Placeholder, EventRelay, SelectionSearch) {
// Decorates MultipleSelection with Placeholder
var adapter = Utils.Decorate(MultipleSelection, Placeholder);
adapter = Utils.Decorate(adapter, SelectionSearch);
adapter = Utils.Decorate(adapter, EventRelay);
adapter.prototype.render = function() {
// Use selection-box from SingleSelection adapter
// This implementation overrides the default implementation
var $search = $(
'<li class="select2-search select2-search--inline">' +
'<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
'</li>'
);
this.$searchContainer = $search;
this.$search = $search.find('input');
let $selection = MultipleSelection.prototype.render.call(this);
this._transferTabIndex();
return $selection;
};
adapter.prototype.update = function(data) {
// copy and modify SingleSelection adapter
var that = this;
this.clear();
if (data.length === 0) {
this.$selection.find('.select2-selection__rendered')
.append(this.$searchContainer);
this.$search.attr('placeholder', this.options.get("placeholder"));
return;
}
this.$search.attr('placeholder', '');
var $rendered = this.$selection.find('.select2-selection__rendered'),
$selectionContainer = [];
if (data.length > 0) {
_.each(data, function(obj) {
var $container = $('<li class="select2-selection__choice"></li>'),
formatted = that.display(obj, $rendered),
$remove = $('<span class="select2-selection__choice__remove" role="presentation">&times;</span>'),
allowRemoveAttr = $(obj.element).data("allowremove"),
allowRemove = obj.allowRemove === undefined ? allowRemoveAttr : obj.allowRemove;
if (allowRemove === undefined || allowRemove !== false) {
$container.append($remove);
}
$container.data("data", obj);
$container.append(formatted);
$selectionContainer.push($container);
});
Utils.appendMany($rendered, $selectionContainer);
}
var searchHadFocus = this.$search[0] == document.activeElement;
this.$search.attr('placeholder', '');
this.$selection.find('.select2-selection__rendered')
.append(this.$searchContainer);
this.resizeSearch();
if (searchHadFocus) {
this.$search.focus();
}
};
return adapter;
});
$.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
"select2/utils",
"select2/dropdown",
......
......@@ -95,6 +95,7 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
});
}
if (modelValue.get('width')) that.$el.find('.' + modelValue.get('name')).css('min-width', modelValue.get('width') + 'px');
if (modelValue.get('fixWidth')) that.$el.find('.' + modelValue.get('name')).css('width', modelValue.get('fixWidth') + 'px');
if (modelValue.get('toolTip')) that.$el.find('.' + modelValue.get('name')).attr('title', modelValue.get('toolTip'));
});
return this;
......@@ -161,6 +162,95 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
return this;
};
/*
backgrid-expandable-cell
https://github.com/cime/backgrid-expandable-cell
Copyright (c) 2014 Andrej Cimperšek
Licensed under the MIT @license.
*/
Backgrid.ExpandableCell = Backgrid.Cell.extend({
accordion: true,
toggle: '<i style="cursor: pointer;" class="glyphicon toggle pull-left"></i>',
toggleClass: 'toggle',
toggleExpandedClass: 'fa fa-angle-down',
toggleCollapsedClass: 'fa fa-angle-right',
trClass: 'expandable',
tdClass: 'expandable-content',
events: {
'click': 'setToggle'
},
initialize: function(options) {
if (options.accordion) {
this.accordion = options.accordion;
}
this.column = options.column;
if (!(this.column instanceof Backgrid.Column)) {
this.column = new Backgrid.Column(this.column);
}
var column = this.column,
model = this.model,
$el = this.$el;
if (Backgrid.callByNeed(column.renderable(), column, model)) $el.addClass("renderable");
},
render: function() {
/* follow along with the original render really... */
this.$el.empty();
this.$toggleEl = $(this.toggle).addClass(this.toggleClass).addClass(this.toggleCollapsedClass);
this.$el.append(this.$toggleEl);
this.delegateEvents();
return this;
},
setToggle: function() {
var detailsRow = this.$el.data('details');
var toggle = this.$toggleEl;
/* if there's details data already stored, then we'll remove it */
if (detailsRow) {
$(detailsRow).remove();
this.$el.data('details', null);
toggle.removeClass(this.toggleExpandedClass).addClass(this.toggleCollapsedClass);
} else {
if (this.accordion) {
var table = this.$el.closest('table');
$('.' + this.toggleClass, table).filter('.' + this.toggleExpandedClass).click();
}
var renderableColumns = this.$el.closest('table').find('th.renderable').length;
var isRenderable = false;
var cellClass = this.tdClass;
if (Backgrid.callByNeed(this.column.renderable(), this.column, this.model)) {
isRenderable = true;
cellClass += ' renderable';
}
/* build a jquery object for the new row... */
detailsRow = $('<tr class="' + this.trClass + '"></td><td class="' + cellClass + '" colspan="' + (renderableColumns - 1) + '"></td></tr>');
/* Inject new row */
this.$el.closest('tr').after(detailsRow);
/* Call expand function */
this.column.get('expand')(detailsRow.find('td.' + this.tdClass), this.model);
this.$el.data('details', detailsRow);
toggle.removeClass(this.toggleCollapsedClass).addClass(this.toggleExpandedClass);
}
return this;
}
});
// Backgrid patch
Backgrid.Header.prototype.initialize = BackgridHeaderInitializeMethod;
......
......@@ -226,8 +226,28 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
},
sessionApiUrl: function() {
return this.baseUrl + '/admin/session';
},
purgeApiUrl: function() {
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';
}
}
});
return UrlLinks;
......
......@@ -382,6 +382,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
matchString: "search"
});
},
isAdministratorTab: function(url) {
return this.checkTabUrl({
url: url,
matchString: "administrator"
});
},
isCustomFilterTab: function(url) {
return this.checkTabUrl({
url: url,
......
/**
* 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/administrator/AdministratorLayoutView_tmpl',
'collection/VEntityList',
'models/VSearch',
'utils/Utils',
'utils/Enums',
'utils/UrlLinks',
'utils/CommonViewFunction'
], function(require, Backbone, AdministratorLayoutView_tmpl, VEntityList, VSearch, Utils, Enums, UrlLinks, CommonViewFunction) {
'use strict';
var AdministratorLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends AuditTableLayoutView */
{
_viewName: 'AdministratorLayoutView',
template: AdministratorLayoutView_tmpl,
/** Layout sub regions */
regions: {
RNamespaceTableLayoutView: "#r_namespaceTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView'
},
/** ui selector cache */
ui: {
tablist: '[data-id="tab-list"] li'
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.tablist] = function(e) {
var tabValue = $(e.currentTarget).attr('role');
Utils.setUrl({
url: Utils.getUrlState.getQueryUrl().queyParams[0],
urlParams: { tabActive: tabValue || 'properties' },
mergeBrowserUrl: false,
trigger: false,
updateTabState: true
});
};
return events;
},
/**
* intialize a new AuditTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'guid', 'entity', 'entityName', 'attributeDefs', 'nameSpaceCollection', 'enumDefCollection'));
},
onShow: function() {
if (this.value && this.value.tabActive) {
this.$('.nav.nav-tabs').find('[role="' + this.value.tabActive + '"]').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('[role="' + this.value.tabActive + '"]').addClass('active').siblings().removeClass('active');
$("html, body").animate({ scrollTop: (this.$('.tab-content').offset().top + 1200) }, 1000);
}
},
bindEvents: function() {
this.renderEnumLayoutView();
},
onRender: function() {
this.renderNameSpaceLayoutView();
this.bindEvents();
},
renderNameSpaceLayoutView: function(obj) {
var that = this;
require(['views/name_space/NameSpaceTableLayoutView'], function(NameSpaceTableLayoutView) {
that.RNamespaceTableLayoutView.show(new NameSpaceTableLayoutView({ nameSpaceCollection: that.nameSpaceCollection }));
});
},
renderEnumLayoutView: function(obj) {
var that = this;
require(["views/name_space/EnumCreateUpdateItemView"], function(EnumCreateUpdateItemView) {
var view = new EnumCreateUpdateItemView({
enumDefCollection: that.enumDefCollection,
nameSpaceCollection: that.nameSpaceCollection
});
that.REnumTableLayoutView.show(view);
});
}
});
return AdministratorLayoutView;
});
\ No newline at end of file
......@@ -179,6 +179,31 @@ define(['require',
getAuditTableColumns: function() {
var that = this;
return this.entityCollection.constructor.getTableCols({
tool: {
label: "",
cell: "html",
editable: false,
sortable: false,
cell: Backgrid.ExpandableCell,
accordion: false,
expand: function(el, model) {
el.attr('colspan', '4');
require([
'views/audit/CreateAuditTableLayoutView',
], function(CreateAuditTableLayoutView) {
that.action = model.get('action');
// $(el.target).attr('disabled', true);
var eventModel = that.entityCollection.fullCollection.findWhere({ 'eventKey': model.get('eventKey') }).toJSON(),
collectionModel = new that.entityCollection.model(eventModel),
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entity: that.entity, entityName: that.entityName, attributeDefs: that.attributeDefs });
view.render();
$(el).append($('<div>').html(view.$el));
});
}
},
user: {
label: "Users",
cell: "html",
......@@ -207,20 +232,7 @@ define(['require',
}
}
})
},
tool: {
label: "Tools",
cell: "html",
editable: false,
sortable: false,
width: 100,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
return '<div class="btn btn-action btn-sm" data-id="auditCreate" data-action="' + Enums.auditAction[model.get('action')] + '" data-modalId="' + model.get('eventKey') + '">Detail</div>';
}
})
},
}
}, this.entityCollection);
},
......
......@@ -157,7 +157,7 @@ define(['require',
}
} else if (detailObj == "Deleted entity") {
that.updateName(this.entityName);
that.updateName(this.entityName ? this.entityName : "Entity");
}
}
});
......
/**
* 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({
skipDefaultError: true,
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
}));
});
}
}
);
return NameSpaceContainerLayoutView;
});
\ No newline at end of file
/**
* 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/NameSpaceDetailLayoutView_tmpl',
'utils/Utils',
'views/tag/AddTagAttributeView',
'collection/VTagList',
'models/VTag',
'utils/Messages',
'utils/UrlLinks',
"utils/Globals",
], function(require, Backbone, NameSpaceDetailLayoutViewTmpl, Utils, AddTagAttributeView, VTagList, VTag, Messages, UrlLinks, Globals) {
'use strict';
var NameSpaceDetailLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends NameSpaceDetailLayoutView */
{
template: NameSpaceDetailLayoutViewTmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
title: '[data-id="title"]',
editBox: '[data-id="editBox"]',
saveButton: "[data-id='saveButton']",
description: '[data-id="description"]',
publishButton: '[data-id="publishButton"]',
backButton: '[data-id="backButton"]'
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.backButton] = function() {
Utils.backButtonClick();
};
return events;
},
/**
* intialize a new NameSpaceDetailLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'attributeDefs', 'enumDefCollection', 'typeHeaders', 'nameSpaceCollection', 'selectedNameSpace', 'nameSpaceAttr'));
},
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() {
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.renderTagDetail();
}
this.bindEvents();
},
renderTagDetail: function() {
var that = this,
attributeData = "";
this.attributeDefs = this.model.get('attributeDefs');
this.ui.title.html('<span>' + that.model.get('name') + '</span>');
if (that.model.get('description')) {
this.ui.description.text((that.model.get('description')));
}
Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.tagDetail'));
}
});
return NameSpaceDetailLayoutView;
});
\ No newline at end of file
......@@ -36,7 +36,8 @@ define([
RGlossaryTreeRender: '[data-id="r_glossaryTreeRender"]',
RClassificationTreeRender: '[data-id="r_classificationTreeRender"]',
REntityTreeRender: '[data-id="r_entityTreeRender"]',
RCustomFilterTreeRender: '[data-id="r_customFilterTreeRender"]'
RCustomFilterTreeRender: '[data-id="r_customFilterTreeRender"]',
RNameSpaceTreeRender: '[data-id="r_nameSpaceTreeRender"]'
},
ui: {
//search
......@@ -81,6 +82,7 @@ define([
this.classificationSearchTree = this.$('[data-id="classificationSearchTree"]');
this.termSearchTree = this.$('[data-id="termSearchTree"]');
this.customFilterSearchTree = this.$('[data-id="customFilterSearchTree"]');
this.nameSpaceSearchTree = this.$('[data-id="nameSpaceSearchTree"]');
this.entitySearchTree.jstree(true).show_all();
this.entitySearchTree.jstree("search", searchString);
this.classificationSearchTree.jstree(true).show_all();
......@@ -89,6 +91,9 @@ define([
this.termSearchTree.jstree("search", searchString);
this.customFilterSearchTree.jstree(true).show_all();
this.customFilterSearchTree.jstree("search", searchString);
this.nameSpaceSearchTree.jstree(true).show_all();
this.nameSpaceSearchTree.jstree("search", searchString);
};
events["click " + this.ui.menuItems] = function(e) {
......@@ -118,11 +123,12 @@ define([
this.bindEvents();
},
onRender: function() {
var opt = opt = Utils.getUrlState.getQueryParams();
var opt = Utils.getUrlState.getQueryParams();
this.renderEntityTree(opt);
this.renderClassificationTree(opt);
this.renderGlossaryTree(opt);
this.renderCustomFilterTree();
this.renderNameSpaceTree();
this.showHideGlobalFilter();
this.showDefaultPage();
},
......@@ -195,6 +201,9 @@ define([
if (options) {
_.extend(this.options, options);
this.showHideGlobalFilter();
if (this.RNameSpaceTreeRender.currentView) {
this.RNameSpaceTreeRender.currentView.manualRender(this.options);
}
if (this.RCustomFilterTreeRender.currentView) {
this.RCustomFilterTreeRender.currentView.manualRender(this.options);
}
......@@ -232,6 +241,12 @@ define([
require(["views/search/tree/CustomFilterTreeLayoutView"], function(CustomFilterTreeLayoutView) {
that.RCustomFilterTreeRender.show(new CustomFilterTreeLayoutView(_.extend({ query: that.query }, that.options)));
});
},
renderNameSpaceTree: function() {
var that = this;
require(["views/search/tree/NameSpaceTreeLayoutView"], function(NameSpaceTreeLayoutView) {
that.RNameSpaceTreeRender.show(new NameSpaceTreeLayoutView(_.extend({ query: that.query }, that.options)));
});
}
});
return SearchFilterBrowseLayoutViewNew;
......
......@@ -245,12 +245,14 @@ define([
var aFilter = that.$("#" + str.node.a_attr.id),
filterOffset = aFilter.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
if (filterOffset.top && filterOffset.left) {
aFilter.find(">span.tree-tooltip").css({
top: "calc(" + filterOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
setTimeout(function() {
if (aFilter.hasClass("jstree-hovered") && filterOffset.top && filterOffset.left) {
aFilter.find(">span.tree-tooltip").css({
top: "calc(" + filterOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
}, 1200);
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
......
......@@ -309,7 +309,7 @@ define([
parent: "#",
icon: "fa fa-file-o",
state: {
disabled: entityCount == 0 ? true : false,
disabled: false,
selected: isSelected
},
};
......@@ -489,12 +489,14 @@ define([
var aType = that.$("#" + str.node.a_attr.id),
typeOffset = aType.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
if (typeOffset.top && typeOffset.left) {
aType.find(">span.tree-tooltip").css({
top: "calc(" + typeOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
setTimeout(function() {
if (aType.hasClass("jstree-hovered") && typeOffset.top && typeOffset.left) {
aType.find(">span.tree-tooltip").css({
top: "calc(" + typeOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
}, 1200);
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
......
......@@ -56,6 +56,7 @@ define([
events["click " + this.ui.createGlossary] = function(e) {
var that = this;
e.stopPropagation();
CommonViewFunction.createEditGlossaryCategoryTerm({
isGlossaryView: true,
collection: that.glossaryCollection,
......@@ -664,12 +665,14 @@ define([
var aTerm = that.$("#" + str.node.a_attr.id),
termOffset = aTerm.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
if (termOffset.top && termOffset.left) {
aTerm.find(">span.tree-tooltip").css({
top: "calc(" + termOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
setTimeout(function() {
if (aTerm.hasClass("jstree-hovered") && termOffset.top && termOffset.left) {
aTerm.find(">span.tree-tooltip").css({
top: "calc(" + termOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
}, 1200);
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment