Skip to content

Commit

Permalink
Merge pull request #1307 from Ride-The-Lightning/ux-link-fixes
Browse files Browse the repository at this point in the history
Bug fix: Manage button link filter #1294 and Page Settings Error
  • Loading branch information
ShahanaFarooqui authored Oct 6, 2023
2 parents ed5a493 + 14fd866 commit 36c5895
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 21 deletions.
1 change: 0 additions & 1 deletion backend/controllers/cln/getInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const getInfo = (req, res, next) => {
req.session.selectedNode.ln_version = body.version || '';
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Connecting to the Core Lightning\'s Websocket Server.' });
clWsClient.updateSelectedNode(req.session.selectedNode);
databaseService.loadDatabase(req.session);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Node Information Received', data: body });
return res.status(200).json(body);
}
Expand Down
1 change: 0 additions & 1 deletion backend/controllers/eclair/getInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const getInfo = (req, res, next) => {
body.lnImplementation = 'Eclair';
req.session.selectedNode.ln_version = body.version.split('-')[0] || '';
eclWsClient.updateSelectedNode(req.session.selectedNode);
databaseService.loadDatabase(req.session);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Node Information Received', data: body });
return res.status(200).json(body);
}).catch((errRes) => {
Expand Down
1 change: 0 additions & 1 deletion backend/controllers/lnd/getInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const getInfo = (req, res, next) => {
else {
req.session.selectedNode.ln_version = body.version.split('-')[0] || '';
lndWsClient.updateSelectedNode(req.session.selectedNode);
databaseService.loadDatabase(req.session);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Node Information Received', data: body });
return res.status(200).json(body);
}
Expand Down
5 changes: 4 additions & 1 deletion backend/controllers/shared/RTLConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ export const updateSelectedNode = (req, res, next) => {
req.session.selectedNode = common.findNode(selNodeIndex);
if (req.headers && req.headers.authorization && req.headers.authorization !== '') {
wsServer.updateLNWSClientDetails(req.session.id, +req.session.selectedNode.index, +req.params.prevNodeIndex);
if (req.params.prevNodeIndex !== -1) {
if (req.params.prevNodeIndex !== '-1') {
databaseService.unloadDatabase(req.params.prevNodeIndex, req.session.id);
}
if (req.params.currNodeIndex !== '-1') {
databaseService.loadDatabase(req.session);
}
}
const responseVal = !req.session.selectedNode.ln_node ? '' : req.session.selectedNode.ln_node;
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'RTLConf', msg: 'Selected Node Updated To ' + responseVal });
Expand Down
4 changes: 4 additions & 0 deletions backend/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ export class CommonService {
errRes.error = errRes.error.stack || errRes.error.message;
err = JSON.parse(JSON.stringify(errRes));
}
else if (errRes.message || errRes.stack) {
errRes.error = errRes.message || errRes.stack;
err = JSON.parse(JSON.stringify(errRes));
}
if (!selectedNode) {
selectedNode = this.initSelectedNode;
}
Expand Down
1 change: 0 additions & 1 deletion frontend/167.08268ac8336448ff.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/167.acf2d2ce9b04eed9.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/315.053626e02bd2bc27.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/315.25112d0bface4bf2.js

This file was deleted.

1 change: 1 addition & 0 deletions frontend/636.129e4ce0e36899dd.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/636.c605e62991998b93.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:95%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.a129e1d501647e70.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.a129e1d501647e70.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.ac7ad551891b54ee.js" type="module"></script><script src="polyfills.aa01d8f6b94657cb.js" type="module"></script><script src="main.31a5aa400eae5089.js" type="module"></script>
<script src="runtime.8ac2d4b251d26e03.js" type="module"></script><script src="polyfills.aa01d8f6b94657cb.js" type="module"></script><script src="main.31a5aa400eae5089.js" type="module"></script>

</body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion server/controllers/cln/getInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const getInfo = (req, res, next) => {
req.session.selectedNode.ln_version = body.version || '';
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Connecting to the Core Lightning\'s Websocket Server.' });
clWsClient.updateSelectedNode(req.session.selectedNode);
databaseService.loadDatabase(req.session);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Node Information Received', data: body });
return res.status(200).json(body);
}
Expand Down
1 change: 0 additions & 1 deletion server/controllers/eclair/getInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const getInfo = (req, res, next) => {
body.lnImplementation = 'Eclair';
req.session.selectedNode.ln_version = body.version.split('-')[0] || '';
eclWsClient.updateSelectedNode(req.session.selectedNode);
databaseService.loadDatabase(req.session);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Node Information Received', data: body });
return res.status(200).json(body);
}).catch((errRes) => {
Expand Down
1 change: 0 additions & 1 deletion server/controllers/lnd/getInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const getInfo = (req, res, next) => {
} else {
req.session.selectedNode.ln_version = body.version.split('-')[0] || '';
lndWsClient.updateSelectedNode(req.session.selectedNode);
databaseService.loadDatabase(req.session);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Node Information Received', data: body });
return res.status(200).json(body);
}
Expand Down
5 changes: 4 additions & 1 deletion server/controllers/shared/RTLConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ export const updateSelectedNode = (req, res, next) => {
req.session.selectedNode = common.findNode(selNodeIndex);
if (req.headers && req.headers.authorization && req.headers.authorization !== '') {
wsServer.updateLNWSClientDetails(req.session.id, +req.session.selectedNode.index, +req.params.prevNodeIndex);
if (req.params.prevNodeIndex !== -1) {
if (req.params.prevNodeIndex !== '-1') {
databaseService.unloadDatabase(req.params.prevNodeIndex, req.session.id);
}
if (req.params.currNodeIndex !== '-1') {
databaseService.loadDatabase(req.session);
}
}
const responseVal = !req.session.selectedNode.ln_node ? '' : req.session.selectedNode.ln_node;
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'RTLConf', msg: 'Selected Node Updated To ' + responseVal });
Expand Down
3 changes: 3 additions & 0 deletions server/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ export class CommonService {
if (err && err.error && Object.keys(err.error).length === 0 && errRes.error && (errRes.error.stack || errRes.error.message)) {
errRes.error = errRes.error.stack || errRes.error.message;
err = JSON.parse(JSON.stringify(errRes));
} else if (errRes.message || errRes.stack) {
errRes.error = errRes.message || errRes.stack;
err = JSON.parse(JSON.stringify(errRes));
}
if (!selectedNode) { selectedNode = this.initSelectedNode; }
switch (selectedNode.ln_implementation) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/cln/graph/lookups/lookups.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CLNLookupsComponent implements OnInit, OnDestroy {
}

ngOnInit() {
if (window.history.state && window.history.state.lookupType) {
if (window.history.state && (window.history.state.lookupType || window.history.state.lookupValue)) {
this.selectedFieldId = +window.history.state.lookupType || 0;
this.lookupKey = window.history.state.lookupValue || '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { getNewAddress } from '../../store/cln.actions';
export class CLNOnChainReceiveComponent {

public addressTypes = ADDRESS_TYPES;
public selectedAddressType = ADDRESS_TYPES[0];
public selectedAddressType = ADDRESS_TYPES[2];
public newAddress = '';

constructor(private store: Store<RTLState>, private clnEffects: CLNEffects) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
}

ngOnInit() {
if (window.history.state && window.history.state.filterColumn) {
if (window.history.state && (window.history.state.filterColumn || window.history.state.filterValue)) {
this.selFilterBy = window.history.state.filterColumn || 'all';
this.selFilter = window.history.state.filterValue || '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/eclair/graph/lookups/lookups.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ECLLookupsComponent implements OnInit, OnDestroy {
}

ngOnInit() {
if (window.history.state && window.history.state.lookupType) {
if (window.history.state && (window.history.state.lookupType || window.history.state.lookupValue)) {
this.selectedFieldId = +window.history.state.lookupType || 0;
this.lookupKeyCtrl.setValue(window.history.state.lookupValue || '');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
}

ngOnInit() {
if (window.history.state && window.history.state.filterColumn) {
if (window.history.state && (window.history.state.filterColumn || window.history.state.filterValue)) {
this.selFilterBy = window.history.state.filterColumn || 'all';
this.selFilter = window.history.state.filterValue || '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/lnd/graph/lookups/lookups.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class LookupsComponent implements OnInit, OnDestroy {
}

ngOnInit() {
if (window.history.state && window.history.state.lookupType) {
if (window.history.state && (window.history.state.lookupType || window.history.state.lookupValue)) {
this.selectedFieldId = +window.history.state.lookupType || 0;
this.lookupKey = window.history.state.lookupValue || '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr
}

ngOnInit() {
if (window.history.state && window.history.state.filterColumn) {
if (window.history.state && (window.history.state.filterColumn || window.history.state.filterValue)) {
this.selFilterBy = window.history.state.filterColumn || 'all';
this.selFilter = window.history.state.filterValue || '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
}

onManagePeer(selNonRoutingChannel: Channel) {
this.router.navigate(['../../', 'connections', 'channels', 'open'], { relativeTo: this.activatedRoute, state: { filter: selNonRoutingChannel.chan_id } });
this.router.navigate(['../../', 'connections', 'channels', 'open'], { relativeTo: this.activatedRoute, state: { filterValue: selNonRoutingChannel.chan_id } });
}

// groupRoutingPeers(forwardingEvents: ForwardingEvent[]) {
Expand Down

0 comments on commit 36c5895

Please sign in to comment.