diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx index e725cdc238..e80e402ec0 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx @@ -409,8 +409,8 @@ class DatasourceEditor extends React.PureComponent { datasource: { ...props.datasource, owners: props.datasource.owners.map(owner => ({ - value: owner.id, - label: `${owner.first_name} ${owner.last_name}`, + value: owner.value || owner.id, + label: owner.label || `${owner.first_name} ${owner.last_name}`, })), metrics: props.datasource.metrics?.map(metric => { const { diff --git a/superset-frontend/src/components/Datasource/DatasourceModal.tsx b/superset-frontend/src/components/Datasource/DatasourceModal.tsx index 5cd6f3aa3f..89b7b5d698 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal.tsx @@ -119,14 +119,17 @@ const DatasourceModal: FunctionComponent = ({ ), type: currentDatasource.type || currentDatasource.datasource_type, owners: currentDatasource.owners.map( - (o: { label: string; value: number }) => o.value, + (o: Record) => o.value || o.id, ), }, }, }) .then(({ json }) => { addSuccessToast(t('The dataset has been saved')); - onDatasourceSave(json); + onDatasourceSave({ + ...json, + owners: currentDatasource.owners, + }); onHide(); }) .catch(response => {