From 61d563e952e3cc61dfa5fe3614e16b5e3d868a30 Mon Sep 17 00:00:00 2001 From: Shahana Farooqui Date: Tue, 18 Apr 2023 15:16:57 -0700 Subject: [PATCH] Lint and test fixes --- .../lookups/node-lookup/node-lookup.component.spec.ts | 9 ++++++++- .../graph/lookups/node-lookup/node-lookup.component.ts | 2 +- .../lookups/node-lookup/node-lookup.component.spec.ts | 8 +++++++- .../graph/lookups/node-lookup/node-lookup.component.ts | 8 +++----- .../lookups/node-lookup/node-lookup.component.spec.ts | 10 +++++++++- .../graph/lookups/node-lookup/node-lookup.component.ts | 1 - src/app/shared/theme/styles/root.scss | 2 +- src/app/shared/theme/styles/theme-mode-dark.scss | 4 ++++ 8 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/app/cln/graph/lookups/node-lookup/node-lookup.component.spec.ts b/src/app/cln/graph/lookups/node-lookup/node-lookup.component.spec.ts index b04c95a9..5f4c701b 100644 --- a/src/app/cln/graph/lookups/node-lookup/node-lookup.component.spec.ts +++ b/src/app/cln/graph/lookups/node-lookup/node-lookup.component.spec.ts @@ -1,4 +1,10 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { StoreModule } from '@ngrx/store'; + +import { RootReducer } from '../../../../store/rtl.reducers'; +import { LNDReducer } from '../../../../lnd/store/lnd.reducers'; +import { CLNReducer } from '../../../../cln/store/cln.reducers'; +import { ECLReducer } from '../../../../eclair/store/ecl.reducers'; import { LoggerService } from '../../../../shared/services/logger.service'; import { SharedModule } from '../../../../shared/shared.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -14,7 +20,8 @@ describe('CLNNodeLookupComponent', () => { declarations: [CLNNodeLookupComponent], imports: [ SharedModule, - BrowserAnimationsModule + BrowserAnimationsModule, + StoreModule.forRoot({ root: RootReducer, lnd: LNDReducer, cln: CLNReducer, ecl: ECLReducer }) ], providers: [LoggerService] }). diff --git a/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts b/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts index d722fe37..0028d04c 100644 --- a/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts +++ b/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts @@ -56,7 +56,7 @@ export class CLNNodeLookupComponent implements OnInit, OnDestroy { this.store.dispatch(openAlert({ payload: { data: { - message: { peer: {id: this.lookupResult.nodeid + '@' + address.address + ':' + address.port}, information: this.information, balance: this.availableBalance }, + message: { peer: { id: this.lookupResult.nodeid + '@' + address.address + ':' + address.port }, information: this.information, balance: this.availableBalance }, component: CLNConnectPeerComponent } } diff --git a/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.spec.ts b/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.spec.ts index 0480f1b6..88b35f88 100644 --- a/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.spec.ts +++ b/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.spec.ts @@ -1,6 +1,11 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { StoreModule } from '@ngrx/store'; +import { RootReducer } from '../../../../store/rtl.reducers'; +import { LNDReducer } from '../../../../lnd/store/lnd.reducers'; +import { CLNReducer } from '../../../../cln/store/cln.reducers'; +import { ECLReducer } from '../../../../eclair/store/ecl.reducers'; import { LoggerService } from '../../../../shared/services/logger.service'; import { SharedModule } from '../../../../shared/shared.module'; @@ -15,7 +20,8 @@ describe('ECLNodeLookupComponent', () => { declarations: [ECLNodeLookupComponent], imports: [ BrowserAnimationsModule, - SharedModule + SharedModule, + StoreModule.forRoot({ root: RootReducer, lnd: LNDReducer, cln: CLNReducer, ecl: ECLReducer }) ], providers: [LoggerService] }). diff --git a/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.ts b/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.ts index e0aec631..7406267e 100644 --- a/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.ts +++ b/src/app/eclair/graph/lookups/node-lookup/node-lookup.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input, ViewChild } from '@angular/core'; +import { Component, OnInit, Input, ViewChild, OnDestroy } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { Store } from '@ngrx/store'; @@ -21,7 +21,7 @@ import { openAlert } from '../../../../store/rtl.actions'; templateUrl: './node-lookup.component.html', styleUrls: ['./node-lookup.component.scss'] }) -export class ECLNodeLookupComponent implements OnInit { +export class ECLNodeLookupComponent implements OnInit, OnDestroy { @ViewChild(MatSort, { static: false }) sort: MatSort | undefined; @Input() lookupResult: LookupNode = {}; @@ -47,7 +47,6 @@ export class ECLNodeLookupComponent implements OnInit { subscribe((oCBalanceSelector: { onchainBalance: OnChainBalance, apiCallStatus: ApiCallStatusPayload }) => { this.availableBalance = oCBalanceSelector.onchainBalance.total || 0; }); - } onConnectNode(address: string) { @@ -55,7 +54,7 @@ export class ECLNodeLookupComponent implements OnInit { payload: { data: { message: { - peer: this.lookupResult.nodeId ? {nodeId: this.lookupResult.nodeId, address: address } : null, + peer: this.lookupResult.nodeId ? { nodeId: this.lookupResult.nodeId, address: address } : null, information: this.information, balance: this.availableBalance }, @@ -63,7 +62,6 @@ export class ECLNodeLookupComponent implements OnInit { } } })); - } onCopyNodeURI(payload: string) { diff --git a/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.spec.ts b/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.spec.ts index c5ca815d..d78f6374 100644 --- a/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.spec.ts +++ b/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.spec.ts @@ -1,5 +1,10 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { StoreModule } from '@ngrx/store'; +import { RootReducer } from '../../../../store/rtl.reducers'; +import { LNDReducer } from '../../../../lnd/store/lnd.reducers'; +import { CLNReducer } from '../../../../cln/store/cln.reducers'; +import { ECLReducer } from '../../../../eclair/store/ecl.reducers'; import { LoggerService } from '../../../../shared/services/logger.service'; import { SharedModule } from '../../../../shared/shared.module'; @@ -12,7 +17,10 @@ describe('NodeLookupComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [NodeLookupComponent], - imports: [SharedModule], + imports: [ + SharedModule, + StoreModule.forRoot({ root: RootReducer, lnd: LNDReducer, cln: CLNReducer, ecl: ECLReducer }) + ], providers: [LoggerService] }). compileComponents(); diff --git a/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.ts b/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.ts index 49a7549d..ee49f74a 100644 --- a/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.ts +++ b/src/app/lnd/graph/lookups/node-lookup/node-lookup.component.ts @@ -43,7 +43,6 @@ export class NodeLookupComponent implements OnInit, OnDestroy { } onConnectNode(address: NodeAddress) { - console.warn(address.addr); this.store.dispatch(openAlert({ payload: { data: { diff --git a/src/app/shared/theme/styles/root.scss b/src/app/shared/theme/styles/root.scss index 4d599064..90a0fba7 100644 --- a/src/app/shared/theme/styles/root.scss +++ b/src/app/shared/theme/styles/root.scss @@ -1576,7 +1576,7 @@ mat-cell:last-of-type, .mdc-data-table__header-cell:last-of-type, mat-footer-cel .mat-mdc-tooltip-panel { & .mdc-tooltip__surface { - min-width: 15rem; + min-width: 10rem; max-width: unset; text-align: start; } diff --git a/src/app/shared/theme/styles/theme-mode-dark.scss b/src/app/shared/theme/styles/theme-mode-dark.scss index d6727053..96fcebc5 100644 --- a/src/app/shared/theme/styles/theme-mode-dark.scss +++ b/src/app/shared/theme/styles/theme-mode-dark.scss @@ -168,6 +168,10 @@ color: $foreground-base; background: $primary-color; } + a { + color: $primary-darker !important; + cursor: pointer; + } button.mdc-button.mat-mdc-button-base.mat-mdc-outlined-button{ border-color: $foreground-disabled; }