changeset and rename
Signed-off-by: Andrew Johnson <ajohnson@gocardless.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-deployments': minor
|
||||
---
|
||||
|
||||
add reload button and functionality
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/plugin-github-deployments",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -38,7 +38,7 @@ const GithubDeploymentsComponent = ({
|
||||
const api = useApi(githubDeploymentsApiRef);
|
||||
const [owner, repo] = projectSlug.split('/');
|
||||
|
||||
const { loading, value, error, retry } = useAsyncRetry(
|
||||
const { loading, value, error, retry: reload } = useAsyncRetry(
|
||||
async () => await api.listDeployments({ owner, repo, last }),
|
||||
);
|
||||
|
||||
@@ -50,7 +50,7 @@ const GithubDeploymentsComponent = ({
|
||||
<GithubDeploymentsTable
|
||||
deployments={value || []}
|
||||
isLoading={loading}
|
||||
retry={retry}
|
||||
reload={reload}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
+4
-4
@@ -85,13 +85,13 @@ const columns: TableColumn<GithubDeployment>[] = [
|
||||
type GithubDeploymentsTableProps = {
|
||||
deployments: GithubDeployment[];
|
||||
isLoading: boolean;
|
||||
retry: () => void;
|
||||
reload: () => void;
|
||||
};
|
||||
|
||||
const GithubDeploymentsTable = ({
|
||||
deployments,
|
||||
isLoading,
|
||||
retry,
|
||||
reload,
|
||||
}: GithubDeploymentsTableProps) => {
|
||||
const classes = useStyles();
|
||||
|
||||
@@ -105,9 +105,9 @@ const GithubDeploymentsTable = ({
|
||||
actions={[
|
||||
{
|
||||
icon: () => <SyncIcon />,
|
||||
tooltip: 'Refresh',
|
||||
tooltip: 'Reload',
|
||||
isFreeAction: true,
|
||||
onClick: () => retry(),
|
||||
onClick: () => reload(),
|
||||
},
|
||||
]}
|
||||
emptyContent={
|
||||
|
||||
Reference in New Issue
Block a user