Skip to content
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 @@ -170,7 +170,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
if (osparc.product.Utils.isS4LProduct()) {
this.__addHypertools();
}
this.__addOtherTabsAccess();
this.__addMoreMenu();
this.getChildControl("new-folder");
},

Expand Down Expand Up @@ -230,8 +230,11 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
});
},

__addOtherTabsAccess: function() {
const moreMenuButton = this.self().createMenuButton("@FontAwesome5Solid/star/16", this.tr("More"));
__addMoreMenu: function() {
const moreMenuButton = this.self().createMenuButton("@FontAwesome5Solid/angle-double-right/16", this.tr("More"));
moreMenuButton.getChildControl("icon").set({
marginLeft: 6, // center it
});
this.addAt(moreMenuButton, this.__itemIdx);
this.__itemIdx++;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
switch (this.__resourceType) {
case "study": {
this._add(this.__createWorkspacesAndFoldersTree());
this._add(this.__createTemplates());
this._add(this.__createPublicProjects());
if (osparc.product.Utils.showTemplates()) {
this._add(this.__createTemplates());
}
if (osparc.product.Utils.showPublicProjects()) {
this._add(this.__createPublicProjects());
}
this._add(this.__createTrashBin());
this._add(filtersSpacer);
const scrollView = new qx.ui.container.Scroll();
Expand Down Expand Up @@ -417,7 +421,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {

// hypertools filter
const button = new qx.ui.toolbar.RadioButton("Hypertools", null);
osparc.utils.Utils.replaceIconWithThumbnail(button, osparc.data.model.StudyUI.HYPERTOOL_ICON(), 20);
osparc.utils.Utils.replaceIconWithThumbnail(button, osparc.data.model.StudyUI.HYPERTOOL_ICON(18), 20);
button.appType = "hypertool";
this.__appTypeButtons.push(button);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,10 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
},

__getPublishPage: function() {
if (!osparc.utils.Resources.isStudy(this.__resourceData)) {
if (
!osparc.utils.Resources.isStudy(this.__resourceData) ||
!osparc.product.Utils.showPublicProjects()
) {
return null;
}

Expand Down Expand Up @@ -799,7 +802,10 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
},

__getCreateTemplatePage: function() {
if (!osparc.utils.Resources.isStudy(this.__resourceData)) {
if (
!osparc.utils.Resources.isStudy(this.__resourceData) ||
osparc.product.Utils.showTemplates()
) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ qx.Class.define("osparc.data.SubJob", {
this.set({
projectUuid: subJobData["projectUuid"],
nodeId: subJobData["nodeId"],
nodeName: subJobData["nodeName"],
state: subJobData["state"],
progress: subJobData["progress"],
startedAt: subJobData["startedAt"] ? new Date(subJobData["startedAt"]) : null,
endedAt: subJobData["endedAt"] ? new Date(subJobData["endedAt"]) : null,
osparcCredits: subJobData["osparcCredits"] === null ? null : -1*parseFloat(subJobData["osparcCredits"]),
image: subJobData["image"] || {},
logDownloadLink: subJobData["logDownloadLink"] || null,
});

this.updateSubJob(subJobData);
},

properties: {
Expand Down Expand Up @@ -100,11 +94,14 @@ qx.Class.define("osparc.data.SubJob", {
members: {
updateSubJob: function(subJobData) {
this.set({
nodeName: subJobData["nodeName"],
state: subJobData["state"],
progress: subJobData["progress"],
startedAt: subJobData["startedAt"] ? new Date(subJobData["startedAt"]) : null,
endedAt: subJobData["endedAt"] ? new Date(subJobData["endedAt"]) : null,
osparcCredits: subJobData["osparcCredits"] === null ? null : -1*parseFloat(subJobData["osparcCredits"]),
image: subJobData["image"] || {},
logDownloadLink: subJobData["logDownloadLink"] || null,
});
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ qx.Class.define("osparc.info.CommentUI", {
const commentContent = this.getChildControl("comment-content");
commentContent.setValue(this.__comment["content"]);

const user = osparc.store.Groups.getInstance().getUserByGroupId(this.__comment["userGroupId"])
if (user) {
thumbnail.setSource(user.getThumbnail());
userName.setValue(user.getLabel());
}
osparc.store.Users.getInstance().getUser(this.__comment["userGroupId"])
.then(user => {
if (user) {
thumbnail.setSource(user.getThumbnail());
userName.setValue(user.getLabel());
}
});

this.getChildControl("spacer");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,28 @@ qx.Class.define("osparc.product.Utils", {
return true;
},

showTemplates: function() {
if (osparc.data.Permissions.getInstance().isTester()) {
return true;
}

if (this.isProduct("tis") || this.isProduct("tiplite")) {
return false;
}
return true;
},

showPublicProjects: function() {
if (osparc.data.Permissions.getInstance().isTester()) {
return true;
}

if (this.isProduct("tis") || this.isProduct("tiplite")) {
return false;
}
return true;
},

showQuality: function() {
if (this.isProduct("osparc")) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ qx.Class.define("osparc.widget.PersistentIframe", {
},

__attachInterframeMessageHandlers: function() {
this.__attachTriggerers();
this.__attachListeners();
this.__attachInterIframeThemeSyncer();
this.__attachInterIframeListeners();
},

__attachTriggerers: function() {
__attachInterIframeThemeSyncer: function() {
this.postThemeSwitch = theme => {
const msg = "osparc;theme=" + theme;
this.sendMessageToIframe(msg);
Expand All @@ -279,12 +279,14 @@ qx.Class.define("osparc.widget.PersistentIframe", {
}
},

__attachListeners: function() {
__attachInterIframeListeners: function() {
this.__iframe.addListener("load", () => {
const iframe = this._getIframeElement();
if (iframe) {
const iframeDomEl = iframe.getDomElement();
if (iframeDomEl) {
const iframeSource = iframe.getSource();
// Make sure the iframe is loaded and has a valid source
if (iframeDomEl && iframeSource && iframeSource !== "about:blank") {
window.addEventListener("message", message => {
const data = message.data;
if (data) {
Expand Down
Loading