|
| 1 | +import { Component, Input, OnInit } from '@angular/core'; |
| 2 | + |
| 3 | +@Component({ |
| 4 | + selector: 'app-attribution-tab-view', |
| 5 | + templateUrl: './attribution-tab-view.component.html', |
| 6 | + styleUrls: ['./attribution-tab-view.component.scss'] |
| 7 | +}) |
| 8 | +export class AttributionTabViewComponent implements OnInit{ |
| 9 | + |
| 10 | + // attribution input |
| 11 | + @Input() attribution: object; |
| 12 | + |
| 13 | + // hard-coded data to complete the functionality |
| 14 | + people = [{ |
| 15 | + 'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, |
| 16 | + 'email': 'benjamin.jones@test.ch', |
| 17 | + 'familyName': 'Jones', |
| 18 | + 'givenName': 'Benjamin', |
| 19 | + 'jobTitle': 'Dr. des.', |
| 20 | + 'organisation': { |
| 21 | + 'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, |
| 22 | + 'email': 'info@universityoftoronto.ca', |
| 23 | + 'name': 'University of Toronto', |
| 24 | + 'url': 'http://www.utoronto.ca/' |
| 25 | + } |
| 26 | + }, { |
| 27 | + 'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, |
| 28 | + 'email': 'james.coleman@dasch.swiss', |
| 29 | + 'familyName': 'Coleman', |
| 30 | + 'givenName': 'James', |
| 31 | + 'jobTitle': 'Dr. des.', |
| 32 | + 'organisation': { |
| 33 | + 'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, |
| 34 | + 'email': 'info@universityoftoronto.ca', |
| 35 | + 'name': 'University of Toronto', |
| 36 | + } |
| 37 | + }, { |
| 38 | + 'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, |
| 39 | + 'email': 'lauren.berry@unibas.ch', |
| 40 | + 'familyName': 'Berry', |
| 41 | + 'givenName': 'Lauren', |
| 42 | + 'jobTitle': 'Dr.', |
| 43 | + 'organisation': { |
| 44 | + 'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, |
| 45 | + 'email': 'info@universityoftoronto.ca', |
| 46 | + 'name': 'University of Toronto', |
| 47 | + } |
| 48 | + }, { |
| 49 | + 'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, |
| 50 | + 'email': 'leonhard.hart@test.ch', |
| 51 | + 'familyName': 'Hart', |
| 52 | + 'givenName': 'Leonhard', |
| 53 | + 'jobTitle': 'Prof.', |
| 54 | + 'organisation': { |
| 55 | + 'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, |
| 56 | + 'email': 'info@universityoftoronto.ca', |
| 57 | + 'name': 'University of Toronto', |
| 58 | + } |
| 59 | + },{ |
| 60 | + 'address': {'addressLocality': 'Basel', 'postalCode': '4000', 'streetAddress': 'Teststrasse'}, |
| 61 | + 'email': 'lauren.berry@unibas.ch', |
| 62 | + 'familyName': 'Berry', |
| 63 | + 'givenName': 'Lauren', |
| 64 | + 'jobTitle': 'Dr.', |
| 65 | + 'organisation': { |
| 66 | + 'address': {'addressLocality': 'Toronto', 'postalCode': '40000', 'streetAddress': 'University of Toronto Street'}, |
| 67 | + 'email': 'info@universityoftoronto.ca', |
| 68 | + 'name': 'University of Toronto', |
| 69 | + 'url': 'http://www.utoronto.ca/' |
| 70 | + } |
| 71 | + }]; |
| 72 | + |
| 73 | + ngOnInit(): void { |
| 74 | + // reformat data |
| 75 | + for (let idx = 0; idx < this.people.length; idx++) { |
| 76 | + if (this.people[idx]['sameAs']) { |
| 77 | + this.people[idx]['sameAs'] = this.people[idx]['sameAs']['value']; |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | +} |
0 commit comments