From 456efc0c2053a27083e513b77998f93571c79028 Mon Sep 17 00:00:00 2001 From: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com> Date: Fri, 29 Oct 2021 12:17:47 -0500 Subject: [PATCH] fix(reports): Owners no longer showing undefined in reports (#17223) * Owners no longer showing undefined * Reverted owners change * removed print * Owners now defined - frontend only solution! * Remove arbitrary space --- .../src/views/CRUD/alert/AlertReportModal.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx index c8c4df66a5dd3..5946b64b07533 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx @@ -524,7 +524,7 @@ const AlertReportModal: FunctionComponent = ({ contentType === 'dashboard' ? currentAlert?.dashboard?.value : null, database: currentAlert?.database?.value, owners: (currentAlert?.owners || []).map( - owner => (owner as MetaObject).value, + owner => (owner as MetaObject).value || owner.id, ), recipients, report_format: @@ -972,9 +972,11 @@ const AlertReportModal: FunctionComponent = ({ label: (resource.database as DatabaseObject).database_name, } : undefined, - owners: (resource.owners || []).map(owner => ({ - value: owner.id, - label: `${(owner as Owner).first_name} ${(owner as Owner).last_name}`, + owners: (alert?.owners || []).map(owner => ({ + value: (owner as MetaObject).value || owner.id, + label: + (owner as MetaObject).label || + `${(owner as Owner).first_name} ${(owner as Owner).last_name}`, })), // @ts-ignore: Type not assignable validator_config_json: