forked from DSpace/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from LotteHofstede/w2p-38248_PageNotFound-comp…
…onent PageNotFound Component
- Loading branch information
Showing
9 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ProtractorPage } from './pagenotfound.po'; | ||
|
||
describe('protractor PageNotFound', function() { | ||
let page: ProtractorPage; | ||
|
||
beforeEach(() => { | ||
page = new ProtractorPage(); | ||
}); | ||
|
||
it('should contain element ds-pagenotfound when navigating to page that doesnt exist"', () => { | ||
page.navigateToNonExistingPage(); | ||
expect(page.elementTagExists("ds-pagenotfound")).toEqual(true); | ||
}); | ||
|
||
it('should not contain element ds-pagenotfound when navigating to existing page"', () => { | ||
page.navigateToExistingPage(); | ||
expect(page.elementTagExists("ds-pagenotfound")).toEqual(false); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { browser, element, by } from 'protractor'; | ||
|
||
export class ProtractorPage { | ||
HOMEPAGE : string = "/home"; | ||
NONEXISTINGPAGE : string = "/e9019a69-d4f1-4773-b6a3-bd362caa46f2"; | ||
|
||
navigateToNonExistingPage() { | ||
return browser.get(this.NONEXISTINGPAGE); | ||
} | ||
navigateToExistingPage() { | ||
return browser.get(this.HOMEPAGE); | ||
} | ||
|
||
elementTagExists(tag : string) { | ||
return element(by.tagName(tag)).isPresent(); | ||
} | ||
|
||
|
||
} |
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,13 +1,19 @@ | ||
{ | ||
"title": "DSpace", | ||
|
||
"nav": { | ||
"home": "Home" | ||
}, | ||
|
||
"example": { | ||
"with": { | ||
"data": "{{greeting}}, {{recipient}}!" | ||
} | ||
}, | ||
|
||
"404": { | ||
"help": "We can't find the page you're looking for. The page may have been moved or deleted. You can use the button below to get back to the home page. ", | ||
"page-not-found": "page not found", | ||
"link": { | ||
"home-page": "Take me to the home page" | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="page-not-found"> | ||
<h1>404</h1> | ||
<h2><small>{{"404.page-not-found" | translate}}</small></h2> | ||
<br> | ||
<p>{{"404.help" | translate}}</p> | ||
<br> | ||
<p class="text-center"> | ||
<a routerLink="/home" class="btn btn-primary">{{"404.link.home-page" | translate}}</a> | ||
</p> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
@import '../../styles/variables.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
|
||
@Component({ | ||
selector: 'ds-pagenotfound', | ||
styleUrls: ['./pagenotfound.component.css'], | ||
templateUrl: './pagenotfound.component.html' | ||
}) | ||
export class PageNotFoundComponent { | ||
|
||
data: any = {}; | ||
|
||
constructor() { | ||
this.universalInit(); | ||
} | ||
|
||
universalInit() { | ||
|
||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
* ]; | ||
**/ | ||
export const routes: string[] = [ | ||
'home' | ||
'home', '**' | ||
]; |