Skip to content

Commit a7f864a

Browse files
authored
Merge branch 'master' into is6201/catalog-history-alternative
2 parents 517952d + a059026 commit a7f864a

File tree

16 files changed

+140
-72
lines changed

16 files changed

+140
-72
lines changed

api/specs/web-server/_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from uuid import UUID
99

1010
from fastapi import APIRouter, Depends, Query, status
11-
from fastapi_pagination.cursor import CursorPage
1211
from models_library.api_schemas_storage.storage_schemas import (
1312
FileLocation,
1413
FileMetaDataGet,
@@ -32,6 +31,7 @@
3231
from models_library.projects_nodes_io import LocationID
3332
from models_library.users import UserID
3433
from pydantic import AnyUrl, ByteSize
34+
from servicelib.fastapi.rest_pagination import CustomizedPathsCursorPage
3535
from simcore_service_webserver._meta import API_VTAG
3636
from simcore_service_webserver.storage.schemas import DatasetMetaData, FileMetaData
3737

@@ -59,7 +59,7 @@ async def list_storage_locations():
5959

6060
@router.get(
6161
"/storage/locations/{location_id}/paths",
62-
response_model=CursorPage[PathMetaDataGet],
62+
response_model=CustomizedPathsCursorPage[PathMetaDataGet],
6363
)
6464
async def list_storage_paths(
6565
_path: Annotated[StorageLocationPathParams, Depends()],

packages/models-library/src/models_library/api_schemas_storage/storage_schemas.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import datetime
1010
from enum import Enum
1111
from pathlib import Path
12-
from typing import Annotated, Any, Literal, Self, TypeAlias
12+
from typing import Annotated, Any, Final, Literal, Self, TypeAlias
1313
from uuid import UUID
1414

1515
from pydantic import (
@@ -404,6 +404,10 @@ class SoftCopyBody(BaseModel):
404404
link_id: SimcoreS3FileID
405405

406406

407+
DEFAULT_NUMBER_OF_PATHS_PER_PAGE: Final[int] = 50
408+
MAX_NUMBER_OF_PATHS_PER_PAGE: Final[int] = 1000
409+
410+
407411
class PathMetaDataGet(BaseModel):
408412
path: Annotated[Path, Field(description="the path to the current path")]
409413
display_path: Annotated[

packages/models-library/src/models_library/api_schemas_webserver/storage.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
from datetime import datetime
22
from pathlib import Path
3-
from typing import Any
3+
from typing import Annotated, Any
44

5-
from pydantic import BaseModel
5+
from models_library.api_schemas_storage.storage_schemas import (
6+
DEFAULT_NUMBER_OF_PATHS_PER_PAGE,
7+
MAX_NUMBER_OF_PATHS_PER_PAGE,
8+
)
9+
from pydantic import BaseModel, Field
610

711
from ..api_schemas_rpc_async_jobs.async_jobs import (
812
AsyncJobGet,
@@ -13,7 +17,9 @@
1317
from ..api_schemas_storage.data_export_async_jobs import DataExportTaskStartInput
1418
from ..progress_bar import ProgressReport
1519
from ..projects_nodes_io import LocationID, StorageFileID
16-
from ..rest_pagination import CursorQueryParameters
20+
from ..rest_pagination import (
21+
CursorQueryParameters,
22+
)
1723
from ._base import InputSchema, OutputSchema
1824

1925

@@ -24,6 +30,15 @@ class StorageLocationPathParams(BaseModel):
2430
class ListPathsQueryParams(InputSchema, CursorQueryParameters):
2531
file_filter: Path | None = None
2632

33+
size: Annotated[
34+
int,
35+
Field(
36+
description="maximum number of items to return (pagination)",
37+
ge=1,
38+
lt=MAX_NUMBER_OF_PATHS_PER_PAGE,
39+
),
40+
] = DEFAULT_NUMBER_OF_PATHS_PER_PAGE
41+
2742

2843
class DataExportPost(InputSchema):
2944
paths: list[StorageFileID]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from typing import TypeAlias, TypeVar
2+
3+
from fastapi import Query
4+
from fastapi_pagination.cursor import CursorPage # type: ignore[import-not-found]
5+
from fastapi_pagination.customization import ( # type: ignore[import-not-found]
6+
CustomizedPage,
7+
UseParamsFields,
8+
)
9+
from models_library.api_schemas_storage.storage_schemas import (
10+
DEFAULT_NUMBER_OF_PATHS_PER_PAGE,
11+
MAX_NUMBER_OF_PATHS_PER_PAGE,
12+
)
13+
14+
_T = TypeVar("_T")
15+
16+
CustomizedPathsCursorPage = CustomizedPage[
17+
CursorPage[_T],
18+
# Customizes the maximum value to fit frontend needs
19+
UseParamsFields(
20+
size=Query(
21+
DEFAULT_NUMBER_OF_PATHS_PER_PAGE,
22+
ge=1,
23+
le=MAX_NUMBER_OF_PATHS_PER_PAGE,
24+
description="Page size",
25+
)
26+
),
27+
]
28+
CustomizedPathsCursorPageParams: TypeAlias = CustomizedPathsCursorPage.__params_type__ # type: ignore

services/api-server/openapi.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,9 @@
805805
"required": false,
806806
"schema": {
807807
"type": "integer",
808-
"maximum": 100,
808+
"maximum": 50,
809809
"minimum": 1,
810-
"default": 50,
810+
"default": 20,
811811
"title": "Limit"
812812
}
813813
},
@@ -3352,9 +3352,9 @@
33523352
"required": false,
33533353
"schema": {
33543354
"type": "integer",
3355-
"maximum": 100,
3355+
"maximum": 50,
33563356
"minimum": 1,
3357-
"default": 50,
3357+
"default": 20,
33583358
"title": "Limit"
33593359
}
33603360
},
@@ -4164,9 +4164,9 @@
41644164
"required": false,
41654165
"schema": {
41664166
"type": "integer",
4167-
"maximum": 100,
4167+
"maximum": 50,
41684168
"minimum": 1,
4169-
"default": 50,
4169+
"default": 20,
41704170
"title": "Limit"
41714171
}
41724172
},
@@ -5351,9 +5351,9 @@
53515351
"required": false,
53525352
"schema": {
53535353
"type": "integer",
5354-
"maximum": 100,
5354+
"maximum": 50,
53555355
"minimum": 1,
5356-
"default": 50,
5356+
"default": 20,
53575357
"title": "Limit"
53585358
}
53595359
},
@@ -5648,9 +5648,9 @@
56485648
"required": false,
56495649
"schema": {
56505650
"type": "integer",
5651-
"maximum": 100,
5651+
"maximum": 50,
56525652
"minimum": 1,
5653-
"default": 50,
5653+
"default": 20,
56545654
"title": "Limit"
56555655
}
56565656
},

services/api-server/src/simcore_service_api_server/models/pagination.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Overrides models in fastapi_pagination
1+
"""Overrides models in fastapi_pagination
22
33
Usage:
44
from fastapi_pagination.api import create_page
@@ -11,7 +11,6 @@
1111

1212
from fastapi import Query
1313
from fastapi_pagination.customization import CustomizedPage, UseName, UseParamsFields
14-
from fastapi_pagination.limit_offset import LimitOffsetParams as _LimitOffsetParams
1514
from fastapi_pagination.links import LimitOffsetPage as _LimitOffsetPage
1615
from models_library.rest_pagination import (
1716
DEFAULT_NUMBER_OF_ITEMS_PER_PAGE,
@@ -43,7 +42,7 @@
4342
UseName(name="Page"),
4443
]
4544

46-
PaginationParams: TypeAlias = _LimitOffsetParams
45+
PaginationParams: TypeAlias = Page.__params_type__ # type: ignore
4746

4847

4948
class OnePage(BaseModel, Generic[T]):

services/static-webserver/client/source/class/osparc/desktop/account/ProfilePage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
225225
maxWidth: 500
226226
});
227227

228-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("For Privacy reasons, you might want to hide your Full Name and/or the email to other users"));
228+
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("For Privacy reasons, you might want to hide your First and Last Names and/or the Email to other users"));
229229
box.add(label);
230230

231231
const hideFullname = new qx.ui.form.CheckBox().set({
@@ -237,7 +237,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
237237

238238
const form = new qx.ui.form.Form();
239239
form.add(hideFullname, "Hide Full Name", null, "hideFullname");
240-
form.add(hideEmail, "Hide email", null, "hideEmail");
240+
form.add(hideEmail, "Hide Email", null, "hideEmail");
241241
box.add(new qx.ui.form.renderer.Single(form));
242242

243243
// binding to a model

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ConfirmationsPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ qx.Class.define("osparc.desktop.preferences.pages.ConfirmationsPage", {
114114
cbConfirmStopNode.addListener("changeValue", e => osparc.Preferences.patchPreferenceField("confirmStopNode", cbConfirmStopNode, e.getData()));
115115
box.add(cbConfirmStopNode);
116116

117-
const cbSnapNodeToGrid = new qx.ui.form.CheckBox(this.tr("Snap Node to grid"));
117+
const cbSnapNodeToGrid = new qx.ui.form.CheckBox(this.tr("Snap Node to Grid"));
118118
preferencesSettings.bind("snapNodeToGrid", cbSnapNodeToGrid, "value");
119119
cbSnapNodeToGrid.addListener("changeValue", e => osparc.Preferences.patchPreferenceField("snapNodeToGrid", cbSnapNodeToGrid, e.getData()));
120120
box.add(cbSnapNodeToGrid);

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/GeneralPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ qx.Class.define("osparc.desktop.preferences.pages.GeneralPage", {
137137

138138
__addLowDiskSpaceSetting: function() {
139139
const box = osparc.ui.window.TabbedView.createSectionBox(this.tr("Low Disk Space Threshold"));
140-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Set the warning Threshold for low Disk Space availability."), "text-13-italic");
140+
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Set the warning Threshold for Low Disk Space availability"), "text-13-italic");
141141
box.add(label);
142142
const form = new qx.ui.form.Form();
143143
const diskUsageSpinner = new qx.ui.form.Spinner().set({

services/static-webserver/client/source/class/osparc/product/AboutProduct.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ qx.Class.define("osparc.product.AboutProduct", {
4949
__buildLayout: function() {
5050
switch (osparc.product.Utils.getProductName()) {
5151
case "s4l":
52-
this.__buildS4LLayout();
53-
break;
5452
case "s4lacad":
55-
this.__buildS4LAcademicLayout();
53+
this.__buildS4LLayout();
5654
break;
5755
case "s4llite":
5856
this.__buildS4LLiteLayout();
@@ -73,11 +71,11 @@ qx.Class.define("osparc.product.AboutProduct", {
7371
__buildS4LLayout: function() {
7472
const licenseUrl = osparc.store.Support.getLicenseURL();
7573
const text = this.tr(`
76-
sim4life.io is a native implementation of the most advanced simulation platform, Sim4Life, in the cloud. \
74+
Sim4Life.web is a native implementation of the most advanced simulation platform, Sim4Life, in the cloud. \
7775
The platform empowers users to simulate, analyze, and predict complex, multifaceted, and dynamic biological interactions within the full anatomical complexity of the human body. \
7876
It provides the ability to set up and run complex simulations directly within any browser, utilizing cloud technology.
7977
<br><br>
80-
sim4life.io makes use of technologies developed by our research partner for the o<sup>2</sup>S<sup>2</sup>PARC platform, the IT’IS Foundation, and co-funded by the U.S. National Institutes of Health’s SPARC initiative.\
78+
Sim4Life.web makes use of technologies developed by our research partner for the o<sup>2</sup>S<sup>2</sup>PARC platform, the IT’IS Foundation, and co-funded by the U.S. National Institutes of Health’s SPARC initiative.\
8179
<br><br>
8280
For more information about Sim4Life, please visit ${osparc.utils.Utils.createHTMLLink("sim4life.swiss", "https://sim4life.swiss/")}.
8381
<br><br>
@@ -90,26 +88,6 @@ qx.Class.define("osparc.product.AboutProduct", {
9088
this.add(label);
9189
},
9290

93-
__buildS4LAcademicLayout: function() {
94-
const licenseUrl = osparc.store.Support.getLicenseURL();
95-
const text = this.tr(`
96-
sim4life.science is a native implementation of the most advanced simulation platform, Sim4Life, in the cloud. \
97-
The platform empowers users to simulate, analyze, and predict complex, multifaceted, and dynamic biological interactions within the full anatomical complexity of the human body. \
98-
It provides the ability to set up and run complex simulations directly within any browser, utilizing cloud technology.
99-
<br><br>
100-
sim4life.science makes use of technologies developed by our research partner for the o<sup>2</sup>S<sup>2</sup>PARC platform, the IT’IS Foundation, and co-funded by the U.S. National Institutes of Health’s SPARC initiative.\
101-
<br><br>
102-
For more information about Sim4Life, please visit ${osparc.utils.Utils.createHTMLLink("sim4life.swiss", "href='https://sim4life.swiss/")}.
103-
<br><br>
104-
To review license agreements, click ${osparc.utils.Utils.createHTMLLink("here", licenseUrl)}.
105-
<br><br>
106-
Send us an email ${this.__getMailTo()}
107-
`);
108-
109-
const label = osparc.product.quickStart.Utils.createLabel(text);
110-
this.add(label);
111-
},
112-
11391
__buildS4LLiteLayout: function() {
11492
// https://zurichmedtech.github.io/s4l-lite-manual/#/docs/what_is_s4l_lite
11593
const introText = "Sim4Life.lite is a powerful web-based simulation platform that allows you to model and analyze real-world phenomena and to design complex technical devices in a validated environment. With its intuitive interface and advanced tools, Sim4Life.lite makes it easy to develop your simulation project, wherever you are.";

0 commit comments

Comments
 (0)