Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests sorting #525

Merged
merged 18 commits into from
Aug 6, 2020
Prev Previous commit
Next Next commit
Refactoring
  • Loading branch information
wojciech.blachowski committed Sep 24, 2019
commit 0c73ec08d1aee0ecc21ff833b68615d7406c4b76
14 changes: 7 additions & 7 deletions report/src/main/webapp/app/layout/sidepanel/sidepanel.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<div style="position: relative; width: calc(100% - 26px - 8px);float:left;" data-aet-sidepanel-order data-toggle="popover">
<div class="filter-list">
<div>
<p ng-bind="$root.orderLabel"></p>
<p data-ng-bind="$root.orderLabel"></p>
<div class="fontawesome">
<i class="fas fa-angle-down fa-lg"></i>
</div>
Expand All @@ -119,13 +119,13 @@
</div>
</div>
<div style="width:26px; height:12px; color:white;float:right;">
<div class="fontawesome" style="position:static;cursor: pointer" ng-click="changeSortingOrder()">
<div ng-if="$root.isReverse">
<i class="fas fa-lg fa-sort-amount-down"></i>
</div>
<div ng-if="!$root.isReverse">
<div class="fontawesome" style="position:static;cursor: pointer" data-ng-click="changeSortingOrder()">
<div data-ng-if="$root.orderIsReverse">
<i class="fas fa-lg fa-sort-amount-up"></i>
</div>
<div data-ng-if="!$root.orderIsReverse">
<i class="fas fa-lg fa-sort-amount-down"></i>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -159,7 +159,7 @@
</div>

<div class="aside-report-container" ng-class="sidepanel.thereAreChangesToSave() ? 'aside-report-container_short' : ''">
<div ng-repeat="test in sidepanel.tests | orderBy:$root.order:$root.isReverse"
<div ng-repeat="test in sidepanel.tests | orderBy:$root.orderAttribute:$root.orderIsReverse"
class="aside-report {{filteredUrls.length > 0 ? 'is-visible' : 'is-hidden'}}">
<a ui-sref="test({'suite':$root.params.project, 'test':test.name})" ui-sref-active="is-active"
class="test-name {{filteredUrls.length > 0 ? 'is-visible' : 'is-hidden'}}" aet-toggle-link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ define(['angularAMD'], function (angularAMD) {

function updateOrdering(orderingAttribute, labelText){
$timeout(function() {
$rootScope.order = orderingAttribute;
$rootScope.isReverse = false;
$rootScope.orderAttribute = orderingAttribute;
$rootScope.orderLabel = labelText;
});
}

function changeSortingOrder(event) {
function changeSortingOrder() {
$timeout(function() {
$rootScope.isReverse = !$rootScope.isReverse;
$rootScope.orderIsReverse = !$rootScope.orderIsReverse;
});
}
}
Expand Down