Renamed the parameter to teamsLimit, reran api report, tsc, lint, and tests.
Signed-off-by: Quadman <QuadmanSWE@gmail.com>
This commit is contained in:
@@ -65,7 +65,7 @@ export type AssignedToUserFilter = BaseFilter &
|
||||
// @public (undocumented)
|
||||
export interface AzureDevOpsApi {
|
||||
// (undocumented)
|
||||
getAllTeams(topTeams?: number): Promise<Team[]>;
|
||||
getAllTeams(teamsLimit?: number): Promise<Team[]>;
|
||||
// (undocumented)
|
||||
getBuildRuns(
|
||||
projectName: string,
|
||||
@@ -81,7 +81,7 @@ export interface AzureDevOpsApi {
|
||||
// (undocumented)
|
||||
getDashboardPullRequests(
|
||||
projectName: string,
|
||||
topTeams?: number,
|
||||
teamsLimit?: number,
|
||||
): Promise<DashboardPullRequest[]>;
|
||||
// (undocumented)
|
||||
getGitTags(
|
||||
@@ -127,7 +127,7 @@ export const azureDevOpsApiRef: ApiRef<AzureDevOpsApi>;
|
||||
export class AzureDevOpsClient implements AzureDevOpsApi {
|
||||
constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi });
|
||||
// (undocumented)
|
||||
getAllTeams(topTeams?: number): Promise<Team[]>;
|
||||
getAllTeams(teamsLimit?: number): Promise<Team[]>;
|
||||
// (undocumented)
|
||||
getBuildRuns(
|
||||
projectName: string,
|
||||
@@ -143,7 +143,7 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
|
||||
// (undocumented)
|
||||
getDashboardPullRequests(
|
||||
projectName: string,
|
||||
topTeams?: number,
|
||||
teamsLimit?: number,
|
||||
): Promise<DashboardPullRequest[]>;
|
||||
// (undocumented)
|
||||
getGitTags(
|
||||
@@ -195,7 +195,7 @@ export const AzurePullRequestsPage: (props: {
|
||||
projectName?: string | undefined;
|
||||
pollingInterval?: number | undefined;
|
||||
defaultColumnConfigs?: PullRequestColumnConfig[] | undefined;
|
||||
topTeams?: number | undefined;
|
||||
teamsLimit?: number | undefined;
|
||||
}) => JSX_2.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
|
||||
@@ -64,10 +64,10 @@ export interface AzureDevOpsApi {
|
||||
|
||||
getDashboardPullRequests(
|
||||
projectName: string,
|
||||
topTeams?: number,
|
||||
teamsLimit?: number,
|
||||
): Promise<DashboardPullRequest[]>;
|
||||
|
||||
getAllTeams(topTeams?: number): Promise<Team[]>;
|
||||
getAllTeams(teamsLimit?: number): Promise<Team[]>;
|
||||
|
||||
getUserTeamIds(userId: string): Promise<string[]>;
|
||||
|
||||
|
||||
@@ -124,21 +124,21 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
|
||||
|
||||
public getDashboardPullRequests(
|
||||
projectName: string,
|
||||
topTeams?: number,
|
||||
teamsLimit?: number,
|
||||
): Promise<DashboardPullRequest[]> {
|
||||
const queryString = new URLSearchParams();
|
||||
queryString.append('top', '100');
|
||||
if (topTeams) {
|
||||
queryString.append('topTeams', topTeams.toString());
|
||||
if (teamsLimit) {
|
||||
queryString.append('teamsLimit', teamsLimit.toString());
|
||||
}
|
||||
const urlSegment = `dashboard-pull-requests/${projectName}?${queryString}`;
|
||||
return this.get<DashboardPullRequest[]>(urlSegment);
|
||||
}
|
||||
|
||||
public getAllTeams(topTeams?: number): Promise<Team[]> {
|
||||
public getAllTeams(teamsLimit?: number): Promise<Team[]> {
|
||||
const queryString = new URLSearchParams();
|
||||
if (topTeams) {
|
||||
queryString.append('topTeams', topTeams.toString());
|
||||
if (teamsLimit) {
|
||||
queryString.append('teamsLimit', teamsLimit.toString());
|
||||
}
|
||||
let urlSegment = 'all-teams';
|
||||
if (queryString.toString()) {
|
||||
|
||||
@@ -70,17 +70,17 @@ type PullRequestsPageProps = {
|
||||
projectName?: string;
|
||||
pollingInterval?: number;
|
||||
defaultColumnConfigs?: PullRequestColumnConfig[];
|
||||
topTeams?: number;
|
||||
teamsLimit?: number;
|
||||
};
|
||||
|
||||
export const PullRequestsPage = (props: PullRequestsPageProps) => {
|
||||
const { projectName, pollingInterval, defaultColumnConfigs, topTeams } =
|
||||
const { projectName, pollingInterval, defaultColumnConfigs, teamsLimit } =
|
||||
props;
|
||||
|
||||
const { pullRequests, loading, error } = useDashboardPullRequests(
|
||||
projectName,
|
||||
pollingInterval,
|
||||
topTeams,
|
||||
teamsLimit,
|
||||
);
|
||||
|
||||
const [columnConfigs] = useState(
|
||||
|
||||
@@ -27,7 +27,7 @@ const POLLING_INTERVAL = 10000;
|
||||
export function useDashboardPullRequests(
|
||||
project?: string,
|
||||
pollingInterval: number = POLLING_INTERVAL,
|
||||
topTeams?: number,
|
||||
teamsLimit?: number,
|
||||
): {
|
||||
pullRequests?: DashboardPullRequest[];
|
||||
loading: boolean;
|
||||
@@ -44,7 +44,7 @@ export function useDashboardPullRequests(
|
||||
}
|
||||
|
||||
try {
|
||||
return await api.getDashboardPullRequests(project, topTeams);
|
||||
return await api.getDashboardPullRequests(project, teamsLimit);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
errorApi.post(error);
|
||||
@@ -52,7 +52,7 @@ export function useDashboardPullRequests(
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}, [project, api, topTeams, errorApi]);
|
||||
}, [project, api, teamsLimit, errorApi]);
|
||||
|
||||
const {
|
||||
value: pullRequests,
|
||||
|
||||
Reference in New Issue
Block a user