mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-18 23:02:40 +00:00
Merge branch 'master' into content-negotiation-middleware
This commit is contained in:
34
changelog.md
34
changelog.md
@@ -52,16 +52,20 @@ pre {
|
||||
font-family: 'Open Sans';
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.page {
|
||||
padding-bottom: 1.5cm;
|
||||
}
|
||||
```
|
||||
|
||||
## changelog
|
||||
For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery).
|
||||
|
||||
### v3.6.0
|
||||
### Friday 23/01/2023 - v3.6.0
|
||||
{{taskList
|
||||
##### calculuschild
|
||||
|
||||
* [x] Fix Google Drive brews sometimes duplicating
|
||||
* [x] Fix Google Drive brews sometimes duplicating
|
||||
|
||||
Fixes issues [#2603](https://github.com/naturalcrit/homebrewery/issues/2603)
|
||||
|
||||
@@ -69,9 +73,17 @@ Fixes issues [#2603](https://github.com/naturalcrit/homebrewery/issues/2603)
|
||||
|
||||
* [x] Add unit tests with full coverage for the Homebrewery API
|
||||
|
||||
* [x] Add message to refresh the browser if the user is missing an update to the Homebrewery
|
||||
|
||||
Fixes issues [#2583](https://github.com/naturalcrit/homebrewery/issues/2583)
|
||||
|
||||
##### G-Ambatte
|
||||
|
||||
* [x] Add Themes directory to development server watchlist.
|
||||
* [x] Auto-compile Themes CSS on development server
|
||||
|
||||
##### 5e-Cleric
|
||||
|
||||
* [x] Fix cloned brews inheriting the parent view count
|
||||
}}
|
||||
|
||||
### Friday 23/12/2022 - v3.5.0
|
||||
@@ -89,22 +101,6 @@ Fixes issues [#1987](https://github.com/naturalcrit/homebrewery/issues/1987)
|
||||
|
||||
\page
|
||||
|
||||
### Monday 05/12/2022 - v3.4.1
|
||||
{{taskList
|
||||
|
||||
##### G-Ambatte
|
||||
|
||||
* [x] Fix Account page incorrect last login time
|
||||
|
||||
Fixes issues [#2521](https://github.com/naturalcrit/homebrewery/issues/2521)
|
||||
|
||||
##### Gazook
|
||||
|
||||
* [x] Fix crashing on iOS and Safari browsers
|
||||
|
||||
Fixes issues [#2531](https://github.com/naturalcrit/homebrewery/issues/2531)
|
||||
}}
|
||||
|
||||
### Saturday 10/12/2022 - v3.4.2
|
||||
{{taskList
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ const Editor = createClass({
|
||||
onTextChange : ()=>{},
|
||||
onStyleChange : ()=>{},
|
||||
onMetaChange : ()=>{},
|
||||
reportError : ()=>{},
|
||||
|
||||
renderer : 'legacy'
|
||||
};
|
||||
@@ -291,7 +292,8 @@ const Editor = createClass({
|
||||
rerenderParent={this.rerenderParent} />
|
||||
<MetadataEditor
|
||||
metadata={this.props.brew}
|
||||
onChange={this.props.onMetaChange} />
|
||||
onChange={this.props.onMetaChange}
|
||||
reportError={this.props.reportError}/>
|
||||
</>;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
const _ = require('lodash');
|
||||
const cx = require('classnames');
|
||||
const request = require('superagent');
|
||||
const request = require('../../utils/request-middleware.js');
|
||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||
const StringArrayEditor = require('../stringArrayEditor/stringArrayEditor.jsx');
|
||||
|
||||
@@ -37,7 +37,8 @@ const MetadataEditor = createClass({
|
||||
renderer : 'legacy',
|
||||
theme : '5ePHB'
|
||||
},
|
||||
onChange : ()=>{}
|
||||
onChange : ()=>{},
|
||||
reportError : ()=>{}
|
||||
};
|
||||
},
|
||||
|
||||
@@ -121,8 +122,12 @@ const MetadataEditor = createClass({
|
||||
|
||||
request.delete(`/api/${this.props.metadata.googleId ?? ''}${this.props.metadata.editId}`)
|
||||
.send()
|
||||
.end(function(err, res){
|
||||
window.location.href = '/';
|
||||
.end((err, res)=>{
|
||||
if(err) {
|
||||
this.props.reportError(err);
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -22,13 +22,14 @@ const ErrorNavItem = createClass({
|
||||
};
|
||||
|
||||
const error = this.props.error;
|
||||
const status = error.status;
|
||||
const message = error.body?.message;
|
||||
const response = error.response;
|
||||
const status = response.status;
|
||||
const message = response.body?.message;
|
||||
let errMsg = '';
|
||||
try {
|
||||
errMsg += `${error.toString()}\n\n`;
|
||||
errMsg += `\`\`\`\n${error.stack}\n`;
|
||||
errMsg += `${JSON.stringify(error.error, null, ' ')}\n\`\`\``;
|
||||
errMsg += `${JSON.stringify(response.error, null, ' ')}\n\`\`\``;
|
||||
console.log(errMsg);
|
||||
} catch (e){}
|
||||
|
||||
@@ -48,7 +49,7 @@ const ErrorNavItem = createClass({
|
||||
</Nav.item>;
|
||||
}
|
||||
|
||||
if(error.req.url.match(/^\/api.*Google.*$/m)){
|
||||
if(response.req.url.match(/^\/api.*Google.*$/m)){
|
||||
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
|
||||
Oops!
|
||||
<div className='errorContainer' onClick={clearError}>
|
||||
|
||||
@@ -19,7 +19,7 @@ const BrewItem = createClass({
|
||||
authors : [],
|
||||
stubbed : true
|
||||
},
|
||||
reportError : null
|
||||
reportError : ()=>{}
|
||||
};
|
||||
},
|
||||
|
||||
@@ -35,8 +35,8 @@ const BrewItem = createClass({
|
||||
request.delete(`/api/${this.props.brew.googleId ?? ''}${this.props.brew.editId}`)
|
||||
.send()
|
||||
.end((err, res)=>{
|
||||
if(err && this.props.reportError) {
|
||||
this.props.reportError(err.response);
|
||||
if(err) {
|
||||
this.props.reportError(err);
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ const EditPage = createClass({
|
||||
.send(brew)
|
||||
.catch((err)=>{
|
||||
console.log('Error Updating Local Brew');
|
||||
this.setState({ error: err.response });
|
||||
this.setState({ error: err });
|
||||
});
|
||||
if(!res) return;
|
||||
|
||||
@@ -305,6 +305,12 @@ const EditPage = createClass({
|
||||
this.warningTimer;
|
||||
},
|
||||
|
||||
errorReported : function(error) {
|
||||
this.setState({
|
||||
error
|
||||
});
|
||||
},
|
||||
|
||||
renderAutoSaveButton : function(){
|
||||
return <Nav.item onClick={this.handleAutoSave}>
|
||||
Autosave <i className={this.state.autoSave ? 'fas fa-power-off active' : 'fas fa-power-off'}></i>
|
||||
@@ -393,6 +399,7 @@ const EditPage = createClass({
|
||||
onTextChange={this.handleTextChange}
|
||||
onStyleChange={this.handleStyleChange}
|
||||
onMetaChange={this.handleMetaChange}
|
||||
reportError={this.errorReported}
|
||||
renderer={this.state.brew.renderer}
|
||||
/>
|
||||
<BrewRenderer text={this.state.brew.text} style={this.state.brew.style} renderer={this.state.brew.renderer} theme={this.state.brew.theme} errors={this.state.htmlErrors} />
|
||||
|
||||
@@ -41,7 +41,7 @@ const HomePage = createClass({
|
||||
.send(this.state.brew)
|
||||
.end((err, res)=>{
|
||||
if(err) {
|
||||
this.setState({ error: err.response });
|
||||
this.setState({ error: err });
|
||||
return;
|
||||
}
|
||||
const brew = res.body;
|
||||
|
||||
@@ -145,7 +145,7 @@ const NewPage = createClass({
|
||||
.send(brew)
|
||||
.catch((err)=>{
|
||||
console.log(err);
|
||||
this.setState({ isSaving: false, error: err.response });
|
||||
this.setState({ isSaving: false, error: err });
|
||||
});
|
||||
if(!res) return;
|
||||
|
||||
|
||||
1431
package-lock.json
generated
1431
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "homebrewery",
|
||||
"description": "Create authentic looking D&D homebrews using only markdown",
|
||||
"version": "3.5.0",
|
||||
"version": "3.6.0",
|
||||
"engines": {
|
||||
"node": "16.11.x"
|
||||
},
|
||||
@@ -87,26 +87,26 @@
|
||||
"jwt-simple": "^0.5.6",
|
||||
"less": "^3.13.1",
|
||||
"lodash": "^4.17.21",
|
||||
"marked": "4.2.5",
|
||||
"marked": "4.2.12",
|
||||
"marked-extended-tables": "^1.0.5",
|
||||
"markedLegacy": "npm:marked@^0.3.19",
|
||||
"moment": "^2.29.4",
|
||||
"mongoose": "^6.8.3",
|
||||
"mongoose": "^6.8.4",
|
||||
"nanoid": "3.3.4",
|
||||
"nconf": "^0.12.0",
|
||||
"npm": "^8.10.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-frame-component": "4.1.3",
|
||||
"react-router-dom": "6.6.1",
|
||||
"react-router-dom": "6.7.0",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"superagent": "^6.1.0",
|
||||
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.31.0",
|
||||
"eslint-plugin-react": "^7.31.11",
|
||||
"jest": "^29.2.2",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-plugin-react": "^7.32.1",
|
||||
"jest": "^29.4.0",
|
||||
"supertest": "^6.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,6 +293,7 @@ app.get('/edit/:id', asyncHandler(getBrew('edit')), (req, res, next)=>{
|
||||
app.get('/new/:id', asyncHandler(getBrew('share')), (req, res, next)=>{
|
||||
sanitizeBrew(req.brew, 'share');
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
req.brew.views = 0;
|
||||
req.brew.title = `CLONE - ${req.brew.title}`;
|
||||
|
||||
req.ogMeta = { ...defaultMetaTags,
|
||||
|
||||
Reference in New Issue
Block a user