Skip to content

Commit 9c35b43

Browse files
Merge pull request #9411 from jrafanie/dead-code
Remove dead code
2 parents fbb9e40 + 2c06ffb commit 9c35b43

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

app/javascript/oldjs/services/miq_service.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ ManageIQ.angular.app.service('miqService', ['$q', 'API', '$window', function($q,
2727
miqJqueryRequest(url, {beforeSend: true, data: serializeFields});
2828
};
2929

30-
this.restAjaxButton = function(url, button, dataType, data) {
31-
miqRESTAjaxButton(url, button, dataType, data);
32-
};
33-
3430
this.jqueryRequest = function(url, options) {
3531
return miqJqueryRequest(url, options);
3632
};
@@ -69,12 +65,6 @@ ManageIQ.angular.app.service('miqService', ['$q', 'API', '$window', function($q,
6965
return form.$valid && form.$dirty;
7066
};
7167

72-
this.detectWithRest = function($event, url) {
73-
angular.element('#button_name').val('detect');
74-
miqSparkleOn();
75-
return $q.when(miqRESTAjaxButton(url, $event.target, 'json'));
76-
};
77-
7868
this.networkProviders = function(options) {
7969
options = Object.assign(options || {}, {
8070
attributes: ['id', 'name'],
@@ -97,34 +87,6 @@ ManageIQ.angular.app.service('miqService', ['$q', 'API', '$window', function($q,
9787
.catch(options.handleFailure);
9888
};
9989

100-
this.validateWithAjax = function(url, model) {
101-
miqSparkleOn();
102-
miqAjaxButton(url, model || true);
103-
};
104-
105-
this.validateWithREST = function($event, credType, url, formSubmit) {
106-
angular.element('#button_name').val('validate');
107-
angular.element('#cred_type').val(credType);
108-
if (formSubmit) {
109-
miqSparkleOn();
110-
return $q.when(miqRESTAjaxButton(url, $event.target, 'json'));
111-
}
112-
$event.preventDefault();
113-
};
114-
115-
this.validateClicked = function($event, authType, formSubmit, angularForm, url) {
116-
miqService.validateWithREST($event, authType, url, formSubmit)
117-
.then(function success(data) {
118-
if (data.level === 'error') {
119-
angularForm.default_auth_status.$setViewValue(false);
120-
} else {
121-
angularForm.default_auth_status.$setViewValue(true);
122-
}
123-
miqService.miqFlash(data.level, data.message);
124-
miqService.sparkleOff();
125-
});
126-
};
127-
12890
this.disabledClick = function($event) {
12991
$event.preventDefault();
13092
};

spec/javascripts/services/miq_service_spec.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -154,34 +154,6 @@ describe('miqService', function() {
154154
});
155155
});
156156

157-
describe('#validateWithREST', function() {
158-
beforeEach(function() {
159-
testService.validateWithREST($.Event, "default", '/ems_cloud/create/new?button=validate&type=default', true);
160-
});
161-
162-
it('turns the spinner on via the miqService', function() {
163-
expect(window.miqSparkleOn).toHaveBeenCalled();
164-
});
165-
166-
it('delegates to miqService.miqAjaxButton', function() {
167-
expect(window.miqAjaxButton).toHaveBeenCalledWith('/ems_cloud/create/new?button=validate&type=default', true);
168-
});
169-
});
170-
171-
describe('#validateWithAjax', function() {
172-
beforeEach(function() {
173-
testService.validateWithAjax('/host/create/new?button=validate&type=default');
174-
});
175-
176-
it('turns the spinner on via the miqService', function() {
177-
expect(window.miqSparkleOn).toHaveBeenCalled();
178-
});
179-
180-
it('delegates to miqService.miqAjaxButton', function() {
181-
expect(window.miqAjaxButton).toHaveBeenCalledWith('/host/create/new?button=validate&type=default', true);
182-
});
183-
});
184-
185157
describe('#disabledClick', function() {
186158
it('prevents a submit action', function() {
187159
var event = $.Event('click');

0 commit comments

Comments
 (0)