mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Revert "Parse TXID, hash or address strings from search bar and allow searching for TXID:OUTPUT. (#578)" (#610)
This reverts commit 2e2e6aa01f
.
This commit is contained in:
parent
2e2e6aa01f
commit
3ae3df6722
5 changed files with 15 additions and 25 deletions
|
@ -23,9 +23,9 @@ export class SearchFormComponent implements OnInit {
|
||||||
searchForm: FormGroup;
|
searchForm: FormGroup;
|
||||||
@Output() searchTriggered = new EventEmitter();
|
@Output() searchTriggered = new EventEmitter();
|
||||||
|
|
||||||
regexAddress = /([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[bB]?[a-z]{2,5}1[ac-hj-np-z02-9]{8,87})/;
|
regexAddress = /^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[bB]?[a-z]{2,5}1[ac-hj-np-z02-9]{8,87})$/;
|
||||||
regexBlockhash = /[0]{8}[a-fA-F0-9]{56}/;
|
regexBlockhash = /^[0]{8}[a-fA-F0-9]{56}$/;
|
||||||
regexTransaction = /([a-fA-F0-9]{64}):?(\d+)?/;
|
regexTransaction = /^[a-fA-F0-9]{64}$/;
|
||||||
regexBlockheight = /^[0-9]+$/;
|
regexBlockheight = /^[0-9]+$/;
|
||||||
|
|
||||||
@ViewChild('instance', {static: true}) instance: NgbTypeahead;
|
@ViewChild('instance', {static: true}) instance: NgbTypeahead;
|
||||||
|
@ -96,26 +96,21 @@ export class SearchFormComponent implements OnInit {
|
||||||
if (searchText) {
|
if (searchText) {
|
||||||
this.isSearching = true;
|
this.isSearching = true;
|
||||||
if (this.regexAddress.test(searchText)) {
|
if (this.regexAddress.test(searchText)) {
|
||||||
const matches = this.regexAddress.exec(searchText);
|
this.navigate('/address/', searchText);
|
||||||
this.navigate('/address/', matches[0]);
|
} else if (this.regexBlockhash.test(searchText) || this.regexBlockheight.test(searchText)) {
|
||||||
} else if (this.regexBlockhash.test(searchText)) {
|
|
||||||
const matches = this.regexBlockhash.exec(searchText);
|
|
||||||
this.navigate('/block/', matches[0]);
|
|
||||||
} else if (this.regexBlockheight.test(searchText)) {
|
|
||||||
this.navigate('/block/', searchText);
|
this.navigate('/block/', searchText);
|
||||||
} else if (this.regexTransaction.test(searchText)) {
|
} else if (this.regexTransaction.test(searchText)) {
|
||||||
const matches = this.regexTransaction.exec(searchText);
|
|
||||||
if (this.network === 'liquid') {
|
if (this.network === 'liquid') {
|
||||||
if (this.assets[matches[0]]) {
|
if (this.assets[searchText]) {
|
||||||
this.navigate('/asset/', matches[0]);
|
this.navigate('/asset/', searchText);
|
||||||
}
|
}
|
||||||
this.electrsApiService.getAsset$(matches[0])
|
this.electrsApiService.getAsset$(searchText)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
() => { this.navigate('/asset/', matches[0]); },
|
() => { this.navigate('/asset/', searchText); },
|
||||||
() => { this.navigate('/tx/', matches[0]); }
|
() => { this.navigate('/tx/', searchText); }
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.navigate('/tx/', matches[0]);
|
this.navigate('/tx/', searchText);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.isSearching = false;
|
this.isSearching = false;
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<app-transactions-list #txList [transactions]="[tx]" [outputIndex]="outputIndex" [transactionPage]="true"></app-transactions-list>
|
<app-transactions-list #txList [transactions]="[tx]" [transactionPage]="true"></app-transactions-list>
|
||||||
|
|
||||||
<h2 class="text-left" i18n="transaction.details">Details</h2>
|
<h2 class="text-left" i18n="transaction.details">Details</h2>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|
|
@ -20,7 +20,6 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||||
network = '';
|
network = '';
|
||||||
tx: Transaction;
|
tx: Transaction;
|
||||||
txId: string;
|
txId: string;
|
||||||
outputIndex: number;
|
|
||||||
txInBlockIndex: number;
|
txInBlockIndex: number;
|
||||||
isLoadingTx = true;
|
isLoadingTx = true;
|
||||||
error: any = undefined;
|
error: any = undefined;
|
||||||
|
@ -76,11 +75,9 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.subscription = this.route.paramMap.pipe(
|
this.subscription = this.route.paramMap.pipe(
|
||||||
switchMap((params: ParamMap) => {
|
switchMap((params: ParamMap) => {
|
||||||
this.resetTransaction();
|
this.txId = params.get('id') || '';
|
||||||
const urlMatch = (params.get('id') || '').split(':');
|
|
||||||
this.txId = urlMatch[0];
|
|
||||||
this.outputIndex = urlMatch[1] === undefined ? null : parseInt(urlMatch[1], 10);
|
|
||||||
this.seoService.setTitle($localize`:@@bisq.transaction.browser-title:Transaction: ${this.txId}:INTERPOLATION:`);
|
this.seoService.setTitle($localize`:@@bisq.transaction.browser-title:Transaction: ${this.txId}:INTERPOLATION:`);
|
||||||
|
this.resetTransaction();
|
||||||
return merge(
|
return merge(
|
||||||
of(true),
|
of(true),
|
||||||
this.stateService.connectionState$.pipe(
|
this.stateService.connectionState$.pipe(
|
||||||
|
@ -205,7 +202,6 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||||
resetTransaction() {
|
resetTransaction() {
|
||||||
this.error = undefined;
|
this.error = undefined;
|
||||||
this.tx = null;
|
this.tx = null;
|
||||||
this.outputIndex = null;
|
|
||||||
this.waitingForTransaction = false;
|
this.waitingForTransaction = false;
|
||||||
this.isLoadingTx = true;
|
this.isLoadingTx = true;
|
||||||
this.rbfTransaction = undefined;
|
this.rbfTransaction = undefined;
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
<table class="table table-borderless smaller-text table-xs" style="margin: 0;">
|
<table class="table table-borderless smaller-text table-xs" style="margin: 0;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<ng-template ngFor let-vout let-vindex="index" [ngForOf]="tx['@voutLimit'] ? tx.vout.slice(0, 10) : tx.vout" [ngForTrackBy]="trackByIndexFn">
|
<ng-template ngFor let-vout let-vindex="index" [ngForOf]="tx['@voutLimit'] ? tx.vout.slice(0, 10) : tx.vout" [ngForTrackBy]="trackByIndexFn">
|
||||||
<tr [ngClass]="{'highlightIndex': outputIndex === vindex}">
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a *ngIf="vout.scriptpubkey_address; else scriptpubkey_type" [routerLink]="['/address/' | relativeUrl, vout.scriptpubkey_address]" title="{{ vout.scriptpubkey_address }}">
|
<a *ngIf="vout.scriptpubkey_address; else scriptpubkey_type" [routerLink]="['/address/' | relativeUrl, vout.scriptpubkey_address]" title="{{ vout.scriptpubkey_address }}">
|
||||||
<span class="d-block d-lg-none">{{ vout.scriptpubkey_address | shortenString : 16 }}</span>
|
<span class="d-block d-lg-none">{{ vout.scriptpubkey_address | shortenString : 16 }}</span>
|
||||||
|
|
|
@ -19,7 +19,6 @@ export class TransactionsListComponent implements OnInit, OnChanges {
|
||||||
displayDetails = false;
|
displayDetails = false;
|
||||||
|
|
||||||
@Input() transactions: Transaction[];
|
@Input() transactions: Transaction[];
|
||||||
@Input() outputIndex: number;
|
|
||||||
@Input() showConfirmations = false;
|
@Input() showConfirmations = false;
|
||||||
@Input() transactionPage = false;
|
@Input() transactionPage = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue