Automatically change instances of .success to .then with this linux script:

#Run in awx/awx/ui/client/src

    #!/bin/bash -ex
    FILES=`grep -l -R "\.success(\s*function\s*(data)\s*{" . | xargs`
    sed -i "s/\.success(\s*function\s*(data)\s*{/\.then(({data}) => {/g" $FILES

    FILES=`grep -l -R "\.success(\s*function\s*()\s*{" . | xargs`
    sed -i "s/\.success(\s*function\s*()\s*{/\.then(() => {/g" $FILES

    FILES=`grep -l -R "\.success(this\.success\.bind(this))" . | xargs`
    sed -i "s/\.success(this\.success\.bind(this))/\.then(this\.then\.bind(this))/g" $FILES
This commit is contained in:
Ben Thomasson 2017-10-04 13:18:30 -04:00 committed by Marliana Lara
parent fabdab78ef
commit 834e6c692c
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
91 changed files with 194 additions and 194 deletions

View File

@ -21,7 +21,7 @@ export default ['$scope', 'ListDefinition', 'Dataset', 'Wait', 'Rest', 'ProcessE
Wait('start');
Rest.setUrl(url);
Rest.post({ "disassociate": true, "id": Number(userId) })
.success(function() {
.then(() => {
Wait('stop');
$state.go('.', null, {reload: true});
})
@ -54,7 +54,7 @@ export default ['$scope', 'ListDefinition', 'Dataset', 'Wait', 'Rest', 'ProcessE
Wait('start');
Rest.setUrl(url);
Rest.post({ "disassociate": true, "id": teamId })
.success(function() {
.then(() => {
Wait('stop');
$state.go('.', null, {reload: true});
})

View File

@ -53,7 +53,7 @@ export default
Rest.setUrl(url);
Rest.post({ "disassociate": true, "id": entry.id })
.success(function() {
.then(() => {
Wait('stop');
$state.go('.', null, { reload: true });
})

View File

@ -15,7 +15,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
Rest.setUrl(url);
Rest.options()
.success(function(data) {
.then(({data}) => {
// Compare GET actions with PUT actions and flag discrepancies
// for disabling in the UI
var getActions = data.actions.GET;
@ -47,7 +47,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
Rest.setUrl(url);
Rest.patch(body)
.success(function(data) {
.then(({data}) => {
deferred.resolve(data);
})
.error(function(error) {
@ -61,7 +61,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
var deferred = $q.defer();
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
deferred.resolve(data);
})
.error(function(error) {

View File

@ -99,7 +99,7 @@ export default ['Rest', 'Wait',
inputs: inputs,
injectors: injectors
})
.success(function(data) {
.then(({data}) => {
$state.go('credentialTypes.edit', { credential_type_id: data.id }, { reload: true });
Wait('stop');
})

View File

@ -173,7 +173,7 @@ export default ['Rest', 'Wait',
inputs: inputs,
injectors: injectors
})
.success(function() {
.then(() => {
$state.go($state.current, null, { reload: true });
Wait('stop');
})

View File

@ -60,7 +60,7 @@ export default ['$rootScope', '$scope', 'Wait', 'CredentialTypesList',
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
let reloadListStateParams = null;

View File

@ -51,7 +51,7 @@ export default
url = GetBasePath("credentials");
Rest.setUrl(url);
Rest.post(data)
.success(function (data) {
.then(({data}) => {
scope.addedItem = data.id;
Wait('stop');
@ -83,7 +83,7 @@ export default
url = GetBasePath('credentials') + scope.id + '/';
Rest.setUrl(url);
Rest.put(data)
.success(function () {
.then(() => {
Wait('stop');
$state.go($state.current, {}, {reload: true});
})

View File

@ -85,7 +85,7 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', '
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
let reloadListStateParams = null;

View File

@ -14,7 +14,7 @@ export default ['$scope', '$rootScope','Wait',
$scope.$on('ws-jobs', function () {
Rest.setUrl(GetBasePath('dashboard'));
Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.dashboardData = data;
})
.error(function (data, status) {
@ -23,7 +23,7 @@ export default ['$scope', '$rootScope','Wait',
Rest.setUrl(GetBasePath("unified_jobs") + "?order_by=-finished&page_size=5&finished__isnull=false&type=workflow_job,job");
Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.dashboardJobsListData = data.results;
})
.error(function (data, status) {
@ -32,7 +32,7 @@ export default ['$scope', '$rootScope','Wait',
Rest.setUrl(GetBasePath("unified_job_templates") + "?order_by=-last_job_run&page_size=5&last_job_run__isnull=false&type=workflow_job_template,job_template");
Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.dashboardJobTemplatesListData = data.results;
})
.error(function (data, status) {
@ -90,7 +90,7 @@ export default ['$scope', '$rootScope','Wait',
Wait('start');
Rest.setUrl(GetBasePath('dashboard'));
Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.dashboardData = data;
$scope.$emit('dashboardReady', data);
})
@ -99,7 +99,7 @@ export default ['$scope', '$rootScope','Wait',
});
Rest.setUrl(GetBasePath("unified_jobs") + "?order_by=-finished&page_size=5&finished__isnull=false&type=workflow_job,job");
Rest.get()
.success(function (data) {
.then(({data}) => {
data = data.results;
$scope.$emit('dashboardJobsListReady', data);
})
@ -108,7 +108,7 @@ export default ['$scope', '$rootScope','Wait',
});
Rest.setUrl(GetBasePath("unified_job_templates") + "?order_by=-last_job_run&page_size=5&last_job_run__isnull=false&type=workflow_job_template,job_template");
Rest.get()
.success(function (data) {
.then(({data}) => {
data = data.results;
$scope.$emit('dashboardJobTemplatesListReady', data);
})

View File

@ -239,7 +239,7 @@ function adhocController($q, $scope, $stateParams,
// Launch the adhoc job
Rest.setUrl(GetBasePath('inventory') + id + '/ad_hoc_commands/');
Rest.post(data)
.success(function (data) {
.then(({data}) => {
Wait('stop');
$state.go('adHocJobStdout', {id: data.id});
})

View File

@ -10,7 +10,7 @@ export default [ '$scope', 'Empty', 'Wait', 'GetBasePath', 'Rest', 'ProcessError
url += "&order_by=-finished&page_size=5";
Rest.setUrl(url);
Rest.get()
.success( function(data) {
.then(({data}) => {
$scope.generateTable(data, event);
})
.error( function(data, status) {

View File

@ -85,7 +85,7 @@ function InventoriesList($scope,
$('#prompt-modal').modal('hide');
Rest.setUrl(url);
Rest.destroy()
.success(function () {
.then(() => {
Wait('stop');
})
.error(function (data, status) {

View File

@ -6,7 +6,7 @@ export default [ '$scope', 'Wait', 'Empty', 'Rest', 'ProcessErrors', '$state',
Wait('start');
Rest.setUrl($scope.inventory.related.inventory_sources + '?order_by=-last_job_run&page_size=5');
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.generateTable(data, event);
})
.error(function(data, status) {

View File

@ -22,7 +22,7 @@ export default
var getNext = function(data, arr, resolve) {
Rest.setUrl(data.next);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.next) {
getNext(data, arr.concat(data.results), resolve);
} else {
@ -35,7 +35,7 @@ export default
var seeMoreResolve = $q.defer();
Rest.setUrl(`${scope[scope.$parent.list.iterator].related.groups}?order_by=id`);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.next) {
getNext(data, data.results, seeMoreResolve);
} else {
@ -65,7 +65,7 @@ export default
if(url) {
Rest.setUrl(url);
Rest.post({"disassociate": true, "id": host.id})
.success(function () {
.then(() => {
Wait('stop');
$state.go('.', null, {reload: true});
})

View File

@ -36,7 +36,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
Wait('start');
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.inventory_files = data;
$scope.inventory_files.push("/ (project root)");
sync_inventory_file_select2();

View File

@ -116,7 +116,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
Wait('start');
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.inventory_files = data;
$scope.inventory_files.push("/ (project root)");

View File

@ -16,18 +16,18 @@ export default
Wait('start');
Rest.setUrl(inventory_source.url);
Rest.get()
.success(function (data) {
.then(({data}) => {
// Check that we have access to cancelling an update
var url = (data.related.current_update) ? data.related.current_update : data.related.last_update;
url += 'cancel/';
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.can_cancel) {
// Cancel the update process
Rest.setUrl(url);
Rest.post()
.success(function () {
.then(() => {
Wait('stop');
//Alert('Inventory Sync Cancelled', 'Request to cancel the sync process was submitted to the task manger. ' +
// 'Click the <i class="fa fa-refresh fa-lg"></i> button to monitor the status.', 'alert-info');

View File

@ -8,7 +8,7 @@ export default
scope[variable] = [];
Rest.setUrl(GetBasePath('inventory_sources'));
Rest.options()
.success(function (data) {
.then(({data}) => {
var i, choices = data.actions.GET.source.choices;
for (i = 0; i < choices.length; i++) {
if (choices[i][0] !== 'file' && choices[i][0] !== "") {

View File

@ -13,7 +13,7 @@ export default
Wait('start');
Rest.setUrl(inventory_source.url);
Rest.get()
.success(function (data) {
.then(({data}) => {
// Get the ID from the correct summary field
var update_id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id;

View File

@ -23,7 +23,7 @@ export default
this.url = GetBasePath('inventory_sources') + '?' + this.stringifyParams(params);
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -32,7 +32,7 @@ export default
this.url = GetBasePath('inventory_sources');
Rest.setUrl(this.url);
return Rest.post(inventory_source)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -41,7 +41,7 @@ export default
this.url = GetBasePath('inventory_sources') + inventory_source.id;
Rest.setUrl(this.url);
return Rest.put(inventory_source)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -50,7 +50,7 @@ export default
this.url = GetBasePath('inventory_sources') + id;
Rest.setUrl(this.url);
return Rest.destroy()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -58,7 +58,7 @@ export default
this.url = GetBasePath('inventory_sources');
Rest.setUrl(this.url);
return Rest.options()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this));
},
getCredential: function(id){
@ -66,7 +66,7 @@ export default
this.url = GetBasePath('credentials') + id;
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -75,7 +75,7 @@ export default
this.url = GetBasePath('inventory_sources') + '?' + this.stringifyParams(params);
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -84,7 +84,7 @@ export default
this.url = url;
Rest.setUrl(this.url);
return Rest.put(params)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -94,7 +94,7 @@ export default
this.url = GetBasePath('groups') + target + '/children/';
Rest.setUrl(this.url);
return Rest.post(group)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -103,7 +103,7 @@ export default
this.url = GetBasePath('groups') + parent + '/children/';
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -112,7 +112,7 @@ export default
this.url = GetBasePath('inventory') + inventory + '/groups/';
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},

View File

@ -60,7 +60,7 @@ function SmartInventoryAdd($scope, $location,
Rest.setUrl(defaultUrl);
Rest.post(data)
.success(function(data) {
.then(({data}) => {
const inventory_id = data.id,
instance_group_url = data.related.instance_groups;

View File

@ -77,7 +77,7 @@ function SmartInventoryEdit($scope, $location,
Rest.setUrl(defaultUrl + inventory_id + '/');
Rest.put(data)
.success(function() {
.then(() => {
InstanceGroupsService.editInstanceGroups(instance_group_url, $scope.instance_groups)
.then(() => {
Wait('stop');

View File

@ -18,7 +18,7 @@ export default {
let ansibleFactsUrl = GetBasePath('hosts') + $stateParams.host_id + '/ansible_facts';
Rest.setUrl(ansibleFactsUrl);
return Rest.get()
.success(function(data) {
.then(({data}) => {
return data;
});
}

View File

@ -23,7 +23,7 @@ export default
this.url = GetBasePath('groups') + '?' + this.stringifyParams(params);
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -32,7 +32,7 @@ export default
this.url = GetBasePath('groups');
Rest.setUrl(this.url);
return Rest.post(group)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -41,7 +41,7 @@ export default
this.url = GetBasePath('groups') + group.id;
Rest.setUrl(this.url);
return Rest.put(group)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -50,7 +50,7 @@ export default
this.url = GetBasePath('groups') + id;
Rest.setUrl(this.url);
return Rest.destroy()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -59,7 +59,7 @@ export default
this.url = GetBasePath('credentials') + id;
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -68,7 +68,7 @@ export default
this.url = GetBasePath('inventory_sources') + '?' + this.stringifyParams(params);
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -77,7 +77,7 @@ export default
this.url = url;
Rest.setUrl(this.url);
return Rest.put(params)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -87,7 +87,7 @@ export default
this.url = GetBasePath('groups') + target + '/children/';
Rest.setUrl(this.url);
return Rest.post(group)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -96,7 +96,7 @@ export default
this.url = GetBasePath('groups') + parent + '/children/';
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -105,7 +105,7 @@ export default
this.url = GetBasePath('groups') + target + '/hosts/';
Rest.setUrl(this.url);
return Rest.post(host)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -114,7 +114,7 @@ export default
this.url = GetBasePath('groups') + group + '/hosts/';
Rest.setUrl(this.url);
return Rest.post({id: host, disassociate: 1})
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -123,7 +123,7 @@ export default
this.url = GetBasePath('inventory') + inventory + '/groups/';
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
}

View File

@ -30,7 +30,7 @@
this.url = GetBasePath('hosts') + '?' + this.stringifyParams(params);
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -39,7 +39,7 @@
this.url = GetBasePath('hosts');
Rest.setUrl(this.url);
return Rest.post(host)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -48,7 +48,7 @@
this.url = GetBasePath('hosts') + host.id;
Rest.setUrl(this.url);
return Rest.put(host)
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -57,7 +57,7 @@
this.url = GetBasePath('hosts') + id;
Rest.setUrl(this.url);
return Rest.destroy()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
}

View File

@ -25,7 +25,7 @@
this.url = GetBasePath('inventory') + id;
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -36,7 +36,7 @@
}).join('');
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
},
@ -60,21 +60,21 @@
this.url = GetBasePath('inventory') + inventoryId + '/inventory_sources';
Rest.setUrl(this.url);
return Rest.options()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this));
},
updateInventorySourcesGet: function(inventoryId) {
this.url = GetBasePath('inventory') + inventoryId + '/update_inventory_sources';
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this));
},
getHost: function(inventoryId, hostId) {
this.url = GetBasePath('inventory') + inventoryId + '/hosts?id=' + hostId;
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.then(this.then.bind(this))
.error(this.error.bind(this));
}
};

View File

@ -19,7 +19,7 @@ export default ['Rest', 'Wait',
function init() {
Rest.setUrl(url);
Rest.options()
.success(function(data) {
.then(({data}) => {
if (!data.actions.POST) {
$state.go("^");
Alert('Permission Error', 'You do not have permission to add an inventory script.', 'alert-info');
@ -43,7 +43,7 @@ export default ['Rest', 'Wait',
organization: $scope.organization,
script: $scope.script
})
.success(function() {
.then(() => {
$state.go('inventoryScripts', null, { reload: true });
Wait('stop');
})

View File

@ -59,7 +59,7 @@ export default ['Rest', 'Wait',
organization: $scope.organization,
script: $scope.script
})
.success(function() {
.then(() => {
$state.go('inventoryScripts', null, { reload: true });
Wait('stop');
})

View File

@ -50,7 +50,7 @@ export default ['$rootScope', '$scope', 'Wait', 'InventoryScriptsList',
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
let reloadListStateParams = null;

View File

@ -76,7 +76,7 @@ export default {
Rest.setUrl(jobData.related.job_events +
"?event=playbook_on_stats");
Rest.get()
.success(function(data) {
.then(({data}) => {
if(!data.results[0]){
defer.resolve({val: {
ok: 0,
@ -131,7 +131,7 @@ export default {
var getNext = function(data, arr, resolve) {
Rest.setUrl(data.next);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.next) {
getNext(data, arr.concat(data.results), resolve);
} else {
@ -145,7 +145,7 @@ export default {
Rest.setUrl(GetBasePath('jobs') + $stateParams.id + '/labels/');
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.next) {
getNext(data, data.results, seeMoreResolve);
} else {

View File

@ -73,7 +73,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
val.resolve({results: data.results,
next: data.next});
})
@ -101,7 +101,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
Wait('start');
Rest.setUrl(job.url);
Rest.destroy()
.success(function() {
.then(() => {
Wait('stop');
$('#prompt-modal').modal('hide');
$state.go('jobs');
@ -123,7 +123,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
var doCancel = function() {
Rest.setUrl(job.url + 'cancel');
Rest.post({})
.success(function() {
.then(() => {
Wait('stop');
$('#prompt-modal').modal('hide');
})
@ -150,7 +150,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
Wait('start');
Rest.setUrl(job.url + 'cancel');
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.can_cancel === true) {
doCancel();
} else {
@ -239,7 +239,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
url = url + id + '/job_events/?' + this.stringifyParams(params);
Rest.setUrl(url);
return Rest.get()
.success(function(data){
.then(({data}) => {
return data;
})
.error(function(data, status) {

View File

@ -59,7 +59,7 @@
Wait('start');
Rest.setUrl(GetBasePath('ad_hoc_commands') + new_job_id + '/');
Rest.destroy()
.success(function() {
.then(() => {
Wait('stop');
})
.error(function (data, status) {
@ -86,7 +86,7 @@
// Re-launch the adhoc job
Rest.setUrl(url);
Rest.post(postData)
.success(function (data) {
.then(({data}) => {
Wait('stop');
if($location.path().replace(/^\//, '').split('/')[0] !== 'jobs') {
$state.go('adHocJobStdout', {id: data.id});
@ -133,7 +133,7 @@
url = GetBasePath('ad_hoc_commands') + id + '/relaunch/';
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
new_job_id = data.id;
scope.passwords_needed_to_start = data.passwords_needed_to_start;

View File

@ -9,7 +9,7 @@ export default
if (!Empty(credential)) {
Rest.setUrl(GetBasePath('credentials')+credential);
Rest.get()
.success(function (data) {
.then(({data}) => {
credentialTypesLookup()
.then(kinds => {
if(data.credential_type === kinds.Machine && data.inputs){

View File

@ -20,7 +20,7 @@ export default
Rest.setUrl(survey_url);
Rest.get()
.success(function (data) {
.then(({data}) => {
if(!Empty(data)){
scope.survey_name = data.name;
scope.survey_description = data.description;

View File

@ -42,7 +42,7 @@ export default
Wait('start');
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
if(params.updateAllSources) {
scope.$emit('StartTheUpdate', {});
}

View File

@ -139,7 +139,7 @@ export default
Rest.setUrl(url);
Rest.post(job_launch_data)
.success(function(data) {
.then(({data}) => {
Wait('stop');
var job = data.job || data.system_job || data.project_update || data.inventory_update || data.ad_hoc_command;
if(base !== 'portal' && Empty(data.system_job) || (base === 'home')){
@ -200,7 +200,7 @@ export default
var getExtraVars = function() {
Rest.setUrl(vars_url);
Rest.get()
.success(function (data) {
.then(({data}) => {
if(!Empty(data.extra_vars)){
data.extra_vars = ToJSON('yaml', data.extra_vars, false);
$.each(data.extra_vars, function(key,value){

View File

@ -43,7 +43,7 @@ export default
Wait('start');
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
project = data;
if (project.can_update) {
if (project.passwords_needed_to_updated) {

View File

@ -152,7 +152,7 @@ export default
Wait('start');
Rest.setUrl(launch_url);
Rest.get()
.success(function (data) {
.then(({data}) => {
// Put all the data that we get back about the launch onto scope
angular.extend($scope, data);

View File

@ -42,7 +42,7 @@
Rest.setUrl(url);
if (action_label === 'cancel') {
Rest.post()
.success(function () {
.then(() => {
$('#prompt-modal').modal('hide');
if (callback) {
scope.$emit(callback, action_label);
@ -64,7 +64,7 @@
});
} else {
Rest.destroy()
.success(function () {
.then(() => {
$('#prompt-modal').modal('hide');
if (callback) {
scope.$emit(callback, action_label);
@ -119,7 +119,7 @@
if (action_label === 'cancel') {
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.can_cancel) {
scope.$emit('CancelJob');
}

View File

@ -7,7 +7,7 @@ export default
Wait('start');
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
InventoryUpdate({
scope: scope,
url: data.related.update

View File

@ -86,7 +86,7 @@ export default
$scope.submit = function(){
Wait('start');
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
.success(function(){
.then(() => {
reset();
ConfigService.delete();
ConfigService.getConfig().then(function(config){

View File

@ -139,7 +139,7 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
scope.removeAuthorizationGetUser = scope.$on('AuthorizationGetUser', function() {
// Get all the profile/access info regarding the logged in user
Authorization.getUser()
.success(function (data) {
.then(({data}) => {
Authorization.setUserInfo(data);
Timer.init().then(function(timer){
$rootScope.sessionTimer = timer;

View File

@ -20,7 +20,7 @@ export default
var getManagementJobs = function(){
Rest.setUrl(defaultUrl);
Rest.get()
.success(function(data){
.then(({data}) => {
$scope.mgmtCards = data.results;
Wait('stop');
})
@ -128,7 +128,7 @@ export default
Rest.setUrl(defaultUrl);
Rest.post(data)
.success(function(data) {
.then(({data}) => {
Wait('stop');
$("#prompt-for-days-facts").dialog("close");
$("#configure-dialog").dialog('close');
@ -218,7 +218,7 @@ export default
Rest.setUrl(defaultUrl);
Rest.post(data)
.success(function(data) {
.then(({data}) => {
Wait('stop');
$("#prompt-for-days").dialog("close");
// $("#configure-dialog").dialog('close');

View File

@ -24,7 +24,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
function init() {
Rest.setUrl(GetBasePath('projects'));
Rest.options()
.success(function(data) {
.then(({data}) => {
if (!data.actions.POST) {
$state.go("^");
Alert('Permission Error', 'You do not have permission to add a notification template.', 'alert-info');
@ -48,7 +48,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
})
.error(function(data, status) {
@ -213,7 +213,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
Wait('start');
Rest.setUrl(url);
Rest.post(params)
.success(function() {
.then(() => {
$state.go('notifications', {}, { reload: true });
Wait('stop');
})

View File

@ -59,7 +59,7 @@ export default ['Rest', 'Wait',
Wait('start');
Rest.setUrl(url + id + '/');
Rest.get()
.success(function(data) {
.then(({data}) => {
var fld;
for (fld in form.fields) {
if (data[fld]) {
@ -280,7 +280,7 @@ export default ['Rest', 'Wait',
Wait('start');
Rest.setUrl(url + id + '/');
Rest.put(params)
.success(function() {
.then(() => {
$state.go('notifications', {}, { reload: true });
Wait('stop');
})

View File

@ -164,7 +164,7 @@
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
let reloadListStateParams = null;

View File

@ -26,7 +26,7 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', 'GetChoices',
Rest.setUrl($rootScope.current_user.related.admin_of_organizations);
Rest.get()
.success(function(data) {
.then(({data}) => {
scope.current_user_admin_orgs = data.results.map(i => i.name);
});

View File

@ -39,7 +39,7 @@ export default ['Wait', 'ProcessErrors', 'Rest',
Wait('start');
Rest.setUrl(url);
Rest.post(params)
.success( function(data) {
.then(({data}) => {
if (callback) {
scope.$emit(callback, data.id);
notifier[column] = !notifier[column];

View File

@ -12,7 +12,7 @@ export default ['$scope', '$rootScope', '$location', '$stateParams',
Rest.setUrl(GetBasePath('organizations'));
Rest.options()
.success(function(data) {
.then(({data}) => {
if (!data.actions.POST) {
$state.go("^");
Alert('Permission Error', 'You do not have permission to add an organization.', 'alert-info');

View File

@ -36,7 +36,7 @@ export default ['$scope', '$location', '$stateParams',
Wait('start');
Rest.setUrl(defaultUrl + id + '/');
Rest.get()
.success(function(data) {
.then(({data}) => {
let fld;
$scope.organization_name = data.name;
@ -124,7 +124,7 @@ export default ['$scope', '$location', '$stateParams',
var url = defaultUrl + $stateParams.organization_id + '/' + set + '/';
Rest.setUrl(url);
Rest.post({ id: itm_id, disassociate: 1 })
.success(function() {
.then(() => {
$('#prompt-modal').modal('hide');
})
.error(function(data, status) {

View File

@ -24,7 +24,7 @@ export default ['$stateParams', '$scope', 'Rest', '$state',
Rest.setUrl(orgBase + $stateParams.organization_id);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
$scope.name = data.name;
$scope.org_id = data.id;
@ -51,7 +51,7 @@ export default ['$stateParams', '$scope', 'Rest', '$state',
Rest.post({
id: id,
disassociate: true
}).success(function() {
}).then(() => {
$state.go('.', null, { reload: true });
})
.error(function(data, status) {

View File

@ -28,7 +28,7 @@ export default ['$scope', '$rootScope', '$location',
$rootScope.flashMessage = null;
Rest.setUrl(orgBase + $stateParams.organization_id);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
$scope.name = data.name;
@ -194,7 +194,7 @@ export default ['$scope', '$rootScope', '$location',
Wait('start');
Rest.setUrl(inventory.related.inventory_sources + '?or__source=ec2&or__source=rax&order_by=-last_job_run&page_size=5');
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.$emit('GroupSummaryReady', event, inventory, data);
})
.error(function(data, status) {
@ -218,7 +218,7 @@ export default ['$scope', '$rootScope', '$location',
url += "&order_by=-finished&page_size=5";
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.$emit('HostSummaryReady', event, data);
})
.error(function(data, status) {

View File

@ -34,7 +34,7 @@ export default ['$scope', '$rootScope',
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
Rest.setUrl(orgBase + $stateParams.organization_id);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
$scope.name = data.name;
$scope.org_id = data.id;

View File

@ -99,7 +99,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
// Go out and get the organization
Rest.setUrl(orgBase + $stateParams.organization_id);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
$scope.name = data.name;
$scope.org_id = data.id;
@ -205,7 +205,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
// Refresh what we have in memory to insure we're accessing the most recent status record
Rest.setUrl(project.url);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.$emit('GoTojobResults', data);
})
.error(function(data, status) {
@ -224,7 +224,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
// Cancel the project update process
Rest.setUrl(url);
Rest.post()
.success(function() {
.then(() => {
Alert('SCM Update Cancel', 'Your request to cancel the update was submitted to the task manager.', 'alert-info');
$scope.refresh();
})
@ -241,7 +241,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
var url = data.related.cancel;
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.can_cancel) {
$scope.$emit('Cancel_Update', url);
} else {
@ -257,11 +257,11 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
$scope.cancelUpdate = function(id, name) {
Rest.setUrl(GetBasePath("projects") + id);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.related.current_update) {
Rest.setUrl(data.related.current_update);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.$emit('Check_Cancel', data);
})
.error(function(data, status) {

View File

@ -30,7 +30,7 @@ export default ['$scope', '$stateParams', 'OrgTeamList', 'Rest', 'OrgTeamsDatase
Rest.setUrl(orgBase + $stateParams.organization_id);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
$scope.name = data.name;

View File

@ -23,7 +23,7 @@ export default ['$stateParams', '$scope', 'OrgUserList','Rest', '$state',
Rest.setUrl(orgBase + $stateParams.organization_id);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.organization_name = data.name;
$scope.name = data.name;
$scope.org_id = data.id;
@ -50,7 +50,7 @@ export default ['$stateParams', '$scope', 'OrgUserList','Rest', '$state',
Rest.post({
id: id,
disassociate: true
}).success(function() {
}).then(() => {
$state.go('.', null, { reload: true });
})
.error(function(data, status) {

View File

@ -143,7 +143,7 @@ export default ['$stateParams', '$scope', '$rootScope',
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
Wait('stop');
let reloadListStateParams = null;

View File

@ -23,7 +23,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
$scope.canEditOrg = true;
Rest.setUrl(GetBasePath('projects'));
Rest.options()
.success(function(data) {
.then(({data}) => {
if (!data.actions.POST) {
$state.go("^");
Alert(i18n._('Permission Error'), i18n._('You do not have permission to add a project.'), 'alert-info');
@ -99,7 +99,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
Wait('start');
Rest.setUrl(url);
Rest.post(data)
.success(function(data) {
.then(({data}) => {
$scope.addedItem = data.id;
$state.go('projects.edit', { project_id: data.id }, { reload: true });
})

View File

@ -85,7 +85,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
// Retrieve detail record and prepopulate the form
Rest.setUrl(defaultUrl);
Rest.get({ params: { id: id } })
.success(function(data) {
.then(({data}) => {
var fld, i;
for (fld in form.fields) {
if (form.fields[fld].type === 'checkbox_group') {
@ -214,7 +214,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
Rest.setUrl(defaultUrl);
Rest.put(params)
.success(function() {
.then(() => {
Wait('stop');
$state.go($state.current, {}, { reload: true });
})
@ -230,7 +230,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
$rootScope.flashMessage = null;
Rest.setUrl(url);
Rest.post({ id: itm_id, disassociate: 1 })
.success(function() {
.then(() => {
$('#prompt-modal').modal('hide');
})
.error(function(data, status) {

View File

@ -26,7 +26,7 @@ export default
Rest.setUrl(GetBasePath('config'));
Rest.get()
.success(function (data) {
.then(({data}) => {
var opts = [], i;
if (data.project_local_paths) {
for (i = 0; i < data.project_local_paths.length; i++) {

View File

@ -162,7 +162,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
// Refresh what we have in memory to insure we're accessing the most recent status record
Rest.setUrl(project.url);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.$emit('GoTojobResults', data);
})
.error(function(data, status) {
@ -179,7 +179,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
let reloadListStateParams = null;
@ -218,7 +218,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
// Cancel the project update process
Rest.setUrl(url);
Rest.post()
.success(function () {
.then(() => {
Alert(i18n._('SCM Update Cancel'), i18n._('Your request to cancel the update was submitted to the task manager.'), 'alert-info');
})
.error(function (data, status) {
@ -234,7 +234,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
var url = data.related.cancel;
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.can_cancel) {
$scope.$emit('Cancel_Update', url);
} else {
@ -251,11 +251,11 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
project.pending_cancellation = true;
Rest.setUrl(GetBasePath("projects") + project.id);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.related.current_update) {
Rest.setUrl(data.related.current_update);
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.$emit('Check_Cancel', data);
})
.error(function (data, status) {

View File

@ -38,7 +38,7 @@
* var url = GetBasePath('inventories') + $stateParams.id + '/';
* Rest.setUrl(url);
* Rest.get()
* .success(function(data) {
* .then(({data}) => {
* // review the data object and take action
* })
* .error(function(status, data) {

View File

@ -22,7 +22,7 @@ export default
Wait('start');
Rest.setUrl(url);
Rest.destroy()
.success(function () {
.then(() => {
$('#prompt-modal').modal('hide');
scope.$emit(callback, id);

View File

@ -121,7 +121,7 @@ export default
// Get the existing record
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
schedule = data;
try {
schedule.extra_data = JSON.parse(schedule.extra_data);

View File

@ -35,7 +35,7 @@ export default
Rest.setUrl(url);
if (mode === 'add') {
Rest.post(schedule)
.success(function(){
.then(() => {
if (callback) {
scope.$emit(callback);
}
@ -50,7 +50,7 @@ export default
}
else {
Rest.put(schedule)
.success(function(){
.then(() => {
if (callback) {
scope.$emit(callback, schedule);
}

View File

@ -12,7 +12,7 @@ export default
scope.removeScheduleFound = scope.$on('ScheduleFound', function(e, data) {
data.enabled = (data.enabled) ? false : true;
Rest.put(data)
.success( function() {
.then(() => {
Wait('stop');
$state.go('.', null, {reload: true});
})
@ -27,7 +27,7 @@ export default
// Get the schedule
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
scope.$emit('ScheduleFound', data);
})
.error(function(data,status){

View File

@ -750,7 +750,7 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
if (!options) {
Rest.setUrl(url);
Rest.options()
.success(function(data) {
.then(({data}) => {
withOptions(data);
})
.error(function(data, status) {

View File

@ -29,10 +29,10 @@ angular.module('ApiLoader', ['Utilities'])
return function () {
$http({ method: 'GET', url:'/api/', headers: { 'Authorization': "" } })
.success(function (data) {
.then(({data}) => {
var base = data.current_version;
$http({ method: 'GET', url:base, headers: { 'Authorization': "" } })
.success(function (data) {
.then(({data}) => {
data.base = base;
$rootScope.defaultUrls = data;
Store('api', data);

View File

@ -556,7 +556,7 @@ function(ConfigurationUtils, i18n, $rootScope) {
Rest.setUrl(`${basePath}` + query);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.count === 1) {
scope[modelKey] = data.results[0].name;
scope[modelName] = data.results[0].id;

View File

@ -14,7 +14,7 @@ export default
if(Authorization.getUserInfo('is_superuser') !== true) {
Rest.setUrl(GetBasePath('users') + $rootScope.current_user.id + '/admin_of_organizations');
Rest.get({ params: { id: params.organization } })
.success(function(data) {
.then(({data}) => {
if(data.count && data.count > 0) {
deferred.resolve(true);
}

View File

@ -18,7 +18,7 @@ export default
Wait("start");
Rest.options()
.success(function(data) {
.then(({data}) => {
if (data.actions.POST) {
canAddVal.resolve({canAdd: true, options: data});
} else {

View File

@ -98,7 +98,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
Rest.setUrl($scope.stdoutEndpoint + '?format=json&start_line=0&end_line=' + page_size);
Rest.get()
.success(function(data) {
.then(({data}) => {
Wait('stop');
if (data.content) {
api_complete = true;
@ -134,7 +134,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
$('#stdoutMoreRowsBottom').fadeIn();
Rest.setUrl(url);
Rest.get()
.success( function(data) {
.then(({data}) => {
if ($('#pre-container-content').html() === "Waiting for results...") {
$('#pre-container-content').html(data.content);
} else {
@ -166,7 +166,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
'&end_line=' + (current_range.end + page_size);
Rest.setUrl(url);
Rest.get()
.success(function(data){
.then(({data}) => {
$('#pre-container-content').append(data.content);
current_range = data.range;
})

View File

@ -13,7 +13,7 @@
callback = params.callback;
Rest.setUrl(url);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (scope_var === 'inventory_source') {
scope.inventory = data.inventory;
}

View File

@ -79,7 +79,7 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams,
// of stdout jobs.
Rest.setUrl(GetBasePath('base') + jobType + '/' + job_id + '/');
Rest.get()
.success(function(data) {
.then(({data}) => {
$scope.job = data;
$scope.job_template_name = data.name;
$scope.created_by = data.summary_fields.created_by;

View File

@ -11,7 +11,7 @@ export default ['$scope', '$rootScope', 'TeamForm', 'GenerateForm', 'Rest',
Rest.setUrl(GetBasePath('teams'));
Rest.options()
.success(function(data) {
.then(({data}) => {
if (!data.actions.POST) {
$state.go("^");
Alert('Permission Error', 'You do not have permission to add a team.', 'alert-info');
@ -43,7 +43,7 @@ export default ['$scope', '$rootScope', 'TeamForm', 'GenerateForm', 'Rest',
data[fld] = $scope[fld];
}
Rest.post(data)
.success(function(data) {
.then(({data}) => {
Wait('stop');
$rootScope.flashMessage = "New team successfully created!";
$rootScope.$broadcast("EditIndicatorChange", "users", data.id);

View File

@ -19,7 +19,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'TeamForm', 'Rest',
$scope.team_id = id;
Rest.setUrl(defaultUrl);
Wait('start');
Rest.get(defaultUrl).success(function(data) {
Rest.get(defaultUrl).then(({data}) => {
setScopeFields(data);
$scope.organization_name = data.summary_fields.organization.name;
@ -74,7 +74,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'TeamForm', 'Rest',
if ($scope[form.name + '_form'].$valid) {
var data = processNewData(form.fields);
Rest.setUrl(defaultUrl);
Rest.put(data).success(function() {
Rest.put(data).then(() => {
$state.go($state.current, null, { reload: true });
})
.error(function(data, status) {

View File

@ -48,7 +48,7 @@ export default ['$scope', 'Rest', 'TeamList', 'Prompt',
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
Wait('stop');
$('#prompt-modal').modal('hide');

View File

@ -146,7 +146,7 @@
url = GetBasePath('projects') + $scope.project + '/playbooks/';
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
var i, opts = [];
for (i = 0; i < data.length; i++) {
opts.push(data[i]);
@ -172,7 +172,7 @@
if (oldValue !== newValue && !Empty($scope.project)) {
Rest.setUrl(GetBasePath('projects') + $scope.project + '/');
Rest.get()
.success(function (data) {
.then(({data}) => {
var msg;
switch (data.status) {
case 'failed':
@ -394,7 +394,7 @@
Rest.setUrl(GetBasePath("organizations"));
Rest.get()
.success(function(data) {
.then(({data}) => {
orgDefer.resolve(data.results[0].id);
});
@ -434,7 +434,7 @@
Rest.post({ name: $scope.survey_name,
description: $scope.survey_description,
spec: $scope.survey_questions })
.success(function () {
.then(() => {
Wait('stop');
})
.error(function (data,

View File

@ -81,7 +81,7 @@ export default
Wait('start');
Rest.setUrl(url);
promises.push(Rest.get()
.success(function (data) {
.then(({data}) => {
$scope.disablePlaybookBecausePermissionDenied = false;
$scope.playbook_options = [];
var playbookNotFound = true;
@ -112,7 +112,7 @@ export default
Rest.setUrl(GetBasePath('projects') + $scope.project + '/');
promises.push(Rest.get()
.success(function (data) {
.then(({data}) => {
var msg;
switch (data.status) {
case 'failed':
@ -539,7 +539,7 @@ export default
var getNext = function(data, arr, resolve) {
Rest.setUrl(data.next);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.next) {
getNext(data, arr.concat(data.results), resolve);
} else {
@ -551,7 +551,7 @@ export default
Rest.setUrl(data.related.labels);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.next) {
getNext(data, data.results, associatedLabelsDefer);
} else {
@ -578,7 +578,7 @@ export default
Rest.setUrl(GetBasePath("organizations"));
Rest.get()
.success(function(data) {
.then(({data}) => {
orgDefer.resolve(data.results[0].id);
});
@ -722,7 +722,7 @@ export default
Rest.setUrl(defaultUrl + $state.params.job_template_id);
Rest.put(data)
.success(function (data) {
.then(({data}) => {
$scope.$emit('templateSaveSuccess', data);
})
.error(function (data, status) {

View File

@ -21,7 +21,7 @@ export default
var getNext = function(data, arr, resolve) {
Rest.setUrl(data.next);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.next) {
getNext(data, arr.concat(data.results), resolve);
} else {
@ -34,7 +34,7 @@ export default
var seeMoreResolve = $q.defer();
Rest.setUrl(scope[scope.$parent.list.iterator].related.labels);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.next) {
getNext(data, data.results, seeMoreResolve);
} else {
@ -71,7 +71,7 @@ export default
if(url) {
Rest.setUrl(url);
Rest.post({"disassociate": true, "id": label.id})
.success(function () {
.then(() => {
Wait('stop');
$state.go('.', null, {reload: true});
})

View File

@ -41,7 +41,7 @@ export default
Rest.setUrl(url);
Rest.destroy()
.success(function () {
.then(() => {
scope.$emit("SurveyDeleted");
})

View File

@ -31,7 +31,7 @@ export default
// Get the existing record
Rest.setUrl(url);
Rest.get()
.success(function (data) {
.then(({data}) => {
if(!Empty(data)){
ShowSurveyModal({ title: "Edit Survey", scope: scope, callback: 'DialogReady' });
scope.survey_name = data.name;

View File

@ -81,7 +81,7 @@ export default
Rest.setUrl(GetBasePath('workflow_job_templates') + id + '/survey_spec/');
}
return Rest.post({name: scope.survey_name, description: scope.survey_description, spec: scope.survey_questions })
.success(function () {
.then(() => {
})
.error(function (data, status) {
@ -98,7 +98,7 @@ export default
Rest.setUrl(GetBasePath('workflow_job_templates') + id+ '/');
}
return Rest.patch({"survey_enabled": scope.survey_enabled})
.success(function () {
.then(() => {
})
.error(function (data, status) {

View File

@ -259,7 +259,7 @@ export default ['Rest', 'GetBasePath', '$q', 'NextPage', function(Rest, GetBaseP
Rest.setUrl(url);
Rest.options()
.success(function(data) {
.then(({data}) => {
deferred.resolve(data);
}).error(function(msg, code) {
deferred.reject(msg, code);
@ -274,7 +274,7 @@ export default ['Rest', 'GetBasePath', '$q', 'NextPage', function(Rest, GetBaseP
Rest.setUrl(url);
Rest.options()
.success(function(data) {
.then(({data}) => {
deferred.resolve(data);
}).error(function(msg, code) {
deferred.reject(msg, code);

View File

@ -112,7 +112,7 @@ export default [
Rest.setUrl(GetBasePath("organizations"));
Rest.get()
.success(function(data) {
.then(({data}) => {
orgDefer.resolve(data.results[0].id);
});

View File

@ -181,7 +181,7 @@ export default [
var getNext = function(data, arr, resolve) {
Rest.setUrl(data.next);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.next) {
getNext(data, arr.concat(data.results), resolve);
} else {
@ -193,7 +193,7 @@ export default [
Rest.setUrl($scope.workflow_job_template_obj.related.labels);
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.next) {
getNext(data, data.results, associatedLabelsDefer);
} else {
@ -220,7 +220,7 @@ export default [
Rest.setUrl(GetBasePath("organizations"));
Rest.get()
.success(function(data) {
.then(({data}) => {
orgDefer.resolve(data.results[0].id);
});

View File

@ -37,7 +37,7 @@ export default ['$scope', '$rootScope', 'UserForm', 'GenerateForm', 'Rest',
Rest.setUrl(GetBasePath('users'));
Rest.options()
.success(function(data) {
.then(({data}) => {
if (!data.actions.POST) {
$state.go("^");
Alert(i18n._('Permission Error'), i18n._('You do not have permission to add a user.'), 'alert-info');
@ -85,7 +85,7 @@ export default ['$scope', '$rootScope', 'UserForm', 'GenerateForm', 'Rest',
data.is_system_auditor = $scope.is_system_auditor;
Wait('start');
Rest.post(data)
.success(function(data) {
.then(({data}) => {
var base = $location.path().replace(/^\//, '').split('/')[0];
if (base === 'users') {
$rootScope.flashMessage = i18n._('New user successfully created!');

View File

@ -38,7 +38,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'UserForm', 'Rest',
$scope.$watch('is_superuser', hidePermissionsTabSmartSearchAndPaginationIfSuperUser($scope));
Rest.setUrl(defaultUrl);
Wait('start');
Rest.get(defaultUrl).success(function(data) {
Rest.get(defaultUrl).then(({data}) => {
$scope.user_id = id;
$scope.ldap_user = (data.ldap_dn !== null && data.ldap_dn !== undefined && data.ldap_dn !== '') ? true : false;
$scope.not_ldap_user = !$scope.ldap_user;
@ -172,7 +172,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'UserForm', 'Rest',
if ($scope[form.name + '_form'].$valid) {
Rest.setUrl(defaultUrl + '/');
var data = processNewData(form.fields);
Rest.put(data).success(function() {
Rest.put(data).then(() => {
$state.go($state.current, null, { reload: true });
})
.error(function(data, status) {

View File

@ -62,7 +62,7 @@ export default ['$scope', '$rootScope', 'Rest', 'UserList', 'Prompt',
var url = defaultUrl + id + '/';
Rest.setUrl(url);
Rest.destroy()
.success(function() {
.then(() => {
let reloadListStateParams = null;

View File

@ -51,7 +51,7 @@ export default {
var defer = $q.defer();
Rest.setUrl(workflowData.related.workflow_nodes + '?order_by=id');
Rest.get()
.success(function(data) {
.then(({data}) => {
if(data.next) {
let allNodes = data.results;
let getNodes = function(nextUrl){
@ -101,7 +101,7 @@ export default {
var getNext = function(data, arr, resolve) {
Rest.setUrl(data.next);
Rest.get()
.success(function (data) {
.then(({data}) => {
if (data.next) {
getNext(data, arr.concat(data.results), resolve);
} else {
@ -115,7 +115,7 @@ export default {
Rest.setUrl(GetBasePath('workflow_jobs') + $stateParams.id + '/labels/');
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.next) {
getNext(data, data.results, seeMoreResolve);
} else {

View File

@ -45,7 +45,7 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
Wait('start');
Rest.setUrl(workflow.url);
Rest.destroy()
.success(function() {
.then(() => {
Wait('stop');
$('#prompt-modal').modal('hide');
$state.go('jobs');
@ -67,7 +67,7 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
var doCancel = function() {
Rest.setUrl(workflow.url + 'cancel');
Rest.post({})
.success(function() {
.then(() => {
Wait('stop');
$('#prompt-modal').modal('hide');
})
@ -94,7 +94,7 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
Wait('start');
Rest.setUrl(workflow.url + 'cancel');
Rest.get()
.success(function(data) {
.then(({data}) => {
if (data.can_cancel === true) {
doCancel();
} else {