0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 15:02:38 +00:00

Update Version number & cleanup

This commit is contained in:
Trevor Buckner
2020-10-07 15:02:42 -04:00
parent ed1c589e2d
commit 0afb503860
10 changed files with 38 additions and 61 deletions

View File

@@ -1,5 +1,8 @@
# changelog
### Wednesday, 07/10/2020 - v2.10.0
- Google Drive integration -- Sign in with your Google account to link it with your Homebrewery profile. A new button in the Edit page will let you transfer your file to your personal Google Drive storage, and Google will keep a backup of each version! No more lost work surprises!
### Friday, 28/08/2020 - v2.9.2
- Many dependency updates
- Finally fixed this changelog page to not run off the edge :P
@@ -40,11 +43,13 @@
### Friday, 03/03/2017 - v2.7.3
- Increasing the range on the Partial Page Rendering for a quick-fix for it getting out of sync on long brews.
```
```
### Saturday, 18/02/2017 - v2.7.2
- Adding ability to delete a brew from the user page, incase the user creates a brew that makes the edit page unrender-able. (re:309)
```
```
### Thursday, 19/01/2017 - v2.7.0
- Fixed saving multiple authors and multiple systems on brew metadata (thanks u/PalaNolho re:282)
@@ -81,13 +86,13 @@
- Added in a snippet for a split table
- Added an account nav item to new page
\page
### Sunday, 27/11/2016 - v2.5.1
- Fixed the column rendering on the new user page. Really should have tested that better
- Added a hover tooltip to fully read the brew description
- Made the brew items take up only 25% allowing you to view more per row.
\page
### Wednesday, 23/11/2016 - v2.5.0
- Metadata can now be added to brews
- Added a metadata editor onto the edit and new pages
@@ -125,6 +130,9 @@
### Friday, 29/07/2016 - v2.2.7
- Adding in descriptive note blocks. (Thanks calculuschild!)
```
```
### Thursday, 07/07/2016 - v2.2.6
- Added a new nav item on the homepage for accessing both recently viewed and edited brews (thanks [ChosenSeraph!](https://github.com/stolksdorf/homebrewery/issues/147))
@@ -149,6 +157,9 @@
- Finally added a syntax for doing spell lists. A bit in-depth about why this took so long. Essentially I'm running out of syntax to use in stardard Markdown. There are too many unique elements in the PHB-style to be mapped. I solved this earlier by stacking certain elements together (eg. an `<hr>` before a `blockquote` turns it into moster state block), but those are getting unweildly. I would like to simply wrap these in `div`s with classes, but unfortunately Markdown stops processing when within HTML blocks. To get around this I wrote my own override to the Markdown parser and lexer to process Markdown within a simple div class wrapper. This should open the door for more unique syntaxes in the future. Big step!
- Override Ctrl+P (and cmd+P) to launch to the print page. Many people try to just print either the editing or share page to get a PDF. While this dones;t make much sense, I do get a ton of issues about it. So now if you try to do this, it'll just bring you imediately to the print page. Everybody wins!
- The onboarding flow has also been confusing a few users (Homepage -> new -> save -> edit page). If you edit the Homepage text now, a Call to Action to save your work will pop-up.
\page
- Added a 'Recently Edited' and 'Recently Viewed' nav item to the edit and share page respectively. Each will remember the last 8 items you edited or viewed and when you viewed it. Makes use of the new title attribute of brews to easy navigatation.
- Paragraphs now indent properly after lists (thanks u/slitjen!)
@@ -156,8 +167,6 @@
- Updated the issue template for (hopefully) better reporting
- Added suggestion to use chrome while PDF printing
\page
### Wednesday, 25/05/2016 -v2.0.5
- The class table generators have the proper ability score improvement progression.

View File

@@ -4,7 +4,7 @@ const createClass = require('create-react-class');
const _ = require('lodash');
const cx = require('classnames'); //Unused variable
const DISMISS_KEY = 'dismiss_notification7-24-19';
const DISMISS_KEY = 'dismiss_notification7-10-20';
const NotificationPopup = createClass({
getInitialState : function() {
@@ -22,17 +22,22 @@ const NotificationPopup = createClass({
notifications : {
psa : function(){
return <li key='psa'>
<em>Known bug: Grey Shadow Boxes </em> <br />
The shadows around certain brew elements such as notes and statblocks might appear as a solid grey box when generating a PDF. &nbsp;
<a target='_blank' href='https://old.reddit.com/r/homebrewery/comments/ch3v0d/psa_grey_boxesshadows_around_notes_stat_blocks_etc/'>
See this Reddit post
</a> for updates and possible workarounds.
<em>Google Drive Integration!</em> <br />
We have added Google Drive integration to the Homebrewery! <a target='_blank' href='https://www.naturalcrit.com/login'>Sign in</a> with
your Google account to link it with your Homebrewery profile. A new button in the Edit page will let you transfer your file to your personal
Google Drive storage, and Google will keep a backup of each version! No more lost work surprises!
<br /><br />
However, we are aware that there may be uncaught bugs. We encourage you to copy your brew into a text document before transferring to Google
Drive just in case any issues arise as this update is rolled out.
<br /><br />
<b>Note:</b> Transferring an existing brew to Google Drive will change the edit and share links of your document. If you have shared your
document online, remember to update the links there as well.
</li>;
},
faq : function(){
return <li key='faq'>
<em>Protect your work! </em> <br />
At the moment we do not save a history of your projects, so please make frequent backups of your brews! &nbsp;
If you opt not to use your Google Drive, keep in mind that we do not save a history of your projects. Please make frequent backups of your brews! &nbsp;
<a target='_blank' href='https://www.reddit.com/r/homebrewery/comments/adh6lh/faqs_psas_announcements/'>
See the FAQ
</a> to learn how to avoid losing your work!

View File

@@ -9,11 +9,11 @@
.notificationPopup{
position : relative;
float : right;
display : inline-block;
display : inline-block;
width : 350px;
padding : 20px;
padding : 15px;
padding-bottom : 10px;
padding-left : 85px;
padding-left : 55px;
background-color : @blue;
color : white;
a{
@@ -22,8 +22,8 @@
}
i.info{
position : absolute;
top : 24px;
left : 24px;
top : 12px;
left : 12px;
opacity : 0.8;
font-size : 2.5em;
}

View File

@@ -192,9 +192,7 @@ const EditPage = createClass({
this.savedBrew = res.body;
}
} else {
console.log('Saving Locally');
if(transfer) {
console.log('Moving to Local Storage');
const res = await request.post('/api')
.send(this.state.brew)
.catch((err)=>{
@@ -209,12 +207,9 @@ const EditPage = createClass({
console.log('Error Deleting Google Brew');
});
console.log('GOT THIS SAVED BREW:');
console.log(res);
this.savedBrew = res.body;
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`); //update URL to match doc ID
} else {
console.log('Updating existing local copy');
const res = await request
.put(`/api/update/${this.state.brew.editId}`)
.send(this.state.brew)
@@ -228,7 +223,6 @@ const EditPage = createClass({
}
}
console.log('Finished saving. About to merge saved brew with current');
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, {
googleId : this.savedBrew.googleId ? this.savedBrew.googleId : null,

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "homebrewery",
"version": "2.8.2",
"version": "2.10.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "homebrewery",
"description": "Create authentic looking D&D homebrews using only markdown",
"version": "2.8.2",
"version": "2.10.0",
"engines": {
"node": "12.16.x"
},

View File

@@ -97,7 +97,6 @@ app.get('/user/:username', async (req, res, next)=>{
let googleBrews = [];
if(req.account && req.account.googleId){
console.log('GETTING DATA FOR USER PAGE');
googleBrews = await GoogleActions.listGoogleBrews(req, res)
.catch((err)=>{
console.error(err);
@@ -202,7 +201,7 @@ app.use((req, res)=>{
account : req.account,
};
templateFn('homebrew', props)
.then((page)=>{console.log('^--- END OF REQUEST ---^'); res.send(page);})
.then((page)=>{res.send(page);})
.catch((err)=>{
console.log(err);
return res.sendStatus(500);

View File

@@ -14,8 +14,6 @@ const config = require('nconf')
GoogleActions = {
authCheck : (account, res)=>{
console.log('RUNNING AUTH CHECK');
if(!account || !account.googleId){ // If not signed into Google
const err = new Error('Not Signed In');
err.status = 401;
@@ -39,18 +37,16 @@ GoogleActions = {
}
account.googleAccessToken = tokens.access_token;
const JWTToken = token.generateAccessToken(account);
console.log('Updated Access Token');
//Save updated token to cookie
res.cookie('nc_session', JWTToken, { maxAge: 1000*60*60*24*365, path: '/', sameSite: 'lax' });
//res.cookie('nc_session', JWTToken, {maxAge: 1000*60*60*24*365, path: '/', sameSite: 'lax', domain: '.naturalcrit.com'});
//res.cookie('nc_session', JWTToken, { maxAge: 1000*60*60*24*365, path: '/', sameSite: 'lax' });
res.cookie('nc_session', JWTToken, { maxAge: 1000*60*60*24*365, path: '/', sameSite: 'lax', domain: '.naturalcrit.com' });
});
return oAuth2Client;
},
getGoogleFolder : async (auth)=>{
console.log('getting google folder');
const drive = google.drive({ version: 'v3', auth: auth });
fileMetadata = {
@@ -69,8 +65,6 @@ GoogleActions = {
let folderId;
if(obj.data.files.length == 0){
console.log('no folders found'); // CREATE APP FOLDER
const obj = await drive.files.create({
resource : fileMetadata
})
@@ -104,12 +98,7 @@ GoogleActions = {
return console.error(`Error Listing Google Brews: ${err}`);
});
if(obj.data.files.length) {
console.log('List Google Brews:');
obj.data.files.map((file)=>{
console.log(`${file.name} (${file.id})`);
});
} else {
if(!obj.data.files.length) {
console.log('No files found.');
}
@@ -172,7 +161,6 @@ GoogleActions = {
},
newGoogleBrew : async (auth, brew)=>{
console.log('CREATE GOOGLE BREW');
const drive = google.drive({ version: 'v3', auth: auth });
const media = {
@@ -288,7 +276,6 @@ GoogleActions = {
deleteGoogleBrew : async (req, res, id)=>{
console.log('trying to delete google brew');
oAuth2Client = GoogleActions.authCheck(req.account, res);
const drive = google.drive({ version: 'v3', auth: oAuth2Client });

View File

@@ -32,11 +32,7 @@ const newBrew = (req, res)=>{
delete brew.shareId;
delete brew.googleId;
console.log('creating new local file using this data:');
console.log(brew);
const newHomebrew = new HomebrewModel(brew);
console.log('this is the new local homebrew');
console.log(newHomebrew);
// Compress brew text to binary before saving
newHomebrew.textBin = zlib.deflateRawSync(newHomebrew.text);
// Delete the non-binary text field since it's not needed anymore
@@ -48,16 +44,13 @@ const newBrew = (req, res)=>{
return res.status(500).send(`Error while creating new brew, ${err.toString()}`);
}
console.log('NEW BREW. gOING TO RETURN THIS:');
obj = obj.toObject();
obj.gDrive = false;
console.log(obj);
return res.status(200).send(obj);
});
};
const updateBrew = (req, res)=>{
console.log('UPDATE LOCAL');
HomebrewModel.get({ editId: req.params.id })
.then((brew)=>{
brew = _.merge(brew, req.body);
@@ -74,13 +67,8 @@ const updateBrew = (req, res)=>{
brew.markModified('authors');
brew.markModified('systems');
console.log('saving this brew');
console.log(brew);
brew.save((err, obj)=>{
if(err) throw err;
console.log('sending this updated brew:');
console.log(obj);
return res.status(200).send(obj);
});
})
@@ -123,8 +111,6 @@ const deleteBrew = (req, res)=>{
const newGoogleBrew = async (req, res, next)=>{
let oAuth2Client;
console.log('newGoogleBrew (API)');
try { oAuth2Client = GoogleActions.authCheck(req.account, res); } catch (err) { return res.status(err.status).send(err.message); }
const brew = req.body;

View File

@@ -21,9 +21,6 @@ const generateAccessToken = (account)=>{
delete payload.password;
delete payload._id;
console.log('THE PAYLOAD');
console.log(payload);
const secret = config.get('authentication_token_secret');
const token = jwt.encode(payload, secret);