Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 Frontend: Rename Service Autostart #5736

Merged
merged 9 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ qx.Class.define("osparc.Application", {
e.returnValue = "";
}
});
if (qx.core.Environment.get("dev.enableFakeSrv")) {
console.debug("Fake server enabled");
osparc.dev.fake.srv.restapi.User;
osparc.dev.fake.srv.restapi.Authentication;
}

// Setting up auth manager
osparc.auth.Manager.getInstance().addListener("logout", () => this.__restart(), this);
Expand Down Expand Up @@ -275,11 +270,6 @@ qx.Class.define("osparc.Application", {
__restart: function() {
let isLogged = osparc.auth.Manager.getInstance().isLoggedIn();

if (qx.core.Environment.get("dev.disableLogin")) {
console.warn("Login page was disabled", "Starting main application ...");
isLogged = true;
}

if (isLogged) {
this.__loadMainPage();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ qx.Class.define("osparc.MaintenanceTracker", {

__setMaintenance: function(maintenanceData) {
// ignore old maintenance
if (new Date(maintenanceData.end).getTime() < new Date().getTime()) {
if (maintenanceData && (new Date(maintenanceData.end).getTime() < new Date().getTime())) {
console.warn(`Old maintenance "${maintenanceData.reason}" wasn't removed"`);
return;
}
Expand All @@ -115,27 +115,21 @@ qx.Class.define("osparc.MaintenanceTracker", {
(oldEnd === null || oldEnd.getTime() !== this.getEnd().getTime()) ||
oldReason !== this.getReason()
) {
this.__scheduleMaintenance();
this.__scheduleStart();
}
},

__scheduleMaintenance: function() {
this.__scheduleStart();
},

__scheduleStart: function() {
if (this.getStart() === null) {
this.__removeRibbonMessage();
this.__removeScheduledLogout();
} else {
this.__removeRibbonMessage();
this.__removeScheduledLogout();

if (this.getStart()) {
this.__scheduleRibbonMessage();
this.__scheduleLogout();
}
},

__scheduleRibbonMessage: function() {
this.__removeRibbonMessage();

const now = new Date();
const diffClosable = this.getStart().getTime() - now.getTime() - this.self().CLOSABLE_WARN_IN_ADVANCE;
const diffPermanent = this.getStart().getTime() - now.getTime() - this.self().PERMANENT_WARN_IN_ADVANCE;
Expand Down Expand Up @@ -177,8 +171,6 @@ qx.Class.define("osparc.MaintenanceTracker", {
},

__scheduleLogout: function() {
this.__removeScheduledLogout();

const now = new Date();
if (this.getStart().getTime() > now.getTime()) {
const diff = this.getStart().getTime() - now.getTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,9 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
if (osparc.utils.Resources.isStudy(resourceData) || osparc.utils.Resources.isTemplate(resourceData)) {
if (osparc.product.Utils.showDisableServiceAutoStart()) {
const study = new osparc.data.model.Study(resourceData);
const autoStartButton = osparc.info.StudyUtils.createDisableServiceAutoStart(study);
const autoStartButton = osparc.info.StudyUtils.createDisableServiceAutoStart(study).set({
enabled: osparc.data.model.Study.canIWrite(this.__resourceData["accessRights"])
});
// eslint-disable-next-line no-underscore-dangle
servicesBootOpts._add(new qx.ui.core.Spacer(null, 15));
// eslint-disable-next-line no-underscore-dangle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ qx.Class.define("osparc.desktop.credits.Usage", {
selectBoxContainer.add(this.__fetchingImg);
container.add(selectBoxContainer);

const filterContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox())
const filterContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(5))
this.__dateFilters = new osparc.desktop.credits.DateFilters();
this.__dateFilters.addListener("change", e => {
this.__table.getTableModel().setFilters(e.getData())
Expand All @@ -73,6 +73,12 @@ qx.Class.define("osparc.desktop.credits.Usage", {
this.__handleExport()
});
filterContainer.add(this.__exportButton);
const refreshButton = new qx.ui.form.Button(this.tr("Reload"), "@FontAwesome5Solid/sync-alt/14").set({
allowStretchY: false,
alignY: "bottom"
});
refreshButton.addListener("execute", () => this.__table && this.__table.getTableModel().reloadData());
filterContainer.add(refreshButton)
container.add(filterContainer);

this._add(container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ qx.Class.define("osparc.desktop.wallets.WalletsList", {

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

this.__addHeader("Personal")
this.__addHeader(this.tr("Personal"), true);
this.__noPersonalWalletsLabel = new qx.ui.basic.Label().set({
value: this.tr("No personal Credit Account found"),
font: "text-13",
marginLeft: 10
});
this._add(this.__noPersonalWalletsLabel);
this.__personalWalletsModel = this.__addWalletsList()

this.__sharedHeader = this.__addHeader("Shared with me")
this.__addHeader(this.tr("Shared with me"), false);
this.__noSharedWalletsLabel = new qx.ui.basic.Label().set({
value: this.tr("No shared Credit Accounts found"),
font: "text-13",
marginLeft: 10
});
this._add(this.__noSharedWalletsLabel);
this.__sharedWalletsModel = this.__addWalletsList({ flex: 1 })

this.loadWallets();
Expand All @@ -47,6 +59,8 @@ qx.Class.define("osparc.desktop.wallets.WalletsList", {
},

members: {
__noPersonalWalletsLabel: null,
__noSharedWalletsLabel: null,
__personalWalletsModel: null,
__sharedWalletsModel: null,

Expand Down Expand Up @@ -125,11 +139,13 @@ qx.Class.define("osparc.desktop.wallets.WalletsList", {
}
});
this.setWalletsLoaded(true);
if (this.__sharedWalletsModel.getLength() === 0) {
this.__sharedHeader.exclude()
} else {
this.__sharedHeader.show()
}

this.__noPersonalWalletsLabel.set({
visibility: this.__personalWalletsModel.getLength() ? "excluded" : "visible"
});
this.__noSharedWalletsLabel.set({
visibility: this.__sharedWalletsModel.getLength() ? "excluded" : "visible"
});
},

__openEditWallet: function(walletId) {
Expand Down Expand Up @@ -187,24 +203,25 @@ qx.Class.define("osparc.desktop.wallets.WalletsList", {
win.close();
},

__addHeader: function(label) {
const header = new qx.ui.container.Composite(new qx.ui.layout.HBox())
__addHeader: function(label, showCurrently) {
const header = new qx.ui.container.Composite(new qx.ui.layout.HBox());
const userWallets = new qx.ui.basic.Label().set({
value: this.tr(label),
value: label,
alignX: "left",
rich: true,
font: "text-14"
});
header.add(userWallets)
header.add(userWallets);
header.add(new qx.ui.core.Spacer(), {
flex: 1
});
const selectColumn = new qx.ui.basic.Label("Currently in use").set({
marginRight: 18
});
header.add(selectColumn)
if (showCurrently) {
const selectColumn = new qx.ui.basic.Label(this.tr("Currently in use")).set({
marginRight: 18
});
header.add(selectColumn)
}
this._add(header);
return header
}
}
});

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading