Adds: Dataset listing links

This commit is contained in:
apapachristou 2019-05-16 11:00:53 +03:00
parent 468810ccf4
commit 61afbb8848
4 changed files with 31 additions and 7 deletions

View File

@ -4,6 +4,7 @@ export interface DatasetListingModel {
dmp: String;
dmpId: String;
project: String;
projectId: String;
projectAbbreviation: String;
profile: String;
dataRepositories: String;

View File

@ -2,7 +2,7 @@
<div class="col">
<div class="row">
<div class="col-12 gray-container container-header">
<p>{{ dataset.projectAbbreviation }}</p>
<p (click)="$event.stopImmediatePropagation(); projectClicked(dataset)">{{ dataset.projectAbbreviation }}</p>
<!-- <button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto"
(click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon>
@ -24,11 +24,13 @@
</div>
<div class="row">
<div class="col-12 about-item">
<mat-icon class="gray-icon pt-2">storage</mat-icon>
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.dmp }}</h4>
<div class="links">
<mat-icon (click)="$event.stopImmediatePropagation(); datasetClicked(dataset)" class="gray-icon pt-2">storage</mat-icon>
<h4 (click)="$event.stopImmediatePropagation(); datasetClicked(dataset)" class="mt-2 ml-1 mr-3 p-1">{{ dataset.dmp }}</h4>
<mat-icon class="gray-icon pt-2">work_outline</mat-icon>
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.project }}</h4>
<mat-icon (click)="$event.stopImmediatePropagation(); projectClicked(dataset)" class="gray-icon pt-2">work_outline</mat-icon>
<h4 (click)="$event.stopImmediatePropagation(); projectClicked(dataset)" class="mt-2 ml-1 mr-3 p-1">{{ dataset.project }}</h4>
</div>
<mat-icon class="gray-icon pt-2">assignment</mat-icon>
<div class="pt-1">

View File

@ -17,6 +17,10 @@
margin-bottom: 0px;
}
.container-header :hover {
color: #4687e6;
}
h4 {
display: inline;
padding-left: 1em;
@ -32,8 +36,16 @@ h4 {
flex-wrap: wrap;
}
.links {
display: flex;
}
.links :hover {
color: #4687e6;
}
.about-item .length {
color: rgb(70, 135, 240);
color: #4687f0;
}
.about-item .title {

View File

@ -1,5 +1,6 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { DatasetListingModel } from '../../../../core/model/dataset/dataset-listing';
import { Router } from '@angular/router';
@Component({
selector: 'app-dataset-listing-item-component',
@ -14,7 +15,7 @@ export class DatasetListingItemComponent implements OnInit {
isDraft: boolean;
constructor() { }
constructor(private router: Router) { }
ngOnInit() {
if (this.dataset.status == 0) { this.isDraft = true }
@ -25,4 +26,12 @@ export class DatasetListingItemComponent implements OnInit {
this.onClick.emit(this.dataset);
}
projectClicked(dataset: DatasetListingModel) {
this.router.navigate(['/projects/edit/' + dataset.projectId]);
}
datasetClicked(dataset: DatasetListingModel) {
this.router.navigate(['/plans/edit/' + dataset.dmpId])
}
}