Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
driusan committed Apr 26, 2024
1 parent 413fb84 commit d21ed63
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions modules/dataquery/jsx/viewdata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import getDictionaryDescription from './getdictionarydescription';

type TableRow = (string|null)[];

type JSONString = string;

type SessionRowCell = {
VisitLabel: string;
value?: string
Expand Down Expand Up @@ -762,7 +760,10 @@ function expandLongitudinalCells(
.join(';'), dictionary: fielddict};
default:
if (thissession.value !== undefined) {
return {value: thissession.value, dictionary: fielddict};
return {
value: thissession.value,
dictionary: fielddict,
};
}
throw new Error('Value was undefined');
}
Expand Down Expand Up @@ -1073,16 +1074,24 @@ function organizedFormatter(
return <td><i>(No data)</i></td>;
}

return <td><DisplayValue value={cellValue(cell.value)} dictionary={cell.dictionary} enumDisplay={enumDisplay} /></td>;
return (<td>
<DisplayValue
value={cellValue(cell.value)}
dictionary={cell.dictionary}
enumDisplay={enumDisplay} />
</td>);
})}</>;
};
return callback;
case 'crosssection':
/**
* Callback that organizes data cross-sectionally
*
* @param {string} label - The label for the column
* @param {string} cell - The raw cell value returned by the API.
* @param {string} label - The header label
* @param {string} cell - the JSON value of the cell
* @param {string[]} row - the entire row
* @param {string[]} headers - the headers for the table
* @param {number} fieldNo - The field number of this cell
* @returns {React.ReactElement} - The table cell for this cell.
*/
callback = (
Expand All @@ -1102,11 +1111,16 @@ function organizedFormatter(

const fieldobj = fields[fieldNo-1];
const fielddict = getDictionary(fieldobj, dict);
console.log(fielddict, fieldobj, cell);

return fielddict === null
? <TableCell data={cell} />
: <td><DisplayValue value={cellValue(cell)} dictionary={fielddict} enumDisplay={enumDisplay} /></td>;
: (<td>
<DisplayValue
value={cellValue(cell)}
dictionary={fielddict}
enumDisplay={enumDisplay}
/>
</td>);
};
return callback;
}
Expand Down

0 comments on commit d21ed63

Please sign in to comment.