Skip to content

Commit

Permalink
Newly added Invoice/payment/peers will be on top, merged channel dash…
Browse files Browse the repository at this point in the history
…board with home, Added accordion for pending channels, Removed stickiness from topbar, changed modal buttons text, other minor UX updates
  • Loading branch information
ShahanaFarooqui committed Feb 4, 2019
1 parent 43ef011 commit 55f66dd
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 28 deletions.
4 changes: 2 additions & 2 deletions angular/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,12 @@ MIT

@angular/material/select

@angular/material/expansion

@angular/material/tree

@angular/material/radio

@angular/material/expansion

@angular/material/sidenav

@angular/material/toolbar
Expand Down
4 changes: 2 additions & 2 deletions angular/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<title>RTL</title>
<base href="/rtl/"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
<link rel="stylesheet" href="styles.9aca8d6b42ca1c4e593e.css"></head>
<link rel="stylesheet" href="styles.5e0b52f71274005aea8e.css"></head>
<body>
<rtl-app></rtl-app>
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.418928a701f2040ada02.js"></script><script type="text/javascript" src="main.805afbeaa1a119f3f6be.js"></script></body>
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.418928a701f2040ada02.js"></script><script type="text/javascript" src="main.a260eb3ea37c9cf9911a.js"></script></body>
</html>
1 change: 0 additions & 1 deletion angular/main.805afbeaa1a119f3f6be.js

This file was deleted.

1 change: 1 addition & 0 deletions angular/main.a260eb3ea37c9cf9911a.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions angular/styles.5e0b52f71274005aea8e.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion angular/styles.9aca8d6b42ca1c4e593e.css

This file was deleted.

9 changes: 9 additions & 0 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@ common.sortDescByKey = (array, key) => {
});
}

common.newestOnTop = (array, key, value) => {
var index = array.findIndex(function(item){
return item[key] === value
});
var newlyAddedRecord = array.splice(index, 1);
array.unshift(newlyAddedRecord[0]);
return array;
}

module.exports = common;
2 changes: 1 addition & 1 deletion connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var validateConfigFile = (macaroonPath, config) => {
common.enable_logging = config.Authentication.enableLogging;
let exists = fs.existsSync(log_file_path);
if(exists) {
fs.writeFile(log_file_path, '');
fs.writeFile(log_file_path, '', () => {});
} else if (!exists && config.Authentication.enableLogging) {
try {
var createStream = fs.createWriteStream(log_file_path);
Expand Down
9 changes: 7 additions & 2 deletions controllers/peers.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ exports.postPeer = (req, res, next) => {
return getAliasForPeers(peer);
}))
.then(function(values) {
logger.info('\r\nPeers: 63: ' + JSON.stringify(Date.now()) + ': INFO: Peer Added Successfully');
logger.info('\r\nPeers: 64: ' + JSON.stringify(Date.now()) + ': INFO: Peer with Alias: ' + JSON.stringify(body));
if (undefined !== body.peers) {
body.peers = common.sortDescByKey(body.peers, 'alias');
logger.info('\r\nPeers: 69: ' + JSON.stringify(Date.now()) + ': INFO: Peer with Alias: ' + JSON.stringify(body));
body.peers = common.newestOnTop(body.peers, 'pub_key', req.body.pubkey);
logger.info('\r\nPeers: 71: ' + JSON.stringify(Date.now()) + ': INFO: Peer with Newest On Top: ' + JSON.stringify(body));
}
logger.info('\r\nPeers: 73: ' + JSON.stringify(Date.now()) + ': INFO: Peer Added Successfully');
res.status(201).json(body.peers);
})
.catch((err) => {
Expand Down
23 changes: 6 additions & 17 deletions controllers/wallet.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
var request = require('request-promise');
var request = require('request');
var options = require("../connect");
var common = require('../common');
var logger = require('./logger');

exports.operateWallet = (req, res, next) => {
var requestBody = {
var requestBody = {
wallet_password: Buffer.from(req.body.wallet_password).toString('base64')
};
if (undefined === req.params.operation || req.params.operation === 'unlock') {
options.url = common.lnd_server_url + '/unlockwallet';
options.form = JSON.stringify(requestBody);
err_message = 'Unlocking wallet failed! Verify that lnd is running!';
err_message = 'Unlocking wallet failed! Verify that lnd is running and the wallet is locked!';
} else {
options.url = common.lnd_server_url + '/initwallet';
options.form = JSON.stringify(requestBody);
err_message = 'Initializing wallet failed!';
}
options.qs = req.query;
request.post(options).then((body) => {
request.post(options, (error, response, body) => {
logger.info('\r\nWallet: 20: ' + JSON.stringify(Date.now()) + ': INFO: Unlock Wallet Response: ' + JSON.stringify(body));
const body_str = (undefined === body) ? '' : JSON.stringify(body);
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
if(undefined === body) {
res.status(500).json({
message: err_message,
error: 'Unlocking wallet failed! Verify that lnd is running!'
error: err_message
});
} else if(search_idx > -1) {
res.status(500).json({
message: err_message,
error: 'Unlocking wallet failed! Verify that lnd is running!'
error: err_message
});
} else if(body.error) {
if((body.code === 1 && body.error === 'context canceled') || (body.code === 14 && body.error === 'transport is closing')) {
Expand All @@ -43,15 +42,5 @@ exports.operateWallet = (req, res, next) => {
} else {
res.status(201).json({wallet: 'successful'});
}
})
.catch(function (err) {
if((err.error.code === 1 && err.error.error === 'context canceled') || (err.error.code === 14 && err.error.error === 'transport is closing')) {
res.status(201).json({wallet: 'successful'});
} else {
res.status(500).json({
message: err_message,
error: err.error.error
});
}
});
};
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.1.13-alpha",
"version": "0.1.14-alpha",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down

0 comments on commit 55f66dd

Please sign in to comment.