Skip to content

Commit

Permalink
fix(reports): Owners no longer showing undefined in reports (#17223)
Browse files Browse the repository at this point in the history
* Owners no longer showing undefined

* Reverted owners change

* removed print

* Owners now defined - frontend only solution!

* Remove arbitrary space
  • Loading branch information
lyndsiWilliams authored Oct 29, 2021
1 parent 0a660a1 commit 456efc0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
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:
Expand Down Expand Up @@ -972,9 +972,11 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
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:
Expand Down

0 comments on commit 456efc0

Please sign in to comment.