Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.4.0 Bug Fixes #82

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/report/Report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ export const NeoReport = ({
* This component renders string response from the cypher query. This feature is only applicable for graph report.
* https://mercedes-benz.atlassian.net/browse/VULCAN-235
*/
if (records !== null && records.length === 1) {
if (type === 'graph' && typeof records[0]?._fields[0] === 'string') {
if (records && records.length === 1) {
const singleValue = records[0]?._fields?.[0];
if (type === 'graph' && typeof singleValue === 'string') {
return (
<CustomSingleValueComponent
value={records[0]._fields[0]}
value={singleValue}
sx={{
fontSize: settings?.fontSize,
color: settings?.color,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/parameterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const extractAllParameterNames = (cypherQuery) => {

export const checkParametersNameInGlobalParameter = (parameterNames: string[], globalParameterNames: any,) => {
for (const key of parameterNames) {
if (!globalParameterNames[key] || globalParameterNames[key].trim() === '') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-o-n-i-s-h - generally comparison with null or undefined should be avoided. Is there another way of doing this that doesn't result in a compiler warning?

if (typeof globalParameterNames[key] === 'undefined' || globalParameterNames[key] === '') {
return true;
}
}
Expand Down