sort by not working in main page 87/43487/1
authorAnjali Walsatwar <anjali.walsatwar@huawei.com>
Wed, 18 Apr 2018 09:11:23 +0000 (14:41 +0530)
committerAnjali Walsatwar <anjali.walsatwar@huawei.com>
Wed, 18 Apr 2018 09:11:23 +0000 (14:41 +0530)
Issue-ID: VNFSDK-239

Change-Id: I2a6518f8d03c87c493adfd134650ae8fe6d32c90
Signed-off-by: Anjali Walsatwar <anjali.walsatwar@huawei.com>
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/marketplace.html
vnfmarket/src/main/webapp/vnfmarket/common/locale/locale-en.json

index 64a3f39..f95bba5 100644 (file)
@@ -24,7 +24,7 @@
         <md-toolbar id="homeToolbar" class="md-hue-3">
             <div class="md-toolbar-tools">
                 <label ng-if="vm.services.length > 0" class="md-title fontSize marginAuto selectLblAlignment">{{'module.marketplace.main.sortBy.label' | translate}}</label>
-                <select ng-model="sortBy" class="md-no-underline noMargin iconMargin md-title fontSize" id="sortByLabel" ng-if="vm.services.length > 0">
+                <select ng-model="vm.filter.sortBy" class="md-no-underline noMargin iconMargin md-title fontSize" id="sortByLabel" ng-if="vm.services.length > 0">
                     <option class="md-title fontSize " value="" disabled selected>{{'module.marketplace.main.sortBy.title' | translate}}</option>
                     <option class="md-title fontSize " value="{{'module.marketplace.main.sortBy.options.name.value' | translate}}">{{'module.marketplace.main.sortBy.options.name.key' | translate}}</option>
                     <option class="md-title fontSize " value="{{'module.marketplace.main.sortBy.options.dateModified.value' | translate}}">{{'module.marketplace.main.sortBy.options.dateModified.key' | translate}}</option>
@@ -82,7 +82,7 @@
         </md-toolbar>
     </md-card>
     <div class="md-padding" layout-xs="column" layout="row" layout-wrap ng-if="vm.hasGridView && vm.services.length > 0" id="gridView">
-        <md-card class="gridViewMargin md-padding tiles flex-md-100 flex-gt-md-30 flex-lt-md-100" ng-repeat="service in vm.services | filter: vm.filter.search| orderBy:sortBy"
+        <md-card class="gridViewMargin md-padding tiles flex-md-100 flex-gt-md-30 flex-lt-md-100" ng-repeat="service in vm.services | filter: vm.filter.search| orderBy:vm.filter.sortBy"
             layout-wrap>
             <md-card-header class="nopadding">
                 <md-card-header-text>
     <md-card flex="100" ng-if="!vm.hasGridView  && vm.services.length > 0" id="listView">
         <md-table-container>
             <table md-table>
-                <thead md-head md-order="sortBy">
+                <thead md-head md-order="vm.filter.sortBy">
                     <tr md-row>
                         <th md-column class="text-center fontSize">
                             <md-tooltip md-direction="top">{{'module.marketplace.main.listView.headers.name' | translate}}</md-tooltip>{{'module.marketplace.main.listView.headers.name'
                     </tr>
                 </thead>
                 <tbody md-body>
-                    <tr md-row md-select="dessert" md-select-id="name" md-auto-select ng-repeat="service in vm.services | filter: vm.filter.search | orderBy:sortBy | limitTo: vm.paginationQuery.limit: (vm.paginationQuery.page - 1) * vm.paginationQuery.limit">
+                    <tr md-row md-select="dessert" md-select-id="name" md-auto-select ng-repeat="service in vm.services | filter: vm.filter.search | orderBy:vm.filter.sortBy | limitTo: vm.paginationQuery.limit: (vm.paginationQuery.page - 1) * vm.paginationQuery.limit">
                         <td md-cell class="text-center">
                             <md-tooltip md-direction="top">{{service.name}}</md-tooltip>
                             <a class="pointerClick" ng-click="vm.showDetails(service)">{{service.name}}</a>
index f82b567..d7a7838 100644 (file)
                                                },\r
                                                "downloads": {\r
                                                        "key": "Downloads",\r
-                                                       "value": "downloads"\r
+                                                       "value": "downloadCount"\r
                                                }\r
                                        }\r
                                },\r