Skip to content

Commit 95352a0

Browse files
authored
Quick fixes (#742)
A couple of iframe bugs fixed: Maximizing an iframe now works. We can now resize a SidePanel over an iframe Other bugs: File picker bug fixed. #741
1 parent 15b9d2e commit 95352a0

File tree

8 files changed

+102
-15
lines changed

8 files changed

+102
-15
lines changed

services/web/client/source/class/qxapp/component/widget/NodeView.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ qx.Class.define("qxapp.component.widget.NodeView", {
4949
});
5050
inputNodesLayout.add(inputLabel);
5151

52-
const scroll = new qx.ui.container.Scroll().set({
52+
const scroll = this.__scrollContainer = new qx.ui.container.Scroll().set({
5353
minWidth: 300
5454
});
5555
scroll.add(inputNodesLayout);
@@ -82,6 +82,7 @@ qx.Class.define("qxapp.component.widget.NodeView", {
8282

8383
members: {
8484
__mainLayout: null,
85+
__scrollContainer: null,
8586
__inputNodesLayout: null,
8687
__settingsLayout: null,
8788
__mapperLayout: null,
@@ -273,6 +274,21 @@ qx.Class.define("qxapp.component.widget.NodeView", {
273274

274275
__attachEventHandlers: function() {
275276
this.__blocker.addListener("tap", this.__inputNodesLayout.toggleCollapsed.bind(this.__inputNodesLayout));
277+
278+
const maximizeIframeCb = msg => {
279+
this.__blocker.setStyles({
280+
display: msg.getData() ? "none" : "block"
281+
});
282+
this.__scrollContainer.setVisibility(msg.getData() ? "excluded" : "visible");
283+
};
284+
285+
this.addListener("appear", () => {
286+
qx.event.message.Bus.getInstance().subscribe("maximizeIframe", maximizeIframeCb, this);
287+
}, this);
288+
289+
this.addListener("disappear", () => {
290+
qx.event.message.Bus.getInstance().unsubscribe("maximizeIframe", maximizeIframeCb, this);
291+
}, this);
276292
}
277293
}
278294
});

services/web/client/source/class/qxapp/component/widget/PersistentIframe.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ qx.Class.define("qxapp.component.widget.PersistentIframe", {
5050
__actionButton: null,
5151
// override
5252
_createContentElement : function() {
53-
let iframe = this.__iframe = new qx.ui.embed.Iframe(this.getSource()).set({
54-
zIndex: 1000
55-
});
53+
let iframe = this.__iframe = new qx.ui.embed.Iframe(this.getSource());
5654
iframe.addListener("load", e => {
5755
this.fireEvent("load");
5856
});
@@ -66,7 +64,7 @@ qx.Class.define("qxapp.component.widget.PersistentIframe", {
6664
top:-10000
6765
});
6866
let actionButton = this.__actionButton = new qx.ui.form.Button(null, osparc.theme.osparcdark.Image.URLS["window-maximize"]+"/20").set({
69-
zIndex: 1001,
67+
zIndex: 20,
7068
backgroundColor: "transparent",
7169
decorator: null
7270
});
@@ -75,6 +73,7 @@ qx.Class.define("qxapp.component.widget.PersistentIframe", {
7573
});
7674
actionButton.addListener("execute", e => {
7775
this.maximizeIFrame(!this.hasState("maximized"));
76+
qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", this.hasState("maximized"));
7877
}, this);
7978
appRoot.add(actionButton);
8079
standin.addListener("appear", e => {

services/web/client/source/class/qxapp/component/widget/inputs/NodeOutputTreeItem.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ qx.Class.define("qxapp.component.widget.inputs.NodeOutputTreeItem", {
7878

7979
value: {
8080
nullable: true,
81-
apply: "_applyValue"
81+
apply: "_applyValue",
82+
transform: "_transformValue"
8283
}
8384
},
8485

8586
members : {
86-
__value: null,
87+
__valueLabel: null,
8788
_addWidgets : function() {
8889
// Here's our indentation and tree-lines
8990
this.addSpacer();
@@ -107,6 +108,15 @@ qx.Class.define("qxapp.component.widget.inputs.NodeOutputTreeItem", {
107108

108109
_applyValue: function(value) {
109110
this.__valueLabel.setValue(value);
111+
},
112+
_transformValue: function(value) {
113+
if (value.getPath) {
114+
const fileName = value.getPath().split("/");
115+
if (fileName.length) {
116+
return fileName[fileName.length-1];
117+
}
118+
}
119+
return value;
110120
}
111121
}
112122
});

services/web/client/source/class/qxapp/component/widget/logger/LoggerView.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,14 @@ qx.Class.define("qxapp.component.widget.logger.LoggerView", {
162162
// table
163163
let table = this.__logView = new qx.ui.table.Table(tableModel, custom).set({
164164
selectable: true,
165-
statusBarVisible: false
165+
statusBarVisible: false,
166+
showCellFocusIndicator: false
166167
});
167168
var colModel = table.getTableColumnModel();
168169
colModel.setDataCellRenderer(0, new qx.ui.table.cellrenderer.Html());
169-
colModel.setDataCellRenderer(1, new qx.ui.table.cellrenderer.Html());
170+
colModel.setDataCellRenderer(1, new qxapp.ui.table.cellrenderer.Html().set({
171+
defaultCellStyle: "user-select: text"
172+
}));
170173
let resizeBehavior = colModel.getBehavior();
171174
resizeBehavior.setWidth(0, "15%");
172175
resizeBehavior.setWidth(1, "85%");

services/web/client/source/class/qxapp/component/workbench/WorkbenchUI.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,14 @@ qx.Class.define("qxapp.component.workbench.WorkbenchUI", {
848848

849849
__addEventListeners: function() {
850850
this.addListener("appear", () => {
851+
// Reset filters and sidebars
851852
qxapp.component.filter.UIFilterController.getInstance().resetGroup("workbench");
852853
qxapp.component.filter.UIFilterController.getInstance().setContainerVisibility("workbench", "visible");
854+
855+
qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", false);
853856
});
854857
this.addListener("disappear", () => {
858+
// Reset filters
855859
qxapp.component.filter.UIFilterController.getInstance().resetGroup("workbench");
856860
qxapp.component.filter.UIFilterController.getInstance().setContainerVisibility("workbench", "excluded");
857861
});

services/web/client/source/class/qxapp/desktop/SidePanel.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,21 @@ qx.Class.define("qxapp.desktop.SidePanel", {
8282
_applyCollapsed: function(collapsed) {
8383
this.__setDecorators("sidepanel");
8484
this.getChildren().forEach(child => child.setVisibility(collapsed ? "excluded" : "visible"));
85+
const splitpaneContainer = this.__getSplitpaneContainer();
8586
if (collapsed) {
8687
// Save widths
8788
this.__savedWidth = this.__getCssWidth();
88-
this.__savedMinWidth = this.__getSplitpaneContainer().getMinWidth();
89-
this.__getSplitpaneContainer().setMinWidth(0);
90-
this.__getSplitpaneContainer().setWidth(20);
89+
this.__savedMinWidth = splitpaneContainer.getMinWidth();
90+
splitpaneContainer.set({
91+
minWidth: 0,
92+
width: 20
93+
});
9194
} else {
9295
// Restore widths
93-
this.__getSplitpaneContainer().setMinWidth(this.__savedMinWidth);
94-
this.__getSplitpaneContainer().setWidth(this.__savedWidth);
96+
splitpaneContainer.set({
97+
minWidth: this.__savedMinWidth,
98+
width: this.__savedWidth
99+
});
95100
}
96101
// Workaround: have to update splitpane's prop
97102
const splitpane = this.__getParentSplitpane();

services/web/client/source/class/qxapp/desktop/StudyEditor.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
3838
width: 500
3939
});
4040

41-
const scroll = new qx.ui.container.Scroll().set({
41+
const scroll = this.__scrollContainer = new qx.ui.container.Scroll().set({
4242
minWidth: 0
4343
});
4444
scroll.add(sidePanel);
@@ -75,6 +75,7 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
7575
__pipelineId: null,
7676
__mainPanel: null,
7777
__sidePanel: null,
78+
__scrollContainer: null,
7879
__workbenchUI: null,
7980
__treeView: null,
8081
__extraView: null,
@@ -602,6 +603,21 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
602603

603604
__attachEventHandlers: function() {
604605
this.__blocker.addListener("tap", this.__sidePanel.toggleCollapsed.bind(this.__sidePanel));
606+
607+
const maximizeIframeCb = msg => {
608+
this.__blocker.setStyles({
609+
display: msg.getData() ? "none" : "block"
610+
});
611+
this.__scrollContainer.setVisibility(msg.getData() ? "excluded" : "visible");
612+
};
613+
614+
this.addListener("appear", () => {
615+
qx.event.message.Bus.getInstance().subscribe("maximizeIframe", maximizeIframeCb, this);
616+
}, this);
617+
618+
this.addListener("disappear", () => {
619+
qx.event.message.Bus.getInstance().unsubscribe("maximizeIframe", maximizeIframeCb, this);
620+
}, this);
605621
}
606622
}
607623
});
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* ************************************************************************
2+
3+
qxapp - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2019 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Ignacio Pascual (ignapas)
15+
16+
************************************************************************ */
17+
18+
/**
19+
* Html cell renderer that does not override the cell styles.
20+
*/
21+
qx.Class.define("qxapp.ui.table.cellrenderer.Html", {
22+
extend: qx.ui.table.cellrenderer.Html,
23+
construct: function() {
24+
this.base(arguments);
25+
},
26+
members: {
27+
// Override
28+
_getCellStyle: function(cellInfo) {
29+
const baseStyle = this.base(arguments, cellInfo) || "";
30+
const cellStyle = cellInfo.style || "";
31+
return baseStyle + cellStyle;
32+
}
33+
}
34+
});

0 commit comments

Comments
 (0)