diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html index 81de620ed..ed2d8f9b6 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html @@ -62,11 +62,11 @@ -
+
diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css index 9c881118a..f77fdfe43 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css @@ -1,26 +1,54 @@ .grey { - color: rgb(162, 162, 162); + color: rgb(162, 162, 162); } .card-draft { - height: calc(100% - 60px); + height: calc(100% - 60px); } .draft-desc { - padding-top: 15px; - padding-bottom: 15px; + position: relative; + overflow: hidden; + height: 60px; + font-size: 14px; + padding-top: 15px; + margin-bottom: 30px; +} + +.draft-desc:after { + content: ""; + text-align: right; + position: absolute; + bottom: 0; + right: 0; + width: 70%; + height: 1.4em; + background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%); +} + +td:hover .draft-desc:after { + background: rgba(255, 255, 255, 0); } .draft-subtitle { - font-weight: 400; - color: rgb(162, 162, 162); + font-weight: 400; + color: rgb(162, 162, 162); } .draft-title { - font-weight: 500; - color: black; + font-weight: 500; + color: black; } .drafts-more-btn { - text-align: right; + text-align: right; +} + +.project-pill { + width: 80%; + border: 1px solid rgb(231, 230, 230); + color: rgb(145, 145, 145); + background-color: rgb(242, 242, 242); + border-radius: 10em; + text-align: center; } diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html index 3690b3eef..b89c3b201 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -1,89 +1,38 @@
-
-
-

DRAFTS

-

Draft Registrations

-
- VIEW ALL -
-
- - - - - - - - - -
-
-
- view_agenda -
-
-
- more_horiz -
-
- Dataset: Clarin-D For Dmp: Dmp for Project: Real time - application -
-
03.08.2019
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed - do eiusmod tempor incididunt ut labore et dolore magna aliqua. - Ut enim ad minim veniam, quis nostrud exercitation ullamco - laboris nisi ut aliquip ex ea commodo consequat. Duis aute - irure dolor in reprehenderit in voluptate velit esse cillum - dolore eu fugiat nulla pariatur. Excepteur sint occaecat - cupidatat non proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
- -
-
-
-
-
- library_books -
-
-
- more_horiz -
-
Title unavailable
-
03.08.2019
-
- Description unavailable -
- -
-
-
-
+
+
+

DRAFTS

+

Draft Registrations

+
+
{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate}}
+
+
+ + + + + + + + + +
+
+
+ library_books +
+
+
+ more_horiz +
+
+ Dataset: {{ dataset.label }} For Dmp: {{ dataset.dmp }} For Project: {{ dataset.project }} +
+
{{ dataset.created | date: "shortDate"}}
+
{{ dataset.description }}
+
{{ dataset.profile }}
+
+
+
+
diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index 432ca07a8..d8e331173 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -1,15 +1,64 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; +import { DatasetService } from '../../../core/services/dataset/dataset.service'; +import { DataTableRequest } from '../../../core/model/data-table/data-table-request'; +import { DatasetCriteria } from '../../../core/query/dataset/dataset-criteria'; +import { DatasetListingModel } from '../../../core/model/dataset/dataset-listing'; +import { AuthService } from '../../../core/services/auth/auth.service'; +import { RecentActivityType } from '../../../core/common/enum/recent-activity-type'; +import { Router} from '@angular/router'; @Component({ - selector: 'app-drafts', - templateUrl: './drafts.component.html', - styleUrls: ['./drafts.component.css'] + selector: 'app-drafts', + templateUrl: './drafts.component.html', + styleUrls: ['./drafts.component.css'] }) export class DraftsComponent implements OnInit { + datasetDrafts: DatasetListingModel[]; + datasetDraftsTypeEnum = RecentActivityType; + @Input() routerLink: string; + status: number; - constructor() { } + constructor( + private router: Router, + private datasetService: DatasetService, + private authentication: AuthService + ) { } - ngOnInit() { - } + ngOnInit() { + const fields: Array = []; + const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, 2, { fields: fields }); + dmpDataTableRequest.criteria = new DatasetCriteria(); + dmpDataTableRequest.criteria.status = 0; + this.datasetService.getPaged(dmpDataTableRequest).subscribe(response => { + this.datasetDrafts = response.data; + }); + } + redirect(id: string, type: RecentActivityType) { + switch (type) { + case RecentActivityType.Project: { + this.router.navigate(["projects/edit/" + id]); + return; + } + case RecentActivityType.Dataset: { + this.router.navigate(["datasets/edit/" + id]); + return; + } + case RecentActivityType.Dmp: { + this.router.navigate(["plans/edit/" + id]); + return; + } + default: + throw new Error("Unsupported Activity Type "); + } + } + + public isAuthenticated(): boolean { + return !!this.authentication.current(); + } + + navigateToUrl() { + if (!this.isAuthenticated()) { return; } + this.router.navigate(['/datasets'], { queryParams: { status: 0 } }); + } } diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts index 15cde7352..5242cd069 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts @@ -34,6 +34,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB pageEvent: PageEvent; titlePrefix: String; dmpId: string; + status: Number; dmpSearchEnabled = true; constructor( @@ -54,6 +55,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB .subscribe(async (params: Params) => { const queryParams = this.route.snapshot.queryParams; this.dmpId = queryParams['dmpId']; + this.status = queryParams['status']; this.criteria.setRefreshCallback(() => this.refresh()); if (this.dmpId != null) { this.dmpSearchEnabled = false; @@ -69,6 +71,11 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB this.refresh(); this.breadCrumbs = Observable.of([]); } + + if (this.status != null && this.status == 0) { + this.criteria.setCriteria(this.getDraftCriteria()); + this.refresh(); + } }); } @@ -88,6 +95,12 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB return defaultCriteria; } + getDraftCriteria(): DatasetCriteria { + const draftCriteria = new DatasetCriteria(); + draftCriteria.status = 0; + return draftCriteria; + } + makeItPublic(id: String) { this.datasetService.makeDatasetPublic(id) .pipe(takeUntil(this._destroyed)) diff --git a/dmp-frontend/src/assets/css/demo.css b/dmp-frontend/src/assets/css/demo.css index 5720ef104..a150df6a7 100644 --- a/dmp-frontend/src/assets/css/demo.css +++ b/dmp-frontend/src/assets/css/demo.css @@ -214,7 +214,7 @@ h4 { margin-top: 5px; } -.card-title h4 { +.card-desc h4 { text-transform: uppercase; } @@ -259,7 +259,13 @@ h4 { margin-top: 10px; margin-right: 10px; font-weight: 400; + cursor: pointer; text-transform: uppercase; + color: rgb(106, 164, 217); +} + +.view-all:hover { + color: rgb(46, 117, 182); } .card-header-plain h4 { @@ -316,20 +322,6 @@ table > thead > tr > th, z-index: 0; } -.pills-outline-blue .nav-item .nav-link { - border: 1px solid rgb(231, 230, 230); - color: rgb(145, 145, 145); -} -.pills-outline-default .nav-item .nav-link.active { - border: 1px solid rgb(231, 230, 230); - color: rgb(145, 145, 145); - background-color: rgb(242, 242, 242); -} -.pills-outline-default .nav-item .nav-link.active:hover { - border: 1px solid rgb(231, 230, 230); - color: rgb(145, 145, 145); -} - .form-control:focus { color: #495057; background-color: rgba(0, 0, 0, 0);