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

fixed upload bug #59

Merged
merged 1 commit into from
Apr 15, 2019
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
4 changes: 2 additions & 2 deletions client/dist/bundle.js

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions client/src/components/DashBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class DashBody extends React.Component {
comments: [],
username: '',
purchaseState: 'Purchase This Contact',
purchaseColor: 'white'
purchaseColor: 'white',
showNotes: true,
};
const { classes } = props;
DashBody.propTypes = {
Expand Down Expand Up @@ -102,7 +103,10 @@ selectContact(contactId, list, view){
this.props.auth.fetch(`/api/users/comments/${this.props.userId}/${contactId}`)
.then((comments) => {
let revComments = comments.reverse();
this.setState({comments: revComments})
this.setState({
comments: revComments,
showNotes: true,
})
})
.catch((err) => {
console.log(err);
Expand Down Expand Up @@ -158,7 +162,10 @@ uploadContact(contact){
this.props.getUserPoints();
this.setState({
currentLead: contact,
contactView: 'access'
contactView: 'access',
comments: [],
showNotes: false,

})
})
.catch((err)=>{
Expand Down Expand Up @@ -259,7 +266,8 @@ render(){
<LeadInfo currentLead={this.state.currentLead} contactView={this.state.contactView}
contactPurchase={this.contactPurchase} commentBody={this.commentBody}
handleComment={this.handleComment} comments={this.state.comments}
commentBodyText={this.state.commentBodyText} purchaseState={this.state.purchaseState} purchaseColor={this.state.purchaseColor}/>
commentBodyText={this.state.commentBodyText} purchaseState={this.state.purchaseState}
purchaseColor={this.state.purchaseColor} showNotes={this.state.showNotes}/>
</Grid>
</Grid>
</div>
Expand Down
13 changes: 9 additions & 4 deletions client/src/components/LeadInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const styles = {



const Practice = ({currentLead, contactView, contactPurchase, handleComment, commentBodyText, comments, commentBody, purchaseState, purchaseColor}) => {
const Practice = ({currentLead, contactView, contactPurchase, handleComment, commentBodyText, comments, commentBody, purchaseState, purchaseColor, showNotes}) => {
let verified;
if (contactView === 'access'){
if (currentLead.verified) {
Expand Down Expand Up @@ -69,17 +69,22 @@ const Practice = ({currentLead, contactView, contactPurchase, handleComment, com
<CardActionArea>
<CardContent>
<Typography gutterBottom variant="h5" component="h2">
<div id="concact-list">Notes</div>
<div id="concact-list">{showNotes ? 'Notes' : 'Success!'}</div>
</Typography>
<Divider/>
<div className="contact-info">
{showNotes ?
<form onSubmit={() => { handleComment(event) }}>
<Input placeholder="Add new comment..." fullWidth={true} required={true}
onChange={(event)=>{commentBody(event.target.value)}} value={commentBodyText}/>
onChange={(event) => { commentBody(event.target.value) }} value={commentBodyText} />
<div>
<Input type="submit" value="Submit"/>
<Input type="submit" value="Submit" />
</div>
</form>
: "This contact has been uploaded!"


}
</div>
</CardContent>
</CardActionArea>
Expand Down
18 changes: 9 additions & 9 deletions database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const host = process.env.host|| "localhost";
const port = process.env.port || '3000'
const dbName = process.env.dbName || 'lead_the_deal'

// const sequelize = new Sequelize('lead_the_deal', username, password, {
// dialect: 'mysql',
// host: host,
// });
const sequelize = new Sequelize('lead_the_deal', username, password, {
dialect: 'mysql',
host: host,
});


const sequelize = new Sequelize('lead_the_deal', 'leadthedeal', process.env.AWSPASS, {
host: 'leadthedeal.co5uhag2jtpo.us-east-2.rds.amazonaws.com',
port: 3306,
dialect: 'mysql'
});
// const sequelize = new Sequelize('lead_the_deal', 'leadthedeal', process.env.AWSPASS, {
// host: 'leadthedeal.co5uhag2jtpo.us-east-2.rds.amazonaws.com',
// port: 3306,
// dialect: 'mysql'
// });

///////////////////
/////MODELS ///////
Expand Down