mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Rename emptyValue to blankValue (#2336)
This commit is contained in:
parent
bab945a6a1
commit
984d6051ab
@ -70,7 +70,7 @@ class Editable extends PureComponent {
|
||||
const {
|
||||
value,
|
||||
fallbackValue,
|
||||
emptyValue,
|
||||
blankValue,
|
||||
singleClick,
|
||||
onEditStart, // eslint-disable-line no-unused-vars
|
||||
className,
|
||||
@ -101,14 +101,14 @@ class Editable extends PureComponent {
|
||||
title: singleClick ? 'Click to edit' : 'Double click to edit',
|
||||
onClick: this._handleSingleClickEditStart,
|
||||
onDoubleClick: this._handleEditStart,
|
||||
emptyValue,
|
||||
blankValue,
|
||||
...extra,
|
||||
};
|
||||
|
||||
if (renderReadView) {
|
||||
return renderReadView(initialValue, readViewProps);
|
||||
} else {
|
||||
return <span {...readViewProps}>{initialValue || emptyValue}</span>;
|
||||
return <span {...readViewProps}>{initialValue || blankValue}</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,7 +120,7 @@ Editable.propTypes = {
|
||||
|
||||
// Optional
|
||||
fallbackValue: PropTypes.string,
|
||||
emptyValue: PropTypes.string,
|
||||
blankValue: PropTypes.string,
|
||||
renderReadView: PropTypes.func,
|
||||
singleClick: PropTypes.bool,
|
||||
onEditStart: PropTypes.func,
|
||||
|
@ -7,18 +7,19 @@ import { fuzzyMatch } from '../../../common/misc';
|
||||
type Props = {|
|
||||
search: string,
|
||||
text: string,
|
||||
blankValue?: String,
|
||||
|};
|
||||
|
||||
@autobind
|
||||
class Highlight extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { search, text, emptyValue, ...otherProps } = this.props;
|
||||
const { search, text, blankValue, ...otherProps } = this.props;
|
||||
|
||||
// Match loose here to make sure our highlighting always works
|
||||
const result = fuzzyMatch(search, text, { splitSpace: true, loose: true });
|
||||
|
||||
if (!result) {
|
||||
return <span {...otherProps}>{text || emptyValue || ''}</span>;
|
||||
return <span {...otherProps}>{text || blankValue || ''}</span>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -191,7 +191,7 @@ class SidebarRequestRow extends PureComponent {
|
||||
<Editable
|
||||
value={request.name}
|
||||
fallbackValue={this.state.renderedUrl}
|
||||
emptyValue="Empty"
|
||||
blankValue="Empty"
|
||||
className="inline-block"
|
||||
onEditStart={this._handleEditStart}
|
||||
onSubmit={this._handleRequestUpdateName}
|
||||
|
Loading…
Reference in New Issue
Block a user