Skip to content

Commit

Permalink
Revert "AMBARI-25289 Upgrade Jquery and Bootstrap to latest versions (a…
Browse files Browse the repository at this point in the history
…pache#3770)"

This reverts commit 447bcd4.
  • Loading branch information
xijunmu committed Sep 29, 2024
1 parent 13aa0aa commit a6813b1
Show file tree
Hide file tree
Showing 233 changed files with 19,945 additions and 49,501 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ pipeline {

stage('Parallel Unit Tests') {
parallel {
stage('Ambari WebUI Tests') {
stage('Ambari WebUI Tests') {
steps {
withEnv(['CHROME_BIN=/usr/bin/chromium-browser']) {
sh 'mvn -T 2C -am test -pl ambari-web,ambari-admin -Dmaven.artifact.threads=10 -Drat.skip'
}
}
}

stage('Ambari Agent Tests') {
steps {
sh 'pip3 install distro'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@

describe('#Cluster', function () {

describe('GroupsListCtrl', function() {
var $scope, ctrl, $t, $httpBackend, $group;
beforeEach(module('ambariAdminConsole', function () {}));
beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_, _Group_) {
$scope = $rootScope.$new();
$t = _$translate_.instant;
$httpBackend = _$httpBackend_;
$group = _Group_;
ctrl = $controller('GroupsListCtrl', {
$scope: $scope
});
}));
});
});
describe('GroupsListCtrl', function() {

var $scope, ctrl, $t, $httpBackend, $group;

beforeEach(module('ambariAdminConsole', function () {}));

beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_, _Group_) {
$scope = $rootScope.$new();
$t = _$translate_.instant;
$httpBackend = _$httpBackend_;
$group = _Group_;
ctrl = $controller('GroupsListCtrl', {
$scope: $scope
});
}));

});

});
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@

describe('#Cluster', function () {

describe('UsersListCtrl', function() {
var scope, ctrl, $t, $httpBackend;
beforeEach(module('ambariAdminConsole', function () {}));
beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_) {
scope = $rootScope.$new();
$t = _$translate_.instant;
$httpBackend = _$httpBackend_;
ctrl = $controller('UsersListCtrl', {
$scope: scope
});
}));
});
});
describe('UsersListCtrl', function() {

var scope, ctrl, $t, $httpBackend;

beforeEach(module('ambariAdminConsole', function () {}));

beforeEach(inject(function($rootScope, $controller, _$translate_, _$httpBackend_) {
scope = $rootScope.$new();
$t = _$translate_.instant;
$httpBackend = _$httpBackend_;
ctrl = $controller('UsersListCtrl', {
$scope: scope
});
}));

});

});
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>Simple Service</h1>
url: _getSimpleResourceUri(),
dataType: "text",
success: function(data) {
var json = JSON.parse(data);
var json = $.parseJSON(data);
$('#results').html('Value: ' + json.value);
}
});
Expand Down
1 change: 0 additions & 1 deletion ambari-web/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ if (Ember.$.uuid === undefined) {
require('utils/bootstrap_reopen');
require('utils/ember_reopen');
require('utils/ember_computed');
require('utils/bootstrap_popups');
var stringUtils = require('utils/string_utils');
var stompClientClass = require('utils/stomp_client');

Expand Down
2 changes: 1 addition & 1 deletion ambari-web/app/assets/test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ var files = [
'test/views/main/service/reassign/step3_view_test',
'test/views/main/service/reassign/step4_view_test',
'test/views/main/service/reassign/step5_view_test',
// 'test/views/main/service/manage_config_groups_view_test',
'test/views/main/service/manage_config_groups_view_test',
'test/views/main/service/reassign_view_test',
'test/views/main/service/reconfigure_test',
'test/views/main/service/service_test',
Expand Down
2 changes: 1 addition & 1 deletion ambari-web/app/controllers/experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ App.ExperimentalController = Em.Controller.extend(App.Persist, {
var propValue = s.get('selected');
Ember.set(propName, propValue);
});
this.postUserPref('user-pref-' + App.router.get('loginName') + '-supports', App.get('supports')).then(function(){
this.postUserPref('user-pref-' + App.router.get('loginName') + '-supports', App.get('supports')).complete(function(){
App.router.transitionTo('root.index');
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ App.ConfigurationController = Em.Controller.extend({
loadedConfigs.push(item);
});
}
}).then(function () {
}).complete(function () {
self.saveToDB(loadedConfigs);
dfd.resolve(loadedConfigs);
});
Expand Down
2 changes: 1 addition & 1 deletion ambari-web/app/controllers/global/update_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ App.UpdateController = Em.Controller.extend({
},

updateWizardWatcher: function(callback) {
App.router.get('wizardWatcherController').getUser().then(callback);
App.router.get('wizardWatcherController').getUser().complete(callback);
},

/**
Expand Down
4 changes: 2 additions & 2 deletions ambari-web/app/controllers/global/user_settings_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ App.UserSettingsController = Em.Controller.extend(App.Persist, {
var key = persistKey ? this.get('userSettingsKeys.' + persistKey + '.name') : '';
var dfd = $.Deferred();
var self = this;
this.getUserPref(key).then(function () {
this.getUserPref(key).complete(function () {
var curPref = self.get('currentPrefObject');
self.set('currentPrefObject', null);
dfd.resolve(curPref);
Expand Down Expand Up @@ -191,7 +191,7 @@ App.UserSettingsController = Em.Controller.extend(App.Persist, {
}

this.dataLoading().done(function(response) {
self.loadPrivileges().then(function() {
self.loadPrivileges().complete(function() {
self._showSettingsPopup(response);
});
});
Expand Down
11 changes: 5 additions & 6 deletions ambari-web/app/controllers/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
var self = this;
var stackServices = App.StackService.find().mapProperty('serviceName');
if (!(stackServices.length && App.StackService.find().objectAt(0).get('stackVersion') === App.get('currentStackVersionNumber'))) {
this.loadServiceComponents().then(function () {
this.loadServiceComponents().complete(function () {
self.set('content.services', App.StackService.find().forEach(function (item) {
// user the service version from VersionDefinition
var serviceInStack = App.Stack.find().findProperty('isSelected').get('stackServices').findProperty('name', item.get('serviceName'));
Expand Down Expand Up @@ -239,7 +239,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
sender: this,
success: 'loadStacksSuccessCallback',
error: 'loadStacksErrorCallback'
}).then(function () {
}).complete(function () {
dfd.resolve(false);
});
}
Expand Down Expand Up @@ -688,7 +688,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
var body = '';
if(request && request.responseText) {
try {
var json = JSON.parse(request.responseText);
var json = $.parseJSON(request.responseText);
body = json.message;
} catch (err) {}
}
Expand Down Expand Up @@ -809,7 +809,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
var body = "";
if(request && request.responseText){
try {
var json = JSON.parse(request.responseText);
var json = $.parseJSON(request.responseText);
body = json.message;
} catch (err) {}
}
Expand Down Expand Up @@ -908,7 +908,6 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
this.set('content.isCheckInProgress', true);
App.ajax.send({
name: 'wizard.advanced_repositories.valid_url',
dataType:'text',
sender: this,
data: {
stackName: stackName,
Expand Down Expand Up @@ -966,7 +965,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
var repo = os.get('repositories').findProperty('repoId', params.repoId);
if (repo) {
var title = Ember.Handlebars.Utils.escapeExpression(request.status + ":" + request.statusText);
var content = Ember.Handlebars.Utils.escapeExpression(JSON.parse(request.responseText) ? JSON.parse(request.responseText).message : "");
var content = Ember.Handlebars.Utils.escapeExpression($.parseJSON(request.responseText) ? $.parseJSON(request.responseText).message : "");
repo.setProperties({
validation: 'INVALID',
errorTitle: title,
Expand Down
16 changes: 0 additions & 16 deletions ambari-web/app/controllers/login_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ App.LoginController = Em.Object.extend({
submit: function (e) {
this.set('errorMessage', '');
this.set('isSubmitDisabled', true);
//Hack to set username and password when user has not focussed on the element and is using previous values
let username="";
let password="";
if(document&&document.getElementsByClassName("login-username")[0]){
username=document.getElementsByClassName("login-username")[0].value;
}
if(document&&document.getElementsByClassName("login-password")[0]){
password=document.getElementsByClassName("login-password")[0].value;
}

if(username){
this.set('loginName',username);
}
if(password){
this.set('password',password);
}
App.get('router').login();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ App.HighAvailabilityWizardStep4Controller = Em.Controller.extend({

getNnCheckPointStatus: function (data) {
const isInSafeMode = !Em.isEmpty(Em.get(data, 'metrics.dfs.namenode.Safemode'));
let journalTransactionInfo = JSON.parse(Em.get(data, 'metrics.dfs.namenode.JournalTransactionInfo'));
let journalTransactionInfo = $.parseJSON(Em.get(data, 'metrics.dfs.namenode.JournalTransactionInfo'));
// in case when transaction info absent or invalid return 2 which will return false in next `if` statement
journalTransactionInfo = !!journalTransactionInfo
? (parseInt(journalTransactionInfo.LastAppliedOrWrittenTxId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
return App.ajax.send({
name: 'common.host.host_component.passive',
sender: this,
dataType:'text',
data: {
hostName: hostName,
passive_state: "ON",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ App.HighAvailabilityWizardStep6Controller = Em.Controller.extend({
var initJnCounter = 0;

if (data.metrics && data.metrics.dfs) {
journalStatusInfo = JSON.parse(data.metrics.dfs.journalnode.journalsStatus);
journalStatusInfo = $.parseJSON(data.metrics.dfs.journalnode.journalsStatus);
if (journalStatusInfo[this.get('content.nameServiceId')] && journalStatusInfo[this.get('content.nameServiceId')].Formatted === "true") {
initJnCounter = this.incrementProperty('initJnCounter');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
return App.ajax.send({
name: 'common.service.configurations',
sender: this,
dataType:'text',
data: {
desired_config: configData
},
Expand Down Expand Up @@ -310,7 +309,6 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
return App.ajax.send({
name: 'common.delete.host_component',
sender: this,
dataType:'text',
data: {
componentName: 'SECONDARY_NAMENODE',
hostName: hostName
Expand Down
1 change: 0 additions & 1 deletion ambari-web/app/controllers/main/admin/kerberos.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ App.MainAdminKerberosController = App.KerberosWizardStep4Controller.extend({
return App.ajax.send({
name: 'admin.kerberos.cluster.artifact.update',
sender: self,
dataType:'text',
data: {
artifactName: 'kerberos_descriptor',
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ App.KerberosDisableController = App.KerberosProgressPageController.extend(App.Wi
},

startZookeeper: function () {
this.startServices(false, ["ZOOKEEPER"], true,'text');
this.startServices(false, ["ZOOKEEPER"], true);
},

stopAllButZookeeper: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
loadRecommendationsError: function(req, ajaxOpts, error, opt) {
var resp;
try {
resp = JSON.parse(req.responseText);
resp = $.parseJSON(req.responseText);
} catch (e) { }
return App.ModalPopup.show({
header: Em.I18n.t('common.error'),
Expand Down
2 changes: 0 additions & 2 deletions ambari-web/app/controllers/main/admin/service_auto_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ App.MainAdminServiceAutoStartController = Em.Controller.extend({
clusterConfigs.recovery_enabled = String(recoveryEnabled);
return App.ajax.send({
name: 'admin.save_configs',
dataType:'text',
sender: this,
data: {
siteName: 'cluster-env',
Expand All @@ -163,7 +162,6 @@ App.MainAdminServiceAutoStartController = Em.Controller.extend({
return App.ajax.send({
name: 'components.update',
sender: this,
dataType:'text',
data: {
ServiceComponentInfo: {
recovery_enabled: recoveryEnabled
Expand Down
Loading

0 comments on commit a6813b1

Please sign in to comment.