mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-11-04 04:29:13 +00:00 
			
		
		
		
	MINOR: fix ui bugs (#14263)
This commit is contained in:
		
							parent
							
								
									566c36b7f3
								
							
						
					
					
						commit
						add00e54cb
					
				@ -26,6 +26,7 @@ import Users from './Users.component';
 | 
			
		||||
import { UserPageTabs } from './Users.interface';
 | 
			
		||||
 | 
			
		||||
const mockParams = {
 | 
			
		||||
  fqn: 'test',
 | 
			
		||||
  tab: UserPageTabs.ACTIVITY,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -140,7 +141,6 @@ jest.mock('../common/EntityDescription/Description', () => {
 | 
			
		||||
const updateUserDetails = jest.fn();
 | 
			
		||||
 | 
			
		||||
const mockProp = {
 | 
			
		||||
  username: 'test',
 | 
			
		||||
  queryFilters: {
 | 
			
		||||
    myData: 'my-data',
 | 
			
		||||
    following: 'following',
 | 
			
		||||
 | 
			
		||||
@ -30,6 +30,7 @@ import { useAuth } from '../../hooks/authHooks';
 | 
			
		||||
import { searchData } from '../../rest/miscAPI';
 | 
			
		||||
import { getEntityName } from '../../utils/EntityUtils';
 | 
			
		||||
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
 | 
			
		||||
import { getDecodedFqn } from '../../utils/StringsUtils';
 | 
			
		||||
import { useAuthContext } from '../Auth/AuthProviders/AuthProvider';
 | 
			
		||||
import Chip from '../common/Chip/Chip.component';
 | 
			
		||||
import DescriptionV1 from '../common/EntityDescription/DescriptionV1';
 | 
			
		||||
@ -49,20 +50,17 @@ import UserProfileInheritedRoles from './UsersProfile/UserProfileInheritedRoles/
 | 
			
		||||
import UserProfileRoles from './UsersProfile/UserProfileRoles/UserProfileRoles.component';
 | 
			
		||||
import UserProfileTeams from './UsersProfile/UserProfileTeams/UserProfileTeams.component';
 | 
			
		||||
 | 
			
		||||
const Users = ({
 | 
			
		||||
  userData,
 | 
			
		||||
  username,
 | 
			
		||||
  queryFilters,
 | 
			
		||||
  updateUserDetails,
 | 
			
		||||
}: Props) => {
 | 
			
		||||
  const { tab: activeTab = UserPageTabs.ACTIVITY } =
 | 
			
		||||
    useParams<{ tab: UserPageTabs }>();
 | 
			
		||||
const Users = ({ userData, queryFilters, updateUserDetails }: Props) => {
 | 
			
		||||
  const { fqn: username, tab: activeTab = UserPageTabs.ACTIVITY } =
 | 
			
		||||
    useParams<{ fqn: string; tab: UserPageTabs }>();
 | 
			
		||||
  const [assetCount, setAssetCount] = useState<number>(0);
 | 
			
		||||
  const { isAdminUser } = useAuth();
 | 
			
		||||
  const history = useHistory();
 | 
			
		||||
  const location = useLocation();
 | 
			
		||||
  const { currentUser } = useAuthContext();
 | 
			
		||||
 | 
			
		||||
  const decodedUsername = useMemo(() => getDecodedFqn(username), [username]);
 | 
			
		||||
 | 
			
		||||
  const [previewAsset, setPreviewAsset] =
 | 
			
		||||
    useState<EntityDetailsObjectInterface>();
 | 
			
		||||
 | 
			
		||||
@ -158,7 +156,7 @@ const Users = ({
 | 
			
		||||
          <ActivityFeedProvider user={userData.id}>
 | 
			
		||||
            <ActivityFeedTab
 | 
			
		||||
              entityType={EntityType.USER}
 | 
			
		||||
              fqn={username}
 | 
			
		||||
              fqn={decodedUsername}
 | 
			
		||||
              isForFeedTab={false}
 | 
			
		||||
              onFeedUpdate={noop}
 | 
			
		||||
            />
 | 
			
		||||
@ -204,7 +202,7 @@ const Users = ({
 | 
			
		||||
        }),
 | 
			
		||||
      },
 | 
			
		||||
    ],
 | 
			
		||||
    [activeTab, userData, username, setPreviewAsset, tabDataRender]
 | 
			
		||||
    [activeTab, userData, decodedUsername, setPreviewAsset, tabDataRender]
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const handleDescriptionChange = useCallback(
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,6 @@ export interface Props {
 | 
			
		||||
    myData: string;
 | 
			
		||||
    following: string;
 | 
			
		||||
  };
 | 
			
		||||
  username: string;
 | 
			
		||||
  handlePaginate: (page: string | number) => void;
 | 
			
		||||
  updateUserDetails: (data: Partial<User>) => Promise<void>;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ const StoredProcedureTab = () => {
 | 
			
		||||
        setIsLoading(false);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    [decodedDatabaseSchemaFQN, pageSize]
 | 
			
		||||
    [decodedDatabaseSchemaFQN, pageSize, showDeleted, handlePagingChange]
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const storedProcedurePagingHandler = useCallback(
 | 
			
		||||
@ -87,7 +87,7 @@ const StoredProcedureTab = () => {
 | 
			
		||||
      }
 | 
			
		||||
      handlePageChange(currentPage);
 | 
			
		||||
    },
 | 
			
		||||
    [paging, handlePageChange]
 | 
			
		||||
    [paging, handlePageChange, fetchStoreProcedureDetails]
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const tableColumn: ColumnsType<ServicePageData> = useMemo(
 | 
			
		||||
 | 
			
		||||
@ -148,7 +148,6 @@ const UserPage = () => {
 | 
			
		||||
      }}
 | 
			
		||||
      updateUserDetails={updateUserDetails}
 | 
			
		||||
      userData={userData}
 | 
			
		||||
      username={username}
 | 
			
		||||
    />
 | 
			
		||||
  );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user