@@ -128,18 +128,14 @@ export const EntityCloudbuildContent: () => JSX.Element;
|
||||
// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityLatestCloudbuildRunCard: ({
|
||||
branch,
|
||||
}: {
|
||||
export const EntityLatestCloudbuildRunCard: (props: {
|
||||
branch: string;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityLatestCloudbuildsForBranchCard: ({
|
||||
branch,
|
||||
}: {
|
||||
export const EntityLatestCloudbuildsForBranchCard: (props: {
|
||||
branch: string;
|
||||
}) => JSX.Element;
|
||||
|
||||
@@ -163,18 +159,12 @@ export { isCloudbuildAvailable as isPluginApplicableToEntity };
|
||||
// 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,
|
||||
}: {
|
||||
branch: string;
|
||||
}) => JSX.Element;
|
||||
export const LatestWorkflowRunCard: (props: { branch: string }) => 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,
|
||||
}: {
|
||||
export const LatestWorkflowsForBranchCard: (props: {
|
||||
branch: string;
|
||||
}) => JSX.Element;
|
||||
|
||||
|
||||
@@ -72,11 +72,8 @@ const WidgetContent = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const LatestWorkflowRunCard = ({
|
||||
branch = 'master',
|
||||
}: {
|
||||
branch: string;
|
||||
}) => {
|
||||
export const LatestWorkflowRunCard = (props: { branch: string }) => {
|
||||
const { branch = 'master' } = props;
|
||||
const { entity } = useEntity();
|
||||
const errorApi = useApi(errorApiRef);
|
||||
const projectId = entity?.metadata.annotations?.[CLOUDBUILD_ANNOTATION] || '';
|
||||
@@ -103,11 +100,8 @@ export const LatestWorkflowRunCard = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const LatestWorkflowsForBranchCard = ({
|
||||
branch = 'master',
|
||||
}: {
|
||||
branch: string;
|
||||
}) => {
|
||||
export const LatestWorkflowsForBranchCard = (props: { branch: string }) => {
|
||||
const { branch = 'master' } = props;
|
||||
const { entity } = useEntity();
|
||||
|
||||
return (
|
||||
|
||||
@@ -61,8 +61,8 @@ const useStyles = makeStyles<Theme>(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const WorkflowRunDetails = ({ entity }: { entity: Entity }) => {
|
||||
const { value: projectName, loading, error } = useProjectName(entity);
|
||||
export const WorkflowRunDetails = (props: { entity: Entity }) => {
|
||||
const { value: projectName, loading, error } = useProjectName(props.entity);
|
||||
const [projectId] = (projectName ?? '/').split('/');
|
||||
|
||||
const details = useWorkflowRunsDetails(projectId);
|
||||
|
||||
@@ -23,11 +23,8 @@ import {
|
||||
StatusError,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
export const WorkflowRunStatus = ({
|
||||
status,
|
||||
}: {
|
||||
status: string | undefined;
|
||||
}) => {
|
||||
export const WorkflowRunStatus = (props: { status: string | undefined }) => {
|
||||
const { status } = props;
|
||||
if (status === undefined) return null;
|
||||
switch (status.toLocaleLowerCase('en-US')) {
|
||||
case 'queued':
|
||||
|
||||
@@ -164,8 +164,8 @@ export const WorkflowRunsTableView = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const WorkflowRunsTable = ({ entity }: { entity: Entity }) => {
|
||||
const { value: projectName, loading } = useProjectName(entity);
|
||||
export const WorkflowRunsTable = (props: { entity: Entity }) => {
|
||||
const { value: projectName, loading } = useProjectName(props.entity);
|
||||
const [projectId] = (projectName ?? '/').split('/');
|
||||
|
||||
const [tableProps, { retry, setPage, setPageSize }] = useWorkflowRuns({
|
||||
|
||||
@@ -33,7 +33,8 @@ export type WorkflowRun = {
|
||||
rerun: () => void;
|
||||
};
|
||||
|
||||
export function useWorkflowRuns({ projectId }: { projectId: string }) {
|
||||
export function useWorkflowRuns(options: { projectId: string }) {
|
||||
const { projectId } = options;
|
||||
const api = useApi(cloudbuildApiRef);
|
||||
const errorApi = useApi(errorApiRef);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user