Skip to content

Commit

Permalink
Bug Fixes (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-o-n-i-s-h authored Dec 15, 2023
1 parent 815d9f9 commit f2fbc4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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() === '') {
if (typeof globalParameterNames[key] === 'undefined' || globalParameterNames[key] === '') {
return true;
}
}
Expand Down

0 comments on commit f2fbc4d

Please sign in to comment.