Skip to content

Commit

Permalink
#23 Replace pool operations by operations-table
Browse files Browse the repository at this point in the history
  • Loading branch information
ihorml committed Nov 9, 2022
1 parent f093d98 commit 93f5399
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 69 deletions.
38 changes: 11 additions & 27 deletions app/sections/pools/pool.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,34 +153,18 @@
</div>
</div>
</div>
<h2><span data-translate="Liquidity Pools"></span></h2>
<div class="panel-body table-responsive">
<responsive-table data-data="operations"
data-columns="operationsColumns"
data-loading="operationsLoading"
data-template="operations-table.html"
data-loading-error="operationsLoadingError"
></responsive-table>
<div class="panel panel-default">
<div class="panel-heading">
<span data-translate="Last operations"></span>
<img src="images/filter.svg" ng-click="showFilters = !showFilters" class="operations-filter"/>
</div>

<footer class="table-footer">
<div class="row">
<div class="col-md-6 page-num-info">
</div>
<div class="col-md-6 text-right pagination-container">
<ul
uib-pagination class="pagination-sm"
ng-model="currentPage"
total-items="total_ops"
max-size="4"
ng-change="currentPage===undefined || select(currentPage)"
items-per-page="20"
rotate="false"
previous-text="&lsaquo;" next-text="&rsaquo;"
boundary-links="true"
></ul>
</div>
</div>
</footer>
<loading ng-if="!pool.id"></loading>
<operations-table ng-if="pool.id" group-by-pool-id="pool.id"
filter-by-asset-id-enabled="false"
filter-by-operation-type-enabled="false"
show-filters="showFilters"
/>
</div>
</div>
</div>
42 changes: 0 additions & 42 deletions app/sections/pools/pools.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,48 +108,6 @@
}
};

$scope.operationsColumns = [
{
title: $filter('translate')('Operation'),
index: 'operation_text',
},
{
title: $filter('translate')('ID'),
index: 'operation_id'
},
{
title: $filter('translate')('Date and time'),
index: 'time',
hidden: ['xs']
},
{
title: $filter('translate')('Block'),
index: 'block_num',
hidden: ['xs', 'sm']
},
{
title: $filter('translate')('Type'),
index: 'type',
hidden: ['xs', 'sm', 'md']
}
];
$scope.select = function(page_operations) {
const page = page_operations - 1;
const limit = 20;
const from = page * limit;

$scope.operationsLoading = true;
$scope.operationsLoadingError = false;
marketService.getLiquidityPoolHistory(name, limit, from, function (returnData) {
$scope.operationsLoading = false;
$scope.operations = returnData;
$scope.currentPage = page_operations;
}).catch(err => {
$scope.operationsLoadingError = true;
throw err;
});
}
$scope.select(1);
}
}
else {
Expand Down

0 comments on commit 93f5399

Please sign in to comment.