Files
redash/client/app/services/parameters/TextParameter.js
Arik Fraimovich 56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00

21 lines
486 B
JavaScript

import { toString, isEmpty } from "lodash";
import { Parameter } from ".";
class TextParameter extends Parameter {
constructor(parameter, parentQueryId) {
super(parameter, parentQueryId);
this.setValue(parameter.value);
}
// eslint-disable-next-line class-methods-use-this
normalizeValue(value) {
const normalizedValue = toString(value);
if (isEmpty(normalizedValue)) {
return null;
}
return normalizedValue;
}
}
export default TextParameter;