Skip to content

Commit

Permalink
fix(ui): GEN-1523 exclude defaultPersona if not present in personas (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-madlani authored Sep 21, 2024
1 parent 1badbb2 commit c1a4f48
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1a4f48

Please sign in to comment.