Skip to content

Commit

Permalink
Merge branch 'master' into 2024/fix/tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnicegyu11 authored Oct 15, 2024
2 parents e62cb83 + ad0a35d commit ebc9e8f
Show file tree
Hide file tree
Showing 35 changed files with 348 additions and 347 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class OutputStatus(StrAutoEnum):
UPLOAD_STARTED = auto()
UPLOAD_WAS_ABORTED = auto()
UPLOAD_FINISHED_SUCCESSFULLY = auto()
UPLOAD_FINISHED_WITH_ERRROR = auto()
UPLOAD_FINISHED_WITH_ERROR = auto()


class InputStatus(StrAutoEnum):
DOWNLOAD_STARTED = auto()
DOWNLOAD_WAS_ABORTED = auto()
DOWNLOAD_FINISHED_SUCCESSFULLY = auto()
DOWNLOAD_FINISHED_WITH_ERRROR = auto()
DOWNLOAD_FINISHED_WITH_ERROR = auto()


class _PortStatusCommon(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def send_output_port_upload_finished_with_error(
self, port_key: ServicePortKey
) -> None:
await self._send_output_port_status(
port_key, OutputStatus.UPLOAD_FINISHED_WITH_ERRROR
port_key, OutputStatus.UPLOAD_FINISHED_WITH_ERROR
)

async def send_input_port_download_started(self, port_key: ServicePortKey) -> None:
Expand All @@ -74,5 +74,5 @@ async def send_input_port_download_finished_with_error(
self, port_key: ServicePortKey
) -> None:
await self._send_input_port_status(
port_key, InputStatus.DOWNLOAD_FINISHED_WITH_ERRROR
port_key, InputStatus.DOWNLOAD_FINISHED_WITH_ERROR
)
4 changes: 2 additions & 2 deletions services/dynamic-sidecar/tests/unit/test_modules_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ async def test_notifier_send_input_port_status(
await port_notifier.send_input_port_download_finished_succesfully(
port_key
)
case InputStatus.DOWNLOAD_FINISHED_WITH_ERRROR:
case InputStatus.DOWNLOAD_FINISHED_WITH_ERROR:
await port_notifier.send_input_port_download_finished_with_error(
port_key
)
Expand Down Expand Up @@ -378,7 +378,7 @@ async def test_notifier_send_output_port_status(
await port_notifier.send_output_port_upload_finished_successfully(
port_key
)
case OutputStatus.UPLOAD_FINISHED_WITH_ERRROR:
case OutputStatus.UPLOAD_FINISHED_WITH_ERROR:
await port_notifier.send_output_port_upload_finished_with_error(
port_key
)
Expand Down
2 changes: 1 addition & 1 deletion services/static-webserver/client/compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"class": "osparc.Application",
"theme": "osparc.theme.products.s4l.ThemeDark",
"name": "s4llite",
"title": "Sim4Life Lite",
"title": "Sim4Life.lite",
"include": [
"iconfont.material.Load",
"iconfont.fontawesome5.Load",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ qx.Class.define("osparc.dashboard.ContextBreadcrumbs", {
__rebuild: function() {
this._removeAll();

if (this.getCurrentWorkspaceId() === -2) {
return;
}

if (this.getCurrentFolderId()) {
const currentFolder = osparc.store.Folders.getInstance().getFolder(this.getCurrentFolderId());
this.__createUpstreamButtons(currentFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ qx.Class.define("osparc.dashboard.Dashboard", {
});
const tabButton = tabPage.getChildControl("button");
tabButton.set({
minWidth: 50
minWidth: 50,
maxHeight: 36,
});
tabButton.ttt = label;
tabButton.getChildControl("label").set({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,10 @@ qx.Class.define("osparc.dashboard.FolderButtonBase", {
},

_shouldApplyFilter: function(data) {
console.log("_shouldApplyFilter", data);
return false;
},

_shouldReactToFilter: function(data) {
console.log("_shouldReactToFilter", data);
return false;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ qx.Class.define("osparc.dashboard.GridButtonNew", {
});

if (title) {
title = osparc.utils.Utils.replaceTokens(
title,
"replace_me_product_name",
osparc.store.StaticInfo.getInstance().getDisplayName()
);

const titleLabel = this.getChildControl("title");
titleLabel.set({
value: title,
Expand All @@ -45,6 +51,12 @@ qx.Class.define("osparc.dashboard.GridButtonNew", {
}

if (description) {
description = osparc.utils.Utils.replaceTokens(
description,
"replace_me_product_name",
osparc.store.StaticInfo.getInstance().getDisplayName()
);

const descLabel = this.getChildControl("subtitle-text");
descLabel.setValue(description.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ qx.Class.define("osparc.dashboard.ListButtonNew", {
});

if (title) {
title = osparc.utils.Utils.replaceTokens(
title,
"replace_me_product_name",
osparc.store.StaticInfo.getInstance().getDisplayName()
);

const titleLabel = this.getChildControl("title");
titleLabel.set({
value: title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,7 @@ qx.Class.define("osparc.dashboard.NewStudies", {
const newStudyClicked = () => this.fireDataEvent("newStudyClicked", templateInfo);

const title = templateInfo.title;
let desc = templateInfo.description;
if (desc) {
desc = osparc.utils.Utils.replaceTokens(
desc,
"replace_me_product_name",
osparc.store.StaticInfo.getInstance().getDisplayName()
);
}
const desc = templateInfo.description;
const newPlanButton = new osparc.dashboard.GridButtonNew(title, desc);
newPlanButton.setCardKey(templateInfo.idToWidget);
osparc.utils.Utils.setIdToWidget(newPlanButton, templateInfo.idToWidget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
const mainLayoutWithSideSpacers = new qx.ui.container.Composite(new qx.ui.layout.HBox(spacing))
this._addToMainLayout(mainLayoutWithSideSpacers);

this.__leftFilters = new qx.ui.container.Composite(new qx.ui.layout.VBox(10)).set({
this.__leftFilters = new qx.ui.container.Composite(new qx.ui.layout.VBox(15)).set({
width: leftColumnWidth
});
mainLayoutWithSideSpacers.add(this.__leftFilters);

this.__centerLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
this.__centerLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(15));
mainLayoutWithSideSpacers.add(this.__centerLayout);

const rightColum = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
const rightColum = new qx.ui.container.Composite(new qx.ui.layout.VBox());
mainLayoutWithSideSpacers.add(rightColum, {
flex: 1
});
Expand Down Expand Up @@ -236,6 +236,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
});
const textField = searchBarFilter.getChildControl("text-field");
osparc.utils.Utils.setIdToWidget(textField, "searchBarFilter-textField-"+this._resourceType);

this._addToLayout(searchBarFilter);
},

Expand Down Expand Up @@ -356,6 +357,15 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
radioGroup.add(btn);
});

if (this._resourceType === "study") {
const viewMode = osparc.utils.Utils.localCache.getLocalStorageItem("studiesViewMode");
if (viewMode) {
if (viewMode === "list") {
radioGroup.setSelection([listBtn]);
}
}
}

this._toolbar.add(viewModeLayout);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
this.__resourcesList = [];
this.__groupedContainersList = [];

const containerHeader = this.__containerHeader = new osparc.dashboard.ContextBreadcrumbs();
this._add(containerHeader);
containerHeader.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");


const workspacesContainer = this.__workspacesContainer = new osparc.dashboard.ToggleButtonContainer();
workspacesContainer.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");
Expand Down Expand Up @@ -64,7 +60,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
init: "grid",
nullable: false,
event: "changeMode",
apply: "reloadCards"
apply: "__reloadCards"
},

groupBy: {
Expand Down Expand Up @@ -117,8 +113,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
__workspacesList: null,
__resourcesList: null,
__groupedContainersList: null,
__foldersLayout: null,
__containerHeader: null,
__foldersContainer: null,
__workspacesContainer: null,
__nonGroupedContainer: null,
Expand Down Expand Up @@ -163,10 +157,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
}
},

getContainerHeader: function() {
return this.__containerHeader;
},

getFlatList: function() {
return this.__nonGroupedContainer;
},
Expand Down Expand Up @@ -233,7 +223,10 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
position: "bottom-right"
});
card.setMenu(menu);
card.subscribeToFilterGroup("searchBarFilter");
if (resourceData.type !== "study") {
// the backend will do the projects:search
card.subscribeToFilterGroup("searchBarFilter");
}

[
"updateStudy",
Expand Down Expand Up @@ -284,6 +277,10 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
this._removeAll();
},

__reloadCards: function(mode) {
this.reloadCards();
},

__addFoldersContainer: function() {
// add foldersContainer dynamically
[
Expand Down Expand Up @@ -356,7 +353,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

reloadWorkspaces: function() {
this.__cleanAll();
this._add(this.__containerHeader);
this._add(this.__workspacesContainer);
let workspacesCards = [];
this.__workspacesList.forEach(workspaceData => workspacesCards.push(this.__workspaceToCard(workspaceData)));
Expand All @@ -375,7 +371,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

__createWorkspaceCard: function(workspace) {
const card = new osparc.dashboard.WorkspaceButtonItem(workspace);
card.subscribeToFilterGroup("searchBarFilter");
[
"workspaceSelected",
"workspaceUpdated",
Expand Down Expand Up @@ -411,7 +406,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

__createFolderCard: function(folder) {
const card = new osparc.dashboard.FolderButtonItem(folder);
card.subscribeToFilterGroup("searchBarFilter");
[
"folderSelected",
"folderUpdated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
this.__openResource();
}
})
.catch(() => this.__openButton.setFetching(false));
.catch(err => {
console.error(err);
osparc.FlashMessenger.logAs(err.message, "ERROR");
this.__openButton.setFetching(false);
});
},

__confirmUpdate: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {
});
},

resetSharedWithActiveFilter: function() {
this.__removeChips("shared-with");
this.__filter();
},

setSharedWithActiveFilter: function(optionId, optionLabel) {
this.__removeChips("shared-with");
Expand Down Expand Up @@ -353,9 +349,13 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {
}
},

__resetFilters: function() {
resetFilters: function() {
this.__removeChips();
this.getChildControl("text-field").resetValue();
},

__resetFilters: function() {
this.resetFilters();
this.__filter();
},

Expand Down
Loading

0 comments on commit ebc9e8f

Please sign in to comment.