Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: display metadata on project landing page (DSP-1065) (#348)
* Feat (Project landing/metadata page): implementation of functionality to display project and dataset metadata
- Loading branch information
Snehal Kumbhar
committed
Jan 11, 2021
1 parent
f348e70
commit 3012ef5
Showing
35 changed files
with
1,500 additions
and
77 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
18 changes: 18 additions & 0 deletions
18
src/app/project/board/address-template/address-template.component.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-address-template', | ||
template: ` | ||
<div class="sub-details"> | ||
<h4>Address:</h4> | ||
<address class="contents"> | ||
<p *ngIf="address['streetAddress']">{{ address['streetAddress'] }}</p> | ||
<span *ngIf="address['postalCode']" style="margin-right: 6px;">{{ address['postalCode'] }}</span> | ||
<span *ngIf="address['addressLocality']">{{ address['addressLocality'] }}</span> | ||
</address> | ||
</div> | ||
` | ||
}) | ||
export class AddressTemplateComponent { | ||
@Input() address: object; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/app/project/board/attribution-tab-view/attribution-tab-view.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<h1>Attribution</h1> | ||
|
||
<p>The following people are involved in the creation of the dataset:</p> | ||
|
||
<div class="tab-contents"> | ||
|
||
<mat-card *ngFor="let entry of attribution | keyvalue;" class="attribution-entry"> | ||
|
||
<h3 class="color-for-role"> {{ entry.value['role'] | titlecase }} </h3> | ||
|
||
<app-person-template [person]="people[entry.key]"></app-person-template> | ||
|
||
</mat-card> | ||
|
||
</div> |
7 changes: 7 additions & 0 deletions
7
src/app/project/board/attribution-tab-view/attribution-tab-view.component.scss
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.attribution-entry { | ||
margin-top: 25px; | ||
|
||
.color-for-role { | ||
color: brown; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/project/board/attribution-tab-view/attribution-tab-view.component.spec.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AttributionTabViewComponent } from './attribution-tab-view.component'; | ||
|
||
describe('AttributionTabViewComponent', () => { | ||
let component: AttributionTabViewComponent; | ||
let fixture: ComponentFixture<AttributionTabViewComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ AttributionTabViewComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AttributionTabViewComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
82 changes: 82 additions & 0 deletions
82
src/app/project/board/attribution-tab-view/attribution-tab-view.component.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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-attribution-tab-view', | ||
templateUrl: './attribution-tab-view.component.html', | ||
styleUrls: ['./attribution-tab-view.component.scss'] | ||
}) | ||
export class AttributionTabViewComponent implements OnInit{ | ||
|
||
// attribution input | ||
@Input() attribution: object; | ||
|
||
// hard-coded data to complete the functionality | ||
people = [{ | ||
'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, | ||
'email': 'benjamin.jones@test.ch', | ||
'familyName': 'Jones', | ||
'givenName': 'Benjamin', | ||
'jobTitle': 'Dr. des.', | ||
'organisation': { | ||
'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, | ||
'email': 'info@universityoftoronto.ca', | ||
'name': 'University of Toronto', | ||
'url': 'http://www.utoronto.ca/' | ||
} | ||
}, { | ||
'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, | ||
'email': 'james.coleman@dasch.swiss', | ||
'familyName': 'Coleman', | ||
'givenName': 'James', | ||
'jobTitle': 'Dr. des.', | ||
'organisation': { | ||
'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, | ||
'email': 'info@universityoftoronto.ca', | ||
'name': 'University of Toronto', | ||
} | ||
}, { | ||
'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, | ||
'email': 'lauren.berry@unibas.ch', | ||
'familyName': 'Berry', | ||
'givenName': 'Lauren', | ||
'jobTitle': 'Dr.', | ||
'organisation': { | ||
'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, | ||
'email': 'info@universityoftoronto.ca', | ||
'name': 'University of Toronto', | ||
} | ||
}, { | ||
'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, | ||
'email': 'leonhard.hart@test.ch', | ||
'familyName': 'Hart', | ||
'givenName': 'Leonhard', | ||
'jobTitle': 'Prof.', | ||
'organisation': { | ||
'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, | ||
'email': 'info@universityoftoronto.ca', | ||
'name': 'University of Toronto', | ||
} | ||
},{ | ||
'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, | ||
'email': 'lauren.berry@unibas.ch', | ||
'familyName': 'Berry', | ||
'givenName': 'Lauren', | ||
'jobTitle': 'Dr.', | ||
'organisation': { | ||
'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, | ||
'email': 'info@universityoftoronto.ca', | ||
'name': 'University of Toronto', | ||
'url': 'http://www.utoronto.ca/' | ||
} | ||
}]; | ||
|
||
ngOnInit(): void { | ||
// reformat data | ||
for (let idx = 0; idx < this.people.length; idx++) { | ||
if (this.people[idx]['sameAs']) { | ||
this.people[idx]['sameAs'] = this.people[idx]['sameAs']['value']; | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.