Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛🎨 [Frontend] Various bug fixes: new tag from Study, Checkpoint viewer, Leave study message #6878

Merged
merged 58 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c1762e2
VIP Store
odeimaiz Nov 27, 2024
cf85791
open vip store
odeimaiz Nov 27, 2024
f5d6651
minor
odeimaiz Nov 27, 2024
52fc036
list models
odeimaiz Nov 27, 2024
2745cf6
minor
odeimaiz Nov 27, 2024
ae78894
minor
odeimaiz Nov 27, 2024
81e050c
parse Features
odeimaiz Nov 28, 2024
8d6ef13
Details
odeimaiz Nov 28, 2024
6914ccb
working
odeimaiz Nov 28, 2024
d72a8ee
sorted with thumbnail
odeimaiz Nov 28, 2024
c1c8ff4
aesthetics
odeimaiz Nov 28, 2024
59393e8
showS4LStore
odeimaiz Nov 28, 2024
8afdcae
minor
odeimaiz Nov 28, 2024
7905a98
Tabbed View
odeimaiz Nov 28, 2024
32eff5f
loading
odeimaiz Nov 28, 2024
ab2c4f6
filter and sort buttons
odeimaiz Nov 28, 2024
ed7e173
filter working
odeimaiz Nov 28, 2024
e14cd4b
sorting
odeimaiz Nov 28, 2024
860e167
leased
odeimaiz Nov 28, 2024
08500ff
leased
odeimaiz Nov 28, 2024
f6acefb
backgroundColor
odeimaiz Nov 28, 2024
b4ae1af
minor
odeimaiz Nov 28, 2024
787decf
sorting
odeimaiz Nov 28, 2024
b92d042
sort wokrs
odeimaiz Nov 28, 2024
160b190
fixed
odeimaiz Nov 28, 2024
6b24ef5
comment
odeimaiz Nov 28, 2024
52fc81c
"modelLeased"
odeimaiz Nov 28, 2024
c05ab72
aesthetics
odeimaiz Nov 28, 2024
d77c9da
minor
odeimaiz Nov 28, 2024
ec239a2
Merge branch 'master' into feature/vip-store
odeimaiz Nov 28, 2024
4c227fc
Merge branch 'master' into feature/vip-store
odeimaiz Nov 29, 2024
4b79bb0
vipStore -> vipMarket
odeimaiz Nov 29, 2024
ac98719
aesthetics
odeimaiz Nov 29, 2024
380968b
renaming
odeimaiz Nov 29, 2024
19cb202
Merge branch 'master' into feature/vip-store
odeimaiz Nov 29, 2024
641a724
minor
odeimaiz Nov 29, 2024
e91a2d3
Merge branch 'feature/vip-store' of github.com:odeimaiz/osparc-simcor…
odeimaiz Nov 29, 2024
74bfa6f
Merge remote-tracking branch 'upstream/master' into feature/vip-store
odeimaiz Dec 2, 2024
ac272b0
Edit Tags
odeimaiz Dec 2, 2024
65ccb8d
FOLDERS always enabled
odeimaiz Dec 2, 2024
d766c06
refactor
odeimaiz Dec 2, 2024
3498dcd
open Tags
odeimaiz Dec 2, 2024
6be8a34
"tagsChanged"
odeimaiz Dec 2, 2024
febe7e8
minor
odeimaiz Dec 2, 2024
87ad476
Fix ``New Tag``
odeimaiz Dec 2, 2024
e3698fa
listen to "tagsChanged"
odeimaiz Dec 2, 2024
57514c4
minor
odeimaiz Dec 2, 2024
7c9ee1e
align buttons
odeimaiz Dec 2, 2024
08b4cef
minor
odeimaiz Dec 2, 2024
26c41fd
minor
odeimaiz Dec 2, 2024
b6e876c
fixed
odeimaiz Dec 2, 2024
89b77af
Merge branch 'master' into bugs/02-12
odeimaiz Dec 2, 2024
4184007
Merge branch 'master' into bugs/02-12
odeimaiz Dec 3, 2024
35bca8a
Merge branch 'master' into bugs/02-12
odeimaiz Dec 3, 2024
d1603bb
Merge branch 'master' into bugs/02-12
odeimaiz Dec 3, 2024
c90c086
Merge branch 'master' into bugs/02-12
odeimaiz Dec 4, 2024
0afb5a2
Merge branch 'master' into bugs/02-12
odeimaiz Dec 4, 2024
918ca9f
move to workspace
odeimaiz Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
if (resourceType === "study") {
const workspacesContainer = this.__workspacesContainer = new osparc.dashboard.ToggleButtonContainer();
this._add(workspacesContainer);
workspacesContainer.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");

const foldersContainer = this.__foldersContainer = new osparc.dashboard.ToggleButtonContainer();
this._add(foldersContainer);
foldersContainer.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");
}

const nonGroupedContainer = this.__nonGroupedContainer = this.__createFlatList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
__serviceTypeButtons: null,

__buildLayout: function() {
if (this.__resourceType === "study" && osparc.utils.DisabledPlugins.isFoldersEnabled()) {
if (this.__resourceType === "study") {
this._add(this.__createWorkspacesAndFoldersTree());
this._add(this.__createTrashBin());
} else {
Expand Down Expand Up @@ -104,7 +104,8 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
value: false,
appearance: "filter-toggle-button",
label: this.tr("Trash"),
icon: "@FontAwesome5Solid/trash/18",
icon: "@FontAwesome5Solid/trash/16",
paddingLeft: 10, // align it with the context
});
trashButton.addListener("changeValue", e => {
const trashEnabled = e.getData();
Expand Down Expand Up @@ -221,11 +222,11 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {

/* TAGS */
__createTagsFilterLayout: function() {
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(5));
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(2));
osparc.utils.Utils.setIdToWidget(layout, this.__resourceType + "-tagsFilter");

this.__populateTags(layout, []);
osparc.store.Store.getInstance().addListener("changeTags", () => {
osparc.store.Tags.getInstance().addListener("tagsChanged", () => {
this.__populateTags(layout, this.__getSelectedTagIds());
}, this);

Expand All @@ -242,7 +243,7 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
this.__tagButtons = [];
layout.removeAll();
osparc.store.Tags.getInstance().getTags().forEach((tag, idx) => {
const button = new qx.ui.form.ToggleButton(null, "@FontAwesome5Solid/tag/18");
const button = new qx.ui.form.ToggleButton(null, "@FontAwesome5Solid/tag/16");
button.id = tag.getTagId();
tag.bind("name", button, "label");
tag.bind("color", button.getChildControl("icon"), "textColor");
Expand All @@ -266,7 +267,7 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {


if (this.__tagButtons.length > maxTags) {
const showAllButton = new qx.ui.form.Button(this.tr("All Tags..."), "@FontAwesome5Solid/tags/20");
const showAllButton = new qx.ui.form.Button(this.tr("All Tags..."), "@FontAwesome5Solid/tags/16");
showAllButton.set({
appearance: "filter-toggle-button"
});
Expand All @@ -284,6 +285,20 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
});
layout.add(showAllButton);
}

const editTagsButton = new qx.ui.form.Button(this.tr("Edit Tags..."), "@FontAwesome5Solid/pencil-alt/14");
editTagsButton.set({
appearance: "filter-toggle-button"
});
editTagsButton.addListener("execute", () => {
const preferencesWindow = osparc.desktop.preferences.PreferencesWindow.openWindow();
preferencesWindow.openTags();
});
layout.add(editTagsButton);

if (this.__resourceType === "study") {
layout.getChildren().forEach(item => item.setPaddingLeft(10)); // align them with the context
}
},
/* /TAGS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {

__addClassifiers: function(menuButton) {
const classifiers = osparc.store.Store.getInstance().getClassifiers();
menuButton.setVisibility(classifiers.length ? "visible" : "excluded");
if (classifiers.length) {
menuButton.setVisibility(classifiers && classifiers.length ? "visible" : "excluded");
if (classifiers && classifiers.length) {
const classifiersMenu = new qx.ui.menu.Menu();
classifiers.forEach(classifier => {
const classifierButton = new qx.ui.menu.Button(classifier.display_name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
__reloadWorkspaces: function() {
if (
!osparc.auth.Manager.getInstance().isLoggedIn() ||
!osparc.utils.DisabledPlugins.isFoldersEnabled() ||
this.getCurrentContext() === "studiesAndFolders" ||
this.getCurrentContext() === "search" || // not yet implemented for workspaces
this.__loadingWorkspaces
Expand Down Expand Up @@ -212,7 +211,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
__reloadFolders: function() {
if (
!osparc.auth.Manager.getInstance().isLoggedIn() ||
!osparc.utils.DisabledPlugins.isFoldersEnabled() ||
this.getCurrentContext() === "workspaces" ||
this.__loadingFolders
) {
Expand Down Expand Up @@ -996,11 +994,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
_createLayout: function() {
this._createSearchBar();

if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
const header = this.__header = new osparc.dashboard.StudyBrowserHeader();
this.__header.addListener("emptyTrashRequested", () => this.__emptyTrash(), this);
this._addToLayout(header);
}
const header = this.__header = new osparc.dashboard.StudyBrowserHeader();
this.__header.addListener("emptyTrashRequested", () => this.__emptyTrash(), this);
this._addToLayout(header);

this._createResourcesLayout("studiesList");

Expand Down Expand Up @@ -1074,112 +1070,108 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
},

__connectContexts: function() {
if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
const header = this.__header;
header.addListener("locationChanged", () => {
const workspaceId = header.getCurrentWorkspaceId();
const folderId = header.getCurrentFolderId();
this._changeContext("studiesAndFolders", workspaceId, folderId);
}, this);
const header = this.__header;
header.addListener("locationChanged", () => {
const workspaceId = header.getCurrentWorkspaceId();
const folderId = header.getCurrentFolderId();
this._changeContext("studiesAndFolders", workspaceId, folderId);
}, this);

const workspacesAndFoldersTree = this._resourceFilter.getWorkspacesAndFoldersTree();
workspacesAndFoldersTree.addListener("locationChanged", e => {
const context = e.getData();
const workspaceId = context["workspaceId"];
if (workspaceId === -1) {
this._changeContext("workspaces");
} else {
const folderId = context["folderId"];
this._changeContext("studiesAndFolders", workspaceId, folderId);
}
}, this);
const workspacesAndFoldersTree = this._resourceFilter.getWorkspacesAndFoldersTree();
workspacesAndFoldersTree.addListener("locationChanged", e => {
const context = e.getData();
const workspaceId = context["workspaceId"];
if (workspaceId === -1) {
this._changeContext("workspaces");
} else {
const folderId = context["folderId"];
this._changeContext("studiesAndFolders", workspaceId, folderId);
}
}, this);

this._resourceFilter.addListener("trashContext", () => {
this._changeContext("trash");
});
this._resourceFilter.addListener("trashContext", () => {
this._changeContext("trash");
});

this._searchBarFilter.addListener("filterChanged", e => {
const filterData = e.getData();
if (filterData.text) {
this._changeContext("search");
} else {
const workspaceId = this.getCurrentWorkspaceId();
const folderId = this.getCurrentFolderId();
this._changeContext("studiesAndFolders", workspaceId, folderId);
}
});
}
this._searchBarFilter.addListener("filterChanged", e => {
const filterData = e.getData();
if (filterData.text) {
this._changeContext("search");
} else {
const workspaceId = this.getCurrentWorkspaceId();
const folderId = this.getCurrentFolderId();
this._changeContext("studiesAndFolders", workspaceId, folderId);
}
});
},

_changeContext: function(context, workspaceId = null, folderId = null) {
if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
if (
context !== "search" && // reload studies for a new search
context === this.getCurrentContext() &&
workspaceId === this.getCurrentWorkspaceId() &&
folderId === this.getCurrentFolderId()
) {
// didn't really change
return;
}

osparc.store.Store.getInstance().setStudyBrowserContext(context);
this.set({
currentContext: context,
currentWorkspaceId: workspaceId,
currentFolderId: folderId,
});
this.resetSelection();
this.setMultiSelection(false);
if (
context !== "search" && // reload studies for a new search
context === this.getCurrentContext() &&
workspaceId === this.getCurrentWorkspaceId() &&
folderId === this.getCurrentFolderId()
) {
// didn't really change
return;
}

// reset lists
this.__setWorkspacesToList([]);
this.__setFoldersToList([]);
this._resourcesList = [];
this._resourcesContainer.setResourcesToList(this._resourcesList);
this._resourcesContainer.reloadCards("studies");

this._toolbar.show();
switch (this.getCurrentContext()) {
case "studiesAndFolders":
this._searchBarFilter.resetFilters();
this.__reloadFolders();
this._loadingResourcesBtn.setFetching(false);
this.invalidateStudies();
this.__reloadStudies();
break;
case "workspaces":
this._toolbar.exclude();
this._searchBarFilter.resetFilters();
this.__reloadWorkspaces();
break;
case "search":
this.__reloadWorkspaces();
this.__reloadFolders();
this._loadingResourcesBtn.setFetching(false);
this.invalidateStudies();
this.__reloadStudies();
break;
case "trash":
this._searchBarFilter.resetFilters();
this.__reloadWorkspaces();
this.__reloadFolders();
this._loadingResourcesBtn.setFetching(false);
this.invalidateStudies();
this.__reloadStudies();
break;
}
osparc.store.Store.getInstance().setStudyBrowserContext(context);
this.set({
currentContext: context,
currentWorkspaceId: workspaceId,
currentFolderId: folderId,
});
this.resetSelection();
this.setMultiSelection(false);

// notify header
const header = this.__header;
header.set({
currentWorkspaceId: workspaceId,
currentFolderId: folderId,
});
// reset lists
this.__setWorkspacesToList([]);
this.__setFoldersToList([]);
this._resourcesList = [];
this._resourcesContainer.setResourcesToList(this._resourcesList);
this._resourcesContainer.reloadCards("studies");

// notify Filters on the left
this._resourceFilter.contextChanged(context, workspaceId, folderId);
this._toolbar.show();
switch (this.getCurrentContext()) {
case "studiesAndFolders":
this._searchBarFilter.resetFilters();
this.__reloadFolders();
this._loadingResourcesBtn.setFetching(false);
this.invalidateStudies();
this.__reloadStudies();
break;
case "workspaces":
this._toolbar.exclude();
this._searchBarFilter.resetFilters();
this.__reloadWorkspaces();
break;
case "search":
this.__reloadWorkspaces();
this.__reloadFolders();
this._loadingResourcesBtn.setFetching(false);
this.invalidateStudies();
this.__reloadStudies();
break;
case "trash":
this._searchBarFilter.resetFilters();
this.__reloadWorkspaces();
this.__reloadFolders();
this._loadingResourcesBtn.setFetching(false);
this.invalidateStudies();
this.__reloadStudies();
break;
}

// notify header
const header = this.__header;
header.set({
currentWorkspaceId: workspaceId,
currentFolderId: folderId,
});

// notify Filters on the left
this._resourceFilter.contextChanged(context, workspaceId, folderId);
},

__addSortByButton: function() {
Expand Down Expand Up @@ -1565,13 +1557,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
menu.add(billingsSettingsButton);
}

if (writeAccess && osparc.utils.DisabledPlugins.isFoldersEnabled()) {
menu.addSeparator();
menu.addSeparator();

const moveToButton = this.__getMoveStudyToMenuButton(studyData);
if (moveToButton) {
menu.add(moveToButton);
}
const moveToButton = this.__getMoveStudyToMenuButton(studyData);
if (moveToButton) {
menu.add(moveToButton);
}

if (deleteAccess) {
Expand Down
Loading
Loading