mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-26 01:46:26 +00:00
Fix : Feeds not getting updated on user profile change. (#20486)
* fix feeds not getting updated after user profile change * fix feeds call happening with aftre payload on initial load * playwright for feed user profile change
This commit is contained in:
parent
685b5702e8
commit
3ea4dbd10e
@ -10,7 +10,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { test as base, expect, Page } from '@playwright/test';
|
import { expect, Page, test as base } from '@playwright/test';
|
||||||
import {
|
import {
|
||||||
PROFILER_EMPTY_RESPONSE_CONFIG,
|
PROFILER_EMPTY_RESPONSE_CONFIG,
|
||||||
PROFILER_REQUEST_CONFIG,
|
PROFILER_REQUEST_CONFIG,
|
||||||
|
@ -449,3 +449,39 @@ test.describe('User with Data Steward Roles', () => {
|
|||||||
await visitOwnProfilePage(dataStewardPage);
|
await visitOwnProfilePage(dataStewardPage);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.describe('User Profile Feed Interactions', () => {
|
||||||
|
test('Should navigate to user profile from feed card avatar click', async ({
|
||||||
|
adminPage,
|
||||||
|
}) => {
|
||||||
|
await redirectToHomePage(adminPage);
|
||||||
|
const feedResponse = adminPage.waitForResponse(
|
||||||
|
'/api/v1/feed?type=Conversation'
|
||||||
|
);
|
||||||
|
|
||||||
|
await visitOwnProfilePage(adminPage);
|
||||||
|
await feedResponse;
|
||||||
|
|
||||||
|
await adminPage.waitForSelector('[data-testid="message-container"]');
|
||||||
|
const userDetailsResponse = adminPage.waitForResponse(
|
||||||
|
'/api/v1/users/name/*'
|
||||||
|
);
|
||||||
|
const userFeedResponse = adminPage.waitForResponse(
|
||||||
|
'/api/v1/feed?type=Conversation&filterType=OWNER_OR_FOLLOWS&userId=*'
|
||||||
|
);
|
||||||
|
|
||||||
|
await adminPage
|
||||||
|
.locator('[data-testid="message-container"]')
|
||||||
|
.first()
|
||||||
|
.locator('[data-testid="profile-avatar"]')
|
||||||
|
.click();
|
||||||
|
await userDetailsResponse;
|
||||||
|
await userFeedResponse;
|
||||||
|
const response = await userDetailsResponse;
|
||||||
|
const { fullyQualifiedName } = await response.json();
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
adminPage.locator('[data-testid="user-display-name"]')
|
||||||
|
).toHaveText(fullyQualifiedName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -19,8 +19,8 @@ import {
|
|||||||
import { VISIT_SERVICE_PAGE_DETAILS } from '../constant/service';
|
import { VISIT_SERVICE_PAGE_DETAILS } from '../constant/service';
|
||||||
import {
|
import {
|
||||||
GlobalSettingOptions,
|
GlobalSettingOptions,
|
||||||
SETTING_CUSTOM_PROPERTIES_PATH,
|
|
||||||
SETTINGS_OPTIONS_PATH,
|
SETTINGS_OPTIONS_PATH,
|
||||||
|
SETTING_CUSTOM_PROPERTIES_PATH,
|
||||||
} from '../constant/settings';
|
} from '../constant/settings';
|
||||||
import { SidebarItem } from '../constant/sidebar';
|
import { SidebarItem } from '../constant/sidebar';
|
||||||
import { UserClass } from '../support/user/UserClass';
|
import { UserClass } from '../support/user/UserClass';
|
||||||
|
@ -536,6 +536,7 @@ export const ActivityFeedTab = ({
|
|||||||
onFeedClick={handleFeedClick}
|
onFeedClick={handleFeedClick}
|
||||||
/>
|
/>
|
||||||
{loader}
|
{loader}
|
||||||
|
{entityThread.length > 0 && (
|
||||||
<div
|
<div
|
||||||
className="w-full"
|
className="w-full"
|
||||||
data-testid="observer-element"
|
data-testid="observer-element"
|
||||||
@ -543,6 +544,7 @@ export const ActivityFeedTab = ({
|
|||||||
ref={elementRef as RefObject<HTMLDivElement>}
|
ref={elementRef as RefObject<HTMLDivElement>}
|
||||||
style={{ height: '2px' }}
|
style={{ height: '2px' }}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
@ -48,6 +48,7 @@ const UserPage = () => {
|
|||||||
const { currentUser, updateCurrentUser } = useApplicationStore();
|
const { currentUser, updateCurrentUser } = useApplicationStore();
|
||||||
|
|
||||||
const fetchUserData = async () => {
|
const fetchUserData = async () => {
|
||||||
|
setIsLoading(true);
|
||||||
try {
|
try {
|
||||||
const res = await getUserByName(username, {
|
const res = await getUserByName(username, {
|
||||||
fields: [
|
fields: [
|
||||||
@ -179,7 +180,7 @@ const UserPage = () => {
|
|||||||
fetchUserData();
|
fetchUserData();
|
||||||
}, [username]);
|
}, [username]);
|
||||||
|
|
||||||
if (isLoading) {
|
if (userData?.name !== username || isLoading) {
|
||||||
return <Loader />;
|
return <Loader />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user