0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-14 08:32:44 +00:00

Merge branch 'naturalcrit:master' into experimentalNotificationDB

This commit is contained in:
G.Ambatte
2023-02-19 15:22:19 +13:00
committed by GitHub
7 changed files with 729 additions and 738 deletions

2
.gitignore vendored
View File

@@ -12,3 +12,5 @@ todo.md
startDB.bat startDB.bat
startMViewer.bat startMViewer.bat
.vscode .vscode
coverage

View File

@@ -61,6 +61,16 @@ pre {
## changelog ## changelog
For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery).
### Saturday 18/02/2023 - v3.6.1
{{taskList
##### G-Ambatte
* [x] Fix users not being removed from Authors list correctly
Fixes issues [#2674](https://github.com/naturalcrit/homebrewery/issues/2674)
}}
### Friday 23/01/2023 - v3.6.0 ### Friday 23/01/2023 - v3.6.0
{{taskList {{taskList
##### calculuschild ##### calculuschild

1426
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "homebrewery", "name": "homebrewery",
"description": "Create authentic looking D&D homebrews using only markdown", "description": "Create authentic looking D&D homebrews using only markdown",
"version": "3.6.0", "version": "3.6.1",
"engines": { "engines": {
"node": "16.11.x" "node": "16.11.x"
}, },
@@ -82,7 +82,7 @@
"express-async-handler": "^1.2.0", "express-async-handler": "^1.2.0",
"express-static-gzip": "2.1.7", "express-static-gzip": "2.1.7",
"fs-extra": "11.1.0", "fs-extra": "11.1.0",
"googleapis": "110.0.0", "googleapis": "111.0.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jwt-simple": "^0.5.6", "jwt-simple": "^0.5.6",
"less": "^3.13.1", "less": "^3.13.1",
@@ -91,22 +91,22 @@
"marked-extended-tables": "^1.0.5", "marked-extended-tables": "^1.0.5",
"markedLegacy": "npm:marked@^0.3.19", "markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.29.4", "moment": "^2.29.4",
"mongoose": "^6.9.0", "mongoose": "^6.9.1",
"nanoid": "3.3.4", "nanoid": "3.3.4",
"nconf": "^0.12.0", "nconf": "^0.12.0",
"npm": "^8.10.0", "npm": "^8.10.0",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-frame-component": "4.1.3", "react-frame-component": "4.1.3",
"react-router-dom": "6.8.0", "react-router-dom": "6.8.1",
"sanitize-filename": "1.6.3", "sanitize-filename": "1.6.3",
"superagent": "^6.1.0", "superagent": "^6.1.0",
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git" "vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.33.0", "eslint": "^8.34.0",
"eslint-plugin-react": "^7.32.2", "eslint-plugin-react": "^7.32.2",
"jest": "^29.4.1", "jest": "^29.4.3",
"supertest": "^6.3.3" "supertest": "^6.3.3"
} }
} }

View File

@@ -317,8 +317,7 @@ If you believe you should have access to this brew, ask the file owner to invite
brew.textBin = zlib.deflateRawSync(brew.text); brew.textBin = zlib.deflateRawSync(brew.text);
brew.text = undefined; brew.text = undefined;
} }
brew.markModified('authors'); //Mongo will not properly update arrays without markModified()
// Otherwise, save the brew with updated author list
await brew.save() await brew.save()
.catch((err)=>{ .catch((err)=>{
throw { status: 500, message: err }; throw { status: 500, message: err };

View File

@@ -11,6 +11,7 @@ describe('Tests for api', ()=>{
let modelBrew; let modelBrew;
let saveFunc; let saveFunc;
let removeFunc; let removeFunc;
let markModifiedFunc;
let saved; let saved;
beforeEach(()=>{ beforeEach(()=>{
@@ -20,15 +21,18 @@ describe('Tests for api', ()=>{
return saved; return saved;
}); });
removeFunc = jest.fn(async function() {}); removeFunc = jest.fn(async function() {});
markModifiedFunc = jest.fn(()=>true);
modelBrew = (brew)=>({ modelBrew = (brew)=>({
...brew, ...brew,
save : saveFunc, save : saveFunc,
remove : removeFunc, remove : removeFunc,
toObject : function() { markModified : markModifiedFunc,
toObject : function() {
delete this.save; delete this.save;
delete this.toObject; delete this.toObject;
delete this.remove; delete this.remove;
delete this.markModified;
return this; return this;
} }
}); });
@@ -627,6 +631,7 @@ brew`);
await api.deleteBrew(req, res); await api.deleteBrew(req, res);
expect(api.getBrew).toHaveBeenCalled(); expect(api.getBrew).toHaveBeenCalled();
expect(markModifiedFunc).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled(); expect(model.findOne).toHaveBeenCalled();
expect(removeFunc).not.toHaveBeenCalled(); expect(removeFunc).not.toHaveBeenCalled();
expect(saveFunc).toHaveBeenCalled(); expect(saveFunc).toHaveBeenCalled();
@@ -716,6 +721,7 @@ brew`);
await api.deleteBrew(req, res); await api.deleteBrew(req, res);
expect(api.getBrew).toHaveBeenCalled(); expect(api.getBrew).toHaveBeenCalled();
expect(markModifiedFunc).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled(); expect(model.findOne).toHaveBeenCalled();
expect(removeFunc).not.toHaveBeenCalled(); expect(removeFunc).not.toHaveBeenCalled();
expect(api.deleteGoogleBrew).toHaveBeenCalled(); expect(api.deleteGoogleBrew).toHaveBeenCalled();

View File

@@ -22,7 +22,7 @@
vertical-align : middle; vertical-align : middle;
text-align : center; text-align : center;
i{ i{
display : block; display : block !important;
margin : 10px 0px; margin : 10px 0px;
font-size : 6px; font-size : 6px;
color : #666; color : #666;