[develop | DONE | ADDED]: funders.component.ts: Adding sorting options by Research products and by Projects & Renamed typo for descending order (desc instead of dsc) | funders.component.less: Commented css rule for "custom-view-button" class (now available on general.less).

This commit is contained in:
Konstantina Galouni 2024-07-11 15:32:48 +03:00
parent 0181035409
commit ff3e56465e
2 changed files with 30 additions and 20 deletions

View File

@ -21,22 +21,22 @@
margin-left: 10px;
}
.custom-view-button {
padding: 4px;
background: @light-color;
border: 1px solid @disable-color;
border-radius: 4px;
icon {
color: @disable-color;
}
&.active {
background: transparent linear-gradient(315deg, @primary-light-color 0%, @primary-dark-color 100%) 0% 0% no-repeat padding-box;
icon {
color: @light-color;
}
}
}
//.custom-view-button {
// padding: 4px;
// background: @light-color;
// border: 1px solid @disable-color;
// border-radius: 4px;
// icon {
// color: @disable-color;
// }
//
// &.active {
// background: transparent linear-gradient(315deg, @primary-light-color 0%, @primary-dark-color 100%) 0% 0% no-repeat padding-box;
// icon {
// color: @light-color;
// }
// }
//}
// .uk-card {
// &.funder-grid {

View File

@ -18,6 +18,7 @@ import {LayoutService} from '../openaireLibrary/dashboard/sharedComponents/sideb
import {FormBuilder, FormControl} from '@angular/forms';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
import {GroupedRequestsService} from "../openaireLibrary/services/groupedRequests.service";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'funders',
@ -31,6 +32,7 @@ export class FundersComponent implements OnInit {
pageTitle: string = "OpenAIRE - Explore | Funders";
pageDescription: string = "Funders | Be an integral part of the open R&I ecosystem";
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'funders'}];
showLoading: boolean = true;
isMobile: boolean = false;
@ -111,10 +113,12 @@ export class FundersComponent implements OnInit {
{value: 'dashboard', label: 'Funders with dashboard'}
];
this.sortOptions = [
{value: 'alphAsc', label: 'Alphabetically Asc. (A-Z)'},
{value: 'alphDsc', label: 'Alphabetically Dsc. (Z-A)'},
{value: 'oaDsc', label: '"Open Access %" Dsc.'},
{value: 'countryAsc', label: 'Country Asc. (A-Z)'}
{value: 'alphAsc', label: 'Alphabetically asc. (A-Z)'},
{value: 'alphDsc', label: 'Alphabetically desc. (Z-A)'},
{value: 'oaDsc', label: 'Open Access % desc.'},
{value: 'countryAsc', label: 'Country desc. (A-Z)'},
{value: 'researcProductsDsc', label: this.openaireEntities.RESULTS+' desc.'},
{value: 'projectsDsc', label: this.openaireEntities.PROJECTS+' desc.'}
];
this.getFunders();
this.keywordControl = this.fb.control('');
@ -355,6 +359,12 @@ export class FundersComponent implements OnInit {
}
});
break;
case "researcProductsDsc":
this.funders = this.funders.sort((a, b) => b['researchProducts'] - a['researchProducts']);
break;
case "projectsDsc":
this.funders = this.funders.sort((a, b) => b['projects'] - a['projects']);
break;
}
this.filtering();
}