From 99f9b1034852f18060151c1581351a595837a4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 7 Apr 2024 16:16:21 +0200 Subject: [PATCH 1/9] initial commit --- .../pages/errorPage/errors/errorIndex.js | 20 +++++++++++++++++-- server/homebrew.api.js | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 7c7a3ae7f..bec3fdfe7 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -73,11 +73,14 @@ const errorIndex = (props)=>{ **Properties** tab, and adding your username to the "invited authors" list. You can then try to access this document again. + : + **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'} - [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, + ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: + 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, // User is not signed in; must be a user on the Authors List '04' : dedent` @@ -86,9 +89,14 @@ const errorIndex = (props)=>{ You must be logged in to one of the accounts listed as an author of this brew. User is not logged in. Please log in [here](${loginUrl}). + : + **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} - **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'}`, + **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'} + + ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: + 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, // Brew load error '05' : dedent` @@ -97,6 +105,8 @@ const errorIndex = (props)=>{ The server could not locate the Homebrewery document. It was likely deleted by its owner. + : + **Requested access:** ${props.brew.accessType} **Brew ID:** ${props.brew.brewId}`, @@ -113,6 +123,8 @@ const errorIndex = (props)=>{ An error occurred while attempting to remove the Homebrewery document. + : + **Brew ID:** ${props.brew.brewId}`, // Author delete error @@ -121,6 +133,8 @@ const errorIndex = (props)=>{ An error occurred while attempting to remove the user from the Homebrewery document author list! + : + **Brew ID:** ${props.brew.brewId}`, // Brew locked by Administrators error @@ -129,6 +143,8 @@ const errorIndex = (props)=>{ Please contact the Administrators to unlock this document. + : + **Brew ID:** ${props.brew.brewId} **Brew Title:** ${props.brew.brewTitle}`, diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 567dc9cf7..f9a2c6156 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -83,9 +83,9 @@ const api = { if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) { const accessError = { name: 'Access Error', status: 401 }; if(req.account){ - throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId }; + throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId, published: stub.published }; } - throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title }; + throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId , published: stub.published}; } // If after all of that we still don't have a brew, throw an exception From 2045bf8060cefe0b95180aadd2b9e9e1b0cff76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:17:10 +0200 Subject: [PATCH 2/9] renaming snippetBar --- client/homebrew/editor/editor.jsx | 2 +- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 7cc800b78..53f9b825f 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -7,7 +7,7 @@ const cx = require('classnames'); const dedent = require('dedent-tabs').default; const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); -const SnippetBar = require('./snippetbar/snippetbar.jsx'); +const snippetBar = require('./snippetBar/snippetBar.jsx'); const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 75fe0d736..1341405e5 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -1,5 +1,5 @@ /*eslint max-lines: ["warn", {"max": 250, "skipBlankLines": true, "skipComments": true}]*/ -require('./snippetbar.less'); +require('./snippetBar.less'); const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); From 22b01b131fc47ea8af9721060e90bd67b44679c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:19:32 +0200 Subject: [PATCH 3/9] rename icons --- client/icons/{book-back-cover.svg => bookBackCover.svg} | 0 client/icons/{book-front-cover.svg => bookFrontCover.svg} | 0 client/icons/{book-inside-cover.svg => bookInsideCover.svg} | 0 client/icons/{book-part-cover.svg => bookPartCover.svg} | 0 client/icons/{mask-center.svg => maskCenter.svg} | 0 client/icons/{mask-corner.svg => maskCorner.svg} | 0 client/icons/{mask-edge.svg => maskEdge.svg} | 0 client/icons/{position-bottom.svg => positionBottom.svg} | 0 client/icons/{position-bottom-left.svg => positionBottomLeft.svg} | 0 .../icons/{position-bottom-right.svg => positionBottomRight.svg} | 0 client/icons/{position-left.svg => positionLeft.svg} | 0 client/icons/{position-right.svg => positionRight.svg} | 0 client/icons/{position-top.svg => positionTop.svg} | 0 client/icons/{position-top-left.svg => positionTopLeft.svg} | 0 client/icons/{position-top-right.svg => positionTopRight.svg} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename client/icons/{book-back-cover.svg => bookBackCover.svg} (100%) rename client/icons/{book-front-cover.svg => bookFrontCover.svg} (100%) rename client/icons/{book-inside-cover.svg => bookInsideCover.svg} (100%) rename client/icons/{book-part-cover.svg => bookPartCover.svg} (100%) rename client/icons/{mask-center.svg => maskCenter.svg} (100%) rename client/icons/{mask-corner.svg => maskCorner.svg} (100%) rename client/icons/{mask-edge.svg => maskEdge.svg} (100%) rename client/icons/{position-bottom.svg => positionBottom.svg} (100%) rename client/icons/{position-bottom-left.svg => positionBottomLeft.svg} (100%) rename client/icons/{position-bottom-right.svg => positionBottomRight.svg} (100%) rename client/icons/{position-left.svg => positionLeft.svg} (100%) rename client/icons/{position-right.svg => positionRight.svg} (100%) rename client/icons/{position-top.svg => positionTop.svg} (100%) rename client/icons/{position-top-left.svg => positionTopLeft.svg} (100%) rename client/icons/{position-top-right.svg => positionTopRight.svg} (100%) diff --git a/client/icons/book-back-cover.svg b/client/icons/bookBackCover.svg similarity index 100% rename from client/icons/book-back-cover.svg rename to client/icons/bookBackCover.svg diff --git a/client/icons/book-front-cover.svg b/client/icons/bookFrontCover.svg similarity index 100% rename from client/icons/book-front-cover.svg rename to client/icons/bookFrontCover.svg diff --git a/client/icons/book-inside-cover.svg b/client/icons/bookInsideCover.svg similarity index 100% rename from client/icons/book-inside-cover.svg rename to client/icons/bookInsideCover.svg diff --git a/client/icons/book-part-cover.svg b/client/icons/bookPartCover.svg similarity index 100% rename from client/icons/book-part-cover.svg rename to client/icons/bookPartCover.svg diff --git a/client/icons/mask-center.svg b/client/icons/maskCenter.svg similarity index 100% rename from client/icons/mask-center.svg rename to client/icons/maskCenter.svg diff --git a/client/icons/mask-corner.svg b/client/icons/maskCorner.svg similarity index 100% rename from client/icons/mask-corner.svg rename to client/icons/maskCorner.svg diff --git a/client/icons/mask-edge.svg b/client/icons/maskEdge.svg similarity index 100% rename from client/icons/mask-edge.svg rename to client/icons/maskEdge.svg diff --git a/client/icons/position-bottom.svg b/client/icons/positionBottom.svg similarity index 100% rename from client/icons/position-bottom.svg rename to client/icons/positionBottom.svg diff --git a/client/icons/position-bottom-left.svg b/client/icons/positionBottomLeft.svg similarity index 100% rename from client/icons/position-bottom-left.svg rename to client/icons/positionBottomLeft.svg diff --git a/client/icons/position-bottom-right.svg b/client/icons/positionBottomRight.svg similarity index 100% rename from client/icons/position-bottom-right.svg rename to client/icons/positionBottomRight.svg diff --git a/client/icons/position-left.svg b/client/icons/positionLeft.svg similarity index 100% rename from client/icons/position-left.svg rename to client/icons/positionLeft.svg diff --git a/client/icons/position-right.svg b/client/icons/positionRight.svg similarity index 100% rename from client/icons/position-right.svg rename to client/icons/positionRight.svg diff --git a/client/icons/position-top.svg b/client/icons/positionTop.svg similarity index 100% rename from client/icons/position-top.svg rename to client/icons/positionTop.svg diff --git a/client/icons/position-top-left.svg b/client/icons/positionTopLeft.svg similarity index 100% rename from client/icons/position-top-left.svg rename to client/icons/positionTopLeft.svg diff --git a/client/icons/position-top-right.svg b/client/icons/positionTopRight.svg similarity index 100% rename from client/icons/position-top-right.svg rename to client/icons/positionTopRight.svg From 7cc83eaf95d141063004d62acd38e9ffba2a23be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:19:43 +0200 Subject: [PATCH 4/9] rename icons less --- client/icons/customIcons.less | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/icons/customIcons.less b/client/icons/customIcons.less index dd6605326..10ba66574 100644 --- a/client/icons/customIcons.less +++ b/client/icons/customIcons.less @@ -1,50 +1,50 @@ .fac { - display : inline-block; + display: inline-block; } .position-top-left { - content: url('../icons/position-top-left.svg'); + content: url('../icons/positionTopLeft.svg'); } .position-top-right { - content: url('../icons/position-top-right.svg'); + content: url('../icons/positionTopRight.svg'); } .position-bottom-left { - content: url('../icons/position-bottom-left.svg'); + content: url('../icons/positionBottomLeft.svg'); } .position-bottom-right { - content: url('../icons/position-bottom-right.svg'); + content: url('../icons/positionBottomRight.svg'); } .position-top { - content: url('../icons/position-top.svg'); + content: url('../icons/positionTop.svg'); } .position-right { - content: url('../icons/position-right.svg'); + content: url('../icons/positionRight.svg'); } .position-bottom { - content: url('../icons/position-bottom.svg'); + content: url('../icons/positionBottom.svg'); } .position-left { - content: url('../icons/position-left.svg'); + content: url('../icons/positionLeft.svg'); } .mask-edge { - content: url('../icons/mask-edge.svg'); + content: url('../icons/maskEdge.svg'); } .mask-corner { - content: url('../icons/mask-corner.svg'); + content: url('../icons/maskCorner.svg'); } .mask-center { - content: url('../icons/mask-center.svg'); + content: url('../icons/maskCenter.svg'); } .book-front-cover { - content: url('../icons/book-front-cover.svg'); + content: url('../icons/bookFrontCover.svg'); } .book-back-cover { - content: url('../icons/book-back-cover.svg'); + content: url('../icons/bookBackCover.svg'); } .book-inside-cover { - content: url('../icons/book-inside-cover.svg'); + content: url('../icons/bookInsideCover.svg'); } .book-part-cover { - content: url('../icons/book-part-cover.svg'); + content: url('../icons/bookPartCover.svg'); } .davek { content: url('../icons/Davek.svg'); From 4f9e93fac744de52b1f8d368024f6e97076e6875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:29:38 +0200 Subject: [PATCH 5/9] Revert "renaming snippetBar" This reverts commit 2045bf8060cefe0b95180aadd2b9e9e1b0cff76d. --- client/homebrew/editor/editor.jsx | 2 +- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 53f9b825f..7cc800b78 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -7,7 +7,7 @@ const cx = require('classnames'); const dedent = require('dedent-tabs').default; const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); -const snippetBar = require('./snippetBar/snippetBar.jsx'); +const SnippetBar = require('./snippetbar/snippetbar.jsx'); const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 1341405e5..75fe0d736 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -1,5 +1,5 @@ /*eslint max-lines: ["warn", {"max": 250, "skipBlankLines": true, "skipComments": true}]*/ -require('./snippetBar.less'); +require('./snippetbar.less'); const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); From f5c729c32856445290b669481b54bb9167de242b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:29:40 +0200 Subject: [PATCH 6/9] Revert "rename icons" This reverts commit 22b01b131fc47ea8af9721060e90bd67b44679c5. --- client/icons/{bookBackCover.svg => book-back-cover.svg} | 0 client/icons/{bookFrontCover.svg => book-front-cover.svg} | 0 client/icons/{bookInsideCover.svg => book-inside-cover.svg} | 0 client/icons/{bookPartCover.svg => book-part-cover.svg} | 0 client/icons/{maskCenter.svg => mask-center.svg} | 0 client/icons/{maskCorner.svg => mask-corner.svg} | 0 client/icons/{maskEdge.svg => mask-edge.svg} | 0 client/icons/{positionBottomLeft.svg => position-bottom-left.svg} | 0 .../icons/{positionBottomRight.svg => position-bottom-right.svg} | 0 client/icons/{positionBottom.svg => position-bottom.svg} | 0 client/icons/{positionLeft.svg => position-left.svg} | 0 client/icons/{positionRight.svg => position-right.svg} | 0 client/icons/{positionTopLeft.svg => position-top-left.svg} | 0 client/icons/{positionTopRight.svg => position-top-right.svg} | 0 client/icons/{positionTop.svg => position-top.svg} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename client/icons/{bookBackCover.svg => book-back-cover.svg} (100%) rename client/icons/{bookFrontCover.svg => book-front-cover.svg} (100%) rename client/icons/{bookInsideCover.svg => book-inside-cover.svg} (100%) rename client/icons/{bookPartCover.svg => book-part-cover.svg} (100%) rename client/icons/{maskCenter.svg => mask-center.svg} (100%) rename client/icons/{maskCorner.svg => mask-corner.svg} (100%) rename client/icons/{maskEdge.svg => mask-edge.svg} (100%) rename client/icons/{positionBottomLeft.svg => position-bottom-left.svg} (100%) rename client/icons/{positionBottomRight.svg => position-bottom-right.svg} (100%) rename client/icons/{positionBottom.svg => position-bottom.svg} (100%) rename client/icons/{positionLeft.svg => position-left.svg} (100%) rename client/icons/{positionRight.svg => position-right.svg} (100%) rename client/icons/{positionTopLeft.svg => position-top-left.svg} (100%) rename client/icons/{positionTopRight.svg => position-top-right.svg} (100%) rename client/icons/{positionTop.svg => position-top.svg} (100%) diff --git a/client/icons/bookBackCover.svg b/client/icons/book-back-cover.svg similarity index 100% rename from client/icons/bookBackCover.svg rename to client/icons/book-back-cover.svg diff --git a/client/icons/bookFrontCover.svg b/client/icons/book-front-cover.svg similarity index 100% rename from client/icons/bookFrontCover.svg rename to client/icons/book-front-cover.svg diff --git a/client/icons/bookInsideCover.svg b/client/icons/book-inside-cover.svg similarity index 100% rename from client/icons/bookInsideCover.svg rename to client/icons/book-inside-cover.svg diff --git a/client/icons/bookPartCover.svg b/client/icons/book-part-cover.svg similarity index 100% rename from client/icons/bookPartCover.svg rename to client/icons/book-part-cover.svg diff --git a/client/icons/maskCenter.svg b/client/icons/mask-center.svg similarity index 100% rename from client/icons/maskCenter.svg rename to client/icons/mask-center.svg diff --git a/client/icons/maskCorner.svg b/client/icons/mask-corner.svg similarity index 100% rename from client/icons/maskCorner.svg rename to client/icons/mask-corner.svg diff --git a/client/icons/maskEdge.svg b/client/icons/mask-edge.svg similarity index 100% rename from client/icons/maskEdge.svg rename to client/icons/mask-edge.svg diff --git a/client/icons/positionBottomLeft.svg b/client/icons/position-bottom-left.svg similarity index 100% rename from client/icons/positionBottomLeft.svg rename to client/icons/position-bottom-left.svg diff --git a/client/icons/positionBottomRight.svg b/client/icons/position-bottom-right.svg similarity index 100% rename from client/icons/positionBottomRight.svg rename to client/icons/position-bottom-right.svg diff --git a/client/icons/positionBottom.svg b/client/icons/position-bottom.svg similarity index 100% rename from client/icons/positionBottom.svg rename to client/icons/position-bottom.svg diff --git a/client/icons/positionLeft.svg b/client/icons/position-left.svg similarity index 100% rename from client/icons/positionLeft.svg rename to client/icons/position-left.svg diff --git a/client/icons/positionRight.svg b/client/icons/position-right.svg similarity index 100% rename from client/icons/positionRight.svg rename to client/icons/position-right.svg diff --git a/client/icons/positionTopLeft.svg b/client/icons/position-top-left.svg similarity index 100% rename from client/icons/positionTopLeft.svg rename to client/icons/position-top-left.svg diff --git a/client/icons/positionTopRight.svg b/client/icons/position-top-right.svg similarity index 100% rename from client/icons/positionTopRight.svg rename to client/icons/position-top-right.svg diff --git a/client/icons/positionTop.svg b/client/icons/position-top.svg similarity index 100% rename from client/icons/positionTop.svg rename to client/icons/position-top.svg From 0e5c91733dffce39523a1388f0114cad69bb8a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:29:43 +0200 Subject: [PATCH 7/9] Revert "rename icons less" This reverts commit 7cc83eaf95d141063004d62acd38e9ffba2a23be. --- client/icons/customIcons.less | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/icons/customIcons.less b/client/icons/customIcons.less index 10ba66574..dd6605326 100644 --- a/client/icons/customIcons.less +++ b/client/icons/customIcons.less @@ -1,50 +1,50 @@ .fac { - display: inline-block; + display : inline-block; } .position-top-left { - content: url('../icons/positionTopLeft.svg'); + content: url('../icons/position-top-left.svg'); } .position-top-right { - content: url('../icons/positionTopRight.svg'); + content: url('../icons/position-top-right.svg'); } .position-bottom-left { - content: url('../icons/positionBottomLeft.svg'); + content: url('../icons/position-bottom-left.svg'); } .position-bottom-right { - content: url('../icons/positionBottomRight.svg'); + content: url('../icons/position-bottom-right.svg'); } .position-top { - content: url('../icons/positionTop.svg'); + content: url('../icons/position-top.svg'); } .position-right { - content: url('../icons/positionRight.svg'); + content: url('../icons/position-right.svg'); } .position-bottom { - content: url('../icons/positionBottom.svg'); + content: url('../icons/position-bottom.svg'); } .position-left { - content: url('../icons/positionLeft.svg'); + content: url('../icons/position-left.svg'); } .mask-edge { - content: url('../icons/maskEdge.svg'); + content: url('../icons/mask-edge.svg'); } .mask-corner { - content: url('../icons/maskCorner.svg'); + content: url('../icons/mask-corner.svg'); } .mask-center { - content: url('../icons/maskCenter.svg'); + content: url('../icons/mask-center.svg'); } .book-front-cover { - content: url('../icons/bookFrontCover.svg'); + content: url('../icons/book-front-cover.svg'); } .book-back-cover { - content: url('../icons/bookBackCover.svg'); + content: url('../icons/book-back-cover.svg'); } .book-inside-cover { - content: url('../icons/bookInsideCover.svg'); + content: url('../icons/book-inside-cover.svg'); } .book-part-cover { - content: url('../icons/bookPartCover.svg'); + content: url('../icons/book-part-cover.svg'); } .davek { content: url('../icons/Davek.svg'); From 9247967f93a10e3a163d925024b544bd86b97344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 9 Apr 2024 20:12:40 +0200 Subject: [PATCH 8/9] fixed published request --- client/homebrew/pages/errorPage/errors/errorIndex.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 5d242648c..f9d52c109 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -79,8 +79,7 @@ const errorIndex = (props)=>{ **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} - ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: - 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, + [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, // User is not signed in; must be a user on the Authors List '04' : dedent` @@ -95,8 +94,7 @@ const errorIndex = (props)=>{ **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} - ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: - 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, + [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, // Brew load error From 7097897df8cc1131863c62a47feefd5f74416519 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 9 Apr 2024 15:24:04 -0400 Subject: [PATCH 9/9] Remove "stub.published" from thrown error, since no longer used --- server/homebrew.api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index f9a2c6156..e73a704a8 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -83,9 +83,9 @@ const api = { if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) { const accessError = { name: 'Access Error', status: 401 }; if(req.account){ - throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId, published: stub.published }; + throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId}; } - throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId , published: stub.published}; + throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId}; } // If after all of that we still don't have a brew, throw an exception