Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
1.  fixed webServiceUrl problem in TokenPage
2. removed the warning message dialog of no rules
3. added determine statement of  "no spacy rules" error message
  • Loading branch information
KimQ0126 committed Jul 24, 2018
1 parent c3bc5dc commit cdd305b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
32 changes: 15 additions & 17 deletions src/components/RulePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,6 @@ class Rule extends Component {
if (json.rules !== undefined) {
console.log('Received 200 ok');
console.log(json);
if (json.rules.length < 1) {
this.setState({
error_display: true,
error_message: 'Project Warning',
error_detail:
'There are NO rules from this project/field combination'
});
console.log(
'There are NO rules from this project/field combination'
);
return;
}

// I overwrite the rules identifier with our own naming. Sometimes these rules
// *are created on the server and no identifier is provided.
Expand Down Expand Up @@ -179,11 +167,21 @@ class Rule extends Component {
output_loc: temp_output_loc
});
} else {
this.setState({
error_display: true,
error_message: 'Error code ' + json.status_code + 'received',
error_detail: json.error_message
});
if (json.error_message === 'no spacy rules') {
this.setState({
error_display: true,
error_message: 'Error code ' + json.status_code + ' received',
error_detail:
json.error_message +
'! If it is a new field, please ignore this message'
});
} else {
this.setState({
error_display: true,
error_message: 'Error code ' + json.status_code + ' received',
error_detail: json.error_message
});
}
console.log('Error code ' + json.status_code + 'received');
console.log('Error msg = ' + json.error_message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TokenPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TokenPage extends Component {
orignal_active: this.props.location.state.rule.is_active,
output_loc: {},
autoRefresh_TP: true,
webServiceUrl: this.props.webServiceUrl,
webServiceUrl: this.props.location.state.webServiceUrl,
path: {
pathname: this.props.location.state.relative_url,
state: {
Expand Down

0 comments on commit cdd305b

Please sign in to comment.