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