Skip to content

Commit

Permalink
🐛 Feedback and bug fixes (#5556)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsaq007 authored Mar 27, 2024
1 parent 56d4f35 commit d608236
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down Expand Up @@ -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"
}
},

Expand All @@ -133,28 +118,31 @@ 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"
};
this.fireDataEvent("sortByChanged", sort);
},

__applySortField: function(value, old) {

},

__applySortDirection: function(value, old) {
__applySort: function(value, old) {

}
}
Expand Down

0 comments on commit d608236

Please sign in to comment.