Skip to content

Commit

Permalink
saving filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ignapas committed Dec 27, 2023
1 parent c0f259c commit e508d47
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ qx.Class.define("osparc.dashboard.Dashboard", {
this.__createMainViewLayout();

const myAccountWindow = osparc.desktop.credits.BillingCenterWindow.openWindow()

Check failure on line 66 in services/static-webserver/client/source/class/osparc/dashboard/Dashboard.js

View workflow job for this annotation

GitHub Actions / [unit] frontend (14, ubuntu-22.04, v0.10.4)

Missing semicolon
myAccountWindow.openWallets()
myAccountWindow.openTransactions()

Check failure on line 67 in services/static-webserver/client/source/class/osparc/dashboard/Dashboard.js

View workflow job for this annotation

GitHub Actions / [unit] frontend (14, ubuntu-22.04, v0.10.4)

Missing semicolon

// const buyView = new osparc.desktop.credits.BuyCredits2([{
// id: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ qx.Class.define("osparc.desktop.credits.Transactions", {

this._setLayout(new qx.ui.layout.VBox(15));

const store = osparc.store.Store.getInstance();
store.bind("contextWallet", this, "contextWallet");
},

properties: {
contextWallet: {
check: "osparc.data.model.Wallet",
init: null,
nullable: false,
apply: "__buildLayout"
this.__params = {
filters: {
from: null,
until: null
}
}

const store = osparc.store.Store.getInstance();
store.getGroupsMe()
.then(personalGroup => {
this.__personalWallet = store.getWallets().find(wallet => wallet.getOwner() === personalGroup.gid)
this.__personalWalletId = this.__personalWallet.getWalletId()
this.__buildLayout()
});
},

members: {
Expand All @@ -50,7 +53,20 @@ qx.Class.define("osparc.desktop.credits.Transactions", {

__buildLayout: function() {
this._removeAll();
const wallet = this.getContextWallet();

this.__introLabel = new qx.ui.basic.Label().set({
value: this.tr("Top-up and refunds in US Dollars associated to your personal account show up here."),
font: "text-14",
rich: true,
wrap: true
});
this._add(this.__introLabel);

this.__dateFilters = new osparc.desktop.credits.DateFilters();
this.__dateFilters.addListener("change", e => this.__saveFilters(e.getData()));
this._add(this.__dateFilters);

const wallet = this.__personalWallet;
if (wallet && wallet.getMyAccessRights()["write"]) {
const transactionsTable = this._createChildControlImpl("transactions-table");
osparc.data.Resources.fetch("payments", "get")
Expand All @@ -66,7 +82,15 @@ qx.Class.define("osparc.desktop.credits.Transactions", {
},

refresh: function() {
this.__buildLayout();
console.log(this.__params);
},

__saveFilters: function(filters) {
this.__params = {
...this.__params,
filters
};
this.refresh();
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ qx.Class.define("osparc.desktop.paymentMethods.PaymentMethods", {

__buildLayout: function() {
this._removeAll();

this.__introLabel = new qx.ui.basic.Label().set({
value: this.tr("Credit cards used for payments in your personal Credit Account"),
font: "text-14",
Expand Down

0 comments on commit e508d47

Please sign in to comment.