Skip to content

Commit

Permalink
Merge updates from 'usnistgov/integration' into main for release
Browse files Browse the repository at this point in the history
  • Loading branch information
RayPlante committed Aug 17, 2020
2 parents 3d4b59b + 4d67182 commit b447f80
Show file tree
Hide file tree
Showing 16 changed files with 1,003 additions and 50 deletions.
12 changes: 6 additions & 6 deletions angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion angular/src/app/landing/landing.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<p></p>
<description-resources [record]="record" [files]="files"
[metadata]="showMetadata" [inBrowser]="inBrowser" [ediid]="ediid" [editEnabled]="editEnabled"></description-resources>
<metadata-detail [record]="record" [serviceApi]="getMdAPI()" [inBrowser]="inBrowser"
<metadata-detail [record]="record" [serviceApi]="getMdService()" [inBrowser]="inBrowser"
[metadata]="showMetadata">
</metadata-detail>
</div>
Expand Down
50 changes: 28 additions & 22 deletions angular/src/app/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,22 @@ export class LandingComponent implements OnInit, OnChanges {
}

/**
* Return mdAPI
* Return mdService
*/
getMdAPI()
getMdService()
{
if(this.edstatsvc.editingEnabled()){
this.mdApi = this.cfg.get("locations.mdService", "/unconfigured");
let mdService: string;

if (this.mdApi.slice(-1) != '/') this.mdApi += '/';
this.mdApi += this.record['ediid'];
}else{
this.mdApi = this.cfg.get("mdAPI", "/unconfigured");
mdService = this.cfg.get("locations.mdService", "/unconfigured");

if (mdService.slice(-1) != '/') mdService += '/';
if (mdService.search("/rmm/") < 0)
mdService += this.record['ediid'];
else
mdService += "records?@id=" + this.record['@id'];

if (this.mdApi.slice(-1) != '/') this.mdApi += '/';
if (this.mdApi.search("/rmm/") < 0)
this.mdApi += this.record['ediid'];
else
this.mdApi += "records?@id=" + this.record['@id'];
}

return this.mdApi;
return mdService;
}

/**
Expand Down Expand Up @@ -377,16 +373,21 @@ export class LandingComponent implements OnInit, OnChanges {
* return a rendering of a release's ID. If possible, the ID will be
* rendered as a link. If there is no ID, a link with the text "View..."
* is returned.
*
* NOTE: the behavior of this function is being temporarily changed until
* there is better version support from the metadata service
*/
renderRelId(relinfo, thisversion) {
if (thisversion == relinfo.version)
return "this version";
let id: string = "View...";
if (relinfo.refid) id = relinfo.refid;
if (this.editMode == this.EDIT_MODES.EDIT_MODE)
return id;
else
return this.renderRelAsLink(relinfo, id);
// let id: string = "View...";
let id: string = "";
if (relinfo.refid) {
id = relinfo.refid;
if (this.editMode != this.EDIT_MODES.EDIT_MODE)
return this.renderRelAsLink(relinfo, id);
}
return id;
}

display: boolean = false;
Expand Down Expand Up @@ -457,7 +458,12 @@ export class LandingComponent implements OnInit, OnChanges {
}
}
// look at the version history to see if there is a newer version listed
if (this.record['version'] && this.record['versionHistory']) {
//
// TODO: this block is being temporarily disable because there is a flaw in the code comparing
// history entries. This will prevent the "there's a newer version available" message
// from appearing erroneously
//
if (false && this.record['version'] && this.record['versionHistory']) {
let history = this.record['versionHistory'];
history.sort(compare_histories);

Expand Down
26 changes: 9 additions & 17 deletions angular/src/app/landing/tools/toolmenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,14 @@ export class ToolMenuComponent implements OnChanges {
var mitems : MenuItem[] = [];
var subitems : MenuItem[] = [];

let mdapi: string;
let mdService: string;
mdService = this.cfg.get("locations.mdService", "/unconfigured");

if(this.edstatsvc.editingEnabled()){
mdapi = this.cfg.get("locations.mdService", "/unconfigured");

if (mdapi.slice(-1) != '/') mdapi += '/';
mdapi += this.record['ediid'];
}else{
mdapi = this.cfg.get("mdAPI", "/unconfigured");

if (mdapi.slice(-1) != '/') mdapi += '/';
if (mdapi.search("/rmm/") < 0)
mdapi += this.record['ediid'];
else
mdapi += "records?@id=" + this.record['@id'];
}
if (mdService.slice(-1) != '/') mdService += '/';
if (mdService.search("/rmm/") < 0)
mdService += this.record['ediid'];
else
mdService += "records?@id=" + this.record['@id'];

// Go To...
// top of the page
Expand All @@ -101,7 +93,7 @@ export class ToolMenuComponent implements OnChanges {
(event) => { this.goToSection(null); }, null)
);

// Go To...
// Go To Description
subitems.push(
this.createMenuItem("Description", "faa faa-arrow-circle-right",
(event) => { this.goToSection('description'); }, null)
Expand All @@ -124,7 +116,7 @@ export class ToolMenuComponent implements OnChanges {
subitems = [
this.createMenuItem("View Metadata", "faa faa-bars",
(event) => { this.goToSection('metadata'); },null),
this.createMenuItem("Export JSON", "faa faa-file-o", null, mdapi)
this.createMenuItem("Export JSON", "faa faa-file-o", null, mdService)
];
mitems.push({ label: "Record Details", items: subitems });

Expand Down
Binary file modified angular/src/assets/images/apple-touch-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified angular/src/assets/images/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b447f80

Please sign in to comment.