Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issues brought up by @len-wallstrom #356

Merged
merged 4 commits into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/components/core/SideBar/SideBarContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SideBarContainer extends React.Component{

render(){
let sideBarContent;
if(this.state.SideNavBar){
if(this.state.SideNavBar || this.props.initShow){
sideBarContent = <div>
<SideNavBar /><br />
<div style={{bottom: "0px", position: "absolute"}}>
Expand Down
11 changes: 5 additions & 6 deletions src/js/components/core/login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ class Login extends React.Component {
_this.props.success();
}
}).catch(function(reason) {
//console.log(reason);
console.log(reason);
if (reason.status === 401) {
dialog.showErrorBox('Login Failed', 'Incorrect username or password');
} else if (reason.hasOwnProperty('message')) {
dialog.showErrorBox('Login Failed', 'Incorrect username or password. This could be caused by using an email address instead of a username.');
} else if (reason.message) {
dialog.showErrorBox('Login Failed', reason.message);
} else if (reason.hasOwnProperty('data')) {
let errorMessage = reason.data;
dialog.showErrorBox('Login Failed', errorMessage);
} else if (reason.data) {
dialog.showErrorBox('Login Failed', reason.data);
} else {
dialog.showErrorBox('Login Failed', 'Unknown Error');
}
Expand Down
72 changes: 38 additions & 34 deletions src/js/components/core/welcome/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const CoreActions = require('../../../actions/CoreActions.js');
const ProjectModal = require('../create_project/ProjectModal');

const Login = require('../login/Login');
const StatusBar = require('../SideBar/StatusBar');
const SideBarContainer = require('../SideBar/SideBarContainer');

const Upload = require('../Upload');
const loadOnline = require('../LoadOnline');
const SideNavBar = require('../SideBar/SideNavBar');
Expand Down Expand Up @@ -152,8 +155,8 @@ class Welcome extends React.Component{
<Popover
id="accountSettings"
placement="right"
positionLeft={88}
positionTop={15}
positionLeft={115}
positionTop={28}
title="Door43 Login">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to log in or log out to your Door43 account. Additionally giving you access to more information about your account.</p>
Expand All @@ -170,13 +173,13 @@ class Welcome extends React.Component{
case 2:
return(
<Popover
id="openProject"
id="syncProject"
placement="right"
positionLeft={88}
positionTop={105}
title="Load in a Project">
positionLeft={115}
positionTop={125}
title="Sync Your Work To Door43">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to import your own or someone else's translationStudio project as well as open an existing translationCore project.</p>
<p>Clicking this button allows you to save or update a copy of your project to your Door43 account.</p>
</div>
<Button
style={Styles.nextTutorialButton}
Expand All @@ -190,33 +193,33 @@ class Welcome extends React.Component{
case 3:
return(
<Popover
id="syncProject"
id="generateReport"
placement="right"
positionLeft={88}
positionTop={202}
title="Sync Your Work To Door43">
positionLeft={115}
positionTop={192}
title="Generating a Report">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to save or update a copy of your project to your Door43 account.</p>
<p>Clicking this button allows you to generate a report for all of the checks performed in the currently opened project.</p>
</div>
<Button
style={Styles.nextTutorialButton}
onClick={() => {_this.setState({tutorialIndex: this.state.tutorialIndex+1})}}
bsStyle="link">
{'Next'} <Glyphicon glyph="chevron-right" />
{'Next'} <Glyphicon glyph="chevron-right" />
</Button>
</Popover>
)
break;
case 4:
return(
<Popover
id="generateReport"
id="appSettings"
placement="right"
positionLeft={88}
positionTop={285}
title="Generating a Report">
positionLeft={115}
positionTop={255}
title="Settings">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to generate a report for all of the checks performed in the currently opened project.</p>
<p>Clicking this button allows you to access various settings options to make translationCore look and perform according to your needs.</p>
</div>
<Button
style={Styles.nextTutorialButton}
Expand All @@ -230,13 +233,13 @@ class Welcome extends React.Component{
case 5:
return(
<Popover
id="loadApp"
id="toolBox"
placement="right"
positionLeft={88}
positionTop={379}
title="Selecting a Tool to perform a Check">
positionLeft={115}
positionTop={349}
title="Toolbox">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to start using a tool to perform a check on your project draft.</p>
<p>Clicking this button allows you to download, update or remove tools to perform different types of checks.</p>
</div>
<Button
style={Styles.nextTutorialButton}
Expand All @@ -250,13 +253,13 @@ class Welcome extends React.Component{
case 6:
return(
<Popover
id="appSettings"
id="openProject"
placement="right"
positionLeft={88}
positionTop={440}
title="Settings">
positionLeft={115}
positionTop={window.innerHeight-250}
title="Load in a Project">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to access various settings options to make translationCore look and perform according to your needs.</p>
<p>{"Clicking this button allows you to import your own or someone else's translationStudio project as well as open an existing translationCore project."}</p>
</div>
<Button
style={Styles.nextTutorialButton}
Expand All @@ -270,13 +273,13 @@ class Welcome extends React.Component{
case 7:
return(
<Popover
id="toolBox"
id="loadApp"
placement="right"
positionLeft={88}
positionTop={551}
title="Tool Box">
positionLeft={115}
positionTop={window.innerHeight-150}
title="Selecting a Tool to perform a Check">
<div style={Styles.tutorialPopover}>
<p>Clicking this button allows you to download, update or remove tools to perform different types of checks.</p>
<p>Clicking this button allows you to start using a tool to perform a check on your project draft.</p>
</div>
<Button
style={Styles.nextTutorialButton}
Expand All @@ -303,7 +306,8 @@ class Welcome extends React.Component{
}else if(this.state.tutorial){
return(
<div style={Styles.tutorialPage}>
<SideNavBar />
<StatusBar />
<SideBarContainer initShow={true}/>
{this.getTutorialOverlay(this.state.tutorialIndex)}
<Button
style={Styles.skipTutorialButton}
Expand Down
4 changes: 2 additions & 2 deletions src/js/pages/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Upload = require('../components/core/Upload');
var Main = React.createClass({
getInitialState() {
var tutorialState = api.getSettings('showTutorial');
if (tutorialState == 'true' || tutorialState === null) {
if (tutorialState === true || tutorialState === null) {
return ({
firstTime: true
})
Expand All @@ -49,7 +49,7 @@ var Main = React.createClass({
localStorage.removeItem('lastProject');
api.setSettings('showTutorial', false);
}

if (localStorage.getItem('user')) {
var phrase = api.getAuthToken('phrase') != undefined ? api.getAuthToken('phrase') : "tc-core";
var decrypted = CryptoJS.AES.decrypt(localStorage.getItem('user'), phrase);
Expand Down