Skip to content

Commit cf6c63a

Browse files
author
Pedro Crespo
committed
Merge remote-tracking branch 'upstream/master'
2 parents 4a8c093 + 63e662c commit cf6c63a

File tree

10 files changed

+450
-105
lines changed

10 files changed

+450
-105
lines changed

services/web/client/compile.json

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
},
5151
{
5252
"uri" : "resource/qxapp/*.png"
53+
},
54+
{
55+
"uri" : "resource/qxapp/loading/*"
5356
}
5457
]
5558
},

services/web/client/source/class/qxapp/auth/core/BaseAuthPage.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,17 @@ qx.Class.define("qxapp.auth.core.BaseAuthPage", {
2323
width: 300,
2424
height: 250
2525
});
26-
26+
// at least chrome hates it when a password input field exists
27+
// outside a form, so lets accomodate him
28+
this.addListenerOnce("appear", e => {
29+
let el = this.getContentElement();
30+
let form = this._form = new qx.html.Element("form", null, {
31+
name: "fakeLoginform",
32+
autocomplete: "on"
33+
});
34+
form.insertBefore(el);
35+
el.insertInto(form);
36+
});
2737
this._buildPage();
2838
},
2939

@@ -44,7 +54,11 @@ qx.Class.define("qxapp.auth.core.BaseAuthPage", {
4454
*/
4555

4656
members: {
47-
57+
/**
58+
* when all is said and done we should remove the form so that the password manager
59+
* knows to save the content of the form. so we save it here.
60+
*/
61+
_form: null,
4862
/**
4963
* This method gets called upon construction and
5064
* must be overriden in a subclass

services/web/client/source/class/qxapp/auth/ui/LoginPage.js

+5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {
4747
email.setPlaceholder(this.tr("Your email address"));
4848
email.setRequired(true);
4949
this.add(email);
50+
email.getContentElement().setAttribute("autocomplete", "username");
5051
this.__form.add(email, "", qx.util.Validate.email(), "email", null);
5152

5253
let pass = new qx.ui.form.PasswordField();
5354
pass.setPlaceholder(this.tr("Your password"));
5455
pass.setRequired(true);
56+
pass.getContentElement().setAttribute("autocomplete", "current-password");
5557
this.add(pass);
5658
this.__form.add(pass, "", null, "password", null);
5759

@@ -130,6 +132,9 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {
130132

131133
let successFun = function(log) {
132134
this.fireDataEvent("done", log.message);
135+
// we don't need the form any more, so remove it
136+
// and thus tell the password manager to save the content
137+
this._form.dispose();
133138
};
134139

135140
let failFun = function(msg) {

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

+89-69
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,15 @@ qx.Class.define("qxapp.component.widget.NodeView", {
4343
let mainLayout = this.__mainLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
4444
mainLayout.set({
4545
alignX: "center",
46-
paddingTop: 20,
47-
paddingRight: 30,
48-
paddingBottom: 20,
49-
paddingLeft: 30
46+
padding: 5
5047
});
5148
this.add(mainLayout, {
5249
flex: 1
5350
});
5451

55-
this.__nodesUI = [];
56-
57-
this.__initTitle();
58-
this.__initSettings();
52+
this.__settingsLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox());
53+
this.__mapperLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
54+
this.__iFrameLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
5955
this.__initButtons();
6056
},
6157

@@ -76,40 +72,14 @@ qx.Class.define("qxapp.component.widget.NodeView", {
7672
},
7773

7874
members: {
79-
__settingsBox: null,
80-
__inputNodesLayout: null,
8175
__mainLayout: null,
82-
__nodesUI: null,
76+
__inputNodesLayout: null,
77+
__settingsLayout: null,
78+
__mapperLayout: null,
79+
__iFrameLayout: null,
8380
__buttonsLayout: null,
8481
__openFolder: null,
8582

86-
__initTitle: function() {
87-
let box = new qx.ui.layout.HBox();
88-
box.set({
89-
spacing: 10,
90-
alignX: "right"
91-
});
92-
let titleBox = new qx.ui.container.Composite(box);
93-
94-
let settLabel = new qx.ui.basic.Label(this.tr("Settings"));
95-
settLabel.set({
96-
alignX: "center",
97-
alignY: "middle"
98-
});
99-
100-
titleBox.add(settLabel, {
101-
width: "75%"
102-
});
103-
this.__mainLayout.add(titleBox);
104-
},
105-
106-
__initSettings: function() {
107-
this.__settingsBox = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
108-
this.__mainLayout.add(this.__settingsBox, {
109-
flex: 1
110-
});
111-
},
112-
11383
__initButtons: function() {
11484
let box = new qx.ui.layout.HBox();
11585
box.set({
@@ -144,16 +114,6 @@ qx.Class.define("qxapp.component.widget.NodeView", {
144114
}, this);
145115

146116
buttonsLayout.add(openFolder);
147-
this.__mainLayout.add(buttonsLayout);
148-
},
149-
150-
__getNodeUI: function(id) {
151-
for (let i = 0; i < this.__nodesUI.length; i++) {
152-
if (this.__nodesUI[i].getNodeUI() === id) {
153-
return this.__nodesUI[i];
154-
}
155-
}
156-
return null;
157117
},
158118

159119
__arePortsCompatible: function(node1, port1, node2, port2) {
@@ -228,7 +188,9 @@ qx.Class.define("qxapp.component.widget.NodeView", {
228188
return nodePorts;
229189
},
230190

231-
__createInputPortsUIs: function(nodeModel) {
191+
__addInputPortsUIs: function(nodeModel) {
192+
this.__clearInputPortsUIs();
193+
232194
// Add the default inputs if any
233195
if (Object.keys(this.getNodeModel().getInputsDefault()).length > 0) {
234196
this.__createInputPortsUI(this.getNodeModel(), false);
@@ -244,8 +206,7 @@ qx.Class.define("qxapp.component.widget.NodeView", {
244206
this.__createInputPortsUI(exposedInnerNode);
245207
}
246208
} else {
247-
let inputLabel = this.__createInputPortsUI(inputNodeModel);
248-
this.__nodesUI.push(inputLabel);
209+
this.__createInputPortsUI(inputNodeModel);
249210
}
250211
}
251212
},
@@ -257,33 +218,92 @@ qx.Class.define("qxapp.component.widget.NodeView", {
257218
}
258219
},
259220

260-
__applyNode: function(nodeModel, oldNode, propertyName) {
261-
this.__settingsBox.removeAll();
262-
this.__settingsBox.add(nodeModel.getPropsWidget());
263-
this.__createDragDropMechanism(nodeModel.getPropsWidget());
221+
__addSettings: function(propsWidget) {
222+
this.__settingsLayout.removeAll();
223+
if (propsWidget) {
224+
let box = new qx.ui.layout.HBox();
225+
box.set({
226+
spacing: 10,
227+
alignX: "right"
228+
});
229+
let titleBox = new qx.ui.container.Composite(box);
230+
let settLabel = new qx.ui.basic.Label(this.tr("Settings"));
231+
settLabel.set({
232+
alignX: "center"
233+
});
234+
titleBox.add(settLabel, {
235+
width: "75%"
236+
});
237+
238+
this.__settingsLayout.add(titleBox);
239+
this.__settingsLayout.add(propsWidget);
240+
this.__createDragDropMechanism(propsWidget);
241+
242+
this.__mainLayout.add(this.__settingsLayout);
243+
} else if (qx.ui.core.Widget.contains(this.__mainLayout, this.__settingsLayout)) {
244+
this.__mainLayout.remove(this.__settingsLayout);
245+
}
246+
},
264247

265-
if (nodeModel.getInputsMapper()) {
266-
this.__settingsBox.add(nodeModel.getInputsMapper(), {
248+
__addMapper: function(mapper) {
249+
this.__mapperLayout.removeAll();
250+
if (mapper) {
251+
this.__mapperLayout.add(mapper, {
267252
flex: 1
268253
});
254+
this.__mainLayout.add(this.__mapperLayout, {
255+
flex: 1
256+
});
257+
} else if (qx.ui.core.Widget.contains(this.__mainLayout, this.__mapperLayout)) {
258+
this.__mainLayout.remove(this.__mapperLayout);
269259
}
260+
},
270261

271-
this.__clearInputPortsUIs();
272-
this.__createInputPortsUIs(nodeModel);
262+
__addIFrame: function(iFrame) {
263+
this.__iFrameLayout.removeAll();
264+
if (iFrame) {
265+
iFrame.addListenerOnce("maximize", e => {
266+
this.__maximizeIFrame(true);
267+
}, this);
268+
iFrame.addListenerOnce("restore", e => {
269+
this.__maximizeIFrame(false);
270+
}, this);
271+
this.__maximizeIFrame(iFrame.hasState("maximized"));
272+
this.__iFrameLayout.add(iFrame, {
273+
flex: 1
274+
});
275+
this.__mainLayout.add(this.__iFrameLayout, {
276+
flex: 1
277+
});
278+
} else if (qx.ui.core.Widget.contains(this.__mainLayout, this.__iFrameLayout)) {
279+
this.__mainLayout.remove(this.__iFrameLayout);
280+
}
281+
},
273282

283+
__maximizeIFrame: function(maximize) {
284+
const othersStatus = maximize ? "excluded" : "visible";
285+
this.__inputNodesLayout.setVisibility(othersStatus);
286+
this.__settingsLayout.setVisibility(othersStatus);
287+
this.__mapperLayout.setVisibility(othersStatus);
288+
this.__buttonsLayout.setVisibility(othersStatus);
289+
},
290+
291+
__addButtons: function(nodeModel) {
274292
this.__buttonsLayout.removeAll();
275-
let iFrameButton = nodeModel.getIFrameButton();
276-
if (iFrameButton) {
277-
iFrameButton.addListener("execute", e => {
278-
this.fireDataEvent("ShowViewer", {
279-
url: nodeModel.getServiceUrl(),
280-
name: nodeModel.getLabel(),
281-
nodeId: nodeModel.getNodeId()
282-
});
283-
}, this);
284-
this.__buttonsLayout.add(iFrameButton);
293+
let restartIFrameButton = nodeModel.getRestartIFrameButton();
294+
if (restartIFrameButton) {
295+
this.__buttonsLayout.add(restartIFrameButton);
285296
}
286297
this.__buttonsLayout.add(this.__openFolder);
298+
this.__mainLayout.add(this.__buttonsLayout);
299+
},
300+
301+
__applyNode: function(nodeModel, oldNode, propertyName) {
302+
this.__addInputPortsUIs(nodeModel);
303+
this.__addSettings(nodeModel.getPropsWidget());
304+
this.__addMapper(nodeModel.getInputsMapper());
305+
this.__addIFrame(nodeModel.getIFrame());
306+
this.__addButtons(nodeModel);
287307
}
288308
}
289309
});

0 commit comments

Comments
 (0)