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; dmp: String;
dmpId: String; dmpId: String;
project: String; project: String;
projectId: String;
projectAbbreviation: String; projectAbbreviation: String;
profile: String; profile: String;
dataRepositories: String; dataRepositories: String;

View File

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

View File

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

View File

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