Add default msg to show when each package size is 0

This commit is contained in:
AhyoungRyu 2017-02-23 16:36:00 +09:00
parent 899e8fa8eb
commit d5ae4e2f04
2 changed files with 15 additions and 0 deletions

View file

@ -277,4 +277,12 @@ function HeliumCtrl($scope, $rootScope, $sce, baseUrlSrv, ngToast, heliumService
return (pkg.type === HeliumType.APPLICATION || pkg.type === HeliumType.INTERPRETER) &&
!$scope.isLocalPackage(pkgSearchResult);
};
$scope.getPackageSize = function(pkgSearchResult, targetPkgType) {
var result = []
_.map(pkgSearchResult, function (pkg) {
result.push(_.find(pkg, {type: targetPkgType}))
})
return _.compact(result).length
}
}

View file

@ -61,6 +61,13 @@ limitations under the License.
</div>
<div class="box width-full heliumPackageContainer">
<div class="row"
style="padding-bottom: 15px"
ng-if="getPackageSize(defaultVersions, pkgListByType) === 0">
<div class="col-md-12 gray40-message">
<em>Currently there is no available package to be listed</em>
</div>
</div>
<div class="row heliumPackageList"
ng-repeat="(pkgName, pkgInfo) in defaultVersions"
ng-show="$parent.pkgListByType == pkgInfo.pkg.type">