Rename emptyValue to blankValue (#2336)

This commit is contained in:
Gregory Schier 2020-06-30 16:52:56 -07:00 committed by GitHub
parent bab945a6a1
commit 984d6051ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -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,

View File

@ -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 (

View File

@ -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}