mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
5c86db3435
commit
d04963f700
2 changed files with 6 additions and 8 deletions
|
@ -28,7 +28,7 @@ export const indexRepoSuccess = createAction<string>('INDEX REPOS SUCCESS');
|
|||
export const indexRepoFailed = createAction<Error>('INDEX REPOS FAILED');
|
||||
|
||||
export const importRepo = createAction<string>('IMPORT REPO');
|
||||
export const importRepoSuccess = createAction<string>('IMPORT REPO SUCCESS');
|
||||
export const importRepoSuccess = createAction<Repository>('IMPORT REPO SUCCESS');
|
||||
export const importRepoFailed = createAction<Error>('IMPORT REPO FAILED');
|
||||
|
||||
export const closeToast = createAction('CLOSE TOAST');
|
||||
|
|
|
@ -21,14 +21,12 @@ import {
|
|||
takeLatest,
|
||||
} from 'redux-saga/effects';
|
||||
|
||||
import { RepositoryUtils } from '../../common/repository_utils';
|
||||
import { Repository, RepositoryUri, WorkerReservedProgress } from '../../model';
|
||||
import * as ROUTES from '../components/routes';
|
||||
import { allStatusSelector, repoUriSelector, routeSelector } from '../selectors';
|
||||
import {
|
||||
deleteRepo,
|
||||
fetchReposSuccess,
|
||||
importRepo,
|
||||
indexRepo,
|
||||
loadRepoSuccess,
|
||||
loadStatusFailed,
|
||||
|
@ -43,6 +41,7 @@ import {
|
|||
pollRepoCloneStatusStop,
|
||||
pollRepoDeleteStatusStop,
|
||||
pollRepoIndexStatusStop,
|
||||
importRepoSuccess,
|
||||
} from '../actions';
|
||||
import { RepoState } from '../reducers';
|
||||
import {
|
||||
|
@ -170,9 +169,8 @@ export function* watchResetPollingStatus() {
|
|||
}
|
||||
|
||||
const parseCloneStatusPollingRequest = (action: Action<any>) => {
|
||||
if (action.type === String(importRepo)) {
|
||||
const repoUrl: string = action.payload;
|
||||
return RepositoryUtils.buildRepository(repoUrl).uri;
|
||||
if (action.type === String(importRepoSuccess)) {
|
||||
return action.payload.uri;
|
||||
} else if (action.type === String(pollRepoCloneStatusStart)) {
|
||||
return action.payload;
|
||||
}
|
||||
|
@ -213,7 +211,7 @@ export function* watchRepoCloneStatusPolling() {
|
|||
// * user click import repository
|
||||
// * repository status has been loaded and it's in cloning
|
||||
yield takeEvery(
|
||||
[String(importRepo), String(pollRepoCloneStatusStart)],
|
||||
[String(importRepoSuccess), String(pollRepoCloneStatusStart)],
|
||||
pollRepoCloneStatusRunner
|
||||
);
|
||||
}
|
||||
|
@ -346,7 +344,7 @@ function createRepoStatusPollingRunner(
|
|||
// Wait for the cancellation task
|
||||
yield take(pollingStopActionFunctionPattern(repoUri));
|
||||
|
||||
// Cancell the task
|
||||
// Cancel the task
|
||||
yield cancel(task);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue