diff --git a/client/homebrew/navbar/error-navitem.jsx b/client/homebrew/navbar/error-navitem.jsx
index efee04019..eb2872c22 100644
--- a/client/homebrew/navbar/error-navitem.jsx
+++ b/client/homebrew/navbar/error-navitem.jsx
@@ -82,4 +82,4 @@ const ErrorNavItem = createClass({
}
});
-module.exports = ErrorNavItem;
\ No newline at end of file
+module.exports = ErrorNavItem;
diff --git a/client/homebrew/navbar/error-navitem.less b/client/homebrew/navbar/error-navitem.less
index 8a7cabb19..7e7dab772 100644
--- a/client/homebrew/navbar/error-navitem.less
+++ b/client/homebrew/navbar/error-navitem.less
@@ -1,77 +1,75 @@
-.navItem {
- &.error {
- position : relative;
- background-color : @red;
- }
+.navItem.error {
+ position : relative;
+ background-color : @red;
+}
- .errorContainer{
- animation-name: glideDown;
- animation-duration: 0.4s;
- position : absolute;
- top : 100%;
- left : 50%;
- z-index : 1000;
- width : 140px;
- padding : 3px;
- color : white;
+.errorContainer{
+ animation-name: glideDown;
+ animation-duration: 0.4s;
+ position : absolute;
+ top : 100%;
+ left : 50%;
+ z-index : 1000;
+ width : 140px;
+ padding : 3px;
+ color : white;
+ background-color : #333;
+ border : 3px solid #444;
+ border-radius : 5px;
+ transform : translate(-50% + 3px, 10px);
+ text-align : center;
+ font-size : 10px;
+ font-weight : 800;
+ text-transform : uppercase;
+ a{
+ color : @teal;
+ }
+ &:before {
+ content: "";
+ width: 0px;
+ height: 0px;
+ position: absolute;
+ border-left: 10px solid transparent;
+ border-right: 10px solid transparent;
+ border-top: 10px solid transparent;
+ border-bottom: 10px solid #444;
+ left: 53px;
+ top: -23px;
+ }
+ &:after {
+ content: "";
+ width: 0px;
+ height: 0px;
+ position: absolute;
+ border-left: 10px solid transparent;
+ border-right: 10px solid transparent;
+ border-top: 10px solid transparent;
+ border-bottom: 10px solid #333;
+ left: 53px;
+ top: -19px;
+ }
+ .deny {
+ width : 48%;
+ margin : 1px;
+ padding : 5px;
background-color : #333;
- border : 3px solid #444;
- border-radius : 5px;
- transform : translate(-50% + 3px, 10px);
- text-align : center;
- font-size : 10px;
- font-weight : 800;
- text-transform : uppercase;
- a{
- color : @teal;
- }
- &:before {
- content: "";
- width: 0px;
- height: 0px;
- position: absolute;
- border-left: 10px solid transparent;
- border-right: 10px solid transparent;
- border-top: 10px solid transparent;
- border-bottom: 10px solid #444;
- left: 53px;
- top: -23px;
- }
- &:after {
- content: "";
- width: 0px;
- height: 0px;
- position: absolute;
- border-left: 10px solid transparent;
- border-right: 10px solid transparent;
- border-top: 10px solid transparent;
- border-bottom: 10px solid #333;
- left: 53px;
- top: -19px;
- }
- .deny {
- width : 48%;
- margin : 1px;
- padding : 5px;
- background-color : #333;
- display : inline-block;
- border-left : 1px solid #666;
- .animate(background-color);
- &:hover{
- background-color : red;
- }
- }
- .confirm {
- width : 48%;
- margin : 1px;
- padding : 5px;
- background-color : #333;
- display : inline-block;
- color : white;
- .animate(background-color);
- &:hover{
- background-color : teal;
- }
+ display : inline-block;
+ border-left : 1px solid #666;
+ .animate(background-color);
+ &:hover{
+ background-color : red;
}
}
-}
\ No newline at end of file
+ .confirm {
+ width : 48%;
+ margin : 1px;
+ padding : 5px;
+ background-color : #333;
+ display : inline-block;
+ color : white;
+ .animate(background-color);
+ &:hover{
+ background-color : teal;
+ }
+ }
+}
diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx
index 94d5aef3b..4f2e8f8a2 100644
--- a/client/homebrew/pages/editPage/editPage.jsx
+++ b/client/homebrew/pages/editPage/editPage.jsx
@@ -254,6 +254,15 @@ const EditPage = createClass({
}
+
+ {this.state.alertTrashedGoogleBrew &&
+
+ This brew is currently in your Trash folder on Google Drive!
If you want to keep it, make sure to move it before it is deleted permanently!
+
+ OK
+
+
+ }
;
},
@@ -335,16 +344,6 @@ const EditPage = createClass({
const shareLink = this.processShareId();
return
-
- {this.state.alertTrashedGoogleBrew &&
-
- This brew is currently in your Trash folder on Google Drive!
If you want to keep it, make sure to move it before it is deleted permanently!
-
- OK
-
-
- }
-
{this.state.brew.title}
diff --git a/package-lock.json b/package-lock.json
index 49887cecc..729396d79 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -36,7 +36,7 @@
"mongoose": "^7.0.3",
"nanoid": "3.3.4",
"nconf": "^0.12.0",
- "npm": "^9.6.3",
+ "npm": "^9.6.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-frame-component": "5.2.6",
@@ -49,7 +49,6 @@
"eslint": "^8.37.0",
"eslint-plugin-react": "^7.32.2",
"jest": "^29.5.0",
- "jest-expect-message": "^1.1.3",
"supertest": "^6.3.3"
},
"engines": {
@@ -7490,12 +7489,6 @@
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
- "node_modules/jest-expect-message": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/jest-expect-message/-/jest-expect-message-1.1.3.tgz",
- "integrity": "sha512-bTK77T4P+zto+XepAX3low8XVQxDgaEqh3jSTQOG8qvPpD69LsIdyJTa+RmnJh3HNSzJng62/44RPPc7OIlFxg==",
- "dev": true
- },
"node_modules/jest-get-type": {
"version": "29.4.3",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz",
@@ -9583,9 +9576,9 @@
}
},
"node_modules/npm": {
- "version": "9.6.3",
- "resolved": "https://registry.npmjs.org/npm/-/npm-9.6.3.tgz",
- "integrity": "sha512-KMAw6cJF5JGPJz/NtsU8H1sMqb34qPGnSMaSWrVO8bzxOdAXJNAtDXATvLl0lflrImIze1FZCqocM8wdIu3Sfg==",
+ "version": "9.6.4",
+ "resolved": "https://registry.npmjs.org/npm/-/npm-9.6.4.tgz",
+ "integrity": "sha512-8/Mct0X/w77PmgIpSlXfNIOlrZBfT+8966zLCxOhwi1qZ2Ueyy99uWPSDW6bt2OKw1NzrvHJBSgkzAvn1iWuhw==",
"bundleDependencies": [
"@isaacs/string-locale-compare",
"@npmcli/arborist",
@@ -9656,7 +9649,7 @@
],
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
- "@npmcli/arborist": "^6.2.6",
+ "@npmcli/arborist": "^6.2.7",
"@npmcli/config": "^6.1.5",
"@npmcli/map-workspaces": "^3.0.3",
"@npmcli/package-json": "^3.0.0",
@@ -9671,7 +9664,7 @@
"columnify": "^1.6.0",
"fastest-levenshtein": "^1.0.16",
"fs-minipass": "^3.0.1",
- "glob": "^9.3.1",
+ "glob": "^9.3.2",
"graceful-fs": "^4.2.11",
"hosted-git-info": "^6.1.1",
"ini": "^3.0.1",
@@ -9679,12 +9672,12 @@
"is-cidr": "^4.0.2",
"json-parse-even-better-errors": "^3.0.0",
"libnpmaccess": "^7.0.2",
- "libnpmdiff": "^5.0.14",
- "libnpmexec": "^5.0.14",
- "libnpmfund": "^4.0.14",
+ "libnpmdiff": "^5.0.15",
+ "libnpmexec": "^5.0.15",
+ "libnpmfund": "^4.0.15",
"libnpmhook": "^9.0.3",
"libnpmorg": "^5.0.3",
- "libnpmpack": "^5.0.14",
+ "libnpmpack": "^5.0.15",
"libnpmpublish": "^7.1.3",
"libnpmsearch": "^6.0.2",
"libnpmteam": "^5.0.3",
@@ -9713,7 +9706,7 @@
"read-package-json": "^6.0.1",
"read-package-json-fast": "^3.0.2",
"semver": "^7.3.8",
- "ssri": "^10.0.1",
+ "ssri": "^10.0.2",
"tar": "^6.1.13",
"text-table": "~0.2.0",
"tiny-relative-date": "^1.3.0",
@@ -9762,7 +9755,7 @@
"license": "ISC"
},
"node_modules/npm/node_modules/@npmcli/arborist": {
- "version": "6.2.6",
+ "version": "6.2.7",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -9793,7 +9786,7 @@
"parse-conflict-json": "^3.0.0",
"proc-log": "^3.0.0",
"promise-all-reject-late": "^1.0.0",
- "promise-call-limit": "^1.0.1",
+ "promise-call-limit": "^1.0.2",
"read-package-json-fast": "^3.0.2",
"semver": "^7.3.7",
"ssri": "^10.0.1",
@@ -10521,7 +10514,7 @@
}
},
"node_modules/npm/node_modules/glob": {
- "version": "9.3.1",
+ "version": "9.3.2",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -10795,7 +10788,7 @@
"license": "MIT"
},
"node_modules/npm/node_modules/just-diff": {
- "version": "6.0.0",
+ "version": "6.0.2",
"inBundle": true,
"license": "MIT"
},
@@ -10817,11 +10810,11 @@
}
},
"node_modules/npm/node_modules/libnpmdiff": {
- "version": "5.0.14",
+ "version": "5.0.15",
"inBundle": true,
"license": "ISC",
"dependencies": {
- "@npmcli/arborist": "^6.2.6",
+ "@npmcli/arborist": "^6.2.7",
"@npmcli/disparity-colors": "^3.0.0",
"@npmcli/installed-package-contents": "^2.0.2",
"binary-extensions": "^2.2.0",
@@ -10836,11 +10829,11 @@
}
},
"node_modules/npm/node_modules/libnpmexec": {
- "version": "5.0.14",
+ "version": "5.0.15",
"inBundle": true,
"license": "ISC",
"dependencies": {
- "@npmcli/arborist": "^6.2.6",
+ "@npmcli/arborist": "^6.2.7",
"@npmcli/run-script": "^6.0.0",
"chalk": "^4.1.0",
"ci-info": "^3.7.1",
@@ -10858,11 +10851,11 @@
}
},
"node_modules/npm/node_modules/libnpmfund": {
- "version": "4.0.14",
+ "version": "4.0.15",
"inBundle": true,
"license": "ISC",
"dependencies": {
- "@npmcli/arborist": "^6.2.6"
+ "@npmcli/arborist": "^6.2.7"
},
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
@@ -10893,11 +10886,11 @@
}
},
"node_modules/npm/node_modules/libnpmpack": {
- "version": "5.0.14",
+ "version": "5.0.15",
"inBundle": true,
"license": "ISC",
"dependencies": {
- "@npmcli/arborist": "^6.2.6",
+ "@npmcli/arborist": "^6.2.7",
"@npmcli/run-script": "^6.0.0",
"npm-package-arg": "^10.1.0",
"pacote": "^15.0.8"
@@ -11756,7 +11749,7 @@
}
},
"node_modules/npm/node_modules/path-scurry": {
- "version": "1.6.1",
+ "version": "1.6.3",
"inBundle": true,
"license": "BlueOak-1.0.0",
"dependencies": {
@@ -11764,7 +11757,7 @@
"minipass": "^4.0.2"
},
"engines": {
- "node": ">=14"
+ "node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -11807,7 +11800,7 @@
}
},
"node_modules/npm/node_modules/promise-call-limit": {
- "version": "1.0.1",
+ "version": "1.0.2",
"inBundle": true,
"license": "ISC",
"funding": {
@@ -12095,7 +12088,7 @@
"license": "CC0-1.0"
},
"node_modules/npm/node_modules/ssri": {
- "version": "10.0.1",
+ "version": "10.0.2",
"inBundle": true,
"license": "ISC",
"dependencies": {
diff --git a/package.json b/package.json
index 5c0756fe4..2ac8c1681 100644
--- a/package.json
+++ b/package.json
@@ -100,7 +100,7 @@
"mongoose": "^7.0.3",
"nanoid": "3.3.4",
"nconf": "^0.12.0",
- "npm": "^9.6.3",
+ "npm": "^9.6.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-frame-component": "5.2.6",
diff --git a/server/homebrew.api.js b/server/homebrew.api.js
index 6f5fcb1ef..39fa021e5 100644
--- a/server/homebrew.api.js
+++ b/server/homebrew.api.js
@@ -305,7 +305,7 @@ If you believe you should have access to this brew, ask the file owner to invite
if(brew.authors.length === 0) {
// Delete brew if there are no authors left
- await brew.remove()
+ await HomebrewModel.deleteOne({ _id: brew._id })
.catch((err)=>{
console.error(err);
throw { status: 500, message: 'Error while removing' };
diff --git a/server/homebrew.api.spec.js b/server/homebrew.api.spec.js
index 5ab6ac4fc..c6443be7b 100644
--- a/server/homebrew.api.spec.js
+++ b/server/homebrew.api.spec.js
@@ -10,7 +10,6 @@ describe('Tests for api', ()=>{
let modelBrew;
let saveFunc;
- let removeFunc;
let markModifiedFunc;
let saved;
@@ -20,18 +19,15 @@ describe('Tests for api', ()=>{
saved = { ...this, _id: '1' };
return saved;
});
- removeFunc = jest.fn(async function() {});
markModifiedFunc = jest.fn(()=>true);
modelBrew = (brew)=>({
...brew,
save : saveFunc,
- remove : removeFunc,
markModified : markModifiedFunc,
toObject : function() {
delete this.save;
delete this.toObject;
- delete this.remove;
delete this.markModified;
return this;
}
@@ -569,13 +565,14 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
const req = {};
await api.deleteBrew(req, res);
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).toHaveBeenCalled();
+ expect(model.deleteOne).toHaveBeenCalled();
});
it('should throw on delete error', async ()=>{
@@ -587,7 +584,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
- removeFunc = jest.fn(async ()=>{ throw 'err'; });
+ model.deleteOne = jest.fn(async ()=>{ throw 'err'; });
const req = {};
let err;
@@ -600,7 +597,7 @@ brew`);
expect(err).not.toBeUndefined();
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).toHaveBeenCalled();
+ expect(model.deleteOne).toHaveBeenCalled();
});
it('should delete when one author', async ()=>{
@@ -612,13 +609,14 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
const req = { account: { username: 'test' } };
await api.deleteBrew(req, res);
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).toHaveBeenCalled();
+ expect(model.deleteOne).toHaveBeenCalled();
});
it('should remove one author when multiple present', async ()=>{
@@ -630,6 +628,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
const req = { account: { username: 'test' } };
await api.deleteBrew(req, res);
@@ -637,7 +636,7 @@ brew`);
expect(api.getBrew).toHaveBeenCalled();
expect(markModifiedFunc).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).not.toHaveBeenCalled();
+ expect(model.deleteOne).not.toHaveBeenCalled();
expect(saveFunc).toHaveBeenCalled();
expect(saved.authors).toEqual(['test2']);
});
@@ -651,6 +650,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
saveFunc = jest.fn(async ()=>{ throw 'err'; });
const req = { account: { username: 'test' } };
@@ -664,7 +664,7 @@ brew`);
expect(err).not.toBeUndefined();
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).not.toHaveBeenCalled();
+ expect(model.deleteOne).not.toHaveBeenCalled();
expect(saveFunc).toHaveBeenCalled();
});
@@ -677,6 +677,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
api.deleteGoogleBrew = jest.fn(async ()=>true);
const req = { account: { username: 'test' } };
@@ -684,7 +685,7 @@ brew`);
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).toHaveBeenCalled();
+ expect(model.deleteOne).toHaveBeenCalled();
expect(api.deleteGoogleBrew).toHaveBeenCalled();
});
@@ -697,6 +698,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
api.deleteGoogleBrew = jest.fn(async ()=>{
throw 'err';
});
@@ -706,7 +708,7 @@ brew`);
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).toHaveBeenCalled();
+ expect(model.deleteOne).toHaveBeenCalled();
expect(api.deleteGoogleBrew).toHaveBeenCalled();
});
@@ -719,6 +721,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
api.deleteGoogleBrew = jest.fn(async ()=>true);
const req = { account: { username: 'test' } };
@@ -727,7 +730,7 @@ brew`);
expect(api.getBrew).toHaveBeenCalled();
expect(markModifiedFunc).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).not.toHaveBeenCalled();
+ expect(model.deleteOne).not.toHaveBeenCalled();
expect(api.deleteGoogleBrew).toHaveBeenCalled();
expect(saveFunc).toHaveBeenCalled();
expect(saved.authors).toEqual(['test2']);
@@ -745,6 +748,7 @@ brew`);
req.brew = brew;
});
model.findOne = jest.fn(async ()=>modelBrew(brew));
+ model.deleteOne = jest.fn(async ()=>{});
api.deleteGoogleBrew = jest.fn(async ()=>true);
const req = { account: { username: 'test2' } };
@@ -752,7 +756,7 @@ brew`);
expect(api.getBrew).toHaveBeenCalled();
expect(model.findOne).toHaveBeenCalled();
- expect(removeFunc).not.toHaveBeenCalled();
+ expect(model.deleteOne).not.toHaveBeenCalled();
expect(api.deleteGoogleBrew).not.toHaveBeenCalled();
expect(saveFunc).toHaveBeenCalled();
expect(saved.authors).toEqual(['test']);
diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js
index 16623b8a5..1960776d3 100644
--- a/shared/naturalcrit/markdown.js
+++ b/shared/naturalcrit/markdown.js
@@ -134,7 +134,7 @@ const mustacheInjectInline = {
const match = inlineRegex.exec(src);
if(match) {
const lastToken = tokens[tokens.length - 1];
- if(!lastToken)
+ if(!lastToken || lastToken.type == 'mustacheInjectInline')
return false;
const tags = ` ${processStyleTags(match[1])}`;
@@ -169,7 +169,7 @@ const mustacheInjectBlock = {
const match = inlineRegex.exec(src);
if(match) {
const lastToken = tokens[tokens.length - 1];
- if(!lastToken)
+ if(!lastToken || lastToken.type == 'mustacheInjectBlock')
return false;
lastToken.originalType = 'mustacheInjectBlock';