Load Table after dispalyed columns calculated

pull/1127/head
ShahanaFarooqui 2 years ago
parent dcf29c5e96
commit 0ce5107e86

@ -81,7 +81,7 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.utxos = (this.isDustUTXO) ? utxosSeletor.utxos?.filter((utxo) => +(utxo.value || 0) < 1000) : utxosSeletor.utxos ? utxosSeletor.utxos : [];
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator) {
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadUTXOsTable(this.utxos);
}
this.logger.info(utxosSeletor);
@ -89,7 +89,7 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
}
ngAfterViewInit() {
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator) {
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadUTXOsTable(this.utxos);
}
}

@ -84,7 +84,7 @@ export class CLNFailedTransactionsComponent implements OnInit, AfterViewInit, On
}
this.totalFailedTransactions = ffhSeletor.failedForwardingHistory.totalForwards || 0;
this.failedEvents = ffhSeletor.failedForwardingHistory.listForwards || [];
if (this.failedEvents.length > 0 && this.sort && this.paginator) {
if (this.failedEvents.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadFailedEventsTable(this.failedEvents);
}
this.logger.info(ffhSeletor);

@ -90,7 +90,7 @@ export class CLNForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
if (this.eventsData.length <= 0 && fhSeletor.forwardingHistory.listForwards) {
this.totalForwardedTransactions = fhSeletor.forwardingHistory.totalForwards || 0;
this.successfulEvents = fhSeletor.forwardingHistory.listForwards || [];
if (this.successfulEvents.length > 0 && this.sort && this.paginator) {
if (this.successfulEvents.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadForwardingEventsTable(this.successfulEvents);
}
this.logger.info(fhSeletor);

@ -85,7 +85,7 @@ export class CLNLocalFailedTransactionsComponent implements OnInit, AfterViewIni
}
this.totalLocalFailedTransactions = lffhSeletor.localFailedForwardingHistory.totalForwards || 0;
this.failedLocalEvents = lffhSeletor.localFailedForwardingHistory.listForwards || [];
if (this.failedLocalEvents.length > 0 && this.sort && this.paginator) {
if (this.failedLocalEvents.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadLocalfailedLocalEventsTable(this.failedLocalEvents);
}
this.logger.info(lffhSeletor);

@ -103,7 +103,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.invoiceJSONArr = invoicesSeletor.listInvoices.invoices || [];
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator) {
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadInvoicesTable(this.invoiceJSONArr);
}
this.logger.info(invoicesSeletor);
@ -120,7 +120,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
}
ngAfterViewInit() {
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator) {
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadInvoicesTable(this.invoiceJSONArr);
}
}

@ -80,7 +80,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.offersBookmarksJSONArr = offerBMsSeletor.offersBookmarks || [];
if (this.offersBookmarksJSONArr && this.offersBookmarksJSONArr.length > 0 && this.sort && this.paginator) {
if (this.offersBookmarksJSONArr && this.offersBookmarksJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadOffersTable(this.offersBookmarksJSONArr);
}
this.logger.info(offerBMsSeletor);
@ -88,7 +88,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O
}
ngAfterViewInit() {
if (this.offersBookmarksJSONArr && this.offersBookmarksJSONArr.length > 0 && this.sort && this.paginator) {
if (this.offersBookmarksJSONArr && this.offersBookmarksJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadOffersTable(this.offersBookmarksJSONArr);
}
}

@ -105,7 +105,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.offerJSONArr = offersSeletor.offers || [];
if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator) {
if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadOffersTable(this.offerJSONArr);
}
this.logger.info(offersSeletor);
@ -113,7 +113,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
}
ngAfterViewInit() {
if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator) {
if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadOffersTable(this.offerJSONArr);
}
}

@ -103,7 +103,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.paymentJSONArr = paymentsSeletor.payments || [];
if (this.paymentJSONArr.length && this.paymentJSONArr.length > 0 && this.sort && this.paginator) {
if (this.paymentJSONArr.length && this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadPaymentsTable(this.paymentJSONArr);
}
this.logger.info(paymentsSeletor);
@ -111,7 +111,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
}
ngAfterViewInit() {
if (this.paymentJSONArr.length && this.paymentJSONArr.length > 0 && this.sort && this.paginator) {
if (this.paymentJSONArr.length && this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadPaymentsTable(this.paymentJSONArr);
}
}

@ -88,7 +88,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.activeChannels = allChannelsSelector.activeChannels;
if (this.activeChannels.length > 0 && this.sort && this.paginator) {
if (this.activeChannels.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadChannelsTable();
}
this.logger.info(allChannelsSelector);
@ -108,7 +108,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
}
ngAfterViewInit() {
if (this.activeChannels.length > 0 && this.sort && this.paginator) {
if (this.activeChannels.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadChannelsTable();
}
}

@ -79,7 +79,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.eventsData = paymentsSelector.payments && paymentsSelector.payments.relayed ? paymentsSelector.payments.relayed : [];
if (this.eventsData.length > 0 && this.sort && this.paginator) {
if (this.eventsData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadForwardingEventsTable(this.eventsData);
}
this.logger.info(this.eventsData);

@ -102,7 +102,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.invoiceJSONArr = (invoicesSelector.invoices && invoicesSelector.invoices.length > 0) ? invoicesSelector.invoices : [];
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator) {
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadInvoicesTable(this.invoiceJSONArr);
}
this.logger.info(invoicesSelector);
@ -119,7 +119,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
}
ngAfterViewInit() {
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator) {
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadInvoicesTable(this.invoiceJSONArr);
}
}

@ -103,7 +103,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
}
this.paymentJSONArr = (paymentsSeletor.payments && paymentsSeletor.payments.sent && paymentsSeletor.payments.sent.length > 0) ? paymentsSeletor.payments.sent : [];
if (this.paymentJSONArr.length > 0 && this.sort && this.paginator) {
if (this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadPaymentsTable(this.paymentJSONArr);
}
this.logger.info(paymentsSeletor);

@ -80,7 +80,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
} else {
this.routingPeersData = [];
}
if (this.routingPeersData.length > 0 && this.sort && this.paginator) {
if (this.routingPeersData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadNonRoutingPeersTable(this.routingPeersData);
}
this.logger.info(fhSelector.apiCallStatus);

@ -110,7 +110,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
this.firstOffset = +(invoicesSelector.listInvoices.first_index_offset || -1);
this.lastOffset = +(invoicesSelector.listInvoices.last_index_offset || -1);
this.invoicesData = invoicesSelector.listInvoices.invoices || [];
if (this.invoicesData.length > 0 && this.sort && this.paginator) {
if (this.invoicesData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadInvoicesTable(this.invoicesData);
}
this.logger.info(invoicesSelector);

@ -109,7 +109,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
this.totalPayments = this.paymentJSONArr.length;
this.firstOffset = +(paymentsSelector.listPayments.first_index_offset || -1);
this.lastOffset = +(paymentsSelector.listPayments.last_index_offset || -1);
if (this.paymentJSONArr && this.paymentJSONArr.length > 0 && this.sort && this.paginator) {
if (this.paymentJSONArr && this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
// this.loadPaymentsTable(this.paymentJSONArr);
this.loadPaymentsTable(this.paymentJSONArr.slice(0, this.pageSize));
}

@ -60,7 +60,7 @@ export class BoltzSwapsComponent implements OnInit, AfterViewInit, OnChanges, On
this.tableSettingSwapOut = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSettingSwapOut.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSettingSwapOut.tableId)!;
this.tableSettingSwapIn = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSettingSwapIn.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSettingSwapIn.tableId)!;
this.setTableColumns();
if (this.swapsData && this.swapsData.length > 0 && this.sort && this.paginator) {
if (this.swapsData && this.swapsData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadSwapsTable(this.swapsData);
}
this.logger.info(this.displayedColumns);

@ -64,7 +64,7 @@ export class SwapsComponent implements OnInit, AfterViewInit, OnChanges, OnDestr
}
this.displayedColumns.push('actions');
this.pageSize = this.tableSetting.recordsPerPage ? +this.tableSetting.recordsPerPage : PAGE_SIZE;
if (this.swapsData && this.swapsData.length > 0 && this.sort && this.paginator) {
if (this.swapsData && this.swapsData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
this.loadSwapsTable(this.swapsData);
}
this.logger.info(this.displayedColumns);

Loading…
Cancel
Save