Skip to content

Commit

Permalink
♻️ Frontend: Refactoring & Cleanup (#4735)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Sep 13, 2023
1 parent 9a973d0 commit e888d90
Show file tree
Hide file tree
Showing 232 changed files with 987 additions and 5,473 deletions.

This file was deleted.

53 changes: 0 additions & 53 deletions services/static-webserver/client/source/class/explorer/MainPage.js

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ qx.Class.define("osparc.Application", {
const threejs = osparc.wrapper.Three.getInstance();
threejs.init();

const announcementsTracker = osparc.AnnouncementsTracker.getInstance();
const announcementsTracker = osparc.announcement.Tracker.getInstance();
announcementsTracker.startTracker();

const webSocket = osparc.wrapper.WebSocket.getInstance();
webSocket.addListener("connect", () => osparc.io.WatchDog.getInstance().setOnline(true));
webSocket.addListener("disconnect", () => osparc.io.WatchDog.getInstance().setOnline(false));
webSocket.addListener("connect", () => osparc.WatchDog.getInstance().setOnline(true));
webSocket.addListener("disconnect", () => osparc.WatchDog.getInstance().setOnline(false));
webSocket.addListener("logout", () => this.logout());
// alert the users that they are about to navigate away
// from osparc. unfortunately it is not possible
Expand Down Expand Up @@ -197,7 +197,7 @@ qx.Class.define("osparc.Application", {
msg = msg.replace(/\+/g, "%20");
msg = decodeURIComponent(msg);
osparc.utils.Utils.cookie.deleteCookie("user");
const errorPage = new osparc.Error().set({
const errorPage = new osparc.ErrorPage().set({
code: urlFragment.params.status_code,
messages: [
msg
Expand Down Expand Up @@ -373,15 +373,15 @@ qx.Class.define("osparc.Application", {

if (osparc.auth.Data.getInstance().isGuest()) {
osparc.utils.Utils.createAccountMessage()
.then(msg => osparc.component.message.FlashMessenger.getInstance().logAs(msg, "WARNING"));
.then(msg => osparc.FlashMessenger.getInstance().logAs(msg, "WARNING"));
} else if ("expirationDate" in profile) {
const now = new Date();
const today = new Date(now.toISOString().slice(0, 10));
const expirationDay = new Date(profile["expirationDate"]);
const daysToExpiration = osparc.utils.Utils.daysBetween(today, expirationDay);
if (daysToExpiration < 7) {
osparc.utils.Utils.expirationMessage(daysToExpiration)
.then(msg => osparc.component.message.FlashMessenger.getInstance().logAs(msg, "WARNING"));
.then(msg => osparc.FlashMessenger.getInstance().logAs(msg, "WARNING"));
}
}

Expand Down Expand Up @@ -469,11 +469,11 @@ qx.Class.define("osparc.Application", {
* Resets session and restarts
*/
logout: function() {
osparc.component.message.FlashMessenger.getInstance().logAs(this.tr("You are logged out"));
osparc.FlashMessenger.getInstance().logAs(this.tr("You are logged out"));

osparc.data.PollTasks.getInstance().removeTasks();
osparc.MaintenanceTracker.getInstance().stopTracker();
osparc.AnnouncementsTracker.getInstance().stopTracker();
osparc.announcement.Tracker.getInstance().stopTracker();
osparc.auth.Manager.getInstance().logout();
if (this.__mainPage) {
this.__mainPage.closeEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* -----------------------
*
*/
qx.Class.define("osparc.Error", {
qx.Class.define("osparc.ErrorPage", {
extend: qx.ui.core.Widget,

construct: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
* Here is a little example of how to use the class.
*
* <pre class='javascript'>
* osparc.component.message.FlashMessenger.getInstance().log(log);
* osparc.FlashMessenger.getInstance().log(log);
* </pre>
*/

qx.Class.define("osparc.component.message.FlashMessenger", {
qx.Class.define("osparc.FlashMessenger", {
extend: qx.core.Object,
type: "singleton",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ qx.Class.define("osparc.MaintenanceTracker", {
const messageToRibbon = closable => {
this.__removeRibbonMessage();
const text = this.__getText();
const notification = new osparc.component.notification.RibbonNotification(text, "maintenance", closable);
osparc.component.notification.RibbonNotifications.getInstance().addNotification(notification);
const notification = new osparc.notification.RibbonNotification(text, "maintenance", closable);
osparc.notification.RibbonNotifications.getInstance().addNotification(notification);
this.__lastRibbonMessage = notification;
};
if (diffClosable < 0) {
Expand All @@ -155,7 +155,7 @@ qx.Class.define("osparc.MaintenanceTracker", {

__removeRibbonMessage: function() {
if (this.__lastRibbonMessage) {
osparc.component.notification.RibbonNotifications.getInstance().removeNotification(this.__lastRibbonMessage);
osparc.notification.RibbonNotifications.getInstance().removeNotification(this.__lastRibbonMessage);
this.__lastRibbonMessage = null;
}
},
Expand All @@ -172,7 +172,7 @@ qx.Class.define("osparc.MaintenanceTracker", {
let text = qx.locale.Manager.tr("We are under maintenance.");
text += "<br>";
text += qx.locale.Manager.tr("Please check back later");
osparc.component.message.FlashMessenger.getInstance().logAs(text, "WARNING");
osparc.FlashMessenger.getInstance().logAs(text, "WARNING");
qx.core.Init.getApplication().logout();
};
const now = new Date();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ qx.Class.define("osparc.Preferences", {
})
.catch(err => {
console.error(err);
osparc.component.message.FlashMessenger.logAs(err.message, "ERROR");
osparc.FlashMessenger.logAs(err.message, "ERROR");
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
* Here is a little example of how to use the class.
*
* <pre class='javascript'>
* osparc.io.WatchDog.getInstance().startCheck();
* osparc.WatchDog.getInstance().startCheck();
* </pre>
*/

qx.Class.define("osparc.io.WatchDog", {
qx.Class.define("osparc.WatchDog", {
extend: qx.core.Object,
type: "singleton",

Expand Down Expand Up @@ -78,7 +78,7 @@ qx.Class.define("osparc.io.WatchDog", {
__clientHeartbeatWWPinger: null,

_applyOnline: function(value) {
let logo = osparc.component.widget.LogoOnOff.getInstance();
let logo = osparc.navigation.LogoOnOff.getInstance();
if (logo) {
logo.setOnline(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ qx.Class.define("osparc.WindowSizeTracker", {

let notification = null;
if (tooSmall === "shortText") {
notification = new osparc.component.notification.RibbonNotification(null, "smallWindow", true);
notification = new osparc.notification.RibbonNotification(null, "smallWindow", true);
} else if (tooSmall === "longText") {
const text = this.__getLongText(true);
notification = new osparc.component.notification.RibbonNotification(text, "smallWindow", true);
notification = new osparc.notification.RibbonNotification(text, "smallWindow", true);
}
osparc.component.notification.RibbonNotifications.getInstance().addNotification(notification);
osparc.notification.RibbonNotifications.getInstance().addNotification(notification);
this.__lastRibbonMessage = notification;
},

Expand All @@ -108,7 +108,7 @@ qx.Class.define("osparc.WindowSizeTracker", {

__removeRibbonMessage: function() {
if (this.__lastRibbonMessage) {
osparc.component.notification.RibbonNotifications.getInstance().removeNotification(this.__lastRibbonMessage);
osparc.notification.RibbonNotifications.getInstance().removeNotification(this.__lastRibbonMessage);
this.__lastRibbonMessage = null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* This is a sort of Task Manager or Activity Monitor for oSPARC. It provides the user with the status of the different services running
* (queueing, hardware usage, running status, etc) and allows to run several actions on them.
*/
qx.Class.define("osparc.component.service.manager.ActivityManager", {
qx.Class.define("osparc.activityManager.ActivityManager", {
extend: qx.ui.core.Widget,

/**
Expand Down Expand Up @@ -49,8 +49,8 @@ qx.Class.define("osparc.component.service.manager.ActivityManager", {
toolbar.add(filtersPart);

const filtersContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
const nameFilter = new osparc.component.filter.TextFilter("name", "activityMonitor");
const studyFilter = this.__studyFilter = new osparc.component.filter.StudyFilter("study", "activityMonitor");
const nameFilter = new osparc.filter.TextFilter("name", "activityMonitor");
const studyFilter = this.__studyFilter = new osparc.filter.StudyFilter("study", "activityMonitor");
filtersContainer.add(nameFilter);
filtersContainer.add(studyFilter);
filtersPart.add(filtersContainer);
Expand All @@ -63,10 +63,10 @@ qx.Class.define("osparc.component.service.manager.ActivityManager", {
},

/**
* Creates the main view, holding an instance of {osparc.component.service.manager.ActivityTree}.
* Creates the main view, holding an instance of {osparc.activityManager.ActivityTree}.
*/
__createActivityTree: function() {
this.__tree = new osparc.component.service.manager.ActivityTree();
this.__tree = new osparc.activityManager.ActivityTree();
this._add(this.__tree, {
flex: 1
});
Expand Down Expand Up @@ -119,15 +119,15 @@ qx.Class.define("osparc.component.service.manager.ActivityManager", {
/*
const runButton = new qx.ui.toolbar.Button(this.tr("Run"), "@FontAwesome5Solid/play/14");
actionsPart.add(runButton);
runButton.addListener("execute", () => osparc.component.message.FlashMessenger.getInstance().logAs("Not implemented"));
runButton.addListener("execute", () => osparc.FlashMessenger.getInstance().logAs("Not implemented"));
const stopButton = new qx.ui.toolbar.Button(this.tr("Stop"), "@FontAwesome5Solid/stop-circle/14");
actionsPart.add(stopButton);
stopButton.addListener("execute", () => osparc.component.message.FlashMessenger.getInstance().logAs("Not implemented"));
stopButton.addListener("execute", () => osparc.FlashMessenger.getInstance().logAs("Not implemented"));
const infoButton = new qx.ui.toolbar.Button(this.tr("Info"), "@FontAwesome5Solid/info/14");
actionsPart.add(infoButton);
infoButton.addListener("execute", () => osparc.component.message.FlashMessenger.getInstance().logAs("Not implemented"));
infoButton.addListener("execute", () => osparc.FlashMessenger.getInstance().logAs("Not implemented"));
[runButton, stopButton, infoButton].map(button => this.__tree.bind("selected", button, "enabled", {
converter: data => data.length > 0
Expand Down
Loading

0 comments on commit e888d90

Please sign in to comment.