Skip to content

Commit

Permalink
Merge pull request #128 from usnistgov/fix/viewmetadata
Browse files Browse the repository at this point in the history
Restore "View Metadata" function
  • Loading branch information
RayPlante authored Apr 10, 2020
2 parents 77c5dde + da16f18 commit d055560
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions angular/src/app/landing/landing.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@

<div class="ui-g">
<div class="ui-g-12 ui-md-12 ui-lg-12 ui-sm-12">
<div [hidden]="metadata">
<div [hidden]="showMetadata">
<app-description [record]="record" [inBrowser]="inBrowser"></app-description>
</div>
<app-topic [record]="record" [inBrowser]="inBrowser"></app-topic>
<app-keyword [record]="record" [inBrowser]="inBrowser"></app-keyword>
<p></p>
<description-resources [record]="record" [files]="files"
[metadata]="metadata" [inBrowser]="inBrowser" [ediid]="ediid" [editEnabled]="editEnabled"></description-resources>
[metadata]="showMetadata" [inBrowser]="inBrowser" [ediid]="ediid" [editEnabled]="editEnabled"></description-resources>
<metadata-detail [record]="record" [serviceApi]="serviceApi" [inBrowser]="inBrowser"
[metadata]="metadata">
[metadata]="showMetadata">
</metadata-detail>
</div>
<div *ngIf="record.length !== 0 && inBrowser">
Expand Down
6 changes: 4 additions & 2 deletions angular/src/app/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export class LandingComponent implements OnInit, OnChanges {
isCopied: boolean = false;
distdownload: string = '';
serviceApi: string = '';
metadata: boolean = false;
private files: TreeNode[] = [];
pdrApi: string = '';
isResultAvailable: boolean = true;
Expand All @@ -134,6 +133,9 @@ export class LandingComponent implements OnInit, OnChanges {
@Input() requestId: string = null; // the ID used in the URL to access this page
@Input() inBrowser: boolean = false;

// this will be removed in the next restructure iteration
@Input() showMetadata: boolean = false;

ediid: string = null;

/**
Expand Down Expand Up @@ -204,7 +206,7 @@ export class LandingComponent implements OnInit, OnChanges {
}

viewmetadata() {
this.metadata = true;
this.showMetadata = true;
this.similarResources = false;
}

Expand Down
3 changes: 2 additions & 1 deletion angular/src/app/landing/landingpage.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<!-- landing page content -->
<div class="ui-g-10 ui-md-10 ui-lg-10 ui-sm-12">

<app-landing [record]="md" [inBrowser]="inBrowser" [requestId]="reqId"></app-landing>
<app-landing [record]="md" [inBrowser]="inBrowser" [requestId]="reqId"
[showMetadata]="showMetadata"></app-landing>

</div>

Expand Down
4 changes: 4 additions & 0 deletions angular/src/app/landing/landingpage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export class LandingPageComponent implements OnInit, AfterViewInit {
citationVisible: boolean = false;
editEnabled: boolean = false;

// this will be removed in next restructure
showMetadata = false;

/**
* create the component.
* @param route the requested URL path to be fulfilled with this view
Expand Down Expand Up @@ -186,6 +189,7 @@ export class LandingPageComponent implements OnInit, AfterViewInit {
}

goToSection(sectionId: string) {
this.showMetadata = (sectionId == "metadata");
if (sectionId)
this.router.navigate(['/od/id/', this.reqId], { fragment: sectionId });
else
Expand Down

0 comments on commit d055560

Please sign in to comment.