Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge b463891 into 24e9303
Browse files Browse the repository at this point in the history
  • Loading branch information
apetro committed Jul 3, 2020
2 parents 24e9303 + b463891 commit 5c7dd04
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 81 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to
(the now preferred URL-to-an-SVG-file way of referencing icons).
so that app directory details pages show the entry icon rather than defaulting
to showing a star icon.
+ remove "popularity" sorting option when browsing app directory entries,
since users are no longer able to rate entries.
+ tell users how many entries match
when filtering when browsing the app directory

## 10.2.2 - 2020-04-14

Expand Down
57 changes: 4 additions & 53 deletions web/src/main/webapp/my-app/marketplace/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,34 +127,6 @@ define(['angular', 'jquery', 'require'], function(angular, $, require) {
);
};

$scope.selectFilter = function(filter, category) {
$scope.sortParameter = filter;
$scope.categoryToShow = category;
$scope.showCategories = false;
if (filter === 'popular') {
$scope.selectedFilter = 'popular';
$scope.sortParameter = ['-rating', '-userRated'];
}
if (filter === 'az') {
$scope.selectedFilter = 'az';
$scope.sortParameter = 'title';
}
if (filter === 'category') {
$scope.selectedFilter = 'category';
$scope.sortParameter = 'title';
$scope.showCategories = true;
}

miscService.pushGAEvent('Marketplace', 'Tab Select', filter);
};

$scope.slideTabs = function(direction) {
$scope.tabsPosition = 'start';
if (direction === 'right') {
$scope.tabsPosition = 'end';
}
};

$scope.toggleShowAll = function() {
$scope.showAll = !$scope.showAll;
};
Expand Down Expand Up @@ -268,31 +240,15 @@ define(['angular', 'jquery', 'require'], function(angular, $, require) {
return true;
});

if (currentPage === 'details') {
// Empty string indicates no categories, show all portlets
$scope.categoryToShow = '';
// Default to filter by category on return back to app dir browse
$scope.selectedFilter = 'category';
// When filtering by category, sort by title

// Default to alphabetical sort by title on return to app dir browse
$scope.selectedFilter = 'az';
$scope.sortParameter = 'title';
// Show category selection div by default
$scope.showCategories = true;

if (currentPage === 'details') {
currentPage = 'market';
if (currentCategory !== '') {
$scope.categoryToShow = currentCategory;
} else {
$scope.categoryToShow = '';
}
} else {
// Empty string indicates no categories, show all portlets
$scope.categoryToShow = '';
// Default filter is to sort by popularity
$scope.selectedFilter = 'popular';
// To sort by popularity, angular will use portlet.rating to filter
$scope.sortParameter = ['-rating', '-userRated'];
// Hide category selection div by default
$scope.showCategories = false;
}

base.initializeConstants();
Expand All @@ -310,11 +266,6 @@ define(['angular', 'jquery', 'require'], function(angular, $, require) {
$controller('MarketplaceCommonFunctionsController',
{$scope: $scope});

$scope.specifyCategory = function(category) {
currentCategory=category;
currentPage='details';
};

var figureOutBackStuff = function() {
var fromInfo = marketplaceService.getFromInfo();
if (fromInfo.term) {
Expand Down
38 changes: 10 additions & 28 deletions web/src/main/webapp/my-app/marketplace/partials/marketplace.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,17 @@ <h1 class="md-display-1">
</md-card>

<md-card>
<div class="mp-tabs-container">
<div class="mp-prev-button" ng-click="slideTabs('left')">
<i class="fa fa-chevron-left"></i>
</div>
<div class="mp-next-button" ng-click="slideTabs('right')">
<i class="fa fa-chevron-right"></i>
</div>
<div class="mp-tabs-canvas">
<ul class="mp-tabs" ng-class="{true:'slide-right'}[tabsPosition === 'end']">
<li class="mp-tab md-ink-ripple" ng-click="selectFilter('popular','')"
ng-class="{true:'active'}[selectedFilter === 'popular']"
ng-style="selectedFilter === 'popular' && {color: primaryColorRgb}">
<span aria-label="Sort by popularity">Popular</span>
<div class="mp-tabs-slide" ng-style="{background: primaryColorRgb}"></div>
</li>
<li class="mp-tab md-ink-ripple" ng-click="selectFilter('az','')"
ng-class="{true: 'active'}[selectedFilter === 'az']"
ng-style="selectedFilter === 'az' && {color: primaryColorRgb}">
<span aria-label="Sort by alphabetical order">A-Z</span>
<div class="mp-tabs-slide" ng-style="{background: primaryColorRgb}"></div>
</li>
</ul>
</div>
</div>

<loading-gif data-object="portlets" layout="row" layout-align="center center"></loading-gif>

<md-card-title ng-show="portlets.length">
<md-card-title-text>
<span ng-show="portlets.length > 0 && !searchTerm">{{portlets.length}} entries are available to you</span>
<span ng-show="portlets.length > 0 && searchTerm">{{(portlets | filter:searchTermFilter | showApplicable:showAll ).length}} entries matching &quot;{{searchTerm}}&quot; are available to you</span>
</md-card-title-text>
</md-card-title>

<div class="portlet-container"
ng-repeat="portlet in portlets | filter:searchTermFilter | showApplicable:showAll | showCategory:categoryToShow | orderBy:sortParameter | limitTo:searchResultLimit"
ng-repeat="portlet in portlets | filter:searchTermFilter | showApplicable:showAll | orderBy:sortParameter | limitTo:searchResultLimit"
ng-class="{portlet_hover: hover}"
ng-mouseenter="hover = true"
ng-mouseleave="hover = false"
Expand All @@ -79,9 +61,9 @@ <h1 class="md-display-1">
</div>

<marketplace-load-more
ng-show="portlets.length > 0 && (portlets | filter:searchTermFilter | showApplicable:showAll | showCategory:categoryToShow).length > searchResultLimit"></marketplace-load-more>
ng-show="portlets.length > 0 && (portlets | filter:searchTermFilter | showApplicable:showAll ).length > searchResultLimit"></marketplace-load-more>
<marketplace-no-results
ng-show="portlets.length > 0 && (portlets | filter:searchTermFilter | showApplicable:showAll | showCategory:categoryToShow).length == 0"></marketplace-no-results>
ng-show="portlets.length > 0 && (portlets | filter:searchTermFilter | showApplicable:showAll ).length == 0"></marketplace-no-results>
</md-card>
</div>
</frame-page>

0 comments on commit 5c7dd04

Please sign in to comment.