Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blocking notification to EditPage #3382

Merged
merged 48 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
963ec28
Initial functionality pass
G-Ambatte Mar 29, 2024
fde1706
Merge branch 'master' into addLockNotification-#3326
G-Ambatte Apr 20, 2024
4bc07ce
Nudge line and button spacing
G-Ambatte Apr 20, 2024
b4b4fbe
Update fixed text and add REMOVAL button (NYI)
G-Ambatte Apr 20, 2024
4c6953a
Differentiate between Edit and Share messages
G-Ambatte Apr 20, 2024
09cf5a9
Fix test
G-Ambatte Apr 20, 2024
9f31a2c
I can spell, honest
G-Ambatte Apr 20, 2024
3a054f1
Merge branch 'master' into addLockNotification-#3326
G-Ambatte May 9, 2024
10a7f34
Update lock message
G-Ambatte May 9, 2024
f6daeb4
Update error message
G-Ambatte May 9, 2024
bf38f95
Pass ID to Lock Notification
G-Ambatte May 9, 2024
632efe8
Add Share ID to lock notification
G-Ambatte May 9, 2024
2424d34
Merge branch 'master' into addLockNotification-#3326
G-Ambatte Jun 1, 2024
a6ce366
Shift NotificationPopup to shared components & update BrewRenderer ref
G-Ambatte Jun 1, 2024
9307092
Lint fix
G-Ambatte Jun 1, 2024
8685c5c
Break Dialog out of NotificationPopup, restore NotificationPopup to o…
G-Ambatte Jun 4, 2024
f3b01bc
Fix for modals
G-Ambatte Jun 4, 2024
1111d82
Tweak dismiss button styling
G-Ambatte Jun 4, 2024
e7735e2
Add closeText prop
G-Ambatte Jun 4, 2024
05ba7b4
Tweak NotificationPopup
G-Ambatte Jun 4, 2024
865c567
Change all Modal references to Dialog
G-Ambatte Jun 4, 2024
5f6d5f5
Change dismiss button to use fa-dismiss
G-Ambatte Jun 4, 2024
24e67e2
Restore Info Circle to notification
G-Ambatte Jun 4, 2024
491b38c
Small cleanup of Dialog component
calculuschild Jun 4, 2024
99ff7fd
linting
calculuschild Jun 4, 2024
7272544
Convert LockNotification.jsx to functional component
calculuschild Jun 4, 2024
ec514cd
Set local storage only if dismissKey prop exists
G-Ambatte Jun 4, 2024
423413e
Merge branch 'master' into addLockNotification-#3326
calculuschild Jun 4, 2024
31b6e0c
Show dialog when dismissKey prop is not specified
G-Ambatte Jun 5, 2024
0efcd5d
Shift LockNotification to use Dialog
G-Ambatte Jun 5, 2024
556ded9
Tweak Dialog to work with showModal and show LockNotifications
G-Ambatte Jun 6, 2024
4f4cef0
Tweak LockNotification styling
G-Ambatte Jun 6, 2024
9e041d2
Fix display property on dialog causing close() to not work
G-Ambatte Jun 6, 2024
fa7b3ea
Shift dismiss button, tweak local storage check
G-Ambatte Jun 6, 2024
38fc647
Change NotificationPopup to inline-block from block
G-Ambatte Jun 6, 2024
ed39852
Move dialog[open] to Dialog component styling
G-Ambatte Jun 6, 2024
866548d
Move renderWarnings to use Dialog
G-Ambatte Jun 6, 2024
359a649
Nudge popups left
G-Ambatte Jun 6, 2024
8c31598
Revert dismiss styling to opacity change on hover
G-Ambatte Jun 6, 2024
7bb92bc
Refactor slightly
calculuschild Jun 6, 2024
54ec1b8
Comment out dialog.less reference
G-Ambatte Jun 6, 2024
476002a
Tweak notificationPopup.less
G-Ambatte Jun 6, 2024
8bbf2e1
Dim background while Modal displayed
G-Ambatte Jun 6, 2024
33c2bee
Remove unused useState
G-Ambatte Jun 7, 2024
08b61a6
Cleanup comments. Fix Indentation.
calculuschild Jun 7, 2024
fdf6acd
Lint notificationPopup.less
calculuschild Jun 7, 2024
6577078
Lint lockNotification.less
calculuschild Jun 7, 2024
66fdf80
Lint renderWarnings.less
calculuschild Jun 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 28 additions & 21 deletions client/homebrew/pages/editPage/editPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
const Editor = require('../../editor/editor.jsx');
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');

const LockNotification = require('./lockNotification/lockNotification.jsx');

const Markdown = require('naturalcrit/markdown.js');

const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js');
Expand Down Expand Up @@ -51,7 +53,8 @@ const EditPage = createClass({
autoSave : true,
autoSaveWarning : false,
unsavedTime : new Date(),
currentEditorPage : 0
currentEditorPage : 0,
displayLockMessage : this.props.brew.lock || false
};
},
savedBrew : null,
Expand Down Expand Up @@ -390,26 +393,30 @@ const EditPage = createClass({
{this.renderNavbar()}

<div className='content'>
<SplitPane onDragFinish={this.handleSplitMove} ref='pane'>
<Editor
ref='editor'
brew={this.state.brew}
onTextChange={this.handleTextChange}
onStyleChange={this.handleStyleChange}
onMetaChange={this.handleMetaChange}
reportError={this.errorReported}
renderer={this.state.brew.renderer}
/>
<BrewRenderer
text={this.state.brew.text}
style={this.state.brew.style}
renderer={this.state.brew.renderer}
theme={this.state.brew.theme}
errors={this.state.htmlErrors}
lang={this.state.brew.lang}
currentEditorPage={this.state.currentEditorPage}
/>
</SplitPane>
{this.state.displayLockMessage ?
<LockNotification message={this.props.brew.lock.message} disableLock={()=>this.setState({ displayLockMessage: false })}/>
:
<SplitPane onDragFinish={this.handleSplitMove} ref='pane'>
<Editor
ref='editor'
brew={this.state.brew}
onTextChange={this.handleTextChange}
onStyleChange={this.handleStyleChange}
onMetaChange={this.handleMetaChange}
reportError={this.errorReported}
renderer={this.state.brew.renderer}
/>
<BrewRenderer
text={this.state.brew.text}
style={this.state.brew.style}
renderer={this.state.brew.renderer}
theme={this.state.brew.theme}
errors={this.state.htmlErrors}
lang={this.state.brew.lang}
currentEditorPage={this.state.currentEditorPage}
/>
</SplitPane>
}
</div>
</div>;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require('./lockNotification.less');
const React = require('react');
const createClass = require('create-react-class');

const LockNotification = createClass({
displayName : 'LockNotification',
getInitialState : function() {
return {
disableLock : ()=>{}
};
},

render : function(){
return <div className='lockNotification'>
<h1>BREW LOCKED</h1>
<p>{this.props.message || 'Unable to retrieve Lock Message'}</p>
<button onClick={()=>{this.props.disableLock();}}>CLICK TO UNLOCK</button>
</div>;
}
});

module.exports = LockNotification;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.lockNotification {
background-color: #ccc;
color: black;
padding: 10px;
margin: 25px 100px;
text-align: center;

button {
background-color: #333;
color: white;
margin-top: 10px;

&:hover {
background-color: #777;
}
}
}