Merge pull request #2512 from NathalieLarsson/dev-v7

Quick fix for U4-11085 and added filtering to list view in MNTP
This commit is contained in:
Sebastiaan Janssen
2018-08-26 20:51:53 +02:00
committed by GitHub
5 changed files with 547 additions and 517 deletions
@@ -8,7 +8,7 @@
scope.search = "";
scope.miniListViews = [];
scope.breadcrumb = [];
var miniListViewsHistory = [];
var goingForward = true;
var skipAnimation = true;
@@ -60,9 +60,13 @@
entityResource.getPagedChildren(miniListView.node.id, scope.entityType, miniListView.pagination)
.then(function (data) {
// update children
miniListView.children = data.items;
_.each(miniListView.children, function(c) {
// child allowed by default
c.allowed = true;
// convert legacy icon for node
if(c.icon) {
c.icon = iconHelper.convertFromLegacyIcon(c.icon);
@@ -74,6 +78,17 @@
c.published = c.metaData.IsPublished;
}
}
// filter items if there is a filter and it's not advanced
// ** ignores advanced filter at the moment
if (scope.entityTypeFilter && !scope.entityTypeFilter.filterAdvanced) {
var a = scope.entityTypeFilter.filter.toLowerCase().replace(/\s/g, '').split(',');
var found = a.indexOf(c.metaData.ContentTypeAlias.toLowerCase()) >= 0;
if (!scope.entityTypeFilter.filterExclude && !found || scope.entityTypeFilter.filterExclude && found) {
c.allowed = false;
}
}
});
// update pagination
miniListView.pagination.totalItems = data.totalItems;
@@ -89,7 +104,7 @@
};
scope.selectNode = function(node) {
if(scope.onSelect) {
if (scope.onSelect && node.allowed) {
scope.onSelect({'node': node});
}
};
@@ -202,7 +217,8 @@
entityType: "@",
startNodeId: "=",
onSelect: "&",
onClose: "&"
onClose: "&",
entityTypeFilter: "="
},
link: link
};
@@ -157,6 +157,10 @@
/* TEMP */
.umb-minilistview {
.umb-table-row.not-allowed { opacity: 0.6; cursor: not-allowed; }
}
.umb-listview .table-striped tbody td {
position: relative
}
@@ -22,7 +22,7 @@
<umb-empty-state ng-if="!hasItems && emptyStateMessage" position="center">
{{ emptyStateMessage }}
</umb-empty-state>
</umb-empty-state>
<div ng-if="treeReady" ng-hide="searchInfo.showSearch" ng-animate="'tree-fade-out'">
<umb-tree
@@ -48,7 +48,8 @@
entity-type="{{entityType}}"
start-node-id="model.startNodeId"
on-select="selectListViewNode(node)"
on-close="closeMiniListView()">
on-close="closeMiniListView()"
entity-type-filter="filter">
</umb-mini-list-view>
</div>
</div>
@@ -1,4 +1,4 @@
<div>
<div class="umb-minilistview">
<div ng-repeat="miniListView in miniListViews" ng-animate="getMiniListViewAnimation()">
@@ -61,7 +61,7 @@
<div class="umb-table-row"
ng-repeat="child in miniListView.children"
ng-click="selectNode(child)"
ng-class="{'-selected':child.selected}">
ng-class="{'-selected':child.selected, 'not-allowed':!child.allowed}">
<div class="umb-table-cell umb-table-cell--auto-width" ng-class="{'umb-table-cell--faded':child.published === false}">
<div class="flex items-center">
<ins class="icon-navigation-right umb-table__row-expand" ng-click="openNode($event, child)" ng-class="{'umb-table__row-expand--hidden': child.hasChildren !== true}">&nbsp;</ins>