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
refactor(project landing page): use metadata endpoint to get data fro…
…m backend (DSP-1199) (#400) * feat(project landing page): displayed message if metadata is not available for selected project. * feat(project landing page): removed copyToClipboard option for license * refactor(project landing page): updated right side column for new metadata structure * refactor(project landing page): update project and terms tabs according to new metadata schema * refactor(project landing page): update dataset and attribution and contact page for new metadata schema Note: need to work on UI for person and organisation templates (mainly used in funder, grant, attribution and contact sections) * chore(project landing page): updated template for funder and grant * chore(project landing page): updated style * chore(project landing page): cleanup, removed hardcoded metadata * refactor(project landing page): updated error handler for project metadata endpoint * chore(project landing page): removed dataset-metadata interface * chore(project landing page): excluded some testcases until test data is ready * chore(project landing page): use service to get contact type
- Loading branch information
Snehal Kumbhar
committed
Mar 2, 2021
1 parent
c23ae61
commit 5dde42f
Showing
27 changed files
with
732 additions
and
791 deletions.
There are no files selected for viewing
21 changes: 10 additions & 11 deletions
21
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { IAddress } from '../dataset-metadata'; | ||
import { Address } from '@dasch-swiss/dsp-js'; | ||
|
||
@Component({ | ||
selector: 'app-address-template', | ||
template: ` | ||
<div class="sub-details"> | ||
<h4>Address:</h4> | ||
<address class="contents"> | ||
<p>{{ address.streetAddress }}</p> | ||
<span class="postcode">{{ address.postalCode }}</span> | ||
<span>{{ address.addressLocality }}</span> | ||
</address> | ||
<div class='metadata-property'> | ||
<div class='property-label display-inline-block'> | ||
Address: | ||
</div> | ||
<div class='display-inline-block add-left-margin'> | ||
<span>{{ address.streetAddress }}, {{ address.postalCode }} {{ address.addressLocality }}</span> | ||
</div> | ||
</div> | ||
`, | ||
styles: ['.postcode { margin-right: 6px; }'] | ||
` | ||
}) | ||
export class AddressTemplateComponent { | ||
@Input() address: IAddress; | ||
@Input() address: Address; | ||
} |
29 changes: 18 additions & 11 deletions
29
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 |
---|---|---|
@@ -1,21 +1,28 @@ | ||
<h1>Attribution</h1> | ||
|
||
<p>The following people are involved in the creation of the dataset:</p> | ||
|
||
<div class="tab-contents"> | ||
|
||
<mat-card *ngFor="let attribution of attributions" class="attribution-entry"> | ||
|
||
<h3 class="color-for-role"> {{ attribution.role | titlecase }} </h3> | ||
<p>The following people are involved in the creation of the dataset:</p> | ||
|
||
<div *ngIf="getAgentType(attribution.agent) === 'person'"> | ||
<app-person-template [person]="attribution.agent"></app-person-template> | ||
<mat-card *ngFor="let attribution of attributions" class="attribution-entry"> | ||
<div class="metadata-property"> | ||
<div class="property-label"> | ||
<p *ngFor="let role of attribution.role" class="color-for-role"> | ||
{{ role | titlecase }} | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div *ngIf="getAgentType(attribution.agent) === 'organisation'"> | ||
<app-organisation-template [organisation]="attribution.agent"></app-organisation-template> | ||
<h4>Agent(s):</h4> | ||
<div *ngFor="let agent of attribution.agent" class="sub-block" > | ||
<div [ngSwitch]="setAgent(agent)"> | ||
<div *ngSwitchCase="'person'"> | ||
<app-person-template [person]="currentAgent" [subProperties]="subProperties"></app-person-template> | ||
</div> | ||
<div *ngSwitchCase="'organization'"> | ||
<app-organisation-template [organisation]="currentAgent"></app-organisation-template> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</mat-card> | ||
|
||
</div> |
3 changes: 2 additions & 1 deletion
3
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
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
Oops, something went wrong.