more api cleanup

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-18 14:11:45 +02:00
parent e195112c5c
commit 3f739be9d9
88 changed files with 358 additions and 594 deletions
+10 -26
View File
@@ -28,35 +28,22 @@ export enum BuildStatus {
'success' = 0,
}
// Warning: (ae-missing-release-tag) "EntityGithubActionsContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityGithubActionsContent: () => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityLatestGithubActionRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityLatestGithubActionRunCard: ({
branch,
variant,
}: {
export const EntityLatestGithubActionRunCard: (props: {
branch: string;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityLatestGithubActionsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityLatestGithubActionsForBranchCard: ({
branch,
variant,
}: {
export const EntityLatestGithubActionsForBranchCard: (props: {
branch: string;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "EntityRecentGithubActionsRunsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityRecentGithubActionsRunsCard: ({
@@ -191,8 +178,6 @@ export class GithubActionsClient implements GithubActionsApi {
}): Promise<any>;
}
// Warning: (ae-missing-release-tag) "githubActionsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
const githubActionsPlugin: BackstagePlugin<
{
@@ -233,22 +218,21 @@ export type Jobs = {
jobs: Job[];
};
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "LatestWorkflowRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const LatestWorkflowRunCard: ({
branch,
variant,
}: Props_2) => JSX.Element;
export const LatestWorkflowRunCard: (props: {
branch: string;
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "LatestWorkflowsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const LatestWorkflowsForBranchCard: ({
branch,
variant,
}: Props_2) => JSX.Element;
export const LatestWorkflowsForBranchCard: (props: {
branch: string;
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "RecentWorkflowRunsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { useEntity } from '@backstage/plugin-catalog-react';
import {
@@ -27,7 +28,6 @@ import { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity';
import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';
import { WorkflowRunsTable } from '../WorkflowRunsTable';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
import { configApiRef, errorApiRef, useApi } from '@backstage/core-plugin-api';
import {
InfoCard,
@@ -43,20 +43,18 @@ const useStyles = makeStyles<Theme>({
},
});
const WidgetContent = ({
error,
loading,
lastRun,
branch,
}: {
const WidgetContent = (props: {
error?: Error;
loading?: boolean;
lastRun: WorkflowRun;
branch: string;
}) => {
const { error, loading, lastRun, branch } = props;
const classes = useStyles();
if (error) return <Typography>Couldn't fetch latest {branch} run</Typography>;
if (loading) return <LinearProgress />;
return (
<StructuredMetadataTable
metadata={{
@@ -80,11 +78,11 @@ const WidgetContent = ({
);
};
export const LatestWorkflowRunCard = ({
branch = 'master',
// Display the card full height suitable for
variant,
}: Props) => {
export const LatestWorkflowRunCard = (props: {
branch: string;
variant?: InfoCardVariants;
}) => {
const { branch = 'master', variant } = props;
const { entity } = useEntity();
const config = useApi(configApiRef);
const errorApi = useApi(errorApiRef);
@@ -120,15 +118,11 @@ export const LatestWorkflowRunCard = ({
);
};
type Props = {
export const LatestWorkflowsForBranchCard = (props: {
branch: string;
variant?: InfoCardVariants;
};
export const LatestWorkflowsForBranchCard = ({
branch = 'master',
variant,
}: Props) => {
}) => {
const { branch = 'master', variant } = props;
const { entity } = useEntity();
return (
+5
View File
@@ -25,6 +25,7 @@ import {
createComponentExtension,
} from '@backstage/core-plugin-api';
/** @public */
export const githubActionsPlugin = createPlugin({
id: 'github-actions',
apis: [
@@ -40,6 +41,7 @@ export const githubActionsPlugin = createPlugin({
},
});
/** @public */
export const EntityGithubActionsContent = githubActionsPlugin.provide(
createRoutableExtension({
name: 'EntityGithubActionsContent',
@@ -48,6 +50,7 @@ export const EntityGithubActionsContent = githubActionsPlugin.provide(
}),
);
/** @public */
export const EntityLatestGithubActionRunCard = githubActionsPlugin.provide(
createComponentExtension({
name: 'EntityLatestGithubActionRunCard',
@@ -58,6 +61,7 @@ export const EntityLatestGithubActionRunCard = githubActionsPlugin.provide(
}),
);
/** @public */
export const EntityLatestGithubActionsForBranchCard =
githubActionsPlugin.provide(
createComponentExtension({
@@ -71,6 +75,7 @@ export const EntityLatestGithubActionsForBranchCard =
}),
);
/** @public */
export const EntityRecentGithubActionsRunsCard = githubActionsPlugin.provide(
createComponentExtension({
name: 'EntityRecentGithubActionsRunsCard',