Skip to content

Commit 220ec04

Browse files
committed
changed api
1 parent 54d13b4 commit 220ec04

File tree

2 files changed

+34
-58
lines changed

2 files changed

+34
-58
lines changed

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13931,35 +13931,6 @@ components:
1393113931
- service_key
1393213932
- running_time_in_hours
1393313933
title: OsparcCreditsAggregatedByServiceGet
13934-
Owner:
13935-
properties:
13936-
user_id:
13937-
type: integer
13938-
exclusiveMinimum: true
13939-
title: User Id
13940-
description: Owner's user id
13941-
minimum: 0
13942-
first_name:
13943-
anyOf:
13944-
- type: string
13945-
maxLength: 255
13946-
- type: 'null'
13947-
title: First Name
13948-
description: Owner's first name
13949-
last_name:
13950-
anyOf:
13951-
- type: string
13952-
maxLength: 255
13953-
- type: 'null'
13954-
title: Last Name
13955-
description: Owner's last name
13956-
additionalProperties: false
13957-
type: object
13958-
required:
13959-
- user_id
13960-
- first_name
13961-
- last_name
13962-
title: Owner
1396313934
PageLinks:
1396413935
properties:
1396513936
self:
@@ -15521,26 +15492,6 @@ components:
1552115492
- workspaceId
1552215493
- folderId
1552315494
title: ProjectListItem
15524-
ProjectLocked:
15525-
properties:
15526-
value:
15527-
type: boolean
15528-
title: Value
15529-
description: True if the project is locked
15530-
status:
15531-
$ref: '#/components/schemas/ProjectStatus'
15532-
description: The status of the project
15533-
owner:
15534-
anyOf:
15535-
- $ref: '#/components/schemas/Owner'
15536-
- type: 'null'
15537-
description: If locked, the user that owns the lock
15538-
additionalProperties: false
15539-
type: object
15540-
required:
15541-
- value
15542-
- status
15543-
title: ProjectLocked
1554415495
ProjectMetadataGet:
1554515496
properties:
1554615497
projectUuid:
@@ -15768,18 +15719,43 @@ components:
1576815719
- shareeEmail
1576915720
- confirmationLink
1577015721
title: ProjectShareAccepted
15771-
ProjectState:
15722+
ProjectShareState:
1577215723
properties:
15724+
status:
15725+
$ref: '#/components/schemas/ProjectStatus'
15726+
description: The status of the project
1577315727
locked:
15774-
$ref: '#/components/schemas/ProjectLocked'
15728+
type: boolean
15729+
title: Locked
15730+
description: True if the project is locked
15731+
current_user_groupids:
15732+
items:
15733+
type: integer
15734+
exclusiveMinimum: true
15735+
minimum: 0
15736+
type: array
15737+
title: Current User Groupids
15738+
description: Current users in the project (if the project is locked, the
15739+
list contains only the lock owner)
15740+
additionalProperties: false
15741+
type: object
15742+
required:
15743+
- status
15744+
- locked
15745+
- current_user_groupids
15746+
title: ProjectShareState
15747+
ProjectState:
15748+
properties:
15749+
share_state:
15750+
$ref: '#/components/schemas/ProjectShareState'
1577515751
description: The project lock state
1577615752
state:
1577715753
$ref: '#/components/schemas/ProjectRunningState'
1577815754
description: The project running state
1577915755
additionalProperties: false
1578015756
type: object
1578115757
required:
15782-
- locked
15758+
- share_state
1578315759
- state
1578415760
title: ProjectState
1578515761
ProjectStatus:

services/web/server/src/simcore_service_webserver/projects/_projects_service.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from models_library.errors import ErrorDict
3535
from models_library.groups import GroupID
3636
from models_library.products import ProductName
37-
from models_library.projects import Project, ProjectID, ProjectIDStr
37+
from models_library.projects import Project, ProjectID
3838
from models_library.projects_access import Owner
3939
from models_library.projects_nodes import Node, NodeState, PartialNode
4040
from models_library.projects_nodes_io import NodeID, NodeIDStr, PortLink
@@ -275,7 +275,7 @@ async def update_project_last_change_timestamp(
275275
):
276276
db: ProjectDBAPI = app[APP_PROJECT_DBAPI]
277277
assert db # nosec
278-
await db.update_project_last_change_timestamp(ProjectIDStr(f"{project_uuid}"))
278+
await db.update_project_last_change_timestamp(f"{project_uuid}")
279279

280280

281281
async def patch_project(
@@ -1577,7 +1577,7 @@ async def get_project_states_for_user(
15771577
) -> ProjectState:
15781578
# for templates: the project is never locked and never opened. also the running state is always unknown
15791579
running_state = RunningState.UNKNOWN
1580-
lock_state, computation_task = await logged_gather(
1580+
share_state, computation_task = await logged_gather(
15811581
_get_project_share_state(user_id, project_uuid, app),
15821582
director_v2_service.get_computation_task(app, user_id, UUID(project_uuid)),
15831583
)
@@ -1586,7 +1586,7 @@ async def get_project_states_for_user(
15861586
running_state = computation_task.state
15871587

15881588
return ProjectState(
1589-
locked=lock_state, state=ProjectRunningState(value=running_state)
1589+
share_state=share_state, state=ProjectRunningState(value=running_state)
15901590
)
15911591

15921592

@@ -1603,7 +1603,7 @@ async def add_project_states_for_user(
16031603
f"{project['uuid']=}",
16041604
)
16051605
# for templates: the project is never locked and never opened. also the running state is always unknown
1606-
lock_state = await _get_project_share_state(user_id, project["uuid"], app)
1606+
share_state = await _get_project_share_state(user_id, project["uuid"], app)
16071607
running_state = RunningState.UNKNOWN
16081608

16091609
if not is_template and (
@@ -1629,7 +1629,7 @@ async def add_project_states_for_user(
16291629
prj_node.update({"progress": round(prj_node_progress * 100.0)})
16301630

16311631
project["state"] = ProjectState(
1632-
locked=lock_state, state=ProjectRunningState(value=running_state)
1632+
share_state=share_state, state=ProjectRunningState(value=running_state)
16331633
).model_dump(by_alias=True, exclude_unset=True)
16341634
return project
16351635

0 commit comments

Comments
 (0)