Skip to content

Commit 6db2504

Browse files
committed
Merge branch 'master' into is34/fix-catalog-service-inherit-group-1
2 parents 4400af2 + 7d6abf5 commit 6db2504

File tree

22 files changed

+561
-206
lines changed

22 files changed

+561
-206
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
"""Make func api access non-nullable
2+
3+
Revision ID: d159ac30983c
4+
Revises: 4f6fd2586491
5+
Create Date: 2025-07-01 08:50:29.095068+00:00
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "d159ac30983c"
14+
down_revision = "4f6fd2586491"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.execute(
22+
"""
23+
UPDATE funcapi_group_api_access_rights
24+
SET read_functions = false
25+
WHERE read_functions IS NULL
26+
"""
27+
)
28+
op.execute(
29+
"""
30+
UPDATE funcapi_group_api_access_rights
31+
SET write_functions = false
32+
WHERE write_functions IS NULL
33+
"""
34+
)
35+
op.execute(
36+
"""
37+
UPDATE funcapi_group_api_access_rights
38+
SET execute_functions = false
39+
WHERE execute_functions IS NULL
40+
"""
41+
)
42+
op.execute(
43+
"""
44+
UPDATE funcapi_group_api_access_rights
45+
SET read_function_jobs = false
46+
WHERE read_function_jobs IS NULL
47+
"""
48+
)
49+
op.execute(
50+
"""
51+
UPDATE funcapi_group_api_access_rights
52+
SET write_function_jobs = false
53+
WHERE write_function_jobs IS NULL
54+
"""
55+
)
56+
op.execute(
57+
"""
58+
UPDATE funcapi_group_api_access_rights
59+
SET execute_function_jobs = false
60+
WHERE execute_function_jobs IS NULL
61+
"""
62+
)
63+
op.execute(
64+
"""
65+
UPDATE funcapi_group_api_access_rights
66+
SET read_function_job_collections = false
67+
WHERE read_function_job_collections IS NULL
68+
"""
69+
)
70+
op.execute(
71+
"""
72+
UPDATE funcapi_group_api_access_rights
73+
SET write_function_job_collections = false
74+
WHERE write_function_job_collections IS NULL
75+
"""
76+
)
77+
op.execute(
78+
"""
79+
UPDATE funcapi_group_api_access_rights
80+
SET execute_function_job_collections = false
81+
WHERE execute_function_job_collections IS NULL
82+
"""
83+
)
84+
op.alter_column(
85+
"funcapi_group_api_access_rights",
86+
"write_functions",
87+
existing_type=sa.BOOLEAN(),
88+
nullable=False,
89+
)
90+
op.alter_column(
91+
"funcapi_group_api_access_rights",
92+
"execute_functions",
93+
existing_type=sa.BOOLEAN(),
94+
nullable=False,
95+
)
96+
op.alter_column(
97+
"funcapi_group_api_access_rights",
98+
"read_function_jobs",
99+
existing_type=sa.BOOLEAN(),
100+
nullable=False,
101+
)
102+
op.alter_column(
103+
"funcapi_group_api_access_rights",
104+
"write_function_jobs",
105+
existing_type=sa.BOOLEAN(),
106+
nullable=False,
107+
)
108+
op.alter_column(
109+
"funcapi_group_api_access_rights",
110+
"execute_function_jobs",
111+
existing_type=sa.BOOLEAN(),
112+
nullable=False,
113+
)
114+
op.alter_column(
115+
"funcapi_group_api_access_rights",
116+
"read_function_job_collections",
117+
existing_type=sa.BOOLEAN(),
118+
nullable=False,
119+
)
120+
op.alter_column(
121+
"funcapi_group_api_access_rights",
122+
"write_function_job_collections",
123+
existing_type=sa.BOOLEAN(),
124+
nullable=False,
125+
)
126+
op.alter_column(
127+
"funcapi_group_api_access_rights",
128+
"execute_function_job_collections",
129+
existing_type=sa.BOOLEAN(),
130+
nullable=False,
131+
)
132+
# ### end Alembic commands ###
133+
134+
135+
def downgrade():
136+
# ### commands auto generated by Alembic - please adjust! ###
137+
op.alter_column(
138+
"funcapi_group_api_access_rights",
139+
"execute_function_job_collections",
140+
existing_type=sa.BOOLEAN(),
141+
nullable=True,
142+
)
143+
op.alter_column(
144+
"funcapi_group_api_access_rights",
145+
"write_function_job_collections",
146+
existing_type=sa.BOOLEAN(),
147+
nullable=True,
148+
)
149+
op.alter_column(
150+
"funcapi_group_api_access_rights",
151+
"read_function_job_collections",
152+
existing_type=sa.BOOLEAN(),
153+
nullable=True,
154+
)
155+
op.alter_column(
156+
"funcapi_group_api_access_rights",
157+
"execute_function_jobs",
158+
existing_type=sa.BOOLEAN(),
159+
nullable=True,
160+
)
161+
op.alter_column(
162+
"funcapi_group_api_access_rights",
163+
"write_function_jobs",
164+
existing_type=sa.BOOLEAN(),
165+
nullable=True,
166+
)
167+
op.alter_column(
168+
"funcapi_group_api_access_rights",
169+
"read_function_jobs",
170+
existing_type=sa.BOOLEAN(),
171+
nullable=True,
172+
)
173+
op.alter_column(
174+
"funcapi_group_api_access_rights",
175+
"execute_functions",
176+
existing_type=sa.BOOLEAN(),
177+
nullable=True,
178+
)
179+
op.alter_column(
180+
"funcapi_group_api_access_rights",
181+
"write_functions",
182+
existing_type=sa.BOOLEAN(),
183+
nullable=True,
184+
)
185+
op.alter_column(
186+
"funcapi_group_api_access_rights",
187+
"read_functions",
188+
existing_type=sa.BOOLEAN(),
189+
nullable=True,
190+
)
191+
# ### end Alembic commands ###

packages/postgres-database/src/simcore_postgres_database/models/funcapi_api_access_rights_table.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,46 +36,55 @@
3636
"read_functions",
3737
sa.Boolean,
3838
default=False,
39+
nullable=False,
3940
),
4041
sa.Column(
4142
"write_functions",
4243
sa.Boolean,
4344
default=False,
45+
nullable=False,
4446
),
4547
sa.Column(
4648
"execute_functions",
4749
sa.Boolean,
4850
default=False,
51+
nullable=False,
4952
),
5053
sa.Column(
5154
"read_function_jobs",
5255
sa.Boolean,
5356
default=False,
57+
nullable=False,
5458
),
5559
sa.Column(
5660
"write_function_jobs",
5761
sa.Boolean,
5862
default=False,
63+
nullable=False,
5964
),
6065
sa.Column(
6166
"execute_function_jobs",
6267
sa.Boolean,
6368
default=False,
69+
nullable=False,
6470
),
6571
sa.Column(
6672
"read_function_job_collections",
6773
sa.Boolean,
6874
default=False,
75+
nullable=False,
6976
),
7077
sa.Column(
7178
"write_function_job_collections",
7279
sa.Boolean,
7380
default=False,
81+
nullable=False,
7482
),
7583
sa.Column(
7684
"execute_function_job_collections",
7785
sa.Boolean,
7886
default=False,
87+
nullable=False,
7988
),
8089
column_created_datetime(),
8190
column_modified_datetime(),

services/static-webserver/client/source/class/osparc/dashboard/AppBrowser.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
129129
this._populateCardMenu(card);
130130
});
131131
osparc.filter.UIFilterController.dispatch("searchBarFilter");
132-
133-
this._resourcesContainer.evaluateNoResourcesFoundLabel(cards, this._resourceType);
134132
},
135133

136134
__itemClicked: function(card) {

services/static-webserver/client/source/class/osparc/dashboard/CardBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
508508
const studyBrowserContext = osparc.store.Store.getInstance().getStudyBrowserContext();
509509
return (
510510
this.getBlocked() === true || // It could be blocked by IN_USE or UNKNOWN_SERVICE
511-
(this.isResourceType("study") && (studyBrowserContext === "trash")) // It could a trashed study
511+
(this.isResourceType("study") && (studyBrowserContext === osparc.dashboard.StudyBrowser.CONTEXT.TRASH)) // It could a trashed study
512512
);
513513
},
514514

services/static-webserver/client/source/class/osparc/dashboard/CardContainer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ qx.Class.define("osparc.dashboard.CardContainer", {
105105
},
106106

107107
areMoreResourcesRequired: function(loadingResourcesBtn) {
108-
if (this.nextRequest !== null && loadingResourcesBtn && osparc.utils.Utils.isWidgetOnScreen(loadingResourcesBtn)) {
108+
if (
109+
this.nextRequest !== null &&
110+
loadingResourcesBtn &&
111+
osparc.utils.Utils.isWidgetOnScreen(loadingResourcesBtn)
112+
) {
109113
return true;
110114
}
111115
return false;

services/static-webserver/client/source/class/osparc/dashboard/ContextBreadcrumbs.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,16 @@ qx.Class.define("osparc.dashboard.ContextBreadcrumbs", {
5555
this._removeAll();
5656

5757
const currentContext = osparc.store.Store.getInstance().getStudyBrowserContext();
58-
if (currentContext !== "studiesAndFolders") {
59-
return;
60-
}
61-
62-
if (this.getCurrentFolderId()) {
63-
const currentFolder = osparc.store.Folders.getInstance().getFolder(this.getCurrentFolderId());
64-
this.__createUpstreamButtons(currentFolder);
65-
}
58+
if (currentContext === osparc.dashboard.StudyBrowser.CONTEXT.PROJECTS) {
59+
if (this.getCurrentFolderId()) {
60+
const currentFolder = osparc.store.Folders.getInstance().getFolder(this.getCurrentFolderId());
61+
this.__createUpstreamButtons(currentFolder);
62+
}
6663

67-
const currentFolderButton = this.__createCurrentFolderButton();
68-
if (currentFolderButton) {
69-
this._add(currentFolderButton);
64+
const currentFolderButton = this.__createCurrentFolderButton();
65+
if (currentFolderButton) {
66+
this._add(currentFolderButton);
67+
}
7068
}
7169
},
7270

services/static-webserver/client/source/class/osparc/dashboard/FolderButtonItem.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,19 +276,19 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
276276

277277
const studyBrowserContext = osparc.store.Store.getInstance().getStudyBrowserContext();
278278
if (
279-
studyBrowserContext === "search" ||
280-
studyBrowserContext === "studiesAndFolders"
279+
studyBrowserContext === osparc.dashboard.StudyBrowser.CONTEXT.PROJECTS ||
280+
studyBrowserContext === osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_PROJECTS
281281
) {
282282
const editButton = new qx.ui.menu.Button(this.tr("Rename..."), "@FontAwesome5Solid/pencil-alt/12");
283283
editButton.addListener("execute", () => this.__editFolder(), this);
284284
menu.add(editButton);
285285

286-
if (studyBrowserContext === "search") {
286+
if (studyBrowserContext === osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_PROJECTS) {
287287
const openLocationButton = new qx.ui.menu.Button(this.tr("Open location"), "@FontAwesome5Solid/external-link-alt/12");
288288
openLocationButton.addListener("execute", () => {
289289
const folder = this.getFolder();
290290
this.fireDataEvent("changeContext", {
291-
context: "studiesAndFolders",
291+
context: osparc.dashboard.StudyBrowser.CONTEXT.PROJECTS,
292292
workspaceId: folder.getWorkspaceId(),
293293
folderId: folder.getParentFolderId(),
294294
});
@@ -306,7 +306,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
306306
const trashButton = new qx.ui.menu.Button(this.tr("Delete"), "@FontAwesome5Solid/trash/12");
307307
trashButton.addListener("execute", () => this.fireDataEvent("trashFolderRequested", this.getFolderId()), this);
308308
menu.add(trashButton);
309-
} else if (studyBrowserContext === "trash") {
309+
} else if (studyBrowserContext === osparc.dashboard.StudyBrowser.CONTEXT.TRASH) {
310310
const restoreButton = new qx.ui.menu.Button(this.tr("Restore"), "@MaterialIcons/restore_from_trash/16");
311311
restoreButton.addListener("execute", () => this.fireDataEvent("untrashFolderRequested", this.getFolder()), this);
312312
menu.add(restoreButton);
@@ -325,7 +325,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
325325
__itemSelected: function() {
326326
const studyBrowserContext = osparc.store.Store.getInstance().getStudyBrowserContext();
327327
// do not allow selecting workspace
328-
if (studyBrowserContext !== "trash") {
328+
if (studyBrowserContext !== osparc.dashboard.StudyBrowser.CONTEXT.TRASH) {
329329
this.fireDataEvent("folderSelected", this.getFolderId());
330330
}
331331
},

services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
3535

3636
events: {
3737
"templatesContext": "qx.event.type.Event",
38-
"publicContext": "qx.event.type.Event",
38+
"publicTemplatesContext": "qx.event.type.Event",
3939
"trashContext": "qx.event.type.Event",
4040
"changeTab": "qx.event.type.Data",
4141
"trashStudyRequested": "qx.event.type.Data",
@@ -100,9 +100,9 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
100100
});
101101
this.__workspacesAndFoldersTree.contextChanged(context);
102102

103-
this.__templatesButton.setValue(context === "templates");
104-
this.__publicProjectsButton.setValue(context === "public");
105-
this.__trashButton.setValue(context === "trash");
103+
this.__templatesButton.setValue(context === osparc.dashboard.StudyBrowser.CONTEXT.TEMPLATES);
104+
this.__publicProjectsButton.setValue(context === osparc.dashboard.StudyBrowser.CONTEXT.PUBLIC_TEMPLATES);
105+
this.__trashButton.setValue(context === osparc.dashboard.StudyBrowser.CONTEXT.TRASH);
106106
},
107107

108108
/* WORKSPACES AND FOLDERS */
@@ -158,7 +158,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
158158
publicProjectsButton.addListener("changeValue", e => {
159159
const templatesEnabled = e.getData();
160160
if (templatesEnabled) {
161-
this.fireEvent("publicContext");
161+
this.fireEvent("publicTemplatesContext");
162162
}
163163
});
164164
return publicProjectsButton;

0 commit comments

Comments
 (0)