-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the active button navigation button in results be an additional …
…item in the list if it's hidden
- Loading branch information
Showing
8 changed files
with
457 additions
and
351 deletions.
There are no files selected for viewing
35 changes: 26 additions & 9 deletions
35
src/app/portal/components/tab-button/tab-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
<a class='tab-button-layout2 link-button' [ngClass]='{"link-button__active": active}' [routerLink]='route' style='text-decoration: none'> | ||
<ng-container *ngIf='routerLink && !disabled'> | ||
<a class='tab-button-layout2 link-button' [ngClass]='{"link-button__active": active, "link-button__disabled": disabled}' style='text-decoration: none' [routerLink]='routerLink' [queryParams]='queryParams'> | ||
|
||
<div style='display: flex'> | ||
<fa-icon [icon]="_icon" style='margin-right: 12px'></fa-icon> | ||
<div style='display: flex'> | ||
<fa-icon [icon]="_icon" style='margin-right: 12px'></fa-icon> | ||
|
||
<div>{{ label }}</div> | ||
</div> | ||
<div>{{ label }}</div> | ||
</div> | ||
|
||
<ng-container *ngIf='count !== -1'> | ||
<div [countUp]="count" [options]="countOps"></div> | ||
</ng-container> | ||
<ng-container *ngIf='count !== -1'> | ||
<div [countUp]="count" [options]="countOps"></div> | ||
</ng-container> | ||
</a> | ||
</ng-container> | ||
|
||
<ng-container *ngIf='!routerLink || disabled'> | ||
<a class='tab-button-layout2 link-button' [ngClass]='{"link-button__active": active, "link-button__disabled": disabled}' style='text-decoration: none'> | ||
|
||
<div style='display: flex'> | ||
<fa-icon [icon]="_icon" style='margin-right: 12px'></fa-icon> | ||
|
||
<div>{{ label }}</div> | ||
</div> | ||
|
||
<ng-container *ngIf='count !== -1'> | ||
<div [countUp]="count" [options]="countOps"></div> | ||
</ng-container> | ||
</a> | ||
</ng-container> | ||
|
||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 27 additions & 3 deletions
30
src/app/portal/components/tab-navigation/tab-navigation.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 56 additions & 57 deletions
113
src/app/portal/models/person/person-activities-awards.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,56 @@ | ||
// This file is part of the research.fi API service | ||
// | ||
// Copyright 2019 Ministry of Education and Culture, Finland | ||
// | ||
// :author: CSC - IT Center for Science Ltd., Espoo Finland [email protected] | ||
// :license: MIT | ||
|
||
import { Adapter } from '../adapter.model'; | ||
import { Injectable } from '@angular/core'; | ||
import { ModelUtilsService } from '@shared/services/model-util.service'; | ||
|
||
export class PersonActivitiesAndRewards { | ||
constructor( | ||
public name: string, | ||
public role: string, | ||
public type: string, | ||
public description: string, | ||
public internationalCollaboration: string, | ||
public year: string, | ||
public organizationName: string, | ||
public departmentName: string, | ||
public url: string, | ||
) {} | ||
} | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class PersonActivitiesAndRewardsAdapter | ||
implements Adapter<PersonActivitiesAndRewards> | ||
{ | ||
constructor(private utils: ModelUtilsService) {} | ||
|
||
adapt(activity: any): PersonActivitiesAndRewards { | ||
console.log('activity', activity); | ||
const getYearRange = () => { | ||
return [activity.startDate.year, activity.endDate.year] | ||
.filter((item) => item > 0) | ||
.join(' - '); | ||
}; | ||
|
||
const translateBoolean = (value: boolean) => | ||
value ? $localize`:@@yes:Kyllä` : $localize`:@@no:Ei`; | ||
|
||
return new PersonActivitiesAndRewards( | ||
this.utils.checkTranslation('name', activity), | ||
this.utils.checkTranslation('roleName', activity), | ||
this.utils.checkTranslation('activityTypeName', activity), | ||
this.utils.checkTranslation('description', activity), | ||
translateBoolean(activity.internationalCollaboration), | ||
getYearRange(), | ||
this.utils.checkTranslation('organizationName', activity), | ||
this.utils.checkTranslation('departmentName', activity), | ||
activity.url | ||
); | ||
} | ||
} | ||
// This file is part of the research.fi API service | ||
// | ||
// Copyright 2019 Ministry of Education and Culture, Finland | ||
// | ||
// :author: CSC - IT Center for Science Ltd., Espoo Finland [email protected] | ||
// :license: MIT | ||
|
||
import { Adapter } from '../adapter.model'; | ||
import { Injectable } from '@angular/core'; | ||
import { ModelUtilsService } from '@shared/services/model-util.service'; | ||
|
||
export class PersonActivitiesAndRewards { | ||
constructor( | ||
public name: string, | ||
public role: string, | ||
public type: string, | ||
public description: string, | ||
public internationalCollaboration: string, | ||
public year: string, | ||
public organizationName: string, | ||
public departmentName: string, | ||
public url: string, | ||
) {} | ||
} | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class PersonActivitiesAndRewardsAdapter | ||
implements Adapter<PersonActivitiesAndRewards> | ||
{ | ||
constructor(private utils: ModelUtilsService) {} | ||
|
||
adapt(activity: any): PersonActivitiesAndRewards { | ||
const getYearRange = () => { | ||
return [activity.startDate.year, activity.endDate.year] | ||
.filter((item) => item > 0) | ||
.join(' - '); | ||
}; | ||
|
||
const translateBoolean = (value: boolean) => | ||
value ? $localize`:@@yes:Kyllä` : $localize`:@@no:Ei`; | ||
|
||
return new PersonActivitiesAndRewards( | ||
this.utils.checkTranslation('name', activity), | ||
this.utils.checkTranslation('roleName', activity), | ||
this.utils.checkTranslation('activityTypeName', activity), | ||
this.utils.checkTranslation('description', activity), | ||
translateBoolean(activity.internationalCollaboration), | ||
getYearRange(), | ||
this.utils.checkTranslation('organizationName', activity), | ||
this.utils.checkTranslation('departmentName', activity), | ||
activity.url | ||
); | ||
} | ||
} |
Oops, something went wrong.