From 934c77cee907bf1c6cff26950641857b20e4cc0d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:12:52 +1300 Subject: [PATCH 01/30] Test CircleCI config changes --- .circleci/config.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bf986cca..9e95deea5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ # # Check https://circleci.com/docs/2.0/language-javascript/ for more details # -version: 2 +version: 2.1 jobs: build: docker: @@ -21,12 +21,33 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- - - run: npm install + - node/install-npm + - node/install-packages - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} + - persist_to_workspace: + root: . + paths: + - . + + test: + steps: + - attach_workspace: + at: . + # run tests! - - run: npm run circleci + - run: + name: Tests + command: npm run circleci + +workflows: + build_and_test: + jobs: + - build + - test: + requires: + - build \ No newline at end of file From 9178d061ff0e5029d2de4f5dcae92252bd8ad1c3 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:14:41 +1300 Subject: [PATCH 02/30] Fix config --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e95deea5..b29198936 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,12 @@ jobs: - . test: + docker: + - image: circleci/node:16.10.0 + - image: circleci/mongo:4.4 + + working_directory: ~/repo + steps: - attach_workspace: at: . From 27530053867f963055de786bb62e289d4315ed4d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:16:16 +1300 Subject: [PATCH 03/30] Add orb to CircleCI config --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b29198936..7becf4cce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,10 @@ # Check https://circleci.com/docs/2.0/language-javascript/ for more details # version: 2.1 + +orbs: + node: circleci/node@3.0.0 + jobs: build: docker: From 8533240407fa84f98f73c57dbc50449acda7ffa0 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:18:59 +1300 Subject: [PATCH 04/30] Add executor to config --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7becf4cce..8190dccda 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,7 @@ jobs: - image: circleci/mongo:4.4 working_directory: ~/repo + executor: node/default steps: - checkout From 03e5d86b735fed82554d63eee51cca9c135cf3dc Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:20:49 +1300 Subject: [PATCH 05/30] Add NPM settings --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8190dccda..67fb6261e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,10 @@ jobs: - v1-dependencies- - node/install-npm - - node/install-packages + - node/install-packages: + app-dir: ~/homebrewery + cache-path: node_modules + overrise-ci-command: npm i - save_cache: paths: From 06598e0665a9e0b50d501fe6c2a1c9a532579e5d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:21:51 +1300 Subject: [PATCH 06/30] Fix typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67fb6261e..e1e316fe9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ jobs: - node/install-packages: app-dir: ~/homebrewery cache-path: node_modules - overrise-ci-command: npm i + override-ci-command: npm i - save_cache: paths: From 0a90218d2aa1333d48472164abbc8721497ab49e Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:27:08 +1300 Subject: [PATCH 07/30] Fix for missing package.json --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1e316fe9..45cde9c41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,8 @@ jobs: executor: node/default steps: - - checkout + - checkout: + path: ~/repo/homebrewery # Download and cache dependencies - restore_cache: @@ -28,7 +29,7 @@ jobs: - node/install-npm - node/install-packages: - app-dir: ~/homebrewery + app-dir: ~/repo/homebrewery cache-path: node_modules override-ci-command: npm i From 8800397ba4ca8d0eb565765d510c2ed410c101d9 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:31:26 +1300 Subject: [PATCH 08/30] Working directory changes --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45cde9c41..62151d5b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,12 +13,12 @@ jobs: - image: circleci/node:16.10.0 - image: circleci/mongo:4.4 - working_directory: ~/repo + working_directory: ~/homebrewery executor: node/default steps: - checkout: - path: ~/repo/homebrewery + path: ~/homebrewery # Download and cache dependencies - restore_cache: @@ -29,7 +29,7 @@ jobs: - node/install-npm - node/install-packages: - app-dir: ~/repo/homebrewery + app-dir: ~/homebrewery cache-path: node_modules override-ci-command: npm i @@ -48,7 +48,7 @@ jobs: - image: circleci/node:16.10.0 - image: circleci/mongo:4.4 - working_directory: ~/repo + working_directory: ~/homebrewery steps: - attach_workspace: From 274b3bcb7e43cdaa66f0b7ddc057e06a0779f0ef Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:34:32 +1300 Subject: [PATCH 09/30] Add parallelism parameter --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62151d5b4..377c6bcb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,7 @@ jobs: - image: circleci/mongo:4.4 working_directory: ~/homebrewery + parallelism: 4 steps: - attach_workspace: From 4134e43f6e4b9bd47c33b639ff1077305e0f0ad8 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 11:58:19 +1300 Subject: [PATCH 10/30] Change test to verbose mode --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 377c6bcb7..6b12ab3e5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: # run tests! - run: name: Tests - command: npm run circleci + command: npm run circleci --verbose workflows: build_and_test: From 9535fea96486f31fd3b93d7f95afc1c7dc5e89fd Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 22 Mar 2022 12:03:26 +1300 Subject: [PATCH 11/30] Revert change to verbose --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b12ab3e5..377c6bcb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: # run tests! - run: name: Tests - command: npm run circleci --verbose + command: npm run circleci workflows: build_and_test: From b17f173e03c75ed8a4bcf760165207ae8430cbbb Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Mon, 21 Mar 2022 22:02:44 -0500 Subject: [PATCH 12/30] Unset `:first-line` small-caps rule with drop-cap --- client/homebrew/editor/snippetbar/snippets/snippets.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 7b008fe1e..af8393046 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -97,7 +97,10 @@ module.exports = [ gen : dedent`/* Removes Drop Caps */ .page h1+p:first-letter { all: unset; - }\n\n` + }\n\n + .page h1+p:first-line { + all: unset; + }` }, { name : 'Tweak Drop Cap', From 58815a391018b10ce0936c03e5910e9bf9ba4351 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Mon, 21 Mar 2022 22:09:45 -0500 Subject: [PATCH 13/30] add descriptive css comment --- client/homebrew/editor/snippetbar/snippets/snippets.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index af8393046..10920a564 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -98,6 +98,7 @@ module.exports = [ .page h1+p:first-letter { all: unset; }\n\n + /* Removes Small-Caps in first line */ .page h1+p:first-line { all: unset; }` From 7aa0aed7c945b564244a010443269f9b4d592a8b Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 14:38:19 +1300 Subject: [PATCH 14/30] Add individual tests to package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 477cd5b65..b03bee513 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,9 @@ "verify": "npm run lint && npm test", "test": "jest", "test:dev": "jest --verbose --watch", + "test:basic": "jest tests/markdown/basic.test.js --verbose", + "test:mustache-span": "jest tests/markdown/mustache-span.test.js --verbose", + "test:route": "jest tests/routes/static-pages.test.js --verbose", "phb": "node scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run buildall", From eaf8b02aa9d541f7f4b8db2f68c3c8f24306192b Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 14:38:50 +1300 Subject: [PATCH 15/30] Update circleCi config to use new tests --- .circleci/config.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 377c6bcb7..ddfb08d96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,8 +57,14 @@ jobs: # run tests! - run: - name: Tests - command: npm run circleci + name: Test - Basic + command: npm run test:basic + - run: + name: Test - Mustache Spans + command: npm run test:mustache-span + - run: + name: Test - Routes + command: npm run test:route workflows: build_and_test: From 5ed6e9842c66b96ddba8e686310e136e5b92b8f2 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 14:39:14 +1300 Subject: [PATCH 16/30] Add 10s delay to route test start --- tests/routes/static-pages.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/routes/static-pages.test.js b/tests/routes/static-pages.test.js index e69706f56..1202ac8f6 100644 --- a/tests/routes/static-pages.test.js +++ b/tests/routes/static-pages.test.js @@ -1,5 +1,10 @@ const supertest = require('supertest'); +const start = Date.now(); +console.log(`START DELAY ${Date.now().toString()}`); +while (Date.now() < start + 10000){}; +console.log(`END DELAY ${Date.now().toString()}`); + // Mimic https responses to avoid being redirected all the time const app = supertest.agent(require('app.js').app) .set('X-Forwarded-Proto', 'https'); From aa7b3d985f42024feec3b22713d71c1b16bb11c4 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 14:50:30 +1300 Subject: [PATCH 17/30] Move test setup to BEFORE delay --- tests/routes/static-pages.test.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/routes/static-pages.test.js b/tests/routes/static-pages.test.js index 1202ac8f6..769cffbb9 100644 --- a/tests/routes/static-pages.test.js +++ b/tests/routes/static-pages.test.js @@ -1,14 +1,13 @@ const supertest = require('supertest'); -const start = Date.now(); -console.log(`START DELAY ${Date.now().toString()}`); -while (Date.now() < start + 10000){}; -console.log(`END DELAY ${Date.now().toString()}`); - // Mimic https responses to avoid being redirected all the time const app = supertest.agent(require('app.js').app) .set('X-Forwarded-Proto', 'https'); +const timeout = 10000; //ms +const start = Date.now(); +while (Date.now() < start + timeout){}; + describe('Tests for static pages', ()=>{ it('Home page works', ()=>{ return app.get('/').expect(200); From f246c96b2855b762c74486c401185aee102ef9c6 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 15:00:33 +1300 Subject: [PATCH 18/30] Remove 10s delay for diagnostics --- tests/routes/static-pages.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/routes/static-pages.test.js b/tests/routes/static-pages.test.js index 769cffbb9..cb4ce6953 100644 --- a/tests/routes/static-pages.test.js +++ b/tests/routes/static-pages.test.js @@ -4,9 +4,9 @@ const supertest = require('supertest'); const app = supertest.agent(require('app.js').app) .set('X-Forwarded-Proto', 'https'); -const timeout = 10000; //ms -const start = Date.now(); -while (Date.now() < start + timeout){}; +// const timeout = 10000; //ms +// const start = Date.now(); +// while (Date.now() < start + timeout){}; describe('Tests for static pages', ()=>{ it('Home page works', ()=>{ From b0d8462a604521a5424a9a60afd7142e0fc35e57 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 15:06:26 +1300 Subject: [PATCH 19/30] Remove MongoDB from testing, update Node image --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ddfb08d96..057cf9cb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ orbs: jobs: build: docker: - - image: circleci/node:16.10.0 + - image: circleci/node:16.11.0 - image: circleci/mongo:4.4 working_directory: ~/homebrewery @@ -45,8 +45,7 @@ jobs: test: docker: - - image: circleci/node:16.10.0 - - image: circleci/mongo:4.4 + - image: circleci/node:16.11.0 working_directory: ~/homebrewery parallelism: 4 From c0c08b33548b51d109c25f380586ff8c097e4abc Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 15:08:37 +1300 Subject: [PATCH 20/30] Fix new Node image location --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 057cf9cb4..04fefade1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ orbs: jobs: build: docker: - - image: circleci/node:16.11.0 + - image: cimg/node:16.11.0 - image: circleci/mongo:4.4 working_directory: ~/homebrewery @@ -45,7 +45,7 @@ jobs: test: docker: - - image: circleci/node:16.11.0 + - image: cimg/node:16.11.0 working_directory: ~/homebrewery parallelism: 4 From 2be365c83945a78ff92cd95cc7b3c4fe4d3a8d8b Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 16:12:33 +1300 Subject: [PATCH 21/30] Shift global declarations to `componentDidMount` --- client/homebrew/homebrew.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 54dcf2206..c0b4fe4b4 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -32,7 +32,7 @@ const Homebrew = createClass({ } }; }, - componentWillMount : function() { + componentDidMount : function() { global.account = this.props.account; global.version = this.props.version; global.enable_v3 = this.props.enable_v3; From 77e8952e8a55bd0b5880d329587648f7df4b5d60 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Mar 2022 16:40:41 +1300 Subject: [PATCH 22/30] Shift componentWillMount call to getInitialState --- client/homebrew/homebrew.jsx | 7 +++++-- client/homebrew/navbar/navbar.jsx | 10 ++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index c0b4fe4b4..094b96744 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -32,11 +32,14 @@ const Homebrew = createClass({ } }; }, - componentDidMount : function() { - global.account = this.props.account; + + getInitialState : function(){ global.version = this.props.version; + global.account = this.props.account; global.enable_v3 = this.props.enable_v3; + return {}; }, + render : function (){ return ( diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index b3255db45..7929bb5e2 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -14,12 +14,10 @@ const Navbar = createClass({ }; }, - componentDidMount : function() { - //const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); - this.setState({ - //showNonChromeWarning : !isChrome, - ver : window.version - }); + getInitialState : function() { + return { + ver : global.version + }; }, /* From 42ee461f56da1f73a5aaeff090d950f7ef952602 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sat, 26 Mar 2022 20:55:50 +1300 Subject: [PATCH 23/30] Remove commented out delay --- tests/routes/static-pages.test.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/routes/static-pages.test.js b/tests/routes/static-pages.test.js index cb4ce6953..e69706f56 100644 --- a/tests/routes/static-pages.test.js +++ b/tests/routes/static-pages.test.js @@ -4,10 +4,6 @@ const supertest = require('supertest'); const app = supertest.agent(require('app.js').app) .set('X-Forwarded-Proto', 'https'); -// const timeout = 10000; //ms -// const start = Date.now(); -// while (Date.now() < start + timeout){}; - describe('Tests for static pages', ()=>{ it('Home page works', ()=>{ return app.get('/').expect(200); From 7403ef60c13427f53e5a3d43491d499a3cbcc96c Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sat, 26 Mar 2022 20:56:04 +1300 Subject: [PATCH 24/30] Increase test timeout via Jest config --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b03bee513..b207ceb2e 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "build/*" ], "jest": { + "testTimeout" : 15000, "modulePaths": [ "mode_modules", "shared", From 57d0e8eea3746875e08931f053107d55dfd0c850 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sat, 26 Mar 2022 21:13:06 +1300 Subject: [PATCH 25/30] Test standard Docker MongoDB image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 04fefade1..13d339892 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: build: docker: - image: cimg/node:16.11.0 - - image: circleci/mongo:4.4 + - image: mongo:4.4 working_directory: ~/homebrewery executor: node/default From 6c85d0f35aea1eea349309a898d6d543b72a0fb5 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 27 Mar 2022 23:16:37 -0400 Subject: [PATCH 26/30] Update version to v3.0.8 --- changelog.md | 34 +++++++++++++++++++++++++++++++++- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 34c832f9c..9fed601f8 100644 --- a/changelog.md +++ b/changelog.md @@ -29,11 +29,43 @@ pre { .page p + pre { margin-top : 0.1cm; } + +.page .openSans { + font-family: 'Open Sans'; + font-size: 0.9em; +} ``` ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). +### Wednesday 27/03/2022 - v3.0.8 +{{taskList +* [x] Style updates to user page. + +* [x] Added a logout button (finally)! You can find it under {{openSans **USERNAME {{fa,fa-user}} → LOGOUT {{fas,fa-power-off}}**}} + + Fixes issues: [#303](https://github.com/naturalcrit/homebrewery/issues/303) + +* [x] Clarified the default text when submitting an issue via Reddit post. + +* [x] Fixed broken Table of Contents links in PDFs. (Thanks lucastucious!) + + Fixes issues: [#1749](https://github.com/naturalcrit/homebrewery/issues/1749) + +* [x] Fixed window resizing causing the edit page divider to get lost off of the edge of the page. + + Fixes issues: [#2053](https://github.com/naturalcrit/homebrewery/issues/2053) + +* [x] Fixed Class Table decorations overlapping main text. + + Fixes issues: [#1985](https://github.com/naturalcrit/homebrewery/issues/1985) + +* [x] Updated {{openSans **STYLE EDITOR {{fa,fa-pencil-alt}} → REMOVE DROP CAP {{fas,fa-remove-format}}**}} snippet to also remove small-caps first line font. + +* [x] Background work in preparation for brew themes. +}} + ### Wednesday 02/02/2022 - v3.0.7 {{taskList * [x] Revert active line highlighting. @@ -50,7 +82,7 @@ For a full record of development, visit our [Github Page](https://github.com/nat Fixes issues: [#1943](https://github.com/naturalcrit/homebrewery/issues/1943) -* [x] Added a Legacy to V3 migration guide under **NEED HELP? {{fa,fa-question-circle}} → MIGRATE {{fas,fa-file-import}}** +* [x] Added a Legacy to V3 migration guide under {{openSans **NEED HELP? {{fa,fa-question-circle}} → MIGRATE {{fas,fa-file-import}}**}} * [x] Background refactoring and unit tests. }} diff --git a/package-lock.json b/package-lock.json index 59cc94b9c..1ccd615cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "homebrewery", - "version": "3.0.7", + "version": "3.0.8", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "3.0.7", + "version": "3.0.8", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -23150,4 +23150,4 @@ "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==" } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 2f95cea2a..a6f25b0ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebrewery", "description": "Create authentic looking D&D homebrews using only markdown", - "version": "3.0.7", + "version": "3.0.8", "engines": { "node": "16.11.x" }, From e9cf7be488a44ccefc12a05414144ee2cdba92f3 Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Mon, 28 Mar 2022 20:43:45 -0500 Subject: [PATCH 27/30] add asyncHandler to async methods in routes --- server/homebrew.api.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 6faa69719..4415c948b 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -5,6 +5,7 @@ const zlib = require('zlib'); const GoogleActions = require('./googleActions.js'); const Markdown = require('../shared/naturalcrit/markdown.js'); const yaml = require('js-yaml'); +const asyncHandler = require('express-async-handler'); // const getTopBrews = (cb) => { // HomebrewModel.find().sort({ views: -1 }).limit(5).exec(function(err, brews) { @@ -226,10 +227,10 @@ const deleteGoogleBrew = async (account, id, res)=>{ return true; }; -router.post('/api', newBrew); -router.put('/api/:id', updateBrew); -router.put('/api/update/:id', updateBrew); -router.delete('/api/:id', deleteBrew); -router.get('/api/remove/:id', deleteBrew); +router.post('/api', asyncHandler(newBrew)); +router.put('/api/:id', asyncHandler(updateBrew)); +router.put('/api/update/:id', asyncHandler(updateBrew)); +router.delete('/api/:id', asyncHandler(deleteBrew)); +router.get('/api/remove/:id', asyncHandler(deleteBrew)); module.exports = router; From 89dbd19556e7040a95731aa4bf0bab73665dd518 Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Tue, 29 Mar 2022 11:46:50 -0500 Subject: [PATCH 28/30] update response handling for saving google brews --- client/homebrew/pages/editPage/editPage.jsx | 38 ++++++++++----------- client/homebrew/pages/newPage/newPage.jsx | 38 ++++++++++----------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index fa985b7bf..ce9d73869 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -276,26 +276,26 @@ const EditPage = createClass({ console.log(errMsg); } catch (e){} - if(this.state.errors.status == '401'){ - return - Oops! -
- You must be signed in to a Google account - to save this to
Google Drive!
- -
- Sign In -
-
-
- Not Now -
-
-
; - } + // if(this.state.errors.status == '401'){ + // return + // Oops! + //
+ // You must be signed in to a Google account + // to save this to
Google Drive!
+ // + //
+ // Sign In + //
+ //
+ //
+ // Not Now + //
+ //
+ //
; + // } - if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){ + if(this.state.errors.response.req.url.match(/^\/api\/.*transfer.*$/m)){ return Oops!
diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index b57da013a..befc53a89 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -187,26 +187,26 @@ const NewPage = createClass({ console.log(errMsg); } catch (e){} - if(this.state.errors.status == '401'){ - return - Oops! -
- You must be signed in to a Google account - to save this to
Google Drive!
- -
- Sign In -
-
-
- Not Now -
-
-
; - } + // if(this.state.errors.status == '401'){ + // return + // Oops! + //
+ // You must be signed in to a Google account + // to save this to
Google Drive!
+ // + //
+ // Sign In + //
+ //
+ //
+ // Not Now + //
+ //
+ //
; + // } - if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){ + if(this.state.errors.response.req.url.match(/^\/api\/.*transfer.*$/m)){ return Oops!
From c17db043ba775b93c66b40d4f6d5e506e53c3b37 Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Tue, 29 Mar 2022 11:54:15 -0500 Subject: [PATCH 29/30] remove extra slash in regex --- client/homebrew/pages/editPage/editPage.jsx | 2 +- client/homebrew/pages/newPage/newPage.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index ce9d73869..a77321e6f 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -295,7 +295,7 @@ const EditPage = createClass({ // ; // } - if(this.state.errors.response.req.url.match(/^\/api\/.*transfer.*$/m)){ + if(this.state.errors.response.req.url.match(/^\/api.*Google.*$/m)){ return Oops!
diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index befc53a89..cb8378bdd 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -206,7 +206,7 @@ const NewPage = createClass({ // ; // } - if(this.state.errors.response.req.url.match(/^\/api\/.*transfer.*$/m)){ + if(this.state.errors.response.req.url.match(/^\/api.*Google.*$/m)){ return Oops!
From e610c12b2ad84b2af93ab3b484fbcda0d75154eb Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Wed, 30 Mar 2022 10:24:25 -0500 Subject: [PATCH 30/30] update logout logic --- client/homebrew/navbar/account.navitem.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/homebrew/navbar/account.navitem.jsx b/client/homebrew/navbar/account.navitem.jsx index ebff531b6..be92cea92 100644 --- a/client/homebrew/navbar/account.navitem.jsx +++ b/client/homebrew/navbar/account.navitem.jsx @@ -23,9 +23,17 @@ const Account = createClass({ // Reset divider position window.localStorage.removeItem('naturalcrit-pane-split'); // Clear login cookie - document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;samesite=lax;${window.domain ? `domain=${window.domain}` : ''}`; + let domain = ''; + if(window.location?.hostname) { + let domainArray = window.location.hostname.split('.'); + if(domainArray.length > 2){ + domainArray = [''].concat(domainArray.slice(-2)); + } + domain = domainArray.join('.'); + } + document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;samesite=lax;${domain ? `domain=${domain}` : ''}`; window.location = '/'; - }; + } }, render : function(){