0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-31 15:12:39 +00:00

update API and frontend for google drive document stubs

This commit is contained in:
Charlie Humphreys
2022-03-30 23:23:45 -05:00
parent 562ba42b1b
commit fa8d47400f
7 changed files with 266 additions and 266 deletions

View File

@@ -16,8 +16,8 @@ const BrewItem = createClass({
brew : {
title : '',
description : '',
authors : []
authors : [],
stubbed : true
}
};
},
@@ -50,7 +50,7 @@ const BrewItem = createClass({
if(!this.props.brew.editId) return;
let editLink = this.props.brew.editId;
if(this.props.brew.googleId) {
if(this.props.brew.googleId && !this.props.brew.stubbed) {
editLink = this.props.brew.googleId + editLink;
}
@@ -63,7 +63,7 @@ const BrewItem = createClass({
if(!this.props.brew.shareId) return;
let shareLink = this.props.brew.shareId;
if(this.props.brew.googleId) {
if(this.props.brew.googleId && !this.props.brew.stubbed) {
shareLink = this.props.brew.googleId + shareLink;
}
@@ -86,7 +86,7 @@ const BrewItem = createClass({
},
renderGoogleDriveIcon : function(){
if(!this.props.brew.gDrive) return;
if(!this.props.brew.googleId) return;
return <span>
<img className='googleDriveIcon' src={googleDriveIcon} alt='googleDriveIcon' />
@@ -104,8 +104,8 @@ const BrewItem = createClass({
</div>
<hr />
<div className='info'>
<span title={`Authors:\n${brew.authors.join('\n')}`}>
<i className='fas fa-user'/> {brew.authors.join(', ')}
<span title={`Authors:\n${brew.authors?.join('\n')}`}>
<i className='fas fa-user'/> {brew.authors?.join(', ')}
</span>
<br />
<span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}>

View File

@@ -211,7 +211,7 @@ const EditPage = createClass({
this.savedBrew = res.body;
if(transfer) {
history.replaceState(null, null, `/edit/${this.savedBrew.googleId ?? ''}${this.savedBrew.editId}`);
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`);
}
this.setState((prevState)=>({

View File

@@ -174,7 +174,7 @@ const NewPage = createClass({
localStorage.removeItem(BREWKEY);
localStorage.removeItem(STYLEKEY);
localStorage.removeItem(METAKEY);
window.location = `/edit/${brew.googleId ?? ''}${brew.editId}`;
window.location = `/edit/${brew.editId}`;
},
renderSaveButton : function(){