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) { for (const data of KPI_DATA) {
await page.getByTestId(`delete-action-${data.displayName}`).click(); 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 page.getByTestId('confirm-button').click();
await deleteResponse;
} }
}); });
}); });

View File

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

View File

@ -13,7 +13,7 @@
import { CheckOutlined } from '@ant-design/icons'; import { CheckOutlined } from '@ant-design/icons';
import { Dropdown, Space, Tooltip, Typography } from 'antd'; import { Dropdown, Space, Tooltip, Typography } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems'; import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { isEmpty } from 'lodash'; import { isEmpty, some } from 'lodash';
import React, { import React, {
ReactNode, ReactNode,
useCallback, useCallback,
@ -312,10 +312,17 @@ export const UserProfileIcon = () => {
); );
useEffect(() => { useEffect(() => {
updateSelectedPersona( let defaultPersona = currentUser?.defaultPersona ?? ({} as EntityReference);
currentUser?.defaultPersona ?? ({} as EntityReference) if (currentUser?.defaultPersona?.id) {
); defaultPersona = some(
}, [currentUser?.defaultPersona]); currentUser?.personas,
(persona) => persona.id === currentUser?.defaultPersona?.id
)
? currentUser?.defaultPersona
: ({} as EntityReference);
}
updateSelectedPersona(defaultPersona);
}, [currentUser?.defaultPersona, currentUser?.personas]);
return ( return (
<Dropdown <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 // We want to override any profile information that is coming from the OIDC provider
profile: { profile: {
...existingUserDetails.profile, ...existingUserDetails.profile,
...updatedUserData.profile ...updatedUserData.profile,
}, },
}; };
const jsonPatch = compare(existingUserDetails, finalData); const jsonPatch = compare(existingUserDetails, finalData);