Skip to content

Commit

Permalink
Merge 'integration' into main to prepare 1.4.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
RayPlante committed Jul 28, 2020
2 parents 3a9ba22 + 6a819f9 commit cd2951a
Show file tree
Hide file tree
Showing 326 changed files with 29,668 additions and 1,190 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sdist
develop-eggs
.installed.cfg
distribute-*.tar.gz
m2repo

# Other
.cache
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ before_install:
script:
- echo && echo '#####' BUILDING AND RUNNING PYTHON TESTS && echo
- bash ./testall python
- echo && echo '#####' BUILDING AND RUNNING JAVA TESTS && echo
- bash ./makedist java
- echo && echo '#####' BUILDING ANGULAR && echo
- bash ./makedist angular
- echo && echo '#####' RUNNING ANGULAR TESTS && echo
Expand Down
4 changes: 3 additions & 1 deletion angular/src/app/_helpers/fakeBackendInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Observable, of, throwError } from 'rxjs';
import { delay, mergeMap, materialize, dematerialize } from 'rxjs/operators';
import { TestDataService } from '../shared/testdata-service/testDataService';
import { DownloadService } from '../shared/download-service/download-service.service';
import { AuthInfo } from '../landing/editcontrol/auth.service';
import { UserDetails } from '../landing/editcontrol/interfaces';
import { userInfo } from 'os';

@Injectable()
export class FakeBackendInterceptor implements HttpInterceptor {
Expand Down Expand Up @@ -93,7 +96,6 @@ export class FakeBackendInterceptor implements HttpInterceptor {
// "Userid": "[email protected]",
// "message": "Unauthorizeduser: User token is empty or expired."
// })

// );
// }

Expand Down
3 changes: 2 additions & 1 deletion angular/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { NerdmComponent } from './landing/nerdm.component';
// import { SearchResolve } from './landing/search-service.resolve';
import { NotFoundComponent, InternalErrorComponent } from './errors/errors.module';
import { DatacartComponent } from './datacart/datacart.component';
import { DoneComponent } from './landing/done/done.component';

const routes: Routes = [
{ path: '', redirectTo: '/about', pathMatch: 'full' },
Expand All @@ -23,7 +24,7 @@ const routes: Routes = [
},
{ path: 'nerdm', component: NerdmComponent },
{ path: 'datacart/:mode', component: DatacartComponent },

{ path: 'done', component: DoneComponent },
// error paths
{ path: 'not-found',
children: [
Expand Down
8 changes: 0 additions & 8 deletions angular/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<pdr-headbar></pdr-headbar>
<!--
<div class="app-loading" id="loadspinner">
<div class="logo"> Loading ...</div>
<svg class="spinner" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
</svg>
</div>
-->
<div style="min-height: 58%;">
<router-outlet></router-outlet>
</div>
Expand Down
7 changes: 7 additions & 0 deletions angular/src/app/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export interface WebLocations {
*/
mdService?: string,

/**
* the URL to fetch taxonomy list
*/
taxonomyService?: string,

/**
* the base URL for the landing page service
*/
Expand Down Expand Up @@ -157,6 +162,8 @@ export class AppConfig implements LPSConfig {
this.locations.distService = this.locations.portalBase + "od/ds/";
if (!this.locations.mdService)
this.locations.mdService = this.locations.portalBase + "rmm/";
if(!this.locations.taxonomyService)
this.locations.taxonomyService = this.locations.portalBase + "rmm/taxonomy";
if (!this.locations.landingPageService)
this.locations.landingPageService = this.locations.portalBase + "od/id/";
if (!this.locations.nerdmAbout)
Expand Down
1 change: 1 addition & 0 deletions angular/src/app/frame/footbar.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/*background-color: white;*/
color: white;
position: relative;
height: 400px;
}

.footer__inner {
Expand Down
18 changes: 13 additions & 5 deletions angular/src/app/frame/headbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CartEntity } from '../datacart/cart.entity';
import { Router } from '@angular/router';
import { NotificationService } from '../shared/notification-service/notification.service';
import { EditStatusService } from '../landing/editcontrol/editstatus.service';
import { LandingConstants } from '../landing/constants';

/**
* A Component that serves as the header of the landing page.
Expand Down Expand Up @@ -34,8 +35,9 @@ export class HeadbarComponent {
appVersion: string = "";
cartLength: number = 0;
editEnabled: any;
editMode: boolean = false;
editMode: string;
contactLink: string = "";
public EDIT_MODES: any;

constructor(
private el: ElementRef,
Expand All @@ -55,13 +57,19 @@ export class HeadbarComponent {
this.cartService.watchStorage().subscribe(value => {
this.cartLength = value;
});
this.EDIT_MODES = LandingConstants.editModes;
}

/*
* init
*/
ngOnInit() {
this.cartLength = this.cartService.getCartSize();
this.editMode = this.EDIT_MODES.VIEWONLY_MODE;

this.editstatsvc.watchEditMode((editMode) => {
this.editMode = editMode;
});
}

/**
Expand All @@ -83,31 +91,31 @@ export class HeadbarComponent {
* Open about window if not in edit mode. Otherwise do nothing.
*/
openRootPage() {
if (!this.editstatsvc.editMode)
if (this.editMode != this.EDIT_MODES.EDIT_MODE)
window.open('/', '_self');
}

/*
* Open about window if not in edit mode. Otherwise do nothing.
*/
openAboutPage() {
if (!this.editstatsvc.editMode)
if (this.editMode != this.EDIT_MODES.EDIT_MODE)
window.open('/pdr/about', '_blank');
}

/*
* Open search window if not in edit mode. Otherwise do nothing.
*/
openSearchPage() {
if (!this.editstatsvc.editMode)
if (this.editMode != this.EDIT_MODES.EDIT_MODE)
window.open(this.searchLink, '_blank');
}

/*
* In edit mode, mouse cursor set to normal
*/
getCursor() {
if (this.editstatsvc.editMode)
if (this.editMode == this.EDIT_MODES.EDIT_MODE)
return 'default';
else
return 'pointer';
Expand Down
1 change: 1 addition & 0 deletions angular/src/app/frame/messagebar.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@
}
.warning {
padding: 1em;
color: rgb(155, 62, 0);
}
2 changes: 1 addition & 1 deletion angular/src/app/frame/messagebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class="faa faa-times faa-lg msg-dismiss" style="margin-right: 8px; margin-left: 12px;"></i></a>
</div>
<div [class]="msg.type">
Oops! {{msg.prefix || defSysErrorPrefix}} Please try to edit and save again.
Oops! {{msg.prefix || defSysErrorPrefix}} {{msg.text}} Please try to edit and save again.
If problem persists, please contact us at
<a href="mailto:[email protected]?subject=PDR Publishing Error&body={{msg.text}}">[email protected]</a>
to report the problem.
Expand Down
4 changes: 2 additions & 2 deletions angular/src/app/frame/messagebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ export class MessageBarComponent {

public constructor(@Optional() private svc : UserMessageService) {
if (svc) {
svc._subscribe({
svc.subscribe({
next: (msg) => {
this.messages.push(msg) // msg: an object with type, message
}
});
}
}

_addMessage(message : string, type ?: string, prefix : string = "") : void {
private _addMessage(message : string, type ?: string, prefix : string = "") : void {
if (! type) type = "information";
this.messages.push({ type: type, text: message, prefix: prefix, id: this.nextid++ });
}
Expand Down
18 changes: 9 additions & 9 deletions angular/src/app/frame/usermessage.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('UserMessageService', () => {
})

it('sends tip', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.tip("50c");
Expand All @@ -29,7 +29,7 @@ describe('UserMessageService', () => {
});

it('sends tip', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.tip("50c");
Expand All @@ -41,7 +41,7 @@ describe('UserMessageService', () => {
});

it('sends instruction', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.instruct("Stop!");
Expand All @@ -53,7 +53,7 @@ describe('UserMessageService', () => {
});

it('sends warning', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.warn("Beware.");
Expand All @@ -65,7 +65,7 @@ describe('UserMessageService', () => {
});

it('sends an error', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.error("tsk");
Expand All @@ -77,7 +77,7 @@ describe('UserMessageService', () => {
});

it('sends a system error', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.syserror("ouch");
Expand All @@ -89,7 +89,7 @@ describe('UserMessageService', () => {
});

it('sends a celebration', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.celebrate("sing!");
Expand All @@ -101,7 +101,7 @@ describe('UserMessageService', () => {
});

it('sends an informational item', () => {
svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();
svc.inform("I am");
Expand All @@ -121,7 +121,7 @@ describe('UserMessageService', () => {
expect(message).toBeNull();
expect(type).toBeNull();

svc._subscribe(subscriber);
svc.subscribe(subscriber);
expect(message).toBeNull();
expect(type).toBeNull();

Expand Down
2 changes: 1 addition & 1 deletion angular/src/app/frame/usermessage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class UserMessageService {
/*
* connect a receiver to this service that will display the messages
*/
_subscribe(receiver) : void {
public subscribe(receiver) : void {
this.msg.subscribe(receiver);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,19 @@
width:100%;
margin: 0.5em 0em 1em 0em;
margin-bottom: 4em;;
}

#orcid-input {
width: calc(100% - 2em);
height:2em;
margin-right: .5em;
}

#orcid-warning {
color: rgb(212, 103, 0);
font-size: 12px;
margin-right: 3em;
margin-top: -10px;
margin-top: -.7em;
text-align: right;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2 class="popup-header">Authors</h2>
<!-- List of authors displayed underneath the toolbar -->
<div id="author-list-outer">
<div id="author-list">
<span class="author-list-detail">Authers: </span>
<span class="author-list-detail" style="font-weight: bolder;">Authors: </span>
<span class="author-list-detail" *ngFor="let author of inputValue.authors; let i = index">
{{ author.fn }}<span *ngIf="i < inputValue.authors.length-1 ">,</span>
</span>
Expand Down Expand Up @@ -151,10 +151,10 @@ <h2 class="popup-header">Authors</h2>
style="color:green;">*</span> ORCID:</span>
</td>
<td>
<input type="text" [(ngModel)]="author.orcid"
style="width: calc(100% - 2em);height:2em; margin-right: .5em;" />
<input type="text" [(ngModel)]="author.orcid" id="orcid-input" (blur)="validateOrcid(author)" (keyup.enter)="validateOrcid(author)" placeholder="####-####-####-####"/>
<a href="https://orcid.org" target="blank"><img src="assets/images/orcid-logo.png"
style="width: 20px;"></a>
<div *ngIf="!author.orcidValid" id="orcid-warning">Please enter valid ORCID. Examples: 0000-1832-8812-1125, 0030-0422-1347-101X</div>
</td>
</tr>

Expand Down Expand Up @@ -184,9 +184,9 @@ <h2 class="popup-header">Authors</h2>
</tr>
<tr>
<td width="10%" align="right" valign="center">Department/Division:</td>
<td><input type="text" [(ngModel)]="author.affiliation[j].dept"
<td><input type="text" [(ngModel)]="author.affiliation[j].subunits"
style="width: 100%;height:2em;"
(input)="onDeptChange(author, $event.target.value)" />
(input)="onDeptChange(author)" />
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ describe('AuthorPopupComponent', () => {
{
"@id": "",
"title": "",
"dept": "",
"subunits": [""],
"@type": [
""
]
}
],
"orcid": "",
"orcid": "0000-1832-8812-1125",
"isCollapsed": false,
"fnLocked": false,
"dataChanged": false
"dataChanged": false,
"orcidValid": true
}]
};

Expand Down Expand Up @@ -64,4 +65,16 @@ describe('AuthorPopupComponent', () => {
expect(component).toBeTruthy();
});

it('ORCID check', () => {
expect(component.orcid_validation(newAuthor.authors[0].orcid)).toBeTruthy();
component.validateOrcid(newAuthor.authors[0]);
expect(newAuthor.authors[0].orcidValid).toBeTruthy();

newAuthor.authors[0].orcid = "0000-1832-8812-112";
component.validateOrcid(newAuthor.authors[0]);
expect(newAuthor.authors[0].orcidValid).toBeFalsy();

component.inputValue = newAuthor;
expect(component.finalValidation()).toBeFalsy();
});
});
Loading

0 comments on commit cd2951a

Please sign in to comment.