clear job event search on relaunch

This commit is contained in:
Jake McDermott 2018-06-26 11:30:23 -04:00
parent e6668a43cd
commit 7f23aa81e6
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35

View File

@ -23,6 +23,13 @@ function atRelaunchCtrl (
const jobObj = new Job();
const jobTemplate = new JobTemplate();
const transitionOptions = { reload: true };
if ($state.includes('output')) {
transitionOptions.inherit = false;
transitionOptions.location = 'replace';
}
const updateTooltip = () => {
if (vm.job.type === 'job' && vm.job.status === 'failed') {
vm.tooltip = strings.get('relaunch.HOSTS');
@ -128,7 +135,7 @@ function atRelaunchCtrl (
.then((launchRes) => {
if (!$state.is('jobs')) {
const relaunchType = launchRes.data.type === 'job' ? 'playbook' : launchRes.data.type;
$state.go('output', { id: launchRes.data.id, type: relaunchType }, { reload: true });
$state.go('output', { id: launchRes.data.id, type: relaunchType }, transitionOptions);
}
}).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, {
@ -173,7 +180,7 @@ function atRelaunchCtrl (
inventorySource.postUpdate(vm.job.inventory_source)
.then((postUpdateRes) => {
if (!$state.is('jobs')) {
$state.go('output', { id: postUpdateRes.data.id, type: 'inventory' }, { reload: true });
$state.go('output', { id: postUpdateRes.data.id, type: 'inventory' }, transitionOptions);
}
}).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, {
@ -197,7 +204,7 @@ function atRelaunchCtrl (
project.postUpdate(vm.job.project)
.then((postUpdateRes) => {
if (!$state.is('jobs')) {
$state.go('output', { id: postUpdateRes.data.id, type: 'project' }, { reload: true });
$state.go('output', { id: postUpdateRes.data.id, type: 'project' }, transitionOptions);
}
}).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, {
@ -219,7 +226,7 @@ function atRelaunchCtrl (
id: vm.job.id
}).then((launchRes) => {
if (!$state.is('jobs')) {
$state.go('workflowResults', { id: launchRes.data.id }, { reload: true });
$state.go('workflowResults', { id: launchRes.data.id }, transitionOptions);
}
}).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, {
@ -243,7 +250,7 @@ function atRelaunchCtrl (
id: vm.job.id
}).then((launchRes) => {
if (!$state.is('jobs')) {
$state.go('output', { id: launchRes.data.id, type: 'command' }, { reload: true });
$state.go('output', { id: launchRes.data.id, type: 'command' }, transitionOptions);
}
}).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, {
@ -268,7 +275,7 @@ function atRelaunchCtrl (
relaunchData: PromptService.bundlePromptDataForRelaunch(vm.promptData)
}).then((launchRes) => {
if (!$state.is('jobs')) {
$state.go('output', { id: launchRes.data.job, type: 'playbook' }, { reload: true });
$state.go('output', { id: launchRes.data.job, type: 'playbook' }, transitionOptions);
}
}).catch(({ data, status }) => {
ProcessErrors($scope, data, status, null, {