Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Apr 23, 2021
1 parent 8bb466c commit 0690c68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
]);

const placeholderText =
(data || []).length === 0
data.length === 0
? t('No data')
: tn('%s option', '%s options', data.length, data.length);
return (
Expand All @@ -155,14 +155,14 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
showSearch={showSearch}
mode={multiSelect ? 'multiple' : undefined}
placeholder={placeholderText}
onSearch={val => setCurrentSuggestionSearch(val)}
onSearch={setCurrentSuggestionSearch}
onSelect={clearSuggestionSearch}
onBlur={clearSuggestionSearch}
// @ts-ignore
onChange={handleChange}
ref={inputRef}
>
{(data || []).map(row => {
{data.map(row => {
const [value] = groupby.map(col => row[col]);
return (
// @ts-ignore
Expand All @@ -172,7 +172,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
);
})}
{currentSuggestionSearch &&
!(values || []).some(
!ensureIsArray(values).some(
suggestion => suggestion === currentSuggestionSearch,
) && (
<Option value={currentSuggestionSearch}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function transformProps(
const newFormData = { ...DEFAULT_FORM_DATA, ...formData };
const { setDataMask = () => {} } = hooks;
const [queryData] = queriesData;
const { colnames = [], coltypes = [], data } = queryData || [];
const { colnames = [], coltypes = [], data = [] } = queryData || {};
const coltypeMap: Record<string, GenericDataType> = colnames.reduce(
(accumulator, item, index) => ({ ...accumulator, [item]: coltypes[index] }),
{},
Expand Down

0 comments on commit 0690c68

Please sign in to comment.