diff --git a/.circleci/config.yml b/.circleci/config.yml index 13d339892..38b3c8249 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- - - node/install-npm + - run: sudo npm install -g npm@8.10.0 - node/install-packages: app-dir: ~/homebrewery cache-path: node_modules @@ -55,13 +55,13 @@ jobs: at: . # run tests! - - run: + - run: name: Test - Basic command: npm run test:basic - - run: + - run: name: Test - Mustache Spans command: npm run test:mustache-span - - run: + - run: name: Test - Routes command: npm run test:route @@ -71,4 +71,4 @@ workflows: - build - test: requires: - - build \ No newline at end of file + - build diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..28da2ef34 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - name: /r/Homebrewery Subreddit + url: https://www.reddit.com/r/homebrewery + about: The Homebrewery community on Reddit! + - name: Discord of Many Things + url: https://discord.gg/domt + about: "Join the conversation in the #formatting channel on DoMT!" \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..b87b267e6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,17 @@ +name: Feature Request +description: Have an idea to improve the Homebrewery? Let us know! +labels: ["feature request"] +body: + - type: markdown + attributes: + value: "We'd love to hear your idea! Please be sure to [search the current Issues](https://github.com/naturalcrit/homebrewery/issues) for any duplicate requests." + - type: textarea + id: user-request + attributes: + label: "Your idea:" + description: The best feature requests provide an explanation of the current issue and then an explanation of how it could be improved. Screenshots/images can be pasted right in as well! + validations: + required: true + - type: markdown + attributes: + value: "Please be sure to search for any close matches to your request in the GitHub Issues tracker before opening a new request, thanks!" diff --git a/.github/ISSUE_TEMPLATE/general_issue.yml b/.github/ISSUE_TEMPLATE/general_issue.yml new file mode 100644 index 000000000..18c19254e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general_issue.yml @@ -0,0 +1,55 @@ +name: General Issue +description: Report an issue unrelated to Saving +body: + - type: markdown + attributes: + value: Please include as much information as possible. + - type: dropdown + id: renderer + attributes: + label: Renderer + description: Which renderer does this issue occur on? If you are unsure, you can check the renderer in the Properties Editor (click the "i" in the Snippet Menu bar above the editor). + options: + - v3 + - Legacy + - Both + validations: + required: true + - type: dropdown + id: browser + attributes: + label: Browser + description: Which browser were you using when the issue occurred? + options: + - Chrome + - Firefox + - Edge + - Safari + - other + validations: + required: true + - type: dropdown + id: operating-system + attributes: + label: Operating System + description: Which OS were you using when the issue occurred? + options: + - Windows + - MacOS + - Linux + - other + validations: + required: true + - type: textarea + id: user-description + attributes: + label: "What happened?" + description: Please include any steps you took leading up to the issue and if you can reproduce it. Let us know what you expected to happen, and what did happen. + validations: + required: true + - type: textarea + id: code + attributes: + label: Code + description: Paste in any relevant code snippet below. + render: gfm \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/save_issue.yml b/.github/ISSUE_TEMPLATE/save_issue.yml new file mode 100644 index 000000000..c08f485ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/save_issue.yml @@ -0,0 +1,26 @@ +name: Saving Issue +description: Report an issue Saving +labels: ["Saving"] +body: + - type: markdown + attributes: + value: | + Woops, sorry there was an issue Saving. Please add any detail you can to this report and check back soon! + - type: textarea + id: error-code + attributes: + label: Error Code + render: shell + - type: textarea + id: user-description + attributes: + label: "Your description of what happened:" + validations: + required: true + - type: markdown + attributes: + value: | + Thanks for the report. Here are some steps that may help in the meantime: + 1. Refreshing your Google credentials in Homebrewery by signing out, and back in (they expire after one year). + 2. Waiting a few minutes and trying again - sometimes there is just a momentary blip in the server. + 3. Check the Issues in Github or the /r/homebrewery subreddit to see if others are experiencing the same issue. diff --git a/.gitignore b/.gitignore index 2f081e2dc..ecd6009b6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ config/docker.* todo.md startDB.bat startMViewer.bat +.vscode diff --git a/changelog.md b/changelog.md index fbf376035..74c8dba99 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ ```css h5 { font-size: .35cm !important; + margin-top: 0.3cm; } .page ul ul { @@ -14,6 +15,11 @@ h5 { filter: brightness(1.1) drop-shadow(1px 2px 1px #222); } +.taskList ul { + margin-bottom: 0px; + margin-top: 0px; +} + .taskList li input[checked] { filter: sepia(100%) hue-rotate(60deg) saturate(3.5) contrast(4) brightness(1.1) drop-shadow(1px 2px 1px #222); } @@ -39,6 +45,81 @@ pre { ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). +### Thursday 28/10/2022 - v3.3.1 +{{taskList + +##### Calculuschild + +* [x] Fixes to several broken CSS styles from v3.3.0 + +Fixes issues [#2468](https://github.com/naturalcrit/homebrewery/issues/2468) + +##### Jeddai + +* [x] Reduce size of thumbnails on social media links + +}} + +### Friday 19/10/2022 - v3.3.0 +{{taskList + +##### Calculuschild + +* [x] Fix for tables broken by Chrome v106 + + +##### G-Ambatte: + +* [x] Fix Table of Contents broken by Chrome v106 + +Fixes issues [#2437](https://github.com/naturalcrit/homebrewery/issues/2437) + +* [x] Show brew thumbnails on user page + +Fixes issues [#2331](https://github.com/naturalcrit/homebrewery/issues/2331) + +* [x] Allow longer URLs for brew thumbnails + +Fixes issues [#2351](https://github.com/naturalcrit/homebrewery/issues/2351) + +* [x] Code no longer unfolds when inserting a snippet + +Fixes issues [#2135](https://github.com/naturalcrit/homebrewery/issues/2135) + +* [x] Fix brew settings being lost on first save + +Fixes issues [#2427](https://github.com/naturalcrit/homebrewery/issues/2427) + + +##### Gazook: + +* [x] Several updates to bug reporting and error popups + +Fixes issues [#2376](https://github.com/naturalcrit/homebrewery/issues/2376) + +* [x] Fixes to userpage search bar + +Fixes issues [#1675](https://github.com/naturalcrit/homebrewery/issues/1675), [#2353](https://github.com/naturalcrit/homebrewery/issues/2353) + +* [x] Renderer *(legacy / V3)* now shown next to page # + +Fixes issues [#1928](https://github.com/naturalcrit/homebrewery/issues/1928) + +* [x] Prevent text selection when moving divider bar + +Fixes issues [#1632](https://github.com/naturalcrit/homebrewery/issues/1632) + +* [x] Tweak Monster Stat Block coloring + +Fixes issues [#2123](https://github.com/naturalcrit/homebrewery/issues/2123) + +* [x] Added dropdown button to toggle autosave + +Fixes issues [#1546](https://github.com/naturalcrit/homebrewery/issues/1546) + +}} + + ### Friday 08/09/2022 - v3.2.2 {{taskList diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index a8435cde5..654806886 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -109,7 +109,12 @@ const BrewRenderer = createClass({ renderPageInfo : function(){ return
- {this.state.viewablePageNumber + 1} / {this.state.pages.length} +
+ {this.props.renderer} +
+
+ {this.state.viewablePageNumber + 1} / {this.state.pages.length} +
; }, @@ -117,7 +122,7 @@ const BrewRenderer = createClass({ if(!this.state.usePPR) return; return
- Partial Page Renderer enabled, because your brew is so large. May effect rendering. + Partial Page Renderer is enabled, because your brew is so large. May affect rendering.
; }, diff --git a/client/homebrew/brewRenderer/brewRenderer.less b/client/homebrew/brewRenderer/brewRenderer.less index abb80fc5f..bde91c92e 100644 --- a/client/homebrew/brewRenderer/brewRenderer.less +++ b/client/homebrew/brewRenderer/brewRenderer.less @@ -21,11 +21,17 @@ right : 17px; bottom : 0; z-index : 1000; - padding : 8px 10px; background-color : #333; font-size : 10px; font-weight : 800; color : white; + div { + display: inline-block; + padding : 8px 10px; + &:not(:last-child){ + border-right: 1px solid #666; + } + } } .ppr_msg{ position : absolute; diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index de3a53a36..965b42873 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -19,11 +19,6 @@ const DEFAULT_STYLE_TEXT = dedent` color: black; }`; -const splice = function(str, index, inject){ - return str.slice(0, index) + inject + str.slice(index); -}; - - const Editor = createClass({ displayName : 'Editor', @@ -80,19 +75,7 @@ const Editor = createClass({ }, handleInject : function(injectText){ - let text; - if(this.isText()) text = this.props.brew.text; - if(this.isStyle()) text = this.props.brew.style ?? DEFAULT_STYLE_TEXT; - - const lines = text.split('\n'); - const cursorPos = this.refs.codeEditor.getCursorPosition(); - lines[cursorPos.line] = splice(lines[cursorPos.line], cursorPos.ch, injectText); - - const injectLines = injectText.split('\n'); - this.refs.codeEditor.setCursorPosition(cursorPos.line + injectLines.length, cursorPos.ch + injectLines[injectLines.length - 1].length); - - if(this.isText()) this.props.onTextChange(lines.join('\n')); - if(this.isStyle()) this.props.onStyleChange(lines.join('\n')); + this.refs.codeEditor?.injectText(injectText, false); }, handleViewChange : function(newView){ @@ -154,9 +137,17 @@ const Editor = createClass({ codeMirror.addLineClass(lineNumber, 'text', 'columnSplit'); } + // Highlight injectors {style} + if(line.includes('{') && line.includes('}')){ + const regex = /(?rule(e.target.value)).filter(Boolean); + + // if no validation rules, save to props + if(validationErr.length === 0){ + e.target.setCustomValidity(''); + this.props.onChange({ + ...this.props.metadata, + [name] : e.target.value + }); + } else { + // if validation issues, display built-in browser error popup with each error. + console.log(validationErr); + const errMessage = validationErr.map((err)=>{ + return `- ${err}`; + }).join('\n'); + e.target.setCustomValidity(errMessage); + e.target.reportValidity(); + }; }, + handleSystem : function(system, e){ if(e.target.checked){ this.props.metadata.systems.push(system); @@ -64,6 +85,7 @@ const MetadataEditor = createClass({ } this.props.onChange(this.props.metadata); }, + handleRenderer : function(renderer, e){ if(e.target.checked){ this.props.metadata.renderer = renderer; @@ -228,24 +250,28 @@ const MetadataEditor = createClass({
this.handleFieldChange('title', e)} />
-
- -