Skip to content

Commit

Permalink
Merge pull request #87 from wealthica/PW-906-loading-status
Browse files Browse the repository at this point in the history
PW-906 loading status
  • Loading branch information
oleg-vysotsky authored Nov 14, 2024
2 parents 31d68ba + a432012 commit e27d3a6
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.0.23]

### Added
- `setLoadingStatus` method to set loading status, param string

## [0.0.22]

### Added
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ addon.saveData({ preferredCurrencies: ['CAD', 'USD', 'GBP', 'MXN'] }).then(funct
});
```

#### addon.setLoadingStatus(status)
This method sets the loading status, sets the status string - shows the loader, sets an empty string - hides the loader.

#### addon.printPage()

This method triggers `window.print()` from dashboard itself.
Expand Down
2 changes: 1 addition & 1 deletion dist/addon-container.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var AddonContainer = function (_EventEmitter) {
}
});

['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage'].forEach(function (event) {
['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage', 'setLoadingStatus'].forEach(function (event) {
_this.channel.bind(event, function (tx, data) {
var eventName = event;
var eventData = data;
Expand Down
4 changes: 2 additions & 2 deletions dist/addon-container.es5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/addon-container.es5.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/addon-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var AddonContainer = function (_EventEmitter) {
}
});

['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage'].forEach(function (event) {
['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage', 'setLoadingStatus'].forEach(function (event) {
_this.channel.bind(event, function (tx, data) {
var eventName = event;
var eventData = data;
Expand Down
4 changes: 2 additions & 2 deletions dist/addon-container.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/addon-container.min.js.map

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions dist/addon.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,30 @@ var Addon = function (_EventEmitter) {
});
}
}, {
key: 'printPage',
value: function printPage() {
key: 'setLoadingStatus',
value: function setLoadingStatus(status) {
var _this18 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this18.channel.call({
method: 'setLoadingStatus',
params: status,
success: function success() {
resolve();
},
error: function error(err) {
reject(err);
}
});
});
}
}, {
key: 'printPage',
value: function printPage() {
var _this19 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this19.channel.call({
method: 'printPage',
success: function success() {
resolve();
Expand Down
4 changes: 2 additions & 2 deletions dist/addon.es5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/addon.es5.min.js.map

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions dist/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,30 @@ var Addon = function (_EventEmitter) {
});
}
}, {
key: 'printPage',
value: function printPage() {
key: 'setLoadingStatus',
value: function setLoadingStatus(status) {
var _this18 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this18.channel.call({
method: 'setLoadingStatus',
params: status,
success: function success() {
resolve();
},
error: function error(err) {
reject(err);
}
});
});
}
}, {
key: 'printPage',
value: function printPage() {
var _this19 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this19.channel.call({
method: 'printPage',
success: function success() {
resolve();
Expand Down
4 changes: 2 additions & 2 deletions dist/addon.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/addon.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/addon-container.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var AddonContainer = function (_EventEmitter) {
}
});

['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage'].forEach(function (event) {
['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage', 'setLoadingStatus'].forEach(function (event) {
_this.channel.bind(event, function (tx, data) {
var eventName = event;
var eventData = data;
Expand Down
2 changes: 1 addition & 1 deletion lib/addon-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var AddonContainer = function (_EventEmitter) {
}
});

['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage'].forEach(function (event) {
['saveData', 'request', 'addTransaction', 'editTransaction', 'addInstitution', 'addInvestment', 'editInstitution', 'editAsset', 'editLiability', 'deleteInstitution', 'deleteAsset', 'deleteLiability', 'downloadDocument', 'upgradePremium', 'getSharings', 'switchUser', 'printPage', 'setLoadingStatus'].forEach(function (event) {
_this.channel.bind(event, function (tx, data) {
var eventName = event;
var eventData = data;
Expand Down
22 changes: 20 additions & 2 deletions lib/addon.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,30 @@ var Addon = function (_EventEmitter) {
});
}
}, {
key: 'printPage',
value: function printPage() {
key: 'setLoadingStatus',
value: function setLoadingStatus(status) {
var _this18 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this18.channel.call({
method: 'setLoadingStatus',
params: status,
success: function success() {
resolve();
},
error: function error(err) {
reject(err);
}
});
});
}
}, {
key: 'printPage',
value: function printPage() {
var _this19 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this19.channel.call({
method: 'printPage',
success: function success() {
resolve();
Expand Down
22 changes: 20 additions & 2 deletions lib/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,30 @@ var Addon = function (_EventEmitter) {
});
}
}, {
key: 'printPage',
value: function printPage() {
key: 'setLoadingStatus',
value: function setLoadingStatus(status) {
var _this18 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this18.channel.call({
method: 'setLoadingStatus',
params: status,
success: function success() {
resolve();
},
error: function error(err) {
reject(err);
}
});
});
}
}, {
key: 'printPage',
value: function printPage() {
var _this19 = this;

return new _es6Promise.Promise(function (resolve, reject) {
_this19.channel.call({
method: 'printPage',
success: function success() {
resolve();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wealthica/wealthica.js",
"version": "0.0.21",
"version": "0.0.23",
"description": "Official Wealthica Add-on Library",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/addon-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class AddonContainer extends EventEmitter {
'getSharings',
'switchUser',
'printPage',
'setLoadingStatus',
].forEach((event) => {
this.channel.bind(event, (tx, data) => {
const eventName = event;
Expand Down
11 changes: 11 additions & 0 deletions src/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@ class Addon extends EventEmitter {
});
}

setLoadingStatus(status) {
return new Promise((resolve, reject) => {
this.channel.call({
method: 'setLoadingStatus',
params: status,
success() { resolve(); },
error(err) { reject(err); },
});
});
}

printPage() {
return new Promise((resolve, reject) => {
this.channel.call({
Expand Down

0 comments on commit e27d3a6

Please sign in to comment.