composite UI

This commit is contained in:
Bill Burke committed 2014-01-31 21:39:54 -05:00
1 parent 1cbe3596b4
commit e222240282
13 files changed
+1187 -617

No files matched your search

@@ -187,6 +187,12 @@ module.config([ '$routeProvider', function($routeProvider) {
},
role : function() {
return {};
},
roles : function(RoleListLoader) {
return RoleListLoader();
},
applications : function(ApplicationListLoader) {
return ApplicationListLoader();
}
},
controller : 'RoleDetailCtrl'
@@ -199,6 +205,12 @@ module.config([ '$routeProvider', function($routeProvider) {
},
role : function(RoleLoader) {
return RoleLoader();
},
roles : function(RoleListLoader) {
return RoleListLoader();
},
applications : function(ApplicationListLoader) {
return ApplicationListLoader();
}
},
controller : 'RoleDetailCtrl'
@@ -227,6 +239,12 @@ module.config([ '$routeProvider', function($routeProvider) {
},
role : function() {
return {};
},
roles : function(RoleListLoader) {
return RoleListLoader();
},
applications : function(ApplicationListLoader) {
return ApplicationListLoader();
}
},
controller : 'ApplicationRoleDetailCtrl'
@@ -242,6 +260,12 @@ module.config([ '$routeProvider', function($routeProvider) {
},
role : function(ApplicationRoleLoader) {
return ApplicationRoleLoader();
},
roles : function(RoleListLoader) {
return RoleListLoader();
},
applications : function(ApplicationListLoader) {
return ApplicationListLoader();
}
},
controller : 'ApplicationRoleDetailCtrl'
@@ -99,7 +99,9 @@ module.controller('ApplicationSessionsCtrl', function($scope, $location, realm,
$scope.application = application;
});
module.controller('ApplicationRoleDetailCtrl', function($scope, realm, application, role, ApplicationRole, $location, Dialog, Notifications) {
module.controller('ApplicationRoleDetailCtrl', function($scope, realm, application, role, roles, applications,
Role, ApplicationRole, RoleById, RoleRealmComposites, RoleApplicationComposites,
$http, $location, Dialog, Notifications) {
$scope.realm = realm;
$scope.application = application;
$scope.role = angular.copy(role);
@@ -107,18 +109,6 @@ module.controller('ApplicationRoleDetailCtrl', function($scope, realm, applicati
$scope.changed = $scope.create;
$scope.$watch(function() {
return $location.path();
}, function() {
$scope.path = $location.path().substring(1).split("/");
});
$scope.$watch('role', function() {
if (!angular.equals($scope.role, role)) {
$scope.changed = true;
}
}, true);
$scope.save = function() {
if ($scope.create) {
ApplicationRole.save({
@@ -134,27 +124,10 @@ module.controller('ApplicationRoleDetailCtrl', function($scope, realm, applicati
Notifications.success("The role has been created.");
});
} else {
ApplicationRole.update({
realm : realm.realm,
application : application.name,
role : role.name
}, $scope.role, function() {
$scope.changed = false;
role = angular.copy($scope.role);
Notifications.success("Your changes have been saved to the role.");
});
$scope.update();
}
};
$scope.reset = function() {
$scope.role = angular.copy(role);
$scope.changed = false;
};
$scope.cancel = function() {
$location.url("/realms/" + realm.realm + "/applications/" + application.name + "/roles");
};
$scope.remove = function() {
Dialog.confirmDelete($scope.role.name, 'role', function() {
$scope.role.$remove({
@@ -167,6 +140,16 @@ module.controller('ApplicationRoleDetailCtrl', function($scope, realm, applicati
});
});
};
$scope.cancel = function () {
$location.url("/realms/" + realm.realm + "/applications/" + application.name + "/roles");
};
roleControl($scope, realm, role, roles, applications,
ApplicationRole, RoleById, RoleRealmComposites, RoleApplicationComposites,
$http, $location, Notifications, Dialog);
});
module.controller('ApplicationListCtrl', function($scope, realm, applications, Application, $location) {
@@ -675,26 +675,18 @@ module.controller('RoleListCtrl', function($scope, $location, realm, roles) {
});
});
module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $location, Dialog, Notifications) {
module.controller('RoleDetailCtrl', function($scope, realm, role, roles, applications,
Role, ApplicationRole, RoleById, RoleRealmComposites, RoleApplicationComposites,
$http, $location, Dialog, Notifications) {
$scope.realm = realm;
$scope.role = angular.copy(role);
$scope.create = !role.name;
$scope.changed = $scope.create;
$scope.$watch(function() {
return $location.path();
}, function() {
$scope.path = $location.path().substring(1).split("/");
});
$scope.$watch('role', function() {
if (!angular.equals($scope.role, role)) {
$scope.changed = true;
}
}, true);
$scope.save = function() {
console.log('save');
if ($scope.create) {
Role.save({
realm: realm.realm
@@ -708,37 +700,31 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $locatio
Notifications.success("The role has been created.");
});
} else {
Role.update({
realm : realm.realm,
role : role.name
}, $scope.role, function() {
$scope.changed = false;
role = angular.copy($scope.role);
Notifications.success("Your changes have been saved to the role.");
});
$scope.update();
}
};
$scope.reset = function() {
$scope.role = angular.copy(role);
$scope.changed = false;
};
$scope.cancel = function() {
$location.url("/realms/" + realm.realm + "/roles");
};
$scope.remove = function() {
Dialog.confirmDelete($scope.role.name, 'role', function() {
$scope.remove = function () {
Dialog.confirmDelete($scope.role.name, 'role', function () {
$scope.role.$remove({
realm : realm.realm,
role : $scope.role.name
}, function() {
realm: realm.realm,
role: $scope.role.name
}, function () {
$location.url("/realms/" + realm.realm + "/roles");
Notifications.success("The role has been deleted.");
});
});
};
$scope.cancel = function () {
$location.url("/realms/" + realm.realm + "/roles");
};
roleControl($scope, realm, role, roles, applications,
ApplicationRole, RoleById, RoleRealmComposites, RoleApplicationComposites,
$http, $location, Notifications, Dialog);
});
module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, realm, $http, $location, Dialog, Notifications) {
File diff suppressed because it is too large. Load diff
@@ -52,6 +52,10 @@
required> -->
</div>
</div>
<div class="form-group clearfix block">
<label for="composite" class="control-label">Composite</label>
<input ng-model="role.composite" name="composite" id="composite" onoffswitch />
</div>
</fieldset>
<div class="form-actions" data-ng-show="create">
<button type="submit" kc-save class="primary" data-ng-show="changed">Save
@@ -70,6 +74,72 @@
Delete
</button>
</div>
<fieldset data-ng-show="!create && role.composite">
<legend collapsed><span class="text">Composite Realm Roles</span> </legend>
<div class="form-group">
<div class="controls changing-selectors">
<div class="select-title">
<label for="available">Available Roles</label>
<select id="available" class="form-control" multiple size="5"
ng-multiple="true"
ng-model="selectedRealmRoles"
ng-options="r.name for r in realmRoles">
</select>
</div>
<div class="middle-buttons">
<button type="submit" ng-click="addRealmRole()" tooltip="Move right" tooltip-placement="right"><span class="icon-arrow-right">Move right</span></button>
<button type="submit" ng-click="deleteRealmRole()" tooltip="Move left" tooltip-placement="right"><span class="icon-arrow-left">Move left</span></button>
</div>
<div class="select-title">
<label for="assigned">Assigned Roles</label>
<select id="assigned" class="form-control" multiple size=5
ng-multiple="true"
ng-model="selectedRealmMappings"
ng-options="r.name for r in realmMappings">
</select>
</div>
</div>
</div>
</fieldset>
<fieldset ng-show="applications.length > 0 && !create && role.composite">
<legend collapsed><span class="text">Composite Application Roles</span> </legend>
<div class="form-group input-select">
<label for="applications">Application</label>
<div class="input-group">
<div class="select-rcue">
<select id="applications" name="applications" ng-change="changeApplication()" ng-model="compositeApp" ng-options="a.name for a in applications">
<option value="" selected> Select an Application...</option>
</select>
</div>
</div>
</div>
<div class="form-group" ng-show="compositeApp">
<div class="controls changing-selectors application">
<div class="select-title">
<label for="available-app">Available Roles</label>
<select id="available-app" class="form-control" multiple size="5"
ng-multiple="true"
ng-model="selectedApplicationRoles"
ng-options="r.name for r in applicationRoles">
</select>
</div>
<div class="middle-buttons">
<button type="submit" ng-click="addApplicationRole()" tooltip="Move right" tooltip-placement="right"><span class="icon-arrow-right">Move right</span></button>
<button type="submit" ng-click="deleteApplicationRole()" tooltip="Move left" tooltip-placement="right"><span class="icon-arrow-left">Move left</span></button>
</div>
<div class="select-title">
<label for="assigned-app">Assigned Roles</label>
<select id="assigned-app" class="form-control" multiple size=5
ng-multiple="true"
ng-model="selectedApplicationMappings"
ng-options="r.name for r in applicationMappings">
</select>
</div>
</div>
</div>
</fieldset>
</form>
</div>
@@ -47,6 +47,10 @@
<textarea rows="5" cols="50" id="description" name="description" data-ng-model="role.description"></textarea>
</div>
</div>
<div class="form-group clearfix block">
<label for="composite" class="control-label">Composite</label>
<input ng-model="role.composite" name="composite" id="composite" onoffswitch />
</div>
</fieldset>
<div class="form-actions" data-ng-show="create">
<button type="submit" kc-save class="primary" data-ng-show="changed">Save
@@ -66,6 +70,72 @@
</button>
</div>
<fieldset data-ng-show="!create && role.composite">
<legend collapsed><span class="text">Composite Realm Roles</span> </legend>
<div class="form-group">
<div class="controls changing-selectors">
<div class="select-title">
<label for="available">Available Roles</label>
<select id="available" class="form-control" multiple size="5"
ng-multiple="true"
ng-model="selectedRealmRoles"
ng-options="r.name for r in realmRoles">
</select>
</div>
<div class="middle-buttons">
<button type="submit" ng-click="addRealmRole()" tooltip="Move right" tooltip-placement="right"><span class="icon-arrow-right">Move right</span></button>
<button type="submit" ng-click="deleteRealmRole()" tooltip="Move left" tooltip-placement="right"><span class="icon-arrow-left">Move left</span></button>
</div>
<div class="select-title">
<label for="assigned">Assigned Roles</label>
<select id="assigned" class="form-control" multiple size=5
ng-multiple="true"
ng-model="selectedRealmMappings"
ng-options="r.name for r in realmMappings">
</select>
</div>
</div>
</div>
</fieldset>
<fieldset ng-show="applications.length > 0 && !create && role.composite">
<legend collapsed><span class="text">Composite Application Roles</span> </legend>
<div class="form-group input-select">
<label for="applications">Application</label>
<div class="input-group">
<div class="select-rcue">
<select id="applications" name="applications" ng-change="changeApplication()" ng-model="compositeApp" ng-options="a.name for a in applications">
<option value="" selected> Select an Application...</option>
</select>
</div>
</div>
</div>
<div class="form-group" ng-show="compositeApp">
<div class="controls changing-selectors application">
<div class="select-title">
<label for="available-app">Available Roles</label>
<select id="available-app" class="form-control" multiple size="5"
ng-multiple="true"
ng-model="selectedApplicationRoles"
ng-options="r.name for r in applicationRoles">
</select>
</div>
<div class="middle-buttons">
<button type="submit" ng-click="addApplicationRole()" tooltip="Move right" tooltip-placement="right"><span class="icon-arrow-right">Move right</span></button>
<button type="submit" ng-click="deleteApplicationRole()" tooltip="Move left" tooltip-placement="right"><span class="icon-arrow-left">Move left</span></button>
</div>
<div class="select-title">
<label for="assigned-app">Assigned Roles</label>
<select id="assigned-app" class="form-control" multiple size=5
ng-multiple="true"
ng-model="selectedApplicationMappings"
ng-options="r.name for r in applicationMappings">
</select>
</div>
</div>
</div>
</fieldset>
</form>
</div>
</div>