0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 04:02:44 +00:00

Merge branch 'master' into SaveDiffs

This commit is contained in:
Trevor Buckner
2025-07-07 15:07:44 -04:00
committed by GitHub
5 changed files with 2169 additions and 2382 deletions

View File

@@ -5,6 +5,15 @@ updates:
schedule: schedule:
interval: daily interval: daily
open-pull-requests-limit: 99 open-pull-requests-limit: 99
groups:
dev-dependencies:
dependency-type: "development"
patterns: ["*"]
update-types: ["patch", "minor"]
prod-dependencies:
dependency-type: "production"
patterns: ["*"]
update-types: ["patch", "minor"]
ignore: ignore:
- dependency-name: eslint - dependency-name: eslint
versions: versions:

View File

@@ -48,7 +48,7 @@ const EditPage = createClass({
return { return {
brew : this.props.brew, brew : this.props.brew,
isSaving : false, isSaving : false,
isPending : false, unsavedChanges : false,
alertTrashedGoogleBrew : this.props.brew.trashed, alertTrashedGoogleBrew : this.props.brew.trashed,
alertLoginToTransfer : false, alertLoginToTransfer : false,
saveGoogle : this.props.brew.googleId ? true : false, saveGoogle : this.props.brew.googleId ? true : false,
@@ -86,7 +86,7 @@ const EditPage = createClass({
}); });
window.onbeforeunload = ()=>{ window.onbeforeunload = ()=>{
if(this.state.isSaving || this.state.isPending){ if(this.state.isSaving || this.state.unsavedChanges){
return 'You have unsaved changes!'; return 'You have unsaved changes!';
} }
}; };
@@ -105,9 +105,9 @@ const EditPage = createClass({
}, },
componentDidUpdate : function(){ componentDidUpdate : function(){
const hasChange = this.hasChanges(); const hasChange = this.hasChanges();
if(this.state.isPending != hasChange){ if(this.state.unsavedChanges != hasChange){
this.setState({ this.setState({
isPending : hasChange unsavedChanges : hasChange
}); });
} }
}, },
@@ -157,9 +157,9 @@ const EditPage = createClass({
if(htmlErrors.length) htmlErrors = Markdown.validate(snippet); if(htmlErrors.length) htmlErrors = Markdown.validate(snippet);
this.setState((prevState)=>({ this.setState((prevState)=>({
brew : { ...prevState.brew, snippets: snippet }, brew : { ...prevState.brew, snippets: snippet },
isPending : true, unsavedChanges : true,
htmlErrors : htmlErrors, htmlErrors : htmlErrors,
}), ()=>{if(this.state.autoSave) this.trySave();}); }), ()=>{if(this.state.autoSave) this.trySave();});
}, },
@@ -294,10 +294,10 @@ const EditPage = createClass({
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`); history.replaceState(null, null, `/edit/${this.savedBrew.editId}`);
this.setState(()=>({ this.setState(()=>({
brew : this.savedBrew, brew : this.savedBrew,
isPending : false, unsavedChanges : false,
isSaving : false, isSaving : false,
unsavedTime : new Date() unsavedTime : new Date()
})); }));
}, },
@@ -356,7 +356,7 @@ const EditPage = createClass({
} }
// #2 - Unsaved changes exist, autosave is OFF and warning timer has expired, show AUTOSAVE WARNING // #2 - Unsaved changes exist, autosave is OFF and warning timer has expired, show AUTOSAVE WARNING
if(this.state.isPending && this.state.autoSaveWarning){ if(this.state.unsavedChanges && this.state.autoSaveWarning){
this.setAutosaveWarning(); this.setAutosaveWarning();
const elapsedTime = Math.round((new Date() - this.state.unsavedTime) / 1000 / 60); const elapsedTime = Math.round((new Date() - this.state.unsavedTime) / 1000 / 60);
const text = elapsedTime == 0 ? 'Autosave is OFF.' : `Autosave is OFF, and you haven't saved for ${elapsedTime} minutes.`; const text = elapsedTime == 0 ? 'Autosave is OFF.' : `Autosave is OFF, and you haven't saved for ${elapsedTime} minutes.`;
@@ -371,7 +371,7 @@ const EditPage = createClass({
// #3 - Unsaved changes exist, click to save, show SAVE NOW // #3 - Unsaved changes exist, click to save, show SAVE NOW
// Use trySave(true) instead of save() to use debounced save function // Use trySave(true) instead of save() to use debounced save function
if(this.state.isPending){ if(this.state.unsavedChanges){
return <Nav.item className='save' onClick={()=>this.trySave(true)} color='blue' icon='fas fa-save'>Save Now</Nav.item>; return <Nav.item className='save' onClick={()=>this.trySave(true)} color='blue' icon='fas fa-save'>Save Now</Nav.item>;
} }
// #4 - No unsaved changes, autosave is ON, show AUTO-SAVED // #4 - No unsaved changes, autosave is ON, show AUTO-SAVED

View File

@@ -148,7 +148,6 @@ const NewPage = createClass({
this.setState((prevState)=>({ this.setState((prevState)=>({
brew : { ...prevState.brew, snippets: snippet }, brew : { ...prevState.brew, snippets: snippet },
isPending : true,
htmlErrors : htmlErrors, htmlErrors : htmlErrors,
}), ()=>{if(this.state.autoSave) this.trySave();}); }), ()=>{if(this.state.autoSave) this.trySave();});
}, },

4479
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -84,17 +84,17 @@
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.27.1", "@babel/core": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.27.1", "@babel/plugin-transform-runtime": "^7.28.0",
"@babel/preset-env": "^7.27.2", "@babel/preset-env": "^7.28.0",
"@babel/preset-react": "^7.27.1", "@babel/preset-react": "^7.27.1",
"@babel/runtime": "^7.27.1", "@babel/runtime": "^7.27.6",
"@googleapis/drive": "^12.1.0", "@googleapis/drive": "^13.0.1",
"@sanity/diff-match-patch": "^3.2.0", "@sanity/diff-match-patch": "^3.2.0",
"body-parser": "^2.2.0", "body-parser": "^2.2.0",
"classnames": "^2.5.1", "classnames": "^2.5.1",
"codemirror": "^5.65.6", "codemirror": "^5.65.6",
"cookie-parser": "^1.4.7", "cookie-parser": "^1.4.7",
"core-js": "^3.42.0", "core-js": "^3.43.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"create-react-class": "^15.7.0", "create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3", "dedent-tabs": "^0.10.3",
@@ -111,40 +111,40 @@
"marked": "15.0.12", "marked": "15.0.12",
"marked-alignment-paragraphs": "^1.0.0", "marked-alignment-paragraphs": "^1.0.0",
"marked-definition-lists": "^1.0.1", "marked-definition-lists": "^1.0.1",
"marked-emoji": "^2.0.0", "marked-emoji": "^2.0.1",
"marked-extended-tables": "^2.0.1", "marked-extended-tables": "^2.0.1",
"marked-gfm-heading-id": "^4.0.1", "marked-gfm-heading-id": "^4.1.2",
"marked-nonbreaking-spaces": "^1.0.1", "marked-nonbreaking-spaces": "^1.0.1",
"marked-smartypants-lite": "^1.0.3", "marked-smartypants-lite": "^1.0.3",
"marked-subsuper-text": "^1.0.3", "marked-subsuper-text": "^1.0.3",
"markedLegacy": "npm:marked@^0.3.19", "markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.30.1", "moment": "^2.30.1",
"mongoose": "^8.15.0", "mongoose": "^8.16.1",
"nanoid": "5.1.5", "nanoid": "5.1.5",
"nconf": "^0.13.0", "nconf": "^0.13.0",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-frame-component": "^4.1.3", "react-frame-component": "^4.1.3",
"react-router": "^7.6.0", "react-router": "^7.6.3",
"romans": "^3.0.0", "romans": "^3.1.0",
"sanitize-filename": "1.6.3", "sanitize-filename": "1.6.3",
"superagent": "^10.2.1", "superagent": "^10.2.1",
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git",
"written-number": "^0.11.1" "written-number": "^0.11.1"
}, },
"devDependencies": { "devDependencies": {
"@stylistic/stylelint-plugin": "^3.1.2", "@stylistic/stylelint-plugin": "^3.1.3",
"babel-plugin-transform-import-meta": "^2.3.2", "babel-plugin-transform-import-meta": "^2.3.3",
"eslint": "^9.27.0", "eslint": "^9.30.1",
"eslint-plugin-jest": "^28.11.0", "eslint-plugin-jest": "^29.0.1",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"globals": "^16.1.0", "globals": "^16.3.0",
"jest": "^29.7.0", "jest": "^30.0.4",
"jest-expect-message": "^1.1.3", "jest-expect-message": "^1.1.3",
"jsdom-global": "^3.0.2", "jsdom-global": "^3.0.2",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"stylelint": "^16.19.1", "stylelint": "^16.21.1",
"stylelint-config-recess-order": "^6.0.0", "stylelint-config-recess-order": "^7.1.0",
"stylelint-config-recommended": "^16.0.0", "stylelint-config-recommended": "^16.0.0",
"supertest": "^7.1.1" "supertest": "^7.1.1"
} }