Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Oct 2, 2019
1 parent 6fb64f5 commit bca8478
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/app/components/Parameters.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { size, filter, forEach, extend, some } from 'lodash';
import { size, filter, forEach, extend, some, trim } from 'lodash';
import { react2angular } from 'react2angular';
import { sortableContainer, sortableElement, sortableHandle } from 'react-sortable-hoc';
import { $location } from '@/services/ng';
Expand All @@ -26,8 +26,8 @@ const SortableItem = sortableElement(({ className, parameterName, disabled, chil
));
const SortableContainer = sortableContainer(({ children }) => children);

function isPendingValueEmpty({ pendingValue }) {
return pendingValue === '' || pendingValue === null;
function isPendingValueEmpty({ hasPendingValue, pendingValue }) {
return hasPendingValue ? trim(pendingValue) === '' : false;
}

function updateUrl(parameters) {
Expand Down Expand Up @@ -143,7 +143,7 @@ export class Parameters extends React.Component {

renderParameter(param, index) {
const { editable } = this.props;
const isEmpty = param.pendingValue === '' || param.pendingValue === null;
const isEmpty = param.hasPendingValue ? isPendingValueEmpty(param) : param.isEmpty;

return (
<div
Expand Down

0 comments on commit bca8478

Please sign in to comment.