Skip to content

Commit

Permalink
🎨 Minors: Watermelon Review (#4474)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Jul 11, 2023
1 parent 84ef3bc commit 8e66b40
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", {
},

statics: {
WIDTH: 715,
WIDTH: 820,
HEIGHT: 720,

popUpInWindow: function(moreOpts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
}
},
EXPECTED_S4L_SERVICE_KEYS: {
"simcore/services/dynamic/jupyter-smash": {
title: "Start Sim4Life lab",
description: "Jupyter powered by Sim4Life",
newStudyLabel: "New Sim4Life lab project",
idToWidget: "startJSmashButton"
},
"simcore/services/dynamic/sim4life-dy": {
title: "Start Sim4Life",
description: "New Sim4Life project",
newStudyLabel: "New Sim4Life project",
idToWidget: "startS4LButton"
},
"simcore/services/dynamic/jupyter-smash": {
title: "Start Sim4Life lab",
description: "Jupyter powered by Sim4Life",
newStudyLabel: "New Sim4Life lab project",
idToWidget: "startJSmashButton"
}
},
EXPECTED_S4L_LITE_SERVICE_KEYS: {
Expand Down Expand Up @@ -507,6 +507,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
},

__addNewS4LServiceButtons: function() {
this.__addNewStudyButton();
const store = osparc.store.Store.getInstance();
store.getAllServices()
.then(services => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
}
});

const pageContext = this.getPageContext();
const pageContext = this.isPropertyInitialized("pageContext") ? this.getPageContext() : null;
switch (pageContext) {
case "guided":
case "app":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,21 +1138,22 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
let showPage = false;
let showStopButton = false;

const sections = [];
if (
node.isDynamic() &&
(node.isUpdatable() || node.isDeprecated() || node.isRetired())
) {
const lifeCycleView = new osparc.component.node.LifeCycleView(node);
node.addListener("versionChanged", () => this.__populateSecondPanel(node));
this.__nodeOptionsPage.add(lifeCycleView);
sections.push(lifeCycleView);
showPage = true;
showStopButton = true;
}

if (node.hasBootModes()) {
const bootOptionsView = new osparc.component.node.BootOptionsView(node);
node.addListener("bootModeChanged", () => this.__populateSecondPanel(node));
this.__nodeOptionsPage.add(bootOptionsView);
sections.push(bootOptionsView);
showPage = true;
showStopButton = true;
}
Expand All @@ -1163,11 +1164,12 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
) {
const updateResourceLimitsView = new osparc.component.node.UpdateResourceLimitsView(node);
node.addListener("limitsChanged", () => this.__populateSecondPanel(node));
this.__nodeOptionsPage.add(updateResourceLimitsView);
sections.push(updateResourceLimitsView);
showPage = true;
showStopButton |= node.isDynamic();
}

this.__nodeOptionsPage.removeAll();
if (showPage) {
const introLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
const title = new qx.ui.basic.Label(this.tr("Service Options")).set({
Expand Down Expand Up @@ -1196,8 +1198,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
introLayout.add(stopButton);
}

this.__nodeOptionsPage.addAt(introLayout, 0);

this.__nodeOptionsPage.add(introLayout);
sections.forEach(section => this.__nodeOptionsPage.add(section));
this.__nodeOptionsPage.getChildControl("button").setVisibility(showPage ? "visible" : "excluded");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ qx.Class.define("osparc.info.StudyLarge", {
_rebuildLayout: function() {
this._removeAll();

const vBox = new qx.ui.container.Composite(new qx.ui.layout.VBox(15));

const title = osparc.info.StudyUtils.createTitle(this.getStudy()).set({
font: "text-14"
});
Expand All @@ -84,16 +86,22 @@ qx.Class.define("osparc.info.StudyLarge", {
if (autoStartButton) {
titleAndCopyLayout.add(autoStartButton);
}
this._add(titleAndCopyLayout);
vBox.add(titleAndCopyLayout);

if (osparc.product.Utils.showStudyPreview() && !this.getStudy().isPipelineEmpty()) {
const studyThumbnailExplorer = new osparc.dashboard.StudyThumbnailExplorer(this.getStudy().serialize());
this._add(studyThumbnailExplorer);
vBox.add(studyThumbnailExplorer);
}

const extraInfo = this.__extraInfo();
const extraInfoLayout = this.__createExtraInfo(extraInfo);
this._add(extraInfoLayout);
vBox.add(extraInfoLayout);

const scrollContainer = new qx.ui.container.Scroll();
scrollContainer.add(vBox);
this._add(scrollContainer, {
flex: 1
});
},

__createViewWithEdit: function(view, cb) {
Expand Down Expand Up @@ -149,7 +157,7 @@ qx.Class.define("osparc.info.StudyLarge", {
},
"DESCRIPTION": {
label: this.tr("DESCRIPTION"),
view: osparc.info.StudyUtils.createDescription(this.getStudy(), 120),
view: osparc.info.StudyUtils.createDescription(this.getStudy()),
action: {
button: osparc.utils.Utils.getEditButton(),
callback: this.__canIWrite() ? this.__openDescriptionEditor : null,
Expand Down Expand Up @@ -199,8 +207,7 @@ qx.Class.define("osparc.info.StudyLarge", {
},

__createExtraInfo: function(extraInfo) {
const moreInfo = osparc.info.StudyUtils.createExtraInfoGrid(extraInfo);
return moreInfo;
return osparc.info.StudyUtils.createExtraInfoGrid(extraInfo);
},

__createStudyId: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ qx.Class.define("osparc.info.StudyMedium", {

extraInfo.push({
label: this.tr("DESCRIPTION"),
view: osparc.info.StudyUtils.createDescription(this.getStudy(), 200)
view: osparc.info.StudyUtils.createDescription(this.getStudy())
});

return extraInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ qx.Class.define("osparc.info.StudyUtils", {
*/
createDescription: function(study, maxHeight) {
const description = new osparc.ui.markdown.Markdown().set({
noMargin: true,
maxHeight: maxHeight
noMargin: true
});
if (maxHeight) {
description.setMaxHeight(maxHeight);
}
study.bind("description", description, "value", {
converter: desc => desc ? desc : "Add description"
});
Expand Down Expand Up @@ -209,7 +211,9 @@ qx.Class.define("osparc.info.StudyUtils", {
tagsContainer.add(noTagsLabel);
osparc.store.Store.getInstance().getTags().filter(tag => model.getTags().includes(tag.id))
.forEach(selectedTag => {
tagsContainer.remove(noTagsLabel);
if (tagsContainer.indexOf(noTagsLabel) > -1) {
tagsContainer.remove(noTagsLabel);
}
tagsContainer.add(new osparc.ui.basic.Tag(selectedTag.name, selectedTag.color));
});
};
Expand Down Expand Up @@ -245,43 +249,44 @@ qx.Class.define("osparc.info.StudyUtils", {

createExtraInfoGrid: function(extraInfos) {
const positions = {
DESCRIPTION: {
column: 0,
row: 0,
colSpan: 3
},
THUMBNAIL: {
column: 3,
row: 0
},
ACCESS_RIGHTS: {
column: 0,
row: 3
row: 0
},
AUTHOR: {
column: 1,
row: 3
row: 0
},
CREATED: {
column: 2,
row: 3
row: 0
},
MODIFIED: {
column: 3,
row: 3
row: 0
},
THUMBNAIL: {
column: 4,
row: 0,
rowSpan: 4
},
TAGS: {
column: 0,
row: 6,
row: 3,
colSpan: 2
},
QUALITY: {
column: 2,
row: 6
row: 3
},
CLASSIFIERS: {
column: 3,
row: 6
row: 3
},
DESCRIPTION: {
column: 0,
row: 6,
colSpan: 5
}
};

Expand Down Expand Up @@ -322,7 +327,8 @@ qx.Class.define("osparc.info.StudyUtils", {
moreInfo.add(extraInfo.view, {
row: gridInfo.row+1,
column: gridInfo.column,
colSpan: gridInfo.colSpan ? gridInfo.colSpan : 1
colSpan: gridInfo.colSpan ? gridInfo.colSpan : 1,
rowSpan: gridInfo.rowSpan ? gridInfo.rowSpan : 1
});
}
});
Expand Down

0 comments on commit 8e66b40

Please sign in to comment.