Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c501b3a
simpler
odeimaiz Jun 25, 2025
0743bd8
feat: add conversation events
giancarloromeo Jun 25, 2025
8de8b2c
minor
odeimaiz Jun 25, 2025
f34e508
event handlers
odeimaiz Jun 25, 2025
bfbbfea
minor
odeimaiz Jun 25, 2025
c604929
prop
odeimaiz Jun 25, 2025
4cc9fab
feat: add events
giancarloromeo Jun 25, 2025
c1fef80
Merge branch 'master' into add-socketio-events-for-conversations
giancarloromeo Jun 25, 2025
eb1fabd
refactor
odeimaiz Jun 25, 2025
9934c4e
not needed
odeimaiz Jun 25, 2025
0b7464e
update and delete
odeimaiz Jun 25, 2025
671c544
minor
odeimaiz Jun 25, 2025
525d1f0
tests: add conversation events
giancarloromeo Jun 25, 2025
9b8c465
minor
odeimaiz Jun 25, 2025
ee73ea9
refactor
odeimaiz Jun 25, 2025
532ccf4
rename
odeimaiz Jun 25, 2025
2cf573a
Merge branch 'add-socketio-events-for-conversations' of github.com:gi…
odeimaiz Jun 25, 2025
663d9bb
extra checks
odeimaiz Jun 25, 2025
4807e05
minor
odeimaiz Jun 25, 2025
93af259
UX
odeimaiz Jun 25, 2025
20a0fe2
tests: fix
giancarloromeo Jun 25, 2025
4ca979c
Merge branch 'add-socketio-events-for-conversations' of github.com:gi…
odeimaiz Jun 26, 2025
08b1dbf
Merge branch 'master' into feature/listen-to-conv-ws
odeimaiz Jun 26, 2025
7123119
refactor
odeimaiz Jun 26, 2025
e21761a
minor
odeimaiz Jun 26, 2025
e4b3cd4
simplify
odeimaiz Jun 26, 2025
c8d0d33
refactor
odeimaiz Jun 26, 2025
bc08fa3
fix: params order
giancarloromeo Jun 26, 2025
85a5117
collect garbage
odeimaiz Jun 26, 2025
e1dff3b
Merge branch 'add-socketio-events-for-conversations' of github.com:gi…
odeimaiz Jun 26, 2025
da10f29
Merge branch 'master' into feature/listen-to-conv-ws
odeimaiz Jun 26, 2025
a278262
minor
odeimaiz Jun 26, 2025
bb1aca6
Merge branch 'master' into feature/listen-to-conv-ws
mergify[bot] Jun 27, 2025
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 @@ -90,9 +90,7 @@ qx.Class.define("osparc.conversation.Conversation", {
const newLabel = e.getData()["newLabel"];
if (this.getConversationId()) {
osparc.study.Conversations.renameConversation(this.__studyData["uuid"], this.getConversationId(), newLabel)
.then(() => {
this.getChildControl("button").setLabel(newLabel);
});
.then(() => this.renameConversation(newLabel));
} else {
// create new conversation first
osparc.study.Conversations.addConversation(this.__studyData["uuid"], newLabel)
Expand All @@ -111,11 +109,11 @@ qx.Class.define("osparc.conversation.Conversation", {
column: 3
});

const trashButton = new qx.ui.form.Button(null, "@FontAwesome5Solid/times/12").set({
const closeButton = new qx.ui.form.Button(null, "@FontAwesome5Solid/times/12").set({
...buttonsAesthetics,
paddingLeft: 4, // adds spacing between buttons
});
trashButton.addListener("execute", () => {
closeButton.addListener("execute", () => {
const deleteConversation = () => {
osparc.study.Conversations.deleteConversation(this.__studyData["uuid"], this.getConversationId())
.then(() => this.fireEvent("conversationDeleted"));
Expand All @@ -138,15 +136,19 @@ qx.Class.define("osparc.conversation.Conversation", {
}
});
// eslint-disable-next-line no-underscore-dangle
tabButton._add(trashButton, {
tabButton._add(closeButton, {
row: 0,
column: 4
});
this.bind("conversationId", trashButton, "visibility", {
this.bind("conversationId", closeButton, "visibility", {
converter: value => value ? "visible" : "excluded"
});
},

renameConversation: function(newName) {
this.getChildControl("button").setLabel(newName);
},

__buildLayout: function() {
this.__messagesTitle = new qx.ui.basic.Label();
this._add(this.__messagesTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ qx.Class.define("osparc.conversation.MessageUI", {
break;
case "message-content":
control = new osparc.ui.markdown.Markdown().set({
decorator: "rounded",
noMargin: true,
paddingLeft: 8,
paddingRight: 8,
allowGrowX: true,
});
control.getContentElement().setStyles({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,13 +1024,16 @@ qx.Class.define("osparc.dashboard.CardBase", {

__openResourceDetails: function(openWindowCB) {
const resourceData = this.getResourceData();
const resourceDetails = new osparc.dashboard.ResourceDetails(resourceData);
const {
resourceDetails,
window,
} = osparc.dashboard.ResourceDetails.popUpInWindow(resourceData);

resourceDetails.addListenerOnce("pagesAdded", () => {
if (openWindowCB in resourceDetails) {
resourceDetails[openWindowCB]();
}
})
const win = osparc.dashboard.ResourceDetails.popUpInWindow(resourceDetails);
});
[
"updateStudy",
"updateTemplate",
Expand All @@ -1041,11 +1044,11 @@ qx.Class.define("osparc.dashboard.CardBase", {
resourceDetails.addListener(ev, e => this.fireDataEvent(ev, e.getData()));
});
resourceDetails.addListener("publishTemplate", e => {
win.close();
window.close();
this.fireDataEvent("publishTemplate", e.getData());
});
resourceDetails.addListener("openStudy", e => {
const openCB = () => win.close();
const openCB = () => window.close();
const studyId = e.getData()["uuid"];
const isStudyCreation = false;
this._startStudyById(studyId, openCB, null, isStudyCreation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,13 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
// so that is not consumed by the menu button itself
e.stopPropagation();
latestMetadata["resourceType"] = "service";
const resourceDetails = new osparc.dashboard.ResourceDetails(latestMetadata);
const win = osparc.dashboard.ResourceDetails.popUpInWindow(resourceDetails);
const {
resourceDetails,
window,
} = osparc.dashboard.ResourceDetails.popUpInWindow(latestMetadata);

resourceDetails.addListener("openService", ev => {
win.close();
window.close();
const openServiceData = ev.getData();
this.fireDataEvent("newStudyFromServiceClicked", {
serviceMetadata: openServiceData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,19 +939,22 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
},

_openResourceDetails: function(resourceData) {
const resourceDetails = new osparc.dashboard.ResourceDetails(resourceData);
const win = osparc.dashboard.ResourceDetails.popUpInWindow(resourceDetails);
const {
resourceDetails,
window,
} = osparc.dashboard.ResourceDetails.popUpInWindow(resourceData);

resourceDetails.addListener("updateStudy", e => this._updateStudyData(e.getData()));
resourceDetails.addListener("updateTemplate", e => this._updateTemplateData(e.getData()));
resourceDetails.addListener("updateTutorial", e => this._updateTutorialData(e.getData()));
resourceDetails.addListener("updateService", e => this._updateServiceData(e.getData()));
resourceDetails.addListener("updateHypertool", e => this._updateHypertoolData(e.getData()));
resourceDetails.addListener("publishTemplate", e => {
win.close();
window.close();
this.fireDataEvent("publishTemplate", e.getData());
});
resourceDetails.addListener("openStudy", e => {
const openCB = () => win.close();
const openCB = () => window.close();
const studyId = e.getData()["uuid"];
const isStudyCreation = false;
this._startStudyById(studyId, openCB, null, isStudyCreation);
Expand All @@ -962,13 +965,13 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
"openHypertool",
].forEach(eventName => {
resourceDetails.addListener(eventName, e => {
win.close();
window.close();
const templateData = e.getData();
this._createStudyFromTemplate(templateData);
});
});
resourceDetails.addListener("openService", e => {
win.close();
window.close();
const openServiceData = e.getData();
this._createStudyFromService(openServiceData["key"], openServiceData["version"]);
});
Expand Down
Loading
Loading