fix(ui): GEN-1523 exclude defaultPersona if not present in personas (#17940)

This commit is contained in:
Chirag Madlani 2024-09-21 11:16:33 +05:30 committed by GitHub
parent 1badbb260b
commit c1a4f487b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 8 deletions

View File

@ -187,8 +187,13 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
for (const data of KPI_DATA) {
await page.getByTestId(`delete-action-${data.displayName}`).click();
await page.getByTestId('confirmation-text-input').type('DELETE');
await page.getByTestId('confirmation-text-input').fill('DELETE');
const deleteResponse = page.waitForResponse(
`/api/v1/kpi/*?hardDelete=true&recursive=false`
);
await page.getByTestId('confirm-button').click();
await deleteResponse;
}
});
});

View File

@ -191,7 +191,7 @@ class RedshiftWithDBTIngestionClass extends ServiceBaseClass {
// Verify DBT in table entity
await visitEntityPage({
page,
searchTerm: REDSHIFT.DBTTable,
searchTerm: this.dbtEntityFqn,
dataTestId: `${REDSHIFT.serviceName}-${REDSHIFT.DBTTable}`,
});

View File

@ -13,7 +13,7 @@
import { CheckOutlined } from '@ant-design/icons';
import { Dropdown, Space, Tooltip, Typography } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { isEmpty } from 'lodash';
import { isEmpty, some } from 'lodash';
import React, {
ReactNode,
useCallback,
@ -312,10 +312,17 @@ export const UserProfileIcon = () => {
);
useEffect(() => {
updateSelectedPersona(
currentUser?.defaultPersona ?? ({} as EntityReference)
);
}, [currentUser?.defaultPersona]);
let defaultPersona = currentUser?.defaultPersona ?? ({} as EntityReference);
if (currentUser?.defaultPersona?.id) {
defaultPersona = some(
currentUser?.personas,
(persona) => persona.id === currentUser?.defaultPersona?.id
)
? currentUser?.defaultPersona
: ({} as EntityReference);
}
updateSelectedPersona(defaultPersona);
}, [currentUser?.defaultPersona, currentUser?.personas]);
return (
<Dropdown

View File

@ -149,7 +149,7 @@ export const checkIfUpdateRequired = async (
// We want to override any profile information that is coming from the OIDC provider
profile: {
...existingUserDetails.profile,
...updatedUserData.profile
...updatedUserData.profile,
},
};
const jsonPatch = compare(existingUserDetails, finalData);