-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added new dep @neo4j/browser-lambda-parser - Updated existing cmd utils to use parser for all things lambda - Standardized and cleaned up error frames appearance regardless of source - Added new help text for :param - Standardized appearance of :help buttons and Error frames
- Loading branch information
Showing
15 changed files
with
328 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2002-2019 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* This file is part of Neo4j. | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
import React, { useCallback } from 'react' | ||
import { connect } from 'react-redux' | ||
import { withBus } from 'react-suber' | ||
import styled from 'styled-components' | ||
|
||
import { executeCommand } from '../../../shared/modules/commands/commandsDuck' | ||
|
||
const StyledAutoExecButton = styled.button` | ||
border-radius: 3px; | ||
border: 1px solid #dadada; | ||
display: inline-block; | ||
font-family: Monaco, 'Courier New', Terminal, monospace; | ||
font-size: 12px; | ||
line-height: 18px; | ||
padding: 0 4px; | ||
color: #428bca; | ||
cursor: pointer; | ||
text-decoration: none; | ||
background-color: #f8f8f8; | ||
outline: transparent; | ||
` | ||
|
||
function AutoExecButtonComponent ({ bus, cmd, cmdChar }) { | ||
const onClick = useCallback( | ||
() => { | ||
const action = executeCommand(`${cmdChar}${cmd}`) | ||
|
||
bus.send(action.type, action) | ||
}, | ||
[cmd] | ||
) | ||
|
||
return ( | ||
<StyledAutoExecButton type='button' onClick={onClick}> | ||
<i className='fa fa-play-circle-o' /> {cmdChar} | ||
{cmd} | ||
</StyledAutoExecButton> | ||
) | ||
} | ||
|
||
const mapStateToProps = ({ settings }) => ({ | ||
cmdChar: settings.cmdchar | ||
}) | ||
const AutoExecButton = withBus( | ||
connect(mapStateToProps)(AutoExecButtonComponent) | ||
) | ||
|
||
export default AutoExecButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.