Adds: Links on buttons VIEW ALL, Translates: Buttons VIEW ALL

This commit is contained in:
apapachristou 2019-04-26 19:08:51 +03:00
parent 6890cd2799
commit 0e09d661d4
7 changed files with 33 additions and 15 deletions

View File

@ -1,9 +0,0 @@
.view-all {
cursor: pointer;
color: rgb(106, 164, 217);
font-weight: 500;
}
.view-all:hover {
color: rgb(46, 117, 182);
}

View File

@ -10,7 +10,7 @@
</div>
<div class="card-footer">
<div class="stats">
<div class="view-all" [class.clickable]="isAuthenticated()" (click)="navigateToUrl()">VIEW ALL</div>
<div class="view-all" [class.clickable]="isAuthenticated()" (click)="navigateToUrl()">{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate}}</div>
</div>
</div>
</div>

View File

@ -19,3 +19,4 @@ th {
border-radius: 10em;
text-align: center;
}

View File

@ -8,7 +8,7 @@
{{ 'RECENT-ACTIVITY.LICENSE' | translate}}
</p>
</div>
<a href="#" class="view-all">{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate }}</a>
<div class="view-all" [class.clickable]="isAuthenticated()" (click)="navigateToUrl()">{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate}}</div>
</div>
<div class="card-body table-responsive">
<table class="table table-hover">
@ -23,7 +23,7 @@
<th></th>
</thead>
<tbody *ngIf="dmpActivities != null">
<tr *ngFor="let activity of dmpActivities">
<tr (click)="redirect(activity.id, recentActivityTypeEnum.Dmp)" *ngFor="let activity of dmpActivities" style="cursor: pointer;">
<td>{{ activity.label }}</td>
<td>
<div class="template-name">

View File

@ -5,6 +5,8 @@ import { AuthService } from '../../../core/services/auth/auth.service';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { RecentActivityType } from '../../../core/common/enum/recent-activity-type';
import { Router } from '@angular/router';
@Component({
selector: 'app-recent-edited-activity',
@ -13,8 +15,10 @@ import { DmpService } from '../../../core/services/dmp/dmp.service';
})
export class RecentEditedActivityComponent implements OnInit {
dmpActivities: DmpListingModel[];
recentActivityTypeEnum = RecentActivityType;
constructor(
private router: Router,
public enumUtils: EnumUtils,
private authentication: AuthService,
private dmpService: DmpService
@ -38,4 +42,24 @@ export class RecentEditedActivityComponent implements OnInit {
return !!this.authentication.current();
}
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 ");
}
}
navigateToUrl() { }
}

View File

@ -8,7 +8,8 @@
{{ 'RECENT-ACTIVITY.LICENSE' | translate}}
</p>
</div>
<a href="#" class="view-all">{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate }}</a>
<div class="view-all" [class.clickable]="isAuthenticated()" (click)="navigateToUrl()">
{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate}}</div>
</div>
<div class="card-body table-responsive">
<table class="table table-hover">
@ -23,8 +24,7 @@
<th></th>
</thead>
<tbody *ngIf="dmpActivities != null">
<tr (click)="redirect(activity.id, recentActivityTypeEnum.Dmp)" *ngFor="let activity of dmpActivities"
style="cursor: pointer;">
<tr (click)="redirect(activity.id, recentActivityTypeEnum.Dmp)" *ngFor="let activity of dmpActivities" style="cursor: pointer;">
<td>{{ activity.label }}</td>
<td>
<div class="template-name">

View File

@ -68,4 +68,6 @@ export class RecentVisitedActivityComponent extends BaseComponent
public isAuthenticated(): boolean {
return !!this.authentication.current();
}
navigateToUrl() { }
}