Merge branch 'master' of github.com:Nek/backstage

This commit is contained in:
Ivan Shmidt
2020-05-18 17:19:45 +02:00
134 changed files with 2539 additions and 2758 deletions
@@ -22,8 +22,9 @@ import { makeStyles } from '@material-ui/core/styles';
import { PluginHeader } from '../../components/PluginHeader';
import { ActionOutput } from './lib/ActionOutput/ActionOutput';
import { Layout } from '../../components/Layout';
import { useBuildWithSteps, useSettings } from '../../state';
import LaunchIcon from '@material-ui/icons/Launch';
import { useSettings } from '../../state/useSettings';
import { useBuildWithSteps } from '../../state/useBuildWithSteps';
const IconLink = IconButton as typeof Link;
const BuildName: FC<{ build?: BuildWithSteps }> = ({ build }) => (
-3
View File
@@ -14,6 +14,3 @@
* limitations under the License.
*/
export * from './AppState';
export * from './useBuildWithSteps';
export * from './useBuilds';
export * from './useSettings';
@@ -33,5 +33,5 @@ export const useAsyncPolling = (
const stopPolling = () => {
isPolling.current = false;
};
return { isPolling, startPolling, stopPolling };
return { startPolling, stopPolling };
};
@@ -44,6 +44,11 @@ export function useBuildWithSteps(buildId: number) {
}
}, [token, owner, repo, buildId]);
const { startPolling, stopPolling } = useAsyncPolling(
getBuildWithSteps,
INTERVAL_AMOUNT,
);
const restartBuild = async () => {
try {
await api.retry(buildId, {
+5
View File
@@ -103,6 +103,11 @@ export function useBuilds() {
[repo, token, owner],
);
const { startPolling, stopPolling } = useAsyncPolling(
getBuilds,
INTERVAL_AMOUNT,
);
const restartBuild = async (buildId: number) => {
try {
await api.retry(buildId, {