From d608236095731788be4a48c5aaef00854e2b44f3 Mon Sep 17 00:00:00 2001 From: Julian Querido Date: Wed, 27 Mar 2024 15:26:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Feedback=20and=20bug=20fixes=20(?= =?UTF-8?q?#5556)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../osparc/dashboard/ResourceMoreOptions.js | 2 +- .../osparc/dashboard/SortedByMenuButton.js | 58 ++++++++----------- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceMoreOptions.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceMoreOptions.js index 1659e113e4b..d8e89d5410e 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceMoreOptions.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceMoreOptions.js @@ -520,7 +520,7 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", { classifiers = new osparc.metadata.ClassifiersViewer(resourceData); } - const page = this.__permissionsPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id); + const page = this.__classifiersPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id); this.__addOpenButton(page); page.addToContent(classifiers); return page; diff --git a/services/static-webserver/client/source/class/osparc/dashboard/SortedByMenuButton.js b/services/static-webserver/client/source/class/osparc/dashboard/SortedByMenuButton.js index d9eebe49b5f..24427e4995b 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/SortedByMenuButton.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/SortedByMenuButton.js @@ -54,19 +54,8 @@ qx.Class.define("osparc.dashboard.SortedByMenuButton", { }); }); - this.addListener("changeSortField", e => { - const sort = { - field: e.getData(), - direction: true - } - this.__handelSortEvent(sort) - }, this); - - this.addListener("changeSortDirection", e => { - const sort = { - field: this.getSortField(), - direction: e.getData() - } + this.addListener("changeSort", e => { + const sort = e.getData(); this.__handelSortEvent(sort) }, this); }, @@ -98,19 +87,15 @@ qx.Class.define("osparc.dashboard.SortedByMenuButton", { }, properties: { - sortField: { - check: "String", - init: "last_change_date", - nullable: true, - event: "changeSortField", - apply: "__applySortField" - }, - sortDirection: { - check: "Boolean", - init: true, - nullable: true, - event: "changeSortDirection", - apply: "__applySortDirection" + sort: { + check: "Object", + init: { + field: "last_change_date", + direction: true + }, + nullable: false, + event: "changeSort", + apply: "__applySort" } }, @@ -133,16 +118,23 @@ qx.Class.define("osparc.dashboard.SortedByMenuButton", { }, __handelSort: function(field) { - if (field === this.getSortField()) { - const direction = !this.getSortDirection(); - this.setSortDirection(direction) + if (field === this.getSort().field) { + const { direction } = this.getSort(); + this.setSort({ + field, + direction: !direction + }) return; } - this.setSortField(field) + this.setSort({ + field, + direction: true + }) }, __handelSortEvent: function({field, direction}) { this.__menuButton.setIcon(direction ? "@FontAwesome5Solid/arrow-down/14" : "@FontAwesome5Solid/arrow-up/14") + this.setIcon(direction ? "@FontAwesome5Solid/arrow-down/14" : "@FontAwesome5Solid/arrow-up/14") const sort = { field: field, direction: direction ? "desc" : "asc" @@ -150,11 +142,7 @@ qx.Class.define("osparc.dashboard.SortedByMenuButton", { this.fireDataEvent("sortByChanged", sort); }, - __applySortField: function(value, old) { - - }, - - __applySortDirection: function(value, old) { + __applySort: function(value, old) { } }