Skip to content

Commit

Permalink
Merge branch 'naturalcrit:master' into addUserInfo-naturalcrit#1908
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ambatte committed Dec 21, 2022
2 parents 30744c0 + 02c0176 commit ad3dc33
Show file tree
Hide file tree
Showing 11 changed files with 1,199 additions and 1,071 deletions.
94 changes: 90 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
```css
h5 {
font-size: .35cm !important;
margin-top: 0.3cm;
}

.page ul ul {
margin-left: 0px;
}

.page .taskList {
display:block;
break-inside:auto;
}

.taskList li input {
list-style-type : none;
margin-left : -0.52cm;
Expand Down Expand Up @@ -36,15 +40,96 @@ pre {
margin-top : 0.1cm;
}

.page ul + h5 {
margin-top: 0.25cm;
}

.page p + h5 {
margin-top: 0.25cm;
}

.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).

### Saturday 10/12/2022 - v3.4.2
{{taskList

##### Jeddai

* [x] Fix broken tags editor

* [x] Reduce server load to fix some saving issues

Fixes issues [#2322](https://github.com/naturalcrit/homebrewery/issues/2322)

##### G-Ambatte

* [x] Account page help link for Google Drive errors

Fixes issues [#2520](https://github.com/naturalcrit/homebrewery/issues/2520)
}}

### Monday 05/12/2022 - v3.4.1
{{taskList

##### G-Ambatte

* [x] Fix Account page incorrect last login time

Fixes issues [#2521](https://github.com/naturalcrit/homebrewery/issues/2521)

##### Gazook

* [x] Fix crashing on iOS and Safari browsers

Fixes issues [#2531](https://github.com/naturalcrit/homebrewery/issues/2531)
}}

### Monday 28/11/2022 - v3.4.0
{{taskList

##### G-Ambatte

* [x] Fix for Chrome v108 handling of page size

Fixes issues [#2445](https://github.com/naturalcrit/homebrewery/issues/2445), [#2516](https://github.com/naturalcrit/homebrewery/issues/2516)

* [x] New account page with some user info, at {{openSans **USERNAME {{fa,fa-user}} → ACCOUNT {{fa,fa-user}}**}}

Fixes issues [#2049](https://github.com/naturalcrit/homebrewery/issues/2049), [#2043](https://github.com/naturalcrit/homebrewery/issues/2043)

* [x] Fix "Published/Private Brews" buttons on userpage

Fixes issues [#2449](https://github.com/naturalcrit/homebrewery/issues/2449)

##### Gazook

* [x] Make autosave default on for new users

* [x] Added link to our FAQ at {{openSans **NEED HELP? {{fa,fa-question-circle}} → FAQ {{fa,fa-question-circle}}**}}

* [x] Fix curly blocks freezing with long property lists

Fixes issues [#2393](https://github.com/naturalcrit/homebrewery/issues/2393)

* [x] Items can now be removed from {{openSans **RECENT BREWS** {{fas,fa-history}} }}

Fixes issues [#1918](https://github.com/naturalcrit/homebrewery/issues/1918)

* [x] Curly injector syntax `{blue}` highlighting in editor

Fixes issues [#1670](https://github.com/naturalcrit/homebrewery/issues/1670)

}}

### Thursday 28/10/2022 - v3.3.1
{{taskList

Expand Down Expand Up @@ -90,7 +175,6 @@ Fixes issues [#2135](https://github.com/naturalcrit/homebrewery/issues/2135)

Fixes issues [#2427](https://github.com/naturalcrit/homebrewery/issues/2427)


##### Gazook:

* [x] Several updates to bug reporting and error popups
Expand Down Expand Up @@ -140,6 +224,10 @@ Fixes issues [#2317](https://github.com/naturalcrit/homebrewery/issues/2317), [
Fixes issues: [#1797](https://github.com/naturalcrit/homebrewery/issues/1797), [#2315](https://github.com/naturalcrit/homebrewery/issues/2315), [#2326](https://github.com/naturalcrit/homebrewery/issues/2326), [#2328](https://github.com/naturalcrit/homebrewery/issues/2328)
}}



\page

### Wednesday 31/08/2022 - v3.2.1
{{taskList

Expand All @@ -166,8 +254,6 @@ Fixes issues [#2317](https://github.com/naturalcrit/homebrewery/issues/2317), [
Fixes issues: [#2301](https://github.com/naturalcrit/homebrewery/issues/2301), [#2303](https://github.com/naturalcrit/homebrewery/issues/2303), [#2121](https://github.com/naturalcrit/homebrewery/issues/2121)
}}

\page

### Saturday 27/08/2022 - v3.2.0
{{taskList

Expand Down
4 changes: 2 additions & 2 deletions client/homebrew/editor/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ const Editor = createClass({

// Highlight injectors {style}
if(line.includes('{') && line.includes('}')){
const regex = /(?<!{){(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g;
const regex = /(?:^|[^{\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\2})/gm;
let match;
while ((match = regex.exec(line)) != null) {
codeMirror.markText({ line: lineNumber, ch: match.index }, { line: lineNumber, ch: match.index + match[0].length }, { className: 'injection' });
codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length }, { className: 'injection' });
}
}
// Highlight inline spans {{content}}
Expand Down
19 changes: 11 additions & 8 deletions client/homebrew/editor/metadataEditor/metadataEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ const Nav = require('naturalcrit/nav/nav.jsx');
const StringArrayEditor = require('../stringArrayEditor/stringArrayEditor.jsx');

const Themes = require('themes/themes.json');
const validations = require('./validations.js')
const validations = require('./validations.js');

const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder'];

const homebreweryThumbnail = require('../../thumbnail.png');

const callIfExists = (val, fn, ...args)=>{
if(val[fn]) {
val[fn](...args);
}
};

const MetadataEditor = createClass({
displayName : 'MetadataEditor',
getDefaultProps : function() {
Expand Down Expand Up @@ -53,28 +59,25 @@ const MetadataEditor = createClass({
},

handleFieldChange : function(name, e){
e.persist();

// load validation rules, and check input value against them
const inputRules = validations[name] ?? [];
const validationErr = inputRules.map((rule)=>rule(e.target.value)).filter(Boolean);

// if no validation rules, save to props
if(validationErr.length === 0){
e.target.setCustomValidity('');
callIfExists(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();
};
callIfExists(e.target, 'setCustomValidity', errMessage);
callIfExists(e.target, 'reportValidity');
}
},

handleSystem : function(system, e){
Expand Down
9 changes: 6 additions & 3 deletions client/homebrew/pages/accountPage/accountPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const AccountPage = createClass({
},

renderUiItems : function() {
// console.log(this.props.uiItems);
return <>
<div className='dataGroup'>
<h1>Account Information <i className='fas fa-user'></i></h1>
Expand All @@ -51,12 +50,16 @@ const AccountPage = createClass({
</div>
<div className='dataGroup'>
<h3>Homebrewery Information <NaturalCritIcon /></h3>
<p><strong>Brews on Homebrewery: </strong> {this.props.uiItems.mongoCount || '-'}</p>
<p><strong>Brews on Homebrewery: </strong> {this.props.uiItems.mongoCount}</p>
</div>
<div className='dataGroup'>
<h3>Google Information <i className='fab fa-google-drive'></i></h3>
<p><strong>Linked to Google: </strong> {this.props.uiItems.googleId ? 'YES' : 'NO'}</p>
{this.props.uiItems.googleId ? <p><strong>Brews on Google Drive: </strong> {this.props.uiItems.fileCount || '-'}</p> : '' }
{this.props.uiItems.googleId &&
<p>
<strong>Brews on Google Drive: </strong> {this.props.uiItems.googleCount ?? <>Unable to retrieve files - <a href='https://github.com/naturalcrit/homebrewery/discussions/1580'>follow these steps to renew your Google credentials.</a></>}
</p>
}
</div>
</>;
},
Expand Down
Loading

0 comments on commit ad3dc33

Please sign in to comment.