Commit f3708887 by Jason Song Committed by GitHub

Merge pull request #397 from lepdou/search_item

bugfix: add view items
parents 588029d6 583b098e
...@@ -65,7 +65,7 @@ directive_module.directive('apollonspanel', ...@@ -65,7 +65,7 @@ directive_module.directive('apollonspanel',
function initNamespace(namespace, viewType) { function initNamespace(namespace, viewType) {
namespace.showSearchInput = false; namespace.showSearchInput = false;
namespace.sourceItems = namespace.items; namespace.viewItems = namespace.items;
namespace.isPropertiesFormat = namespace.format == 'properties'; namespace.isPropertiesFormat = namespace.format == 'properties';
namespace.isTextEditing = false; namespace.isTextEditing = false;
namespace.instanceViewType = namespace_instance_view_type.LATEST_RELEASE; namespace.instanceViewType = namespace_instance_view_type.LATEST_RELEASE;
...@@ -345,7 +345,7 @@ directive_module.directive('apollonspanel', ...@@ -345,7 +345,7 @@ directive_module.directive('apollonspanel',
function parseModel2Text(namespace) { function parseModel2Text(namespace) {
if (namespace.sourceItems.length == 0) { if (namespace.items.length == 0) {
namespace.itemCnt = MIN_ROW_SIZE; namespace.itemCnt = MIN_ROW_SIZE;
return ""; return "";
} }
...@@ -360,7 +360,7 @@ directive_module.directive('apollonspanel', ...@@ -360,7 +360,7 @@ directive_module.directive('apollonspanel',
} }
function parseNotPropertiesText(namespace) { function parseNotPropertiesText(namespace) {
var text = namespace.sourceItems[0].item.value; var text = namespace.items[0].item.value;
var lineNum = text.split("\n").length; var lineNum = text.split("\n").length;
namespace.itemCnt = lineNum < MIN_ROW_SIZE ? MIN_ROW_SIZE : lineNum; namespace.itemCnt = lineNum < MIN_ROW_SIZE ? MIN_ROW_SIZE : lineNum;
return text; return text;
...@@ -369,7 +369,7 @@ directive_module.directive('apollonspanel', ...@@ -369,7 +369,7 @@ directive_module.directive('apollonspanel',
function parsePropertiesText(namespace) { function parsePropertiesText(namespace) {
var result = ""; var result = "";
var itemCnt = 0; var itemCnt = 0;
namespace.sourceItems.forEach(function (item) { namespace.items.forEach(function (item) {
//deleted key //deleted key
if (!item.item.dataChangeLastModifiedBy) { if (!item.item.dataChangeLastModifiedBy) {
return; return;
...@@ -398,13 +398,13 @@ directive_module.directive('apollonspanel', ...@@ -398,13 +398,13 @@ directive_module.directive('apollonspanel',
function searchItems(namespace) { function searchItems(namespace) {
var searchKey = namespace.searchKey.toLowerCase(); var searchKey = namespace.searchKey.toLowerCase();
var items = []; var items = [];
namespace.sourceItems.forEach(function (item) { namespace.items.forEach(function (item) {
var key = item.item.key; var key = item.item.key;
if (key && key.toLowerCase().indexOf(searchKey) >= 0){ if (key && key.toLowerCase().indexOf(searchKey) >= 0){
items.push(item); items.push(item);
} }
}); });
namespace.items = items; namespace.viewItems = items;
} }
function lockCheck(namespace) { function lockCheck(namespace) {
......
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="config in namespace.items" ng-class="{warning:config.isModified}" <tr ng-repeat="config in namespace.viewItems" ng-class="{warning:config.isModified}"
ng-if="config.item.key && !config.isDeleted"> ng-if="config.item.key && !config.isDeleted">
<td width="20%" title="{{config.item.key}}"> <td width="20%" title="{{config.item.key}}">
<span ng-bind="config.item.key | limitTo: 250"></span> <span ng-bind="config.item.key | limitTo: 250"></span>
......
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