Skip to content

Commit

Permalink
some progress
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Nov 14, 2024
1 parent 5589d99 commit ebaeadb
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ qx.Class.define("osparc.po.Announcements", {
const generateAnnouncementBtn = new osparc.ui.form.FetchButton(this.tr("Generate"));
generateAnnouncementBtn.set({appearance: "form-button"});
generateAnnouncementBtn.addListener("execute", () => {
const products = [osparc.product.Utils.getProductName()];
const widgets = [];
if (widgetLogin.getValue()) {
widgets.push("login");
Expand All @@ -118,10 +119,10 @@ qx.Class.define("osparc.po.Announcements", {
}
const announcementData = {
"id": osparc.utils.Utils.uuidV4(),
"products": "[" + osparc.product.Utils.getProductName() + "]",
"title": title.getValue() ? encodeURIComponent(title.getValue()) : "",
"description": description.getValue() ? encodeURIComponent(description.getValue()) : "",
"widgets": "[" + widgets.join("") + "]",
"products": JSON.stringify(products),
"title": title.getValue() ? title.getValue() : "",
"description": description.getValue() ? description.getValue() : "",
"widgets": JSON.stringify(widgets),
"start": start.getValue(),
"end": end.getValue(),
};
Expand All @@ -147,7 +148,7 @@ qx.Class.define("osparc.po.Announcements", {
});
copyAnnouncementBtn.set({appearance: "form-button"});
copyAnnouncementBtn.addListener("execute", () => {
if (osparc.utils.Utils.copyTextToClipboard(announcementData)) {
if (osparc.utils.Utils.copyTextToClipboard(JSON.stringify(announcementData))) {
copyAnnouncementBtn.setIcon("@FontAwesome5Solid/check/12");
}
});
Expand Down

0 comments on commit ebaeadb

Please sign in to comment.