mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 03:59:12 +00:00
Fixed issue 4948 active page value is not updating in ui for team page (#4949)
This commit is contained in:
parent
c58e642ee7
commit
9009cf8ea6
@ -18,6 +18,7 @@ export const PRIMERY_COLOR = '#7147E8';
|
||||
export const LITE_GRAY_COLOR = '#DBE0EB';
|
||||
|
||||
export const FOLLOWERS_VIEW_CAP = 20;
|
||||
export const INITIAL_PAGIN_VALUE = 1;
|
||||
export const JSON_TAB_SIZE = 2;
|
||||
export const PAGE_SIZE = 10;
|
||||
export const PAGE_SIZE_MEDIUM = 16;
|
||||
|
||||
@ -37,6 +37,7 @@ import Loader from '../../components/Loader/Loader';
|
||||
import TeamsAndUsers from '../../components/TeamsAndUsers/TeamsAndUsers.component';
|
||||
import {
|
||||
getTeamAndUserDetailsPath,
|
||||
INITIAL_PAGIN_VALUE,
|
||||
PAGE_SIZE_MEDIUM,
|
||||
ROUTES,
|
||||
} from '../../constants/constants';
|
||||
@ -69,7 +70,8 @@ const TeamsAndUsersPage = () => {
|
||||
const [currentTeam, setCurrentTeam] = useState<Team>();
|
||||
const [currentTeamUsers, setCurrentTeamUsers] = useState<User[]>([]);
|
||||
const [teamUserPagin, setTeamUserPagin] = useState<Paging>({} as Paging);
|
||||
const [currentTeamUserPage, setCurrentTeamUserPage] = useState(1);
|
||||
const [currentTeamUserPage, setCurrentTeamUserPage] =
|
||||
useState(INITIAL_PAGIN_VALUE);
|
||||
const [teamUsersSearchText, setTeamUsersSearchText] = useState('');
|
||||
const [isDescriptionEditable, setIsDescriptionEditable] = useState(false);
|
||||
const [isAddingTeam, setIsAddingTeam] = useState<boolean>(false);
|
||||
@ -311,11 +313,15 @@ const TeamsAndUsersPage = () => {
|
||||
.finally(() => setIsTeamMemberLoading(false));
|
||||
};
|
||||
|
||||
const teamUserPaginHandler = (cursorValue: string | number) => {
|
||||
const teamUserPaginHandler = (
|
||||
cursorValue: string | number,
|
||||
activePage?: number
|
||||
) => {
|
||||
if (teamUsersSearchText) {
|
||||
setCurrentTeamUserPage(cursorValue as number);
|
||||
searchUsers(teamUsersSearchText, cursorValue as number);
|
||||
} else {
|
||||
setCurrentTeamUserPage(activePage as number);
|
||||
getCurrentTeamUsers(currentTeam?.name || '', {
|
||||
[cursorValue]: teamUserPagin[cursorValue as keyof Paging] as string,
|
||||
});
|
||||
@ -324,8 +330,9 @@ const TeamsAndUsersPage = () => {
|
||||
|
||||
const handleTeamUsersSearchAction = (text: string) => {
|
||||
setTeamUsersSearchText(text);
|
||||
setCurrentTeamUserPage(INITIAL_PAGIN_VALUE);
|
||||
if (text) {
|
||||
searchUsers(text, currentTeamUserPage);
|
||||
searchUsers(text, INITIAL_PAGIN_VALUE);
|
||||
} else {
|
||||
getCurrentTeamUsers(currentTeam?.name as string);
|
||||
}
|
||||
@ -371,6 +378,7 @@ const TeamsAndUsersPage = () => {
|
||||
.then((res: AxiosResponse) => {
|
||||
if (res.data) {
|
||||
fetchCurrentTeam(res.data.name, true);
|
||||
setTeamUsersSearchText('');
|
||||
} else {
|
||||
throw jsonData['api-error-messages']['unexpected-server-response'];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user