Skip to content

Commit 89c097f

Browse files
authored
Merge pull request #1301 from jvwong/iss1299_error-message
Add pc search branding; typos corrected
2 parents 8c79ec9 + d7df976 commit 89c097f

File tree

5 files changed

+46
-8
lines changed

5 files changed

+46
-8
lines changed

src/client/common/components/error-message.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ const { Link } = require('react-router-dom');
55

66
class ErrorMessage extends React.Component {
77
render(){
8-
const logo = this.props.logo ? h(Link, { to: { pathname: `/`}, target: '_blank' }, [ h('div.pc-logo')]): null;
8+
const logo = this.props.logo
9+
? h( Link, { to: { pathname: `/`}, target: '_blank' }, [
10+
h('div.error-branding', [
11+
h('div.pc-logo'),
12+
h('div.error-branding-descriptor', [
13+
h('h2.error-subtitle', 'Pathway Commons'),
14+
h('h1.error-title', 'Search')
15+
])
16+
])
17+
])
18+
: null;
919

1020
const title = h('h1.error-message-title',
1121
this.props.title !== undefined ? this.props.title : 'An error occurred' );
@@ -21,8 +31,8 @@ class ErrorMessage extends React.Component {
2131
]);
2232

2333
return h('div.error-message-container', [
24-
logo,
2534
h('div.error-message', [
35+
logo,
2636
title,
2737
body,
2838
footer

src/client/features/enrichment/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Enrichment extends React.Component {
7777
if( networkEmpty ) {
7878
errorMessage = h(ErrorMessage, { title: 'No results to display.', body: 'Try different genes in your search.' , footer: null, logo: true } );
7979
} else if( error instanceof TimeoutError ) {
80-
errorMessage = h( ErrorMessage, { title: 'This is taking longer that we expected', body: 'Try again later.', logo: true } );
80+
errorMessage = h( ErrorMessage, { title: 'This is taking longer than expected', body: 'Try again later.', logo: true } );
8181
} else if( error ) {
8282
errorMessage = h( ErrorMessage, { logo: true } );
8383
}

src/client/features/interactions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Interactions extends React.Component {
7777
if( networkEmpty ) {
7878
errorMessage = h(ErrorMessage, { title: 'No interactions to display.', body: 'Try different genes in your search.' , footer: null, logo: true } );
7979
} else if( error instanceof TimeoutError ) {
80-
errorMessage = h( ErrorMessage, { title: 'This is taking longer that we expected', body: 'Try again later.', logo: true } );
80+
errorMessage = h( ErrorMessage, { title: 'This is taking longer than expected', body: 'Try again later.', logo: true } );
8181
} else if( error ) {
8282
errorMessage = h( ErrorMessage, { logo: true } );
8383
}

src/client/features/search/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class Search extends React.Component {
121121
if( this.props.notFoundError ) {
122122
errorMessage = h( ErrorMessage, { title: 'We couldn\'t find the resource you are looking for', body: 'Check the location and try again.' } );
123123
} else if( this.state.error instanceof TimeoutError ) {
124-
errorMessage = h( ErrorMessage, { title: 'This is taking longer that we expected', body: 'Try again later.' } );
124+
errorMessage = h( ErrorMessage, { title: 'This is taking longer than expected', body: 'Try again later.' } );
125125
} else if( this.state.error ) {
126126
errorMessage = h( ErrorMessage );
127127
}

src/styles/common/error-message.css

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,44 @@
33
justify-content: center;
44
align-items: center;
55
flex-direction: row;
6+
margin: 1.5em;
67

78
& .pc-logo {
89
background-image: url("../image/pc_logo_dark.svg");
910
background-repeat: no-repeat;
10-
height: 5em;
11-
width: 5em;
12-
padding: 0px 10px 0px 0px;
11+
height: 3em;
12+
width: 3em;
13+
padding: 0;
1314
}
1415
}
1516

17+
.error-branding {
18+
display: flex;
19+
justify-content: center;
20+
align-items: center;
21+
height: 100%;
22+
padding-right: 0.5em;
23+
margin-bottom: 1em;
24+
}
25+
26+
.error-branding-descriptor {
27+
margin-left: 0.5em;
28+
}
29+
30+
.error-title {
31+
margin: 0;
32+
line-height: 1em;
33+
color: var(--dark-base-colour);
34+
font-size: 2em;
35+
}
36+
37+
.error-subtitle {
38+
margin: 0;
39+
line-height: 1em;
40+
color: var(--dark-base-colour);
41+
font-size: 0.75em;
42+
}
43+
1644
.error-message {
1745
display: flex;
1846
justify-content: center;

0 commit comments

Comments
 (0)