[] = [
type GithubDeploymentsTableProps = {
deployments: GithubDeployment[];
+ isLoading: boolean;
+ retry: () => void;
};
const GithubDeploymentsTable = ({
deployments,
+ isLoading,
+ retry,
}: GithubDeploymentsTableProps) => {
const classes = useStyles();
@@ -96,6 +101,15 @@ const GithubDeploymentsTable = ({
options={{ padding: 'dense', paging: true, search: false, pageSize: 5 }}
title="GitHub Deployments"
data={deployments}
+ isLoading={isLoading}
+ actions={[
+ {
+ icon: () => ,
+ tooltip: 'Refresh',
+ isFreeAction: true,
+ onClick: () => retry(),
+ },
+ ]}
emptyContent={
diff --git a/plugins/github-deployments/src/mocks/mocks.ts b/plugins/github-deployments/src/mocks/mocks.ts
index 6a394b54bf..f636a08558 100644
--- a/plugins/github-deployments/src/mocks/mocks.ts
+++ b/plugins/github-deployments/src/mocks/mocks.ts
@@ -64,4 +64,31 @@ export const responseStub: QueryResponse = {
},
};
+export const refreshedResponseStub: QueryResponse = {
+ repository: {
+ deployments: {
+ nodes: [
+ {
+ state: 'active',
+ environment: 'prd',
+ updatedAt: '2021-03-25T12:08:45Z',
+ commit: {
+ commitUrl: 'https://exampleapi.com/123456789',
+ abbreviatedOid: '12345',
+ },
+ },
+ {
+ state: 'failure',
+ environment: 'lab',
+ updatedAt: '2021-03-25T12:09:47Z',
+ commit: {
+ commitUrl: 'https://exampleapi.com/543212345',
+ abbreviatedOid: '54321',
+ },
+ },
+ ],
+ },
+ },
+};
+
export const noDataResponseStub: QueryResponse = {};