From c93f8eda528f6d220f73fd0b7d2422ceabf5783b Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 18 Jun 2020 18:22:08 +0300 Subject: [PATCH] Removed explore-dmp and explore-dataset components --- .../java/eu/eudat/controllers/Datasets.java | 4 +- .../criteria/dataset-criteria.component.ts | 15 +- .../explore-dataset-listing.component.html | 82 ---- .../explore-dataset-listing.component.scss | 78 ---- .../explore-dataset-listing.component.ts | 117 ------ .../explore-dataset/explore-dataset.module.ts | 25 -- .../explore-dataset.routing.ts | 19 - ...explore-dataset-filter-item.component.html | 20 - ...explore-dataset-filter-item.component.scss | 14 - .../explore-dataset-filter-item.component.ts | 94 ----- .../explore-dataset-filters.component.html | 129 ------ .../explore-dataset-filters.component.scss | 106 ----- .../explore-dataset-filters.component.ts | 366 ------------------ ...xplore-dataset-listing-item.component.html | 72 ---- ...xplore-dataset-listing-item.component.scss | 99 ----- .../explore-dataset-listing-item.component.ts | 29 -- .../explore-dmp-filter-item.component.html | 20 - .../explore-dmp-filter-item.component.scss | 14 - .../explore-dmp-filter-item.component.ts | 84 ---- .../explore-dmp-filters.component.html | 122 ------ .../explore-dmp-filters.component.scss | 106 ----- .../explore-dmp-filters.component.ts | 347 ----------------- .../explore-dmp-listing.component.html | 39 -- .../explore-dmp-listing.component.scss | 86 ---- .../explore-dmp-listing.component.ts | 198 ---------- .../app/ui/explore-dmp/explore-dmp.module.ts | 27 -- .../app/ui/explore-dmp/explore-dmp.routing.ts | 35 -- .../explore-dmp-listing-item.component.html | 88 ----- .../explore-dmp-listing-item.component.scss | 142 ------- .../explore-dmp-listing-item.component.ts | 53 --- 30 files changed, 8 insertions(+), 2622 deletions(-) delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/explore-dataset.module.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/explore-dataset.routing.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/explore-dmp.module.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/explore-dmp.routing.ts delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss delete mode 100644 dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.ts diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java index 74edf561e..bcec35163 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java @@ -44,13 +44,13 @@ public class Datasets extends BaseController { return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable)); } - @RequestMapping(method = RequestMethod.POST, value = {"/public/paged"}, consumes = "application/json", produces = "application/json") + /*@RequestMapping(method = RequestMethod.POST, value = {"/public/paged"}, consumes = "application/json", produces = "application/json") public @ResponseBody ResponseEntity>> getPublicPaged(@RequestBody DatasetPublicTableRequest datasetTableRequest, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal principal) throws Exception { DataTableData dataTable = this.datasetManager.getPaged(datasetTableRequest, principal); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable)); - } + }*/ @Transactional @RequestMapping(method = RequestMethod.GET, value = {"/makepublic/{id}"}, produces = "application/json") diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts index 55c7d6a8f..56ef4129a 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts @@ -231,18 +231,15 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O filterDmps(value: string): Observable> { const fields: Array = new Array(); fields.push('asc'); - - if (this.isPublic) { - const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dmpDataTableRequest.criteria = new ExploreDmpCriteriaModel(); - dmpDataTableRequest.criteria.like = value; - return this.dmpService.getPublicPaged(dmpDataTableRequest, "autocomplete"); - } else { - const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); + const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); dmpDataTableRequest.criteria = new DmpCriteria(); dmpDataTableRequest.criteria.like = value; - return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete"); + dmpDataTableRequest.criteria.onlyPublic = this.isPublic; + if (this.isPublic) { + dmpDataTableRequest.criteria.isPublic = true; } + dmpDataTableRequest.criteria.allVersions = false; + return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete"); } filterGrant(query: string) { diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html deleted file mode 100644 index a7cd49185..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html +++ /dev/null @@ -1,82 +0,0 @@ -
-
-

Welcome to ARGOS

-

Create, Link, Share Data Management Plans

-
-
-
-
-
-
-
-

{{'DASHBOARD.DATASETS' | translate}}

- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss deleted file mode 100644 index c5763d039..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss +++ /dev/null @@ -1,78 +0,0 @@ -@import "node_modules/bootstrap/scss/functions"; -@import "node_modules/bootstrap/scss/variables"; -@import "node_modules/bootstrap/scss/mixins/_breakpoints"; - -@include media-breakpoint-down(sm) { - .lightblue-btn { - font-size: 12px; - } - ::ng-deep .mat-paginator-container { - height: auto !important; - } -} - -text-center { - text-align: center; -} - -.header-image { - background: url("/assets/images/new-dashboard-bg.png") no-repeat; - background-size: cover; - margin-top: 70px; - min-height: 15em; - position: relative; -} - -.header-text-container { - background: rgba(255, 255, 255, 0.7); - position: absolute; - bottom: 0px; - padding-left: 5em; - padding-right: 10em; - padding-top: 2em; - padding-bottom: 2em; -} - -.explore-dmp-content { - padding: 30px 15px; -} - -.card-desc { - min-height: 5vh; -} - -::ng-deep .mat-paginator { - margin-top: 1em; -} - -::ng-deep .mat-paginator-container { - flex-direction: row-reverse !important; - justify-content: space-between !important; - background-color: #f6f6f6; - height: 30px; - min-height: 30px !important; -} - -::ng-deep .mat-paginator-page-size { - height: 43px; -} - -::ng-deep .mat-icon-button { - height: 30px !important; - font-size: 12px !important; -} - -::ng-deep .mat-paginator-range-label { - margin: 15px 32px 0 24px !important; -} - -::ng-deep .mat-paginator-range-actions { - width: auto !important; - min-width: 55% !important; - min-height: 43px !important; - justify-content: space-between; -} - -::ng-deep .mat-paginator-navigation-previous { - margin-left: auto !important; -} diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts deleted file mode 100644 index c3d83154b..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { ActivatedRoute, Params, Router } from '@angular/router'; -import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing'; -import { ExploreDatasetCriteriaModel } from '@app/core/query/explore-dataset/explore-dataset-criteria'; -import { DatasetService } from '@app/core/services/dataset/dataset.service'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { BaseComponent } from '@common/base/base.component'; -import { TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; -import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item'; -import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent'; - - -@Component({ - selector: 'app-explore-dataset-listing-component', - templateUrl: 'explore-dataset-listing.component.html', - styleUrls: ['./explore-dataset-listing.component.scss'], -}) -export class ExploreDatasetListingComponent extends BaseComponent implements OnInit, IBreadCrumbComponent { - - @ViewChild(MatPaginator, { static: true }) _paginator: MatPaginator; - @ViewChild(MatSort, { static: false }) sort: MatSort; - - totalCount: number; - listingItems: DatasetListingModel[] = []; - exploreDatasetCriteriaModel: ExploreDatasetCriteriaModel; - breadCrumbs: Observable; - dmpId: string; - dmpSearchEnabled = true; - titlePrefix: String; - - constructor( - private datasetService: DatasetService, - private dmpService: DmpService, - private router: Router, - private route: ActivatedRoute, - private language: TranslateService, - ) { - super(); - } - - ngOnInit() { - this.route.params - .pipe(takeUntil(this._destroyed)) - .subscribe(async (params: Params) => { - const queryParams = this.route.snapshot.queryParams; - this.dmpId = queryParams['dmpId']; - if (this.dmpId != null) { - this.dmpSearchEnabled = false; - const dmp = await this.dmpService.getSinglePublic(this.dmpId).toPromise(); - - const fields: Array = []; - const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, this._paginator.pageSize, { fields: fields }); - dmpDataTableRequest.criteria = new ExploreDatasetCriteriaModel(); - dmpDataTableRequest.criteria.dmpIds.push(this.dmpId); - - this.datasetService.getPublicPaged(dmpDataTableRequest).pipe(takeUntil(this._destroyed)).subscribe(result => { - if (!result) { return []; } - if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; } - this.listingItems = result.data; - }); - - - } else { - this.refresh(); - } - }); - - const breadCrumbs = []; - breadCrumbs.push({ - parentComponentName: null, - label: this.language.instant('NAV-BAR.PUBLIC DATASETS'), - url: "/explore" - }) - this.breadCrumbs = observableOf(breadCrumbs); - } - - refresh(resetPages = false) { - if (this._paginator.pageSize === undefined) this._paginator.pageSize = 10; - const startIndex = this._paginator.pageIndex * this._paginator.pageSize; - let fields: Array = new Array(); - if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } - const request = new DataTableRequest(startIndex, this._paginator.pageSize, { fields: fields }); - request.criteria = this.exploreDatasetCriteriaModel || this.getDefaultCriteria(); - this.datasetService.getPublicPaged(request).pipe(takeUntil(this._destroyed)).subscribe(result => { - if (!result) { return []; } - if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; } - this.listingItems = result.data; - }); - } - - // rowClicked(dataset: DatasetListingModel) { - // this.router.navigate(['/datasets/publicEdit/' + dataset.id]); - // } - - onCriteriaChange(event: ExploreDatasetCriteriaModel) { - this.exploreDatasetCriteriaModel = event; - this._paginator.pageIndex = 0; - this.refresh(); - } - - getDefaultCriteria(): ExploreDatasetCriteriaModel { - const defaultCriteria = new ExploreDatasetCriteriaModel(); - // if (dmp != null) { - // defaultCriteria.dmpIds.push(dmp.id); - // } - return defaultCriteria; - } - - pageThisEvent(event) { - this.refresh(); - } -} diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset.module.ts b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset.module.ts deleted file mode 100644 index b06554524..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { NgModule } from '@angular/core'; -import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; -import { ExploreDatasetListingComponent } from '@app/ui/explore-dataset/explore-dataset-listing.component'; -import { ExploreDatasetRoutingModule } from '@app/ui/explore-dataset/explore-dataset.routing'; -import { ExploreDatasetFilterItemComponent } from '@app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component'; -import { ExploreDatasetFiltersComponent } from '@app/ui/explore-dataset/filters/explore-dataset-filters.component'; -import { ExploreDatasetListingItemComponent } from '@app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component'; -import { CommonFormsModule } from '@common/forms/common-forms.module'; -import { CommonUiModule } from '@common/ui/common-ui.module'; - -@NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - AutoCompleteModule, - ExploreDatasetRoutingModule - ], - declarations: [ - ExploreDatasetListingComponent, - ExploreDatasetFiltersComponent, - ExploreDatasetFilterItemComponent, - ExploreDatasetListingItemComponent - ] -}) -export class ExploreDatasetModule { } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset.routing.ts b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset.routing.ts deleted file mode 100644 index fd9f14154..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset.routing.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { ExploreDatasetListingComponent } from './explore-dataset-listing.component'; - -const routes: Routes = [ - { - path: '', - component: ExploreDatasetListingComponent, - data: { - breadcrumb: true - }, - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class ExploreDatasetRoutingModule { } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.html b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.html deleted file mode 100644 index 16495cc71..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.html +++ /dev/null @@ -1,20 +0,0 @@ -
- - - -
- - - {{ - displayLabel(option) }} - cancel - - - -
- - -

{{ displayLabel(option) }}

-
-
-
\ No newline at end of file diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.scss b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.scss deleted file mode 100644 index dfc39d9c0..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.scss +++ /dev/null @@ -1,14 +0,0 @@ -.facet-option-item { - height: auto !important; - min-height: 48px; - padding: 0.5em; - .mat-list-item-content { - min-height: inherit; - } -} - -.data-expand-panel{ - max-height: 20em; - overflow-x: hidden; - overflow-y: auto; -} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts deleted file mode 100644 index fddaa4b57..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts +++ /dev/null @@ -1,94 +0,0 @@ - -import { SelectionModel } from '@angular/cdk/collections'; -import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { MatListOption, MatSelectionList } from '@angular/material/list'; -import { BaseComponent } from '@common/base/base.component'; -import { Observable, of as observableOf } from 'rxjs'; -import { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators'; - - -@Component({ - selector: 'app-explore-dataset-filter-item-component', - templateUrl: './explore-dataset-filter-item.component.html', - styleUrls: ['./explore-dataset-filter-item.component.scss'] -}) -export class ExploreDatasetFilterItemComponent extends BaseComponent implements OnInit { - - @Input() - searchEnabled = false; - - @Input() - requestDelay = 200; - - @Input() - multipleSelect = true; - - @Input() - filterOptions: (value) => Observable; - - @Input() - options: Observable = observableOf([]); - - @Input() - displayTitleFunc: (value) => string; - - @Input() - displayValueFunc: (value) => string; - - @Output() - selectedChanged = new EventEmitter(); - - @Output() - optionRemoved = new EventEmitter(); - - optionSearchControl = new FormControl(''); - - private selectedOptions: any[] = []; - - @ViewChild('optionsList', { static: true }) selectionList: MatSelectionList; - - constructor() { super(); } - - ngOnInit(): void { - if (!this.multipleSelect) { this.selectionList.selectedOptions = new SelectionModel(this.multipleSelect); } - this.optionSearchControl.valueChanges.pipe(debounceTime(this.requestDelay), - distinctUntilChanged()) - .pipe(takeUntil(this._destroyed)) - .subscribe(x => { if (this.filterOptions) { this.options = this.filterOptions(x); } }); - } - - public selectionChanged(event: any) { - const eventValue = event.option.value; - if (event.option.selected) { this.selectedOptions.push(eventValue); } - if (!event.option.selected) { - const index = this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(eventValue)); - this.selectedOptions.splice(index, 1); - } - this.selectedChanged.emit(event); - } - - public removeOption(grant) { - const list = this.selectionList.selectedOptions.selected.map(x => x.value); - const indexOfGrant = list.indexOf(grant); - if (this.selectionList.selectedOptions.selected[indexOfGrant]) { - this.selectionList.selectedOptions.selected[indexOfGrant].selected = false; - this.selectionList.selectedOptions.selected.splice(indexOfGrant, 1); - } - this.selectedOptions.splice(this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(grant)), 1); - this.optionRemoved.emit(grant); - } - - public isOptionSelected(value) { - return this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(value)) !== -1; - } - - displayLabel(value) { - return this.displayTitleFunc ? this.displayTitleFunc(value) : value; - } - - displayValue(value) { - return this.displayValueFunc ? this.displayValueFunc(value) : value; - } - -} diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html deleted file mode 100644 index 01769decb..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html +++ /dev/null @@ -1,129 +0,0 @@ -
-
{{'CRITERIA.FILTERS'| translate}}
-
- - - - search - - - - -
-
{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}
- - {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }} - {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }} - {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }} - -
- -
-
{{'CRITERIA.DATA-SETS.RELATED-DMP' | translate}}
- - - - -
- -
-
{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}
- - - - -
- -
-
{{ 'FACET-SEARCH.PROFILES.TITLE' | translate }}
- - - - -
- -
-
{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}
- - {{ 'FACET-SEARCH.ROLE.ANY' | translate }} - {{ 'FACET-SEARCH.ROLE.OWNER' | translate }} - {{ 'FACET-SEARCH.ROLE.MEMBER' | translate }} - -
- -
-
{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}
- - - - -
-
-
- - - diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.scss b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.scss deleted file mode 100644 index b3f5e80d5..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.scss +++ /dev/null @@ -1,106 +0,0 @@ -.facet-search-component { - .mat-form-field { - width: 100%; - } - - .tags-chips { - padding: 0px; - } -} - -.search ::ng-deep.mat-form-field-infix { - margin-left: 1em; -} - -.category-title { - color: black; - // color: #089dbb; - margin-top: 8px; - margin-bottom: 12px; -} - -.import { - margin: 10px; - padding: 0px; -} - -.filters { - border: 1px solid #e4e4e4; - border-radius: 5px; -} - -.filters-title { - width: 90px; - color: #089dbb; - background-color: white; - padding: 0px 20px; - margin-top: -10px; - margin-left: 20px; - text-transform: uppercase; -} - -.style-icon { - color: #adadad; -} - -// ::ng-deep .mat-checkbox-inner-container { -// background: white; -// } - -// ::ng-deep .mat-focused .mat-form-field-label { -// color: #00b29f !important; -// } - -// ::ng-deep.mat-form-field-underline { -// background-color: #adadad; -// } - -// ::ng-deep.mat-form-field-ripple { -// background-color: #00b29f !important; -// } - -// ::ng-deep .mat-checkbox { -// background-color: #f6f6f6 !important; -// } - -::ng-deep .mat-checkbox .mat-checkbox-frame { - border: 1px solid #aaaaaa; -} - -::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background, -.mat-checkbox-indeterminate.mat-accent .mat-checkbox-background, -.mat-accent .mat-pseudo-checkbox-checked, -.mat-accent .mat-pseudo-checkbox-indeterminate, -.mat-pseudo-checkbox-checked, -.mat-pseudo-checkbox-indeterminate { - background-color: #00b29f; -} - -::ng-deep .mat-ripple-element { - background-color: #2e74b649 !important; -} - -::ng-deep .mat-radio-container { - border-radius: 1em; - background: white; -} - -::ng-deep .mat-radio-button .mat-radio-outer-circle { - border: 1px solid #aaaaaa; -} - -::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle { - border-color: #777777; - // border-color: #00b29f; -} - -::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle { - color: #777777; - background-color: #777777; - // color: #00b29f; - // background-color: #00b29f; -} - -.mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element { - background-color: #2e74b649; -} diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts deleted file mode 100644 index 084a35f7f..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts +++ /dev/null @@ -1,366 +0,0 @@ - -import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { MatAccordion } from '@angular/material/expansion'; -import { ActivatedRoute } from '@angular/router'; -import { GrantStateType } from '@app/core/common/enum/grant-state-type'; -import { DataTableData } from '@app/core/model/data-table/data-table-data'; -import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; -import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; -import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; -import { GrantListingModel } from '@app/core/model/grant/grant-listing'; -import { OrganizationModel } from '@app/core/model/organisation/organization'; -import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; -import { ExploreDatasetCriteriaModel } from '@app/core/query/explore-dataset/explore-dataset-criteria'; -import { ExploreDmpCriteriaModel } from '@app/core/query/explore-dmp/explore-dmp-criteria'; -import { GrantCriteria } from '@app/core/query/grant/grant-criteria'; -import { OrganisationCriteria } from '@app/core/query/organisation/organisation-criteria'; -import { RequestItem } from '@app/core/query/request-item'; -import { TagCriteria } from '@app/core/query/tag/tag-criteria'; -import { AuthService } from '@app/core/services/auth/auth.service'; -import { DatasetService } from '@app/core/services/dataset/dataset.service'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { GrantService } from '@app/core/services/grant/grant.service'; -import { OrganisationService } from '@app/core/services/organisation/organisation.service'; -import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; -import { BaseComponent } from '@common/base/base.component'; -import { TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf } from 'rxjs'; -import { map } from 'rxjs/operators'; - - -@Component({ - selector: 'app-explore-dataset-filters-component', - templateUrl: './explore-dataset-filters.component.html', - styleUrls: ['./explore-dataset-filters.component.scss'] -}) -export class ExploreDatasetFiltersComponent extends BaseComponent implements OnInit, AfterViewInit { - - @Input() facetCriteria = new ExploreDatasetCriteriaModel(); - @Output() facetCriteriaChange = new EventEmitter(); - public filteringTagsAsync = false; - public filteredTags: ExternalSourceItemModel[]; - GrantStateType = GrantStateType; - grants: Observable; - profiles: Observable; - dmpOrganisations: Observable; - dmpIds: Observable>; - grantOptions: Observable; - grantStateOptions: Observable; - filteringOrganisationsAsync = false; - @ViewChild('facetAccordion', { static: false }) accordion: MatAccordion; - - displayGrantStateValue = (option) => option['value']; - displayGrantStateLabel = (option) => option['label']; - - displayGrantValue = (option) => option['id']; - displayGrantLabel = (option) => option['label']; - - displayProfileValue = (option) => option['id']; - displayProfileLabel = (option) => option['label']; - - displayDmpOrganisationsValue = (option) => option['id']; - displayDmpOrganisationsLabel = (option) => option['name']; - - tagsAutoCompleteConfiguration = { - filterFn: this.filterTags.bind(this), - initialItems: (excludedItems: any[]) => this.filterTags('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['name'], - titleFn: (item) => item['name'] - }; - - dmpAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: (x, excluded) => this.filterDmps(x).pipe(map(x => x.data)), - initialItems: (extraData) => this.filterDmps('').pipe(map(x => x.data)), - displayFn: (item) => item['label'], - titleFn: (item) => item['label'] - }; - - grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: this.filterGrant.bind(this), - initialItems: (excludedItems: any[]) => - this.filterGrant('').pipe( - map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['label'], - titleFn: (item) => item['label'] - } - - profileAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: this.filterProfile.bind(this), - initialItems: (excludedItems: any[]) => - this.filterProfile('').pipe( - map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['label'], - titleFn: (item) => item['label'] - }; - - organizationAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: this.filterOrganisation.bind(this), - initialItems: (excludedItems: any[]) => - this.getOrganisations().pipe( - map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['name'], - titleFn: (item) => item['name'] - } - - constructor( - public activatedRoute: ActivatedRoute, - private authentication: AuthService, - public grantService: GrantService, - public dmpService: DmpService, - public organisationService: OrganisationService, - public languageService: TranslateService, - public datasetProfileService: DatasetService, - public externalSourcesService: ExternalSourcesService, - ) { super(); } - - ngOnInit() { - setTimeout(() => { - this.grantStateOptions = observableOf( - [ - { label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE'), value: GrantStateType.Finished }, - { label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE'), value: GrantStateType.OnGoing }, - ]); - }); - // this.profiles = this.datasetProfileService.getDatasetProfiles(); - this.dmpOrganisations = this.externalSourcesService.searchDMPOrganizations(''); - } - - ngAfterViewInit(): void { - // this.accordion.openAll(); - } - - public grantStatusChanged(event) { - this.facetCriteria.grantStatus = event.value; - if (event.value === 'null') { - this.facetCriteria.grantStatus = null; - this.grants = observableOf([]); - this.facetCriteria.grants = []; - } - // if (event.option.selected) { - // if (event.source.checked) { - else { - // const grantCriteria = new GrantCriteria(); - // grantCriteria.grantStateType = this.facetCriteria.grantStatus; - //grantCriteria['length'] = 10; - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new GrantCriteria(); - dataTableRequest.criteria.grantStateType = this.facetCriteria.grantStatus; - dataTableRequest.criteria['length'] = 10; - - this.grants = this.grantService.getPublicPaged(dataTableRequest).pipe(map(x => x.data)); - this.facetCriteria.grants = []; - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - public grantChanged(event: any) { - const eventValue = event.option.value.id; - if (event.option.selected) { this.facetCriteria.grants.push(eventValue); } - if (!event.option.selected) { - const index = this.facetCriteria.grants.indexOf(eventValue); - this.facetCriteria.grants.splice(index, 1); - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - removeGrant(grant) { - this.facetCriteria.grants.splice(this.facetCriteria.grants.indexOf(grant), 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - public profileChanged(event: any) { - const eventValue = event.option.value.id; - if (event.option.selected) { - this.facetCriteria.datasetProfile.push(eventValue); - } - if (!event.option.selected) { - const index = this.facetCriteria.datasetProfile.indexOf(eventValue); - this.facetCriteria.datasetProfile.splice(index, 1); - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - // getProfiles() { - // return this.datasetProfileService.getDatasetProfiles(); - // } - - removeProfile(profile) { - this.facetCriteria.datasetProfile.splice(this.facetCriteria.datasetProfile.indexOf(profile), 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - getOrganisations() { - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new OrganisationCriteria(); - dataTableRequest.criteria.labelLike = ''; - return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data)); - } - - public roleChanged(event: any) { - this.facetCriteria.role = event.value; - if (event.value === 'null') { - this.facetCriteria.role = null; - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - public dmpOrganisationChanged(event: any) { - const eventValue = event.option.value.id; - if (event.option.selected) { this.facetCriteria.dmpOrganisations.push(eventValue); } - if (!event.option.selected) { - const index = this.facetCriteria.dmpOrganisations.indexOf(eventValue); - this.facetCriteria.dmpOrganisations.splice(index, 1); - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - public grantSearch(value: string): Observable { - - const grantCriteria = new GrantCriteria(); - grantCriteria.grantStateType = this.facetCriteria.grantStatus; - grantCriteria['length'] = 10; - grantCriteria.like = value; - - const fields: Array = new Array(); - fields.push('asc'); - - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = grantCriteria; - //const dataTableRequest: RequestItem = { criteria: grantCriteria }; - //return this.grantService.getPaged(dataTableRequest, "autocomplete").map(x => x.data); - return this.grantService.getPublicPaged(dataTableRequest).pipe(map(x => x.data)); - } - - public dmpOrganisationSearch(value: string): Observable { - return this.externalSourcesService.searchDMPOrganizations(value); - } - - removeOrganisation(organisation) { - this.facetCriteria.dmpOrganisations.splice(this.facetCriteria.dmpOrganisations.indexOf(organisation), 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - // public profileSearch(value: string) { - // return this.datasetProfileService.getDatasetProfiles(); - // } - - public controlModified() { - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onGrantOptionSelected(item: GrantListingModel) { - this.facetCriteria.grants.push(item.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onGrantOptionRemoved(item: GrantListingModel) { - const index = this.facetCriteria.grants.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.grants.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - onDmpOptionSelected(item: DmpListingModel) { - this.facetCriteria.dmpIds.push(item.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onDmpOptionRemoved(item: DmpListingModel) { - const index = this.facetCriteria.dmpIds.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.dmpIds.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - onProfileOptionSelected(item: DatasetProfileModel) { - this.facetCriteria.datasetProfile.push(item.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onProfileOptionRemoved(item: DatasetProfileModel) { - const index = this.facetCriteria.datasetProfile.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.datasetProfile.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - onOrganizationOptionSelected(item: OrganizationModel) { - this.facetCriteria.dmpOrganisations.push(item.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onOrganizationOptionRemoved(item: OrganizationModel) { - const index = this.facetCriteria.dmpOrganisations.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.dmpOrganisations.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - filterDmps(value: string): Observable> { - const fields: Array = new Array(); - fields.push('-finalizedAt'); - const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dmpDataTableRequest.criteria = new ExploreDmpCriteriaModel(); - dmpDataTableRequest.criteria.like = value; - return this.dmpService.getPublicPaged(dmpDataTableRequest, "autocomplete") - } - - filterTags(value: string): Observable { - this.filteredTags = undefined; - this.filteringTagsAsync = true; - const requestItem: RequestItem = new RequestItem(); - const criteria: TagCriteria = new TagCriteria(); - criteria.like = value; - requestItem.criteria = criteria; - return this.externalSourcesService.searchDatasetTags(requestItem); - // .subscribe(items => { - // this.filteredTags = items; - // this.filteringTagsAsync = false; - // }); - } - - filterGrant(query: string) { - const fields: Array = new Array(); - fields.push('asc'); - const grantRequestItem: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - grantRequestItem.criteria = new GrantCriteria(); - grantRequestItem.criteria.like = query; - return this.grantService.getPublicPaged(grantRequestItem).pipe(map(x => x.data)); - } - - filterProfile(query: string) { - const fields: Array = new Array(); - fields.push('asc'); - const profileRequestItem: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - profileRequestItem.criteria = new DatasetProfileCriteria(); - profileRequestItem.criteria.like = query; - - return this.datasetProfileService.getDatasetProfiles(profileRequestItem); - // this.dmpService.getPublicPaged(profileRequestItem, "listing").pipe(map(x => x.data)); - } - - filterOrganisation(value: string) { - this.filteringOrganisationsAsync = true; - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new OrganisationCriteria(); - dataTableRequest.criteria.labelLike = value; - - return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data)); - } - - public isAuthenticated(): boolean { - return !(!this.authentication.current()); - } -} diff --git a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html b/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html deleted file mode 100644 index 903822e55..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html +++ /dev/null @@ -1,72 +0,0 @@ - - diff --git a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.scss b/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.scss deleted file mode 100644 index 26c7bf5b0..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.scss +++ /dev/null @@ -1,99 +0,0 @@ -.gray-container { - letter-spacing: 5px; - color: #aaaaaa; -} - -.container-header { - display: flex; - align-items: baseline; - margin-top: 0px; - text-transform: uppercase; -} - -.container-header p { - letter-spacing: 5px; - color: #aaaaaa; - padding-top: 10px; - margin-bottom: 0px; -} - -h4 { - display: inline; - padding-left: 1em; - color: #333333; -} - -.title h4 { - padding-left: 30px; - line-height: 2em; -} - -.about-item { - display: flex; - flex-wrap: wrap; -} - -.about-item .length { - color: #00b29f; - // color: #089dbb; -} - -.about-item .title { - margin: 2px 10px; -} - -.about-item p { - margin-left: auto; - margin-bottom: 0px; - padding-top: 7px; - color: #aaaaaa; -} - -p { - color: #333333; -} - -.finalized-bookmark { - color: #08bd63; -} - -// .explore-dataset-info { -// background-color: #f6f6f6; -// padding: 8px 15px; -// } - -// .explore-dataset-info p { -// margin-bottom: 0px; -// color: rgb(37, 35, 140); -// font-weight: 600; -// } - -// .template-name { -// padding-left: 0px; -// border: 1px solid rgb(218, 227, 243); -// color: rgb(43, 104, 209); -// background-color: rgb(236, 241, 249); -// border-radius: 10em; -// justify-content: center; -// text-transform: uppercase; -// display: flex; -// width: 25em; -// height: 1.8em; -// margin-top: 15px; -// font-size: 13px; -// font-weight: 500; -// } - -// .draft-bookmark { -// color: #e7e6e6; -// display: inline; -// } - -// .finalized-bookmark { -// color: #92d050; -// display: inline; -// } - -// h4 { -// display: inline; -// } diff --git a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.ts b/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.ts deleted file mode 100644 index 83ac3f9ad..000000000 --- a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { DatasetListingModel } from '../../../core/model/dataset/dataset-listing'; -import { DatasetStatus } from '../../../core/common/enum/dataset-status'; - -@Component({ - selector: 'app-explore-dataset-listing-item-component', - templateUrl: './explore-dataset-listing-item.component.html', - styleUrls: ['./explore-dataset-listing-item.component.scss'] -}) -export class ExploreDatasetListingItemComponent implements OnInit { - - @Input() dataset: DatasetListingModel; - @Input() showDivider: boolean = true; - @Output() onClick: EventEmitter = new EventEmitter(); - - isDraft: boolean; - - constructor() { } - - ngOnInit() { - if (this.dataset.status == DatasetStatus.Draft) { this.isDraft = true } - else { this.isDraft = false } - } - - // itemClicked() { - // this.onClick.emit(this.dataset); - // } - -} diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.html b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.html deleted file mode 100644 index b0406d2ce..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.html +++ /dev/null @@ -1,20 +0,0 @@ -
- - - -
- - - {{ - displayLabel(option) }} - cancel - - - -
- - -

{{ displayLabel(option) }}

-
-
-
diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.scss b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.scss deleted file mode 100644 index b4d929724..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.scss +++ /dev/null @@ -1,14 +0,0 @@ -.facet-option-item { - height: auto !important; - min-height: 48px; - padding: 0.5em; - .mat-list-item-content { - min-height: inherit; - } -} - -.data-expand-panel{ - max-height: 20em; - overflow-x: hidden; - overflow-y: auto; -} diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.ts b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.ts deleted file mode 100644 index f18a44f34..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component.ts +++ /dev/null @@ -1,84 +0,0 @@ - -import { SelectionModel } from '@angular/cdk/collections'; -import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { MatListOption, MatSelectionList } from '@angular/material/list'; -import { BaseComponent } from '@common/base/base.component'; -import { Observable, of as observableOf } from 'rxjs'; -import { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators'; - - -@Component({ - selector: 'app-explore-dmp-filter-item-component', - templateUrl: './explore-dmp-filter-item.component.html', - styleUrls: ['./explore-dmp-filter-item.component.scss'] -}) -export class ExploreDmpFilterItemComponent extends BaseComponent implements OnInit { - @Input() - searchEnabled = false; - @Input() - requestDelay = 200; - @Input() - multipleSelect = true; - @Input() - filterOptions: (value) => Observable; - @Input() - options: Observable = observableOf([]); - @Input() - displayTitleFunc: (value) => string; - @Input() - displayValueFunc: (value) => string; - @Output() - selectedChanged = new EventEmitter(); - @Output() - optionRemoved = new EventEmitter(); - - - optionSearchControl = new FormControl(''); - public selectedOptions: any[] = []; - - @ViewChild('optionsList', { static: true }) selectionList: MatSelectionList; - - constructor() { super(); } - - ngOnInit(): void { - if (!this.multipleSelect) { this.selectionList.selectedOptions = new SelectionModel(this.multipleSelect); } - this.optionSearchControl.valueChanges.pipe(debounceTime(this.requestDelay), - distinctUntilChanged()) - .pipe(takeUntil(this._destroyed)) - .subscribe(x => { if (this.filterOptions) { this.options = this.filterOptions(x); } }); - } - - public selectionChanged(event: any) { - const eventValue = event.option.value; - if (event.option.selected) { this.selectedOptions.push(eventValue); } - if (!event.option.selected) { - const index = this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(eventValue)); - this.selectedOptions.splice(index, 1); - } - this.selectedChanged.emit(event); - } - - public removeOption(grant) { - const list = this.selectionList.selectedOptions.selected.map(x => x.value); - const indexOfGrant = list.indexOf(grant); - if (this.selectionList.selectedOptions.selected[indexOfGrant]) { - this.selectionList.selectedOptions.selected[indexOfGrant].selected = false; - this.selectionList.selectedOptions.selected.splice(indexOfGrant, 1); - } - this.selectedOptions.splice(this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(grant)), 1); - this.optionRemoved.emit(grant); - } - - public isOptionSelected(value) { - return this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(value)) !== -1; - } - - displayLabel(value) { - return this.displayTitleFunc ? this.displayTitleFunc(value) : value; - } - - displayValue(value) { - return this.displayValueFunc ? this.displayValueFunc(value) : value; - } -} diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.html b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.html deleted file mode 100644 index d7a2e6ce6..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.html +++ /dev/null @@ -1,122 +0,0 @@ -
-
{{'CRITERIA.FILTERS'| translate}}
-
- - - - search - - -
-
{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}
- - - {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }} - - - {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }} - - - {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }} - - -
- -
-
{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}
- - - - -
- -
-
{{ 'FACET-SEARCH.PROFILES.TITLE' | translate }}
- - - - -
- -
-
{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}
- - - {{ 'FACET-SEARCH.ROLE.ANY' | translate }} - - - {{ 'FACET-SEARCH.ROLE.OWNER' | translate }} - - - {{ 'FACET-SEARCH.ROLE.MEMBER' | translate }} - - -
- -
-
{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}
- - - - -
-
-
- - - diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss deleted file mode 100644 index 0bceec0ed..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss +++ /dev/null @@ -1,106 +0,0 @@ -.facet-search-component { - .mat-form-field { - width: 100%; - } - - .tags-chips { - padding: 0px; - } -} - -.search ::ng-deep.mat-form-field-infix { - margin-left: 1em; -} - -.category-title { - color: black; - // color: #089dbb; - margin-top: 8px; - margin-bottom: 12px; -} - -.import { - margin: 10px; - padding: 0px; -} - -.filters { - border: 1px solid #e4e4e4; - border-radius: 5px; -} - -.filters-title { - width: 93px; - color: #089dbb; - background-color: white; - padding: 0px 20px; - margin-top: -10px; - margin-left: 20px; - text-transform: uppercase; -} - -.style-icon { - color: #adadad; -} - -// ::ng-deep .mat-checkbox-inner-container { -// background: white; -// } - -// ::ng-deep .mat-focused .mat-form-field-label { -// color: #00b29f !important; -// } - -// ::ng-deep.mat-form-field-underline { -// background-color: #adadad; -// } - -// ::ng-deep.mat-form-field-ripple { -// background-color: #00b29f !important; -// } - -// ::ng-deep .mat-checkbox { -// background-color: #f6f6f6 !important; -// } - -::ng-deep .mat-checkbox .mat-checkbox-frame { - border: 1px solid #aaaaaa; -} - -::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background, -.mat-checkbox-indeterminate.mat-accent .mat-checkbox-background, -.mat-accent .mat-pseudo-checkbox-checked, -.mat-accent .mat-pseudo-checkbox-indeterminate, -.mat-pseudo-checkbox-checked, -.mat-pseudo-checkbox-indeterminate { - background-color: #00b29f; -} - -::ng-deep .mat-ripple-element { - background-color: #2e74b649 !important; -} - -::ng-deep .mat-radio-container { - border-radius: 1em; - background: white; -} - -::ng-deep .mat-radio-button .mat-radio-outer-circle { - border: 1px solid #aaaaaa; -} - -::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle { - border-color: #777777; - // border-color: #00b29f; -} - -::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle { - color: #777777; - background-color: #777777; - // color: #00b29f; - // background-color: #00b29f; -} - -.mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element { - background-color: #2e74b649; -} diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.ts b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.ts deleted file mode 100644 index 99917f0e4..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.ts +++ /dev/null @@ -1,347 +0,0 @@ - -import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild } from "@angular/core"; -import { MatAccordion } from "@angular/material/expansion"; -import { ActivatedRoute } from "@angular/router"; -import { GrantStateType } from '@app/core/common/enum/grant-state-type'; -import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; -import { GrantListingModel } from '@app/core/model/grant/grant-listing'; -import { OrganizationModel } from '@app/core/model/organisation/organization'; -import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; -import { ExploreDmpCriteriaModel } from '@app/core/query/explore-dmp/explore-dmp-criteria'; -import { GrantCriteria } from '@app/core/query/grant/grant-criteria'; -import { OrganisationCriteria } from '@app/core/query/organisation/organisation-criteria'; -import { AuthService } from '@app/core/services/auth/auth.service'; -import { DatasetService } from '@app/core/services/dataset/dataset.service'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { GrantService } from '@app/core/services/grant/grant.service'; -import { OrganisationService } from '@app/core/services/organisation/organisation.service'; -import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; -import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component'; -import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; -import { TranslateService } from "@ngx-translate/core"; -import { Observable, of as observableOf } from 'rxjs'; -import { map } from 'rxjs/operators'; - - -@Component({ - selector: 'app-explore-dmp-filters-component', - templateUrl: './explore-dmp-filters.component.html', - styleUrls: ['./explore-dmp-filters.component.scss'] -}) -export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements OnInit, AfterViewInit { - - @Input() facetCriteria = new ExploreDmpCriteriaModel(); - @Output() facetCriteriaChange = new EventEmitter(); - @Input() displayTitleFunc: (value) => string; - GrantStateType = GrantStateType; - grants: Observable; - profiles: Observable; - dmpOrganisations: Observable; - grantOptions: Observable; - grantStateOptions: Observable; - filteringOrganisationsAsync = false; - filteredOrganisations: OrganizationModel[]; - status: GrantStateType; - IsChecked: boolean; - IsIndeterminate: boolean; - LabelAlign: string; - IsDisabled: boolean; - Active: string; - Inactive: string; - - @ViewChild('facetAccordion', { static: false }) accordion: MatAccordion; - - displayGrantStateValue = (option) => option['value']; - displayGrantStateLabel = (option) => option['label']; - - displayGrantValue = (option) => option['id']; - displayGrantLabel = (option) => option['label']; - - displayProfileValue = (option) => option['id']; - displayProfileLabel = (option) => option['label']; - - displayDmpOrganisationsValue = (option) => option['id']; - displayDmpOrganisationsLabel = (option) => option['name']; - - profileAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: this.filterProfile.bind(this), - initialItems: (excludedItems: any[]) => - this.filterProfile('').pipe( - map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['label'], - titleFn: (item) => item['label'] - }; - - organizationAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: this.filterOrganisation.bind(this), - initialItems: (excludedItems: any[]) => - this.getOrganisations().pipe( - map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['name'], - titleFn: (item) => item['name'] - } - - grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - filterFn: this.filterGrant.bind(this), - initialItems: (excludedItems: any[]) => - this.filterGrant('').pipe( - map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - displayFn: (item) => item['label'], - titleFn: (item) => item['label'] - } - - constructor( - public activatedRoute: ActivatedRoute, - public languageService: TranslateService, - public grantService: GrantService, - private authentication: AuthService, - public datasetProfileService: DatasetService, - public organisationService: OrganisationService, - public externalSourcesService: ExternalSourcesService, - private dmpService: DmpService - ) { - super(new ValidationErrorModel()); - this.IsChecked = false; - this.IsIndeterminate = false; - this.LabelAlign = 'after'; - this.IsDisabled = false; - this.Active = "0"; - this.Inactive = "1"; - } - - ngOnInit() { - setTimeout(x => { - this.grantStateOptions = observableOf( - [ - { label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE'), value: GrantStateType.Finished }, - { label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE'), value: GrantStateType.OnGoing }, - ]); - }); - //this.profiles = this.datasetProfileService.getDatasetProfiles(); - const fields: Array = new Array(); - fields.push('asc'); - this.dmpOrganisations = this.organisationService.searchPublicOrganisations(new DataTableRequest(0, null, { fields: fields })).pipe(map(x => x.data)); - } - - ngAfterViewInit(): void { - // this.accordion.openAll(); - } - - OnChange($event) { - console.log($event); - } - - OnIndeterminateChange($event) { - console.log($event); - } - - controlModified() { - this.facetCriteriaChange.emit(this.facetCriteria); - } - - grantSearch(value: string): Observable { - const grantCriteria = new GrantCriteria(); - grantCriteria.grantStateType = this.facetCriteria.grantStatus; - grantCriteria['length'] = 10; - grantCriteria.like = value; - - const fields: Array = new Array(); - fields.push('asc'); - - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = grantCriteria; - return this.grantService.getPublicPaged(dataTableRequest).pipe(map(x => x.data)); - } - - grantStatusChanged(event) { - this.facetCriteria.grantStatus = event.value; - // this.facetCriteria.grantStatus = +event.source.ariaLabel; // For checkboxes - // this.facetCriteria.grantStatus = event.option.value.value; // For - // if (!event.source.checked) { - if (event.value === 'null') { - this.facetCriteria.grantStatus = null; - this.grants = observableOf([]); - this.facetCriteria.grants = []; - } - // if (event.checked) { - // if (event.option.selected) { - // if (event.source.checked) { - else { - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new GrantCriteria(); - dataTableRequest.criteria.grantStateType = this.facetCriteria.grantStatus; - dataTableRequest.criteria['length'] = 10; - - this.grants = this.grantService.getPublicPaged(dataTableRequest).pipe(map(x => x.data)); - this.facetCriteria.grants = []; - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - grantChanged(event: any) { - const eventValue = event.option.value.id; - if (event.option.selected) { this.facetCriteria.grants.push(eventValue); } - if (!event.option.selected) { - const index = this.facetCriteria.grants.indexOf(eventValue); - this.facetCriteria.grants.splice(index, 1); - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - removeGrant(grant) { - this.facetCriteria.grants.splice(this.facetCriteria.grants.indexOf(grant), 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onProfileOptionSelected(items: DatasetProfileModel) { - //this.facetCriteria.datasetProfile.splice(0); - this.facetCriteria.datasetProfile.push(items.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onProfileOptionRemoved(item: DatasetProfileModel) { - const index = this.facetCriteria.datasetProfile.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.datasetProfile.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - profileChanged(event: any) { - const eventValue = event.option.value.id; - if (event.option.selected) { - this.facetCriteria.datasetProfile.push(eventValue); - } - if (!event.option.selected) { - const index = this.facetCriteria.datasetProfile.indexOf(eventValue); - this.facetCriteria.datasetProfile.splice(index, 1); - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - removeProfile(profile) { - this.facetCriteria.datasetProfile.splice(this.facetCriteria.datasetProfile.indexOf(profile), 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onOrganizationOptionSelected(item: OrganizationModel) { - this.facetCriteria.dmpOrganisations.push(item.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onOrganizationOptionRemoved(item: OrganizationModel) { - const index = this.facetCriteria.dmpOrganisations.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.dmpOrganisations.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - onGrantOptionSelected(item: GrantListingModel) { - this.facetCriteria.grants.push(item.id); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - onGrantOptionRemoved(item: GrantListingModel) { - const index = this.facetCriteria.grants.indexOf(item.id); - if (index >= 0) { - this.facetCriteria.grants.splice(index, 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - } - - public roleChanged(event: any) { - this.facetCriteria.role = event.value; - if (event.value === 'null') { - this.facetCriteria.role = null; - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - dmpOrganisationChanged(event: any) { - const eventValue = event.option.value.id; - if (event.option.selected) { this.facetCriteria.dmpOrganisations.push(eventValue); } - if (!event.option.selected) { - const index = this.facetCriteria.dmpOrganisations.indexOf(eventValue); - this.facetCriteria.dmpOrganisations.splice(index, 1); - } - this.facetCriteriaChange.emit(this.facetCriteria); - } - - // profileSearch(value: string) { - // return this.datasetProfileService.getDatasetProfiles(); - // } - - dmpOrganisationSearch(value: string): Observable { - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new OrganisationCriteria(); - dataTableRequest.criteria.labelLike = value; - return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data)); - } - - removeOrganisation(organisation) { - this.facetCriteria.dmpOrganisations.splice(this.facetCriteria.dmpOrganisations.indexOf(organisation), 1); - this.facetCriteriaChange.emit(this.facetCriteria); - } - - // getProfiles() { - // return this.datasetProfileService.getDatasetProfiles(); - // } - - getOrganisations() { - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new OrganisationCriteria(); - dataTableRequest.criteria.labelLike = ''; - return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data)); - } - - filterGrant(query: string) { - const fields: Array = new Array(); - fields.push('asc'); - const grantRequestItem: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - grantRequestItem.criteria = new GrantCriteria(); - grantRequestItem.criteria.like = query; - return this.grantService.getPublicPaged(grantRequestItem).pipe(map(x => x.data)); - } - - filterProfile(query: string) { - const fields: Array = new Array(); - fields.push('asc'); - const profileRequestItem: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - profileRequestItem.criteria = new DatasetProfileCriteria(); - profileRequestItem.criteria.like = query; - - return this.datasetProfileService.getDatasetProfiles(profileRequestItem); - } - - filterOrganisation(value: string) { - this.filteringOrganisationsAsync = true; - const fields: Array = new Array(); - fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new OrganisationCriteria(); - dataTableRequest.criteria.labelLike = value; - - return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data)); - } - - displayLabel(value) { - return this.displayTitleFunc ? this.displayTitleFunc(value) : value; - } - - isOptionSelected(profile: any) { - return this.formGroup.value.map(x => x.id).indexOf(profile.id) !== -1; - } - - public isAuthenticated(): boolean { - return !(!this.authentication.current()); - } -} diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html deleted file mode 100644 index 1652e34fe..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html +++ /dev/null @@ -1,39 +0,0 @@ -
-
-

{{ 'ABOUT.WELCOME' | translate }}

-

{{ 'ABOUT.WELCOME-MESSAGE' | translate }}

-
-
-
-
-
-
-
-

{{'DMP-LISTING.TITLE' | translate}}

-
- - {{'DMP-LISTING.VIEW-ALL-VERSIONS' | translate}} - - - {{this.groupLabel}} - -
-
-
-
-
-
- - -
-
-
- -
- -
-
-
-
-
-
diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss deleted file mode 100644 index 79bfb137b..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss +++ /dev/null @@ -1,86 +0,0 @@ -@import "node_modules/bootstrap/scss/functions"; -@import "node_modules/bootstrap/scss/variables"; -@import "node_modules/bootstrap/scss/mixins/_breakpoints"; - -@include media-breakpoint-down(sm) { - .lightblue-btn { - font-size: 12px; - } - ::ng-deep .mat-paginator-container { - height: auto !important; - } -} - -text-center { - text-align: center; -} - -.card-desc { - min-height: 5vh; -} - -.header-image { - background: url("/assets/images/new-dashboard-bg.png") no-repeat; - background-size: cover; - margin-top: 70px; - min-height: 15em; - position: relative; -} - -.header-text-container { - background: rgba(255, 255, 255, 0.7); - position: absolute; - bottom: 0px; - padding-left: 5em; - padding-right: 10em; - padding-top: 2em; - padding-bottom: 2em; -} - -.explore-dmp-content { - padding: 30px 15px; -} - -::ng-deep .mat-paginator { - margin-top: 1em; -} - -::ng-deep .mat-paginator-container { - flex-direction: row-reverse !important; - justify-content: space-between !important; - background-color: #f6f6f6; - height: 30px; - min-height: 30px !important; -} - -::ng-deep .mat-paginator-page-size { - height: 43px; -} - -::ng-deep .mat-icon-button { - height: 30px !important; - font-size: 12px !important; -} - -::ng-deep .mat-paginator-range-label { - margin: 15px 32px 0 24px !important; -} - -::ng-deep .mat-paginator-range-actions { - width: auto !important; - min-width: 55% !important; - min-height: 43px !important; - justify-content: space-between; -} - -::ng-deep .mat-paginator-navigation-previous { - margin-left: auto !important; -} - -.all-versions { - color: #999999 !important; -} - -.dmp-label { - color: #089dbb !important; -} diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts deleted file mode 100644 index 9ca409955..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts +++ /dev/null @@ -1,198 +0,0 @@ - -import { Component, OnInit, ViewChild } from "@angular/core"; -import { MatPaginator } from "@angular/material/paginator"; -import { MatSort } from "@angular/material/sort"; -import { ActivatedRoute, Router } from "@angular/router"; -import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; -import { ExploreDmpCriteriaModel } from '@app/core/query/explore-dmp/explore-dmp-criteria'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; -import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; -import { BaseComponent } from '@common/base/base.component'; -import { TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -@Component({ - selector: 'app-explore-dmp-listing-component', - templateUrl: 'explore-dmp-listing.component.html', - styleUrls: ['./explore-dmp-listing.component.scss'], -}) -export class ExploreDmpListingComponent extends BaseComponent implements OnInit, IBreadCrumbComponent { - - @ViewChild(MatPaginator, { static: true }) _paginator: MatPaginator; - sort = new MatSort(); - - exploreDmpCriteriaModel: ExploreDmpCriteriaModel = new ExploreDmpCriteriaModel(); - titlePrefix: string; - totalCount: number; - listingItems: DmpListingModel[] = []; - breadCrumbs: Observable; - linkToDmpId: string; - groupId: string; - allVersions: boolean = false; - groupLabel: string; - - constructor( - private dmpService: DmpService, - private router: Router, - private route: ActivatedRoute, - private language: TranslateService, - ) { - super(); - this.sort.direction = 'desc'; - this.sort.active = "publishedAt"; - } - - ngOnInit() { - this.route.params - .pipe(takeUntil(this._destroyed)) - .subscribe(params => { - if (params['groupId']) { - this.groupId = params['groupId']; - this.exploreDmpCriteriaModel.groupIds.push(this.groupId); - this.exploreDmpCriteriaModel.allVersions = true; - this.allVersions = true; - this.route.queryParams - .pipe(takeUntil(this._destroyed)) - .subscribe(queryParams => { - if (queryParams["groupLabel"]) { - this.groupLabel = queryParams["groupLabel"]; - } - }) - } - - this.refresh(); - const breadCrumbs = []; - breadCrumbs.push({ - parentComponentName: null, - label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), - url: "/explore-plans" - }) - this.breadCrumbs = observableOf(breadCrumbs); - }) - } - - refresh() { - if (this._paginator.pageSize === undefined) this._paginator.pageSize = 10; - const startIndex = this._paginator.pageIndex * this._paginator.pageSize; - let fields: Array = new Array(); - if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } - const request = new DataTableRequest(startIndex, this._paginator.pageSize, { fields: fields }); - request.criteria = this.exploreDmpCriteriaModel || this.getDefaultCriteria(); - this.dmpService.getPublicPaged(request, "listing").pipe(takeUntil(this._destroyed)).subscribe(result => { - if (!result) { return []; } - if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; } - this.listingItems = result.data; - }); - } - - - getDefaultCriteria(): ExploreDmpCriteriaModel { - const defaultCriteria = new ExploreDmpCriteriaModel(); - return defaultCriteria; - } - - onCriteriaChange(event: ExploreDmpCriteriaModel) { - this.exploreDmpCriteriaModel = event; - if (this.allVersions == true) this.exploreDmpCriteriaModel.allVersions = this.allVersions; - if (this.groupId) this.exploreDmpCriteriaModel.groupIds.push(this.groupId); - this._paginator.pageIndex = 0; - this.refresh(); - } - - pageThisEvent(event) { - this.refresh(); - } - - // rowClicked(dmp: DmpListingModel) { - // this.router.navigate(['overview', dmp.id], { relativeTo: this.route }); - // } - - // @ViewChild(MatPaginator) _paginator: MatPaginator; - // @ViewChild(MatSort) sort: MatSort; - // criteria: ExploreDmpCriteriaModel = new ExploreDmpCriteriaModel(); - - // dataSource: DmpDataSource | null; - // displayedColumns: String[] = ['name', 'grant', 'organisations', 'created']; - // pageEvent: PageEvent; - // titlePrefix: String; - // dmpId: string; - - // constructor( - // public dmpService: DmpService, - // private router: Router, - // private languageService: TranslateService, - // public snackBar: MatSnackBar, - // public route: ActivatedRoute - // ) { - // super(); - // } - - // ngOnInit() { - // this.refresh(); - // } - - // rowClick(rowId: String) { - // this.router.navigate(['/plans/publicEdit/' + rowId]); - // } - - // refresh() { - // this.dataSource = new DmpDataSource(this.dmpService, this._paginator, this.sort, this.languageService, this.snackBar, this.criteria); - // } - - // getDefaultCriteria(dmpId: String): DmpCriteria { - // const defaultCriteria = new DmpCriteria(); - // return defaultCriteria; - // } - - // onCriteriaChange(event: ExploreDmpCriteriaModel) { - // //console.log(event) - // this.criteria = event; - // this.refresh(); - // } -} - -// export class DmpDataSource extends DataSource { - -// totalCount = 0; - -// constructor( -// private _service: DmpService, -// private _paginator: MatPaginator, -// private _sort: MatSort, -// private _languageService: TranslateService, -// private _snackBar: MatSnackBar, -// private _criteria: ExploreDmpCriteriaModel, -// ) { -// super(); -// } - -// connect(): Observable { -// const displayDataChanges = [ -// this._paginator.page -// ]; - -// return Observable.merge(...displayDataChanges) -// .startWith(null) -// .switchMap(() => { -// const startIndex = this._paginator.pageIndex * this._paginator.pageSize; -// let fields: Array = new Array(); -// if (this._sort.active) { fields = this._sort.direction === 'asc' ? ['+' + this._sort.active] : ['-' + this._sort.active]; } -// const request = new DataTableRequest(startIndex, this._paginator.pageSize, { fields: fields }); -// request.criteria = this._criteria; -// //if (this.dmpId) request.criteria.allVersions = true; -// return this._service.getPublicPaged(request); -// }) -// .map(result => { -// if (!result) { return []; } -// if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; } -// return result.data; -// }); -// } - -// disconnect(): void { -// // No-op -// } -// } diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp.module.ts b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp.module.ts deleted file mode 100644 index 51046c470..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { NgModule } from "@angular/core"; -import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; -import { DmpOverviewModule } from '@app/ui/dmp/overview/dmp-overview.module'; -import { ExploreDmpFilterItemComponent } from '@app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filter-item/explore-dmp-filter-item.component'; -import { ExploreDmpFiltersComponent } from '@app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component'; -import { ExploreDmpListingComponent } from '@app/ui/explore-dmp/explore-dmp-listing.component'; -import { ExploreDmpRoutingModule } from '@app/ui/explore-dmp/explore-dmp.routing'; -import { ExploreDmpListingItemComponent } from '@app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component'; -import { CommonFormsModule } from '@common/forms/common-forms.module'; -import { CommonUiModule } from '@common/ui/common-ui.module'; - -@NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - AutoCompleteModule, - ExploreDmpRoutingModule, - DmpOverviewModule - ], - declarations: [ - ExploreDmpListingComponent, - ExploreDmpFiltersComponent, - ExploreDmpFilterItemComponent, - ExploreDmpListingItemComponent - ] -}) -export class ExploreDmpModule { } diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp.routing.ts b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp.routing.ts deleted file mode 100644 index 4918a250d..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp.routing.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { ExploreDmpListingComponent } from './explore-dmp-listing.component'; -import { DmpOverviewComponent } from '../dmp/overview/dmp-overview.component'; - -const routes: Routes = [ - { - path: '', - component: ExploreDmpListingComponent, - data: { - breadcrumb: true - } - }, - { - path: 'versions/:groupId', - component: ExploreDmpListingComponent, - data: { - breadcrumb: true - }, - }, - { - path: 'overview/:publicId', - component: DmpOverviewComponent, - data: { - breadcrumb: true, - title: 'GENERAL.TITLES.EXPLORE-PLANS-OVERVIEW' - }, - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class ExploreDmpRoutingModule { } diff --git a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html deleted file mode 100644 index 407534416..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - diff --git a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss deleted file mode 100644 index 53f7173c0..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss +++ /dev/null @@ -1,142 +0,0 @@ -.gray-container { - letter-spacing: 5px; - color: #aaaaaa; -} - -.container-header { - display: flex; - align-items: baseline; - margin-top: 0px; - text-transform: uppercase; -} - -.about-item { - display: flex; - flex-wrap: wrap; -} - -.about-item h4 { - font-size: 1rem; - line-height: 1.25em; - font-weight: 500; -} - -.about-item .length { - color: #00b29f; - // color: #089dbb; -} - -.about-item .title { - margin: 2px 10px; -} - -.about-item p { - margin-left: auto; - margin-bottom: 0px; - padding-top: 7px; - color: #aaaaaa; -} - -.draft-icon { - color: #aaaaaa; -} - -.more-horiz { - font-size: 28px; - color: #aaaaaa; -} - -.custom-published-icon { - width: 20px; - height: 20px; - border-radius: 50%; - background-color: #08bd6342; - margin-top: 3px; -} - -.published-icon { - color: #08bd63; - font-size: 12px; - margin-left: 4px; - padding-bottom: 7px; - // padding-top: 2px; - // padding-left: 4px; - // color: #92d050; -} - -.outer-circle { - background: #08bd6342; - border-radius: 50%; - width: 20px; - height: 20px; - position: relative; - margin-top: 3px; -} - -.inner-circle { - position: absolute; - background: #08bd63; - border-radius: 50%; - height: 10px; - width: 10px; - top: 50%; - left: 50%; - margin: -5px 0px 0px -5px; -} - -h4 { - display: inline; - padding-left: 1em; - line-height: 1.7em; -} - -h4 > span { - text-transform: uppercase; -} - -p { - color: #333333; -} - -.description { - margin-bottom: 0.4em; -} - -// .explore-dmp-listing-item { -// margin-top: 2em; -// margin-bottom: 2em; -// cursor: pointer; - -// .title { -// color: black; -// } - -// .grant-title { -// color: rgb(93, 125, 173); -// } - -// .gray-icon { -// color: rgb(191, 191, 191); -// } - -// .explore-dmp-chip { -// padding: 0.1em 1em; -// border: 0.1em solid rgb(236, 241, 249); -// border-radius: 10em; -// background-color: rgb(236, 241, 249); -// color: rgb(68, 114, 196); -// } - -// .explore-dmp-squared-chip { -// padding: 0.1em 1em; -// border: 0.1em solid rgb(236, 241, 249); -// border-radius: 0.5em; -// background-color: rgb(246, 246, 246); -// color: rgb(127, 127, 127); -// } - -// mat-icon { -// width: auto; -// height: auto; -// } -// } diff --git a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.ts deleted file mode 100644 index 327bc33be..000000000 --- a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { DmpListingModel } from '../../../core/model/dmp/dmp-listing'; -import { Principal } from '../../../core/model/auth/principal'; -import { AuthService } from '../../../core/services/auth/auth.service'; -import { TranslateService } from '@ngx-translate/core'; -import { Router, ActivatedRoute } from '@angular/router'; - -@Component({ - selector: 'app-explore-dmp-listing-item-component', - templateUrl: './explore-dmp-listing-item.component.html', - styleUrls: ['./explore-dmp-listing-item.component.scss'], -}) -export class ExploreDmpListingItemComponent implements OnInit { - - @Input() dmp: DmpListingModel; - @Input() showDivider: boolean = true; - @Output() onClick: EventEmitter = new EventEmitter(); - - constructor( - private authentication: AuthService, - private translate: TranslateService, - private router: Router, - private route: ActivatedRoute - ) { } - - ngOnInit() { - } - - // itemClicked() { - // this.onClick.emit(this.dmp); - // } - - roleDisplay(value: any) { - const principal: Principal = this.authentication.current(); - let role: number; - if (principal) { - value.forEach(element => { - if (principal.id === element.id) { - role = element.role; - } - }); - } - if (role === 0) { - return this.translate.instant('DMP-PUBLIC-LISTING.OWNER'); - } - else if (role === 1) { - return this.translate.instant('DMP-PUBLIC-LISTING.MEMBER'); - } - else { - return this.translate.instant('DMP-PUBLIC-LISTING.VIEW-ONLY'); - } - } -}