1
0
Fork 0
forked from lthn/blockchain

update contract state interval

This commit is contained in:
wildkif 2019-04-24 16:31:52 +03:00
parent 43c137edd2
commit 3b975c7ce3
5 changed files with 15 additions and 18 deletions

View file

@ -1174,12 +1174,12 @@ var ContractStatusMessagesPipe = /** @class */ (function () {
}
return state.part1 + (state.part2.length ? '. ' + state.part2 : '');
};
ContractStatusMessagesPipe.prototype.transform = function (item, args) {
if (item.is_a) {
return this.getStateBuyer(item.state);
ContractStatusMessagesPipe.prototype.transform = function (state, is_a) {
if (is_a) {
return this.getStateBuyer(state);
}
else {
return this.getStateSeller(item.state);
return this.getStateSeller(state);
}
};
ContractStatusMessagesPipe = __decorate([
@ -3754,7 +3754,7 @@ var AssignAliasComponent = /** @class */ (function () {
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div class=\"empty-contracts\" *ngIf=\"!variablesService.currentWallet.contracts.length\">\r\n <span>{{ 'CONTRACTS.EMPTY' | translate }}</span>\r\n</div>\r\n\r\n<div class=\"wrap-table scrolled-content\" *ngIf=\"variablesService.currentWallet.contracts.length\">\r\n\r\n <table class=\"contracts-table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'CONTRACTS.CONTRACTS' | translate }}</th>\r\n <th>{{ 'CONTRACTS.DATE' | translate }}</th>\r\n <th>{{ 'CONTRACTS.AMOUNT' | translate }}</th>\r\n <th>{{ 'CONTRACTS.STATUS' | translate }}</th>\r\n <th>{{ 'CONTRACTS.COMMENTS' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of variablesService.currentWallet.contracts\" [routerLink]=\"'/wallet/' + walletId + '/purchase/' + item.contract_id\">\r\n <td>\r\n <div class=\"contract\">\r\n <i class=\"icon alert\" *ngIf=\"!item.is_new\"></i>\r\n <i class=\"icon new\" *ngIf=\"item.is_new\"></i>\r\n <i class=\"icon\" [class.purchase]=\"item.is_a\" [class.sell]=\"!item.is_a\"></i>\r\n <span tooltip=\"{{ item.private_detailes.t }}\" placement=\"top-left\" tooltipClass=\"table-tooltip\" [delay]=\"500\" [showWhenNoOverflow]=\"false\">{{item.private_detailes.t}}</span>\r\n </div>\r\n </td>\r\n <td>\r\n <div>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</div>\r\n </td>\r\n <td>\r\n <div>{{item.private_detailes.to_pay | intToMoney}} {{variablesService.defaultCurrency}}</div>\r\n </td>\r\n <td>\r\n <div class=\"status\" [class.error-text]=\"item.state === 4\" tooltip=\"{{ item | contractStatusMessages }}\" placement=\"top\" tooltipClass=\"table-tooltip\" [delay]=\"500\">\r\n {{item | contractStatusMessages}}\r\n </div>\r\n </td>\r\n <td>\r\n <div class=\"comment\" tooltip=\"{{ item.private_detailes.c }}\" placement=\"top-right\" tooltipClass=\"table-tooltip\" [delay]=\"500\">\r\n {{item.private_detailes.c}}\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n</div>\r\n\r\n<div class=\"contracts-buttons\">\r\n <button type=\"button\" class=\"blue-button\" [routerLink]=\"'/wallet/' + walletId + '/purchase'\">{{ 'CONTRACTS.PURCHASE_BUTTON' | translate }}</button>\r\n <button type=\"button\" class=\"blue-button\" disabled>{{ 'CONTRACTS.LISTING_BUTTON' | translate }}</button>\r\n</div>\r\n"
module.exports = "<div class=\"empty-contracts\" *ngIf=\"!variablesService.currentWallet.contracts.length\">\r\n <span>{{ 'CONTRACTS.EMPTY' | translate }}</span>\r\n</div>\r\n\r\n<div class=\"wrap-table scrolled-content\" *ngIf=\"variablesService.currentWallet.contracts.length\">\r\n\r\n <table class=\"contracts-table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'CONTRACTS.CONTRACTS' | translate }}</th>\r\n <th>{{ 'CONTRACTS.DATE' | translate }}</th>\r\n <th>{{ 'CONTRACTS.AMOUNT' | translate }}</th>\r\n <th>{{ 'CONTRACTS.STATUS' | translate }}</th>\r\n <th>{{ 'CONTRACTS.COMMENTS' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of variablesService.currentWallet.contracts\" [routerLink]=\"'/wallet/' + walletId + '/purchase/' + item.contract_id\">\r\n <td>\r\n <div class=\"contract\">\r\n <i class=\"icon alert\" *ngIf=\"!item.is_new\"></i>\r\n <i class=\"icon new\" *ngIf=\"item.is_new\"></i>\r\n <i class=\"icon\" [class.purchase]=\"item.is_a\" [class.sell]=\"!item.is_a\"></i>\r\n <span tooltip=\"{{ item.private_detailes.t }}\" placement=\"top-left\" tooltipClass=\"table-tooltip\" [delay]=\"500\" [showWhenNoOverflow]=\"false\">{{item.private_detailes.t}}</span>\r\n </div>\r\n </td>\r\n <td>\r\n <div>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</div>\r\n </td>\r\n <td>\r\n <div>{{item.private_detailes.to_pay | intToMoney}} {{variablesService.defaultCurrency}}</div>\r\n </td>\r\n <td>\r\n <div class=\"status\" [class.error-text]=\"item.state === 4\" tooltip=\"{{item.state | contractStatusMessages : item.is_a}}\" placement=\"top\" tooltipClass=\"table-tooltip\" [delay]=\"500\">\r\n {{item.state | contractStatusMessages : item.is_a}}\r\n </div>\r\n </td>\r\n <td>\r\n <div class=\"comment\" tooltip=\"{{ item.private_detailes.c }}\" placement=\"top-right\" tooltipClass=\"table-tooltip\" [delay]=\"500\">\r\n {{item.private_detailes.c}}\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n</div>\r\n\r\n<div class=\"contracts-buttons\">\r\n <button type=\"button\" class=\"blue-button\" [routerLink]=\"'/wallet/' + walletId + '/purchase'\">{{ 'CONTRACTS.PURCHASE_BUTTON' | translate }}</button>\r\n <button type=\"button\" class=\"blue-button\" disabled>{{ 'CONTRACTS.LISTING_BUTTON' | translate }}</button>\r\n</div>\r\n"
/***/ }),
@ -3795,9 +3795,8 @@ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
var ContractsComponent = /** @class */ (function () {
function ContractsComponent(route, router, variablesService) {
function ContractsComponent(route, variablesService) {
this.route = route;
this.router = router;
this.variablesService = variablesService;
}
ContractsComponent.prototype.ngOnInit = function () {
@ -3818,7 +3817,6 @@ var ContractsComponent = /** @class */ (function () {
styles: [__webpack_require__(/*! ./contracts.component.scss */ "./src/app/contracts/contracts.component.scss")]
}),
__metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
_helpers_services_variables_service__WEBPACK_IMPORTED_MODULE_2__["VariablesService"]])
], ContractsComponent);
return ContractsComponent;

File diff suppressed because one or more lines are too long

View file

@ -104,11 +104,11 @@ export class ContractStatusMessagesPipe implements PipeTransform {
return state.part1 + (state.part2.length ? '. ' + state.part2 : '');
}
transform(item: any, args?: any): any {
if (item.is_a) {
return this.getStateBuyer(item.state);
transform(state: number, is_a?: boolean): any {
if (is_a) {
return this.getStateBuyer(state);
} else {
return this.getStateSeller(item.state);
return this.getStateSeller(state);
}
}

View file

@ -31,8 +31,8 @@
<div>{{item.private_detailes.to_pay | intToMoney}} {{variablesService.defaultCurrency}}</div>
</td>
<td>
<div class="status" [class.error-text]="item.state === 4" tooltip="{{ item | contractStatusMessages }}" placement="top" tooltipClass="table-tooltip" [delay]="500">
{{item | contractStatusMessages}}
<div class="status" [class.error-text]="item.state === 4" tooltip="{{item.state | contractStatusMessages : item.is_a}}" placement="top" tooltipClass="table-tooltip" [delay]="500">
{{item.state | contractStatusMessages : item.is_a}}
</div>
</td>
<td>

View file

@ -1,5 +1,5 @@
import {Component, OnInit, OnDestroy} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute} from '@angular/router';
import {VariablesService} from '../_helpers/services/variables.service';
@Component({
@ -14,8 +14,7 @@ export class ContractsComponent implements OnInit, OnDestroy {
constructor(
private route: ActivatedRoute,
private router: Router,
private variablesService: VariablesService
public variablesService: VariablesService
) {
}