create changeset and run api-reports

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2022-10-06 14:51:23 +01:00
parent d27181ca29
commit df226e124c
12 changed files with 78 additions and 135 deletions
@@ -22,7 +22,6 @@ import {
} from '@backstage/core-plugin-api';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { ForwardedError } from '@backstage/errors';
import { IssuesByRepoOptions, IssuesFilters } from '../types';
/** @internal */
export type Assignee = {
@@ -74,6 +73,34 @@ export type IssuesByRepo = Record<string, RepoIssues>;
/** @internal */
export type GitHubIssuesApi = ReturnType<typeof gitHubIssuesApi>;
/**
* @public
*/
export interface IssuesFilters {
assignee?: string;
createdBy?: string;
labels?: string[];
mentioned?: string;
milestone?: string;
states?: ('OPEN' | 'CLOSED')[];
}
/**
* @public
*/
export interface IssuesOrdering {
field: 'CREATED_AT' | 'UPDATED_AT' | 'COMMENTS';
direction?: 'ASC' | 'DESC';
}
/**
* @public
*/
export interface IssuesByRepoOptions {
filterBy?: IssuesFilters;
orderBy?: IssuesOrdering;
}
/** @internal */
export const gitHubIssuesApiRef = createApiRef<GitHubIssuesApi>({
id: 'plugin.githubissues.service',
@@ -24,7 +24,7 @@ import { useGetIssuesByRepoFromGitHub } from '../../hooks/useGetIssuesByRepoFrom
import { IssuesList } from './IssuesList';
import { NoRepositoriesInfo } from './NoRepositoriesInfo';
import { IssuesByRepoOptions } from '../../types';
import type { IssuesFilters, IssuesOrdering } from '../../api/gitHubIssuesApi';
/**
* @public
@@ -32,8 +32,8 @@ import { IssuesByRepoOptions } from '../../types';
export type GitHubIssuesProps = {
itemsPerPage?: number;
itemsPerRepo?: number;
filterBy?: IssuesByRepoOptions['filterBy'];
orderBy?: IssuesByRepoOptions['orderBy'];
filterBy?: IssuesFilters;
orderBy?: IssuesOrdering;
};
export const GitHubIssues = (props: GitHubIssuesProps) => {
@@ -16,8 +16,7 @@
import { useApi } from '@backstage/core-plugin-api';
import useAsyncRetry from 'react-use/lib/useAsyncRetry';
import { gitHubIssuesApiRef } from '../api';
import { IssuesByRepoOptions } from '../types';
import { gitHubIssuesApiRef, IssuesByRepoOptions } from '../api';
export const useGetIssuesByRepoFromGitHub = (
repos: Array<string>,
+5
View File
@@ -20,3 +20,8 @@ export {
} from './plugin';
export type { GitHubIssuesProps } from './components/GitHubIssues';
export type {
IssuesFilters,
IssuesOrdering,
IssuesByRepoOptions,
} from './api/gitHubIssuesApi';
-34
View File
@@ -1,34 +0,0 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
type IssueState = 'OPEN' | 'CLOSED';
/** @internal */
export interface IssuesFilters {
assignee?: string;
createdBy?: string;
labels?: string[];
mentioned?: string;
milestone?: string;
states?: IssueState[];
}
export interface IssuesByRepoOptions {
filterBy?: IssuesFilters;
orderBy?: {
field: 'CREATED_AT' | 'UPDATED_AT' | 'COMMENTS';
direction?: 'ASC' | 'DESC';
};
}