You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2016/04/05 00:21:58 UTC
[1/2] ambari git commit: AMBARI-15688. Ambari Admin: 'users/groups'
message on Roles page is not correct (alexantonenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 0300a6aee -> af19b7d0f
AMBARI-15688. Ambari Admin: 'users/groups' message on Roles page is not correct (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/af19b7d0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/af19b7d0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/af19b7d0
Branch: refs/heads/trunk
Commit: af19b7d0f16f850eef1a8164ea9670402f33049d
Parents: 891addc
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Apr 4 19:47:06 2016 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Apr 5 01:21:54 2016 +0300
----------------------------------------------------------------------
.../app/scripts/controllers/clusters/UserAccessListCtrl.js | 5 +++--
.../ui/admin-web/app/views/clusters/userAccessList.html | 4 ++--
.../ui/admin-web/app/views/modals/RoleDetailsModal.html | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/af19b7d0/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
index 346e922..32f46c1 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
@@ -22,7 +22,8 @@ angular.module('ambariAdminConsole')
function($scope, $location, Cluster, $modal, $rootScope, $routeParams, PermissionSaver, Alert, $translate) {
var $t = $translate.instant;
$scope.constants = {
- usersGroups: $t('common.usersGroups').toLowerCase()
+ users: $t('common.users').toLowerCase(),
+ groups: $t('common.groups').toLowerCase()
};
$scope.users = [];
$scope.usersPerPage = 10;
@@ -181,7 +182,7 @@ function($scope, $location, Cluster, $modal, $rootScope, $routeParams, Permissio
$scope.currentPage = 1;
$scope.loadUsers();
};
- $scope.currentRoleFilter = { label:$('common.all'), value: '' };
+ $scope.currentRoleFilter = { label:$t('common.all'), value: '' };
$scope.typeFilterOptions = [
http://git-wip-us.apache.org/repos/asf/ambari/blob/af19b7d0/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/userAccessList.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/userAccessList.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/userAccessList.html
index c14b8c3..e3bbcdc 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/userAccessList.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/userAccessList.html
@@ -85,11 +85,11 @@
</tbody>
</table>
<div class="alert alert-info col-sm-12" ng-show="!users.length">
- {{'common.alerts.nothingToDisplay' | translate: '{term: constants.usersGroups}'}}
+ {{'common.alerts.nothingToDisplay' | translate: '{term: (isUserActive ? constants.users : constants.groups)}'}}
</div>
<div class="col-sm-12 table-bar">
<div class="pull-left filtered-info">
- <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: constants.usersGroups}'}}</span>
+ <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: (isUserActive ? constants.users : constants.groups)}'}}</span>
<span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
</div>
<div class="pull-right left-margin">
http://git-wip-us.apache.org/repos/asf/ambari/blob/af19b7d0/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
index f750142..e2222a8 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/RoleDetailsModal.html
@@ -34,5 +34,5 @@
</table>
</div>
<div class="modal-footer text-center">
- <button class="btn btn-primary" ng-click="ok()">Close</button>
+ <button class="btn btn-primary" ng-click="ok()">{{'common.controls.close' | translate}}</button>
</div>
[2/2] ambari git commit: AMBARI-15687. Incorrect Hive DB
recommendations being made on Safari browser (alexantonenko)
Posted by al...@apache.org.
AMBARI-15687. Incorrect Hive DB recommendations being made on Safari browser (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/891addc7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/891addc7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/891addc7
Branch: refs/heads/trunk
Commit: 891addc7d134cc1edf710b2b524764f3c867726c
Parents: 0300a6a
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Apr 4 19:45:20 2016 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Apr 5 01:21:54 2016 +0300
----------------------------------------------------------------------
ambari-web/app/views/common/controls_view.js | 2 +-
.../test/views/common/controls_view_test.js | 113 ++++++++++++++++---
2 files changed, 97 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/891addc7/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index 661ef54..3ca0eda 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -769,8 +769,8 @@ App.ServiceConfigRadioButton = Ember.Checkbox.extend(App.SupportsDependentConfig
// in Service Config page
if (this.get('clicked')) {
Em.run.next(this, function() {
- this.sendRequestRorDependentConfigs(this.get('parentView.serviceConfig'));
this.set('parentView.serviceConfig.value', this.get('value'));
+ this.sendRequestRorDependentConfigs(this.get('parentView.serviceConfig'));
this.set('clicked', false);
this.updateForeignKeys();
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/891addc7/ambari-web/test/views/common/controls_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/controls_view_test.js b/ambari-web/test/views/common/controls_view_test.js
index 07a80dd..dca7911 100644
--- a/ambari-web/test/views/common/controls_view_test.js
+++ b/ambari-web/test/views/common/controls_view_test.js
@@ -444,6 +444,21 @@ describe('App.ServiceConfigRadioButtons', function () {
describe('App.ServiceConfigRadioButton', function () {
+ var view;
+
+ beforeEach(function () {
+ view = App.ServiceConfigRadioButton.create({
+ parentView: Em.Object.create({
+ serviceConfig: Em.Object.create()
+ }),
+ controller: Em.Object.create({
+ wizardController: Em.Object.create({
+ name: null
+ })
+ })
+ })
+ });
+
describe('#disabled', function () {
var cases = [
@@ -487,35 +502,99 @@ describe('App.ServiceConfigRadioButton', function () {
cases.forEach(function (item) {
it(item.title, function () {
- var view = App.ServiceConfigRadioButton.create({
- parentView: Em.Object.create({
- serviceConfig: Em.Object.create()
- }),
- controller: Em.Object.create({
- wizardController: Em.Object.create({
- name: null
- })
- })
+ view.setProperties({
+ 'value': item.value,
+ 'controller.wizardController.name': item.wizardControllerName,
+ 'parentView.serviceConfig.isEditable': true
});
- view.set('value', item.value);
- view.set('controller.wizardController.name', item.wizardControllerName);
- view.set('parentView.serviceConfig.isEditable', true);
expect(view.get('disabled')).to.equal(item.disabled);
});
});
it('parent view is disabled', function () {
- var view = App.ServiceConfigRadioButton.create({
- parentView: Em.Object.create({
- serviceConfig: Em.Object.create()
- })
- });
view.set('parentView.serviceConfig.isEditable', false);
expect(view.get('disabled')).to.be.true;
});
});
+ describe('#onChecked', function () {
+
+ var cases = [
+ {
+ clicked: true,
+ value: 'v1',
+ sendRequestRorDependentConfigsCallCount: 1,
+ updateForeignKeysCallCount: 1,
+ title: 'invoked with click'
+ },
+ {
+ clicked: false,
+ value: 'v0',
+ sendRequestRorDependentConfigsCallCount: 0,
+ updateForeignKeysCallCount: 0,
+ title: 'not invoked with click'
+ }
+ ];
+
+ cases.forEach(function (item) {
+
+ describe(item.title, function () {
+
+ beforeEach(function () {
+ sinon.stub(Em.run, 'next', function (context, callback) {
+ callback.call(context);
+ });
+ sinon.stub(view, 'sendRequestRorDependentConfigs', Em.K);
+ sinon.stub(view, 'updateForeignKeys', Em.K);
+ sinon.stub(view, 'updateCheck', Em.K);
+ view.setProperties({
+ 'clicked': item.clicked,
+ 'parentView.serviceConfig.value': 'v0',
+ 'value': 'v1'
+ });
+ view.propertyDidChange('checked');
+ });
+
+ afterEach(function () {
+ Em.run.next.restore();
+ view.sendRequestRorDependentConfigs.restore();
+ view.updateForeignKeys.restore();
+ view.updateCheck.restore();
+ });
+
+ it('property value', function () {
+ expect(view.get('parentView.serviceConfig.value')).to.equal(item.value);
+ });
+
+ it('dependent configs request', function () {
+ expect(view.sendRequestRorDependentConfigs.callCount).to.equal(item.sendRequestRorDependentConfigsCallCount);
+ });
+
+ if (item.sendRequestRorDependentConfigsCallCount) {
+ it('config object for dependent configs request', function () {
+ expect(view.sendRequestRorDependentConfigs.firstCall.args).to.eql([
+ Em.Object.create({
+ value: item.value
+ })
+ ]);
+ });
+ }
+
+ it('clicked flag reset', function () {
+ expect(view.get('clicked')).to.be.false;
+ });
+
+ it('update foreign keys', function () {
+ expect(view.updateForeignKeys.callCount).to.equal(item.updateForeignKeysCallCount);
+ });
+
+ });
+
+ });
+
+ });
+
});
describe('App.CheckDBConnectionView', function () {