Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: fix ui bugs #14263

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Users from './Users.component';
import { UserPageTabs } from './Users.interface';

const mockParams = {
fqn: 'test',
tab: UserPageTabs.ACTIVITY,
};

Expand Down Expand Up @@ -140,7 +141,6 @@ jest.mock('../common/EntityDescription/Description', () => {
const updateUserDetails = jest.fn();

const mockProp = {
username: 'test',
queryFilters: {
myData: 'my-data',
following: 'following',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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>();

Expand Down Expand Up @@ -158,7 +156,7 @@ const Users = ({
<ActivityFeedProvider user={userData.id}>
<ActivityFeedTab
entityType={EntityType.USER}
fqn={username}
fqn={decodedUsername}
isForFeedTab={false}
onFeedUpdate={noop}
/>
Expand Down Expand Up @@ -204,7 +202,7 @@ const Users = ({
}),
},
],
[activeTab, userData, username, setPreviewAsset, tabDataRender]
[activeTab, userData, decodedUsername, setPreviewAsset, tabDataRender]
);

const handleDescriptionChange = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export interface Props {
myData: string;
following: string;
};
username: string;
handlePaginate: (page: string | number) => void;
updateUserDetails: (data: Partial<User>) => Promise<void>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const StoredProcedureTab = () => {
setIsLoading(false);
}
},
[decodedDatabaseSchemaFQN, pageSize]
[decodedDatabaseSchemaFQN, pageSize, showDeleted, handlePagingChange]
);

const storedProcedurePagingHandler = useCallback(
Expand All @@ -87,7 +87,7 @@ const StoredProcedureTab = () => {
}
handlePageChange(currentPage);
},
[paging, handlePageChange]
[paging, handlePageChange, fetchStoreProcedureDetails]
);

const tableColumn: ColumnsType<ServicePageData> = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ const UserPage = () => {
}}
updateUserDetails={updateUserDetails}
userData={userData}
username={username}
/>
);
};
Expand Down