Start on mobilification of repo view
This commit is contained in:
parent
79caf2dab2
commit
a4cacd7307
31 changed files with 265 additions and 91 deletions
|
@ -754,7 +754,10 @@ angular.module("core-ui", [])
|
|||
displayer.removeAttr('ng-repeat');
|
||||
}
|
||||
|
||||
displayer.append(headers[idx].clone(true).addClass('mobile-col-header'));
|
||||
if (idx < headers.length) {
|
||||
displayer.append(headers[idx].clone(true).addClass('mobile-col-header'));
|
||||
}
|
||||
|
||||
displayer.append(cloneWithAttr(td, 'div', true).addClass('mobile-col-value'));
|
||||
div.append(displayer);
|
||||
});
|
||||
|
|
6
static/js/directives/ui/prototype-manager.js
vendored
6
static/js/directives/ui/prototype-manager.js
vendored
|
@ -18,12 +18,6 @@ angular.module('quay').directive('prototypeManager', function () {
|
|||
$scope.clearCounter = 0;
|
||||
$scope.newForWholeOrg = true;
|
||||
|
||||
$scope.roles = [
|
||||
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
|
||||
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
|
||||
];
|
||||
|
||||
$scope.setRole = function(role, prototype) {
|
||||
var params = {
|
||||
'orgname': $scope.organization.name,
|
||||
|
|
|
@ -28,13 +28,6 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
|
|||
'repository': '=repository'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService) {
|
||||
// TODO(jschorr): move this to a service.
|
||||
$scope.roles = [
|
||||
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
|
||||
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
|
||||
];
|
||||
|
||||
$scope.permissionResources = {'team': {}, 'user': {}};
|
||||
$scope.permissionCache = {};
|
||||
$scope.permissions = {};
|
||||
|
|
|
@ -14,12 +14,6 @@ angular.module('quay').directive('repositoryTokensTable', function () {
|
|||
'hasTokens': '=hasTokens'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService) {
|
||||
$scope.roles = [
|
||||
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
|
||||
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
|
||||
];
|
||||
|
||||
$scope.hasTokens = false;
|
||||
|
||||
var loadTokens = function() {
|
||||
|
|
|
@ -15,13 +15,6 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
controller: function($scope, $element, ApiService, $routeParams, CreateService, Config) {
|
||||
$scope.ROBOT_PATTERN = ROBOT_PATTERN;
|
||||
|
||||
// TODO(jschorr): move this to a service.
|
||||
$scope.roles = [
|
||||
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
|
||||
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
|
||||
];
|
||||
|
||||
$scope.robots = null;
|
||||
$scope.loading = false;
|
||||
$scope.shownRobot = null;
|
||||
|
|
|
@ -10,12 +10,14 @@ angular.module('quay').directive('roleGroup', function () {
|
|||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'roles': '=roles',
|
||||
'roles': '@roles',
|
||||
'currentRole': '=currentRole',
|
||||
'readOnly': '=readOnly',
|
||||
'roleChanged': '&roleChanged'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
controller: function($scope, $element, RolesService) {
|
||||
$scope.fullRoles = RolesService[$scope.roles];
|
||||
|
||||
$scope.setRole = function(role) {
|
||||
if ($scope.currentRole == role) { return; }
|
||||
if ($scope.roleChanged) {
|
||||
|
@ -24,6 +26,14 @@ angular.module('quay').directive('roleGroup', function () {
|
|||
$scope.currentRole = role;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.getRoleInfo = function(role) {
|
||||
var found = null;
|
||||
$scope.fullRoles.forEach(function(r) {
|
||||
if (r.id == role) { found = r; }
|
||||
});
|
||||
return found;
|
||||
};
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
|
|
|
@ -97,12 +97,6 @@
|
|||
$scope.TEAM_PATTERN = TEAM_PATTERN;
|
||||
$rootScope.title = 'Loading...';
|
||||
|
||||
$scope.teamRoles = [
|
||||
{ 'id': 'member', 'title': 'Member', 'kind': 'default' },
|
||||
{ 'id': 'creator', 'title': 'Creator', 'kind': 'success' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
|
||||
];
|
||||
|
||||
$scope.setRole = function(role, teamname) {
|
||||
var previousRole = $scope.organization.teams[teamname].role;
|
||||
$scope.organization.teams[teamname].role = role;
|
||||
|
|
|
@ -110,12 +110,6 @@
|
|||
}, ApiService.errorDisplay('Cannot change permission'));
|
||||
};
|
||||
|
||||
$scope.roles = [
|
||||
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
|
||||
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
|
||||
];
|
||||
|
||||
$scope.setRole = function(role, entityName, kind) {
|
||||
var permission = $scope.permissions[kind][entityName];
|
||||
var currentRole = permission.role;
|
||||
|
|
20
static/js/services/roles-service.js
Normal file
20
static/js/services/roles-service.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* Service which defines the various role groups.
|
||||
*/
|
||||
angular.module('quay').factory('RolesService', [function() {
|
||||
var roleService = {};
|
||||
|
||||
roleService.repoRoles = [
|
||||
{ 'id': 'read', 'title': 'Read', 'kind': 'success', 'description': 'Can view and pull from the repository' },
|
||||
{ 'id': 'write', 'title': 'Write', 'kind': 'success', 'description': 'Can view, pull and push to the repository' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary', 'description': 'Full admin access, pull and push on the repository' }
|
||||
];
|
||||
|
||||
roleService.teamRoles = [
|
||||
{ 'id': 'member', 'title': 'Member', 'kind': 'default', 'description': 'Inherits all permissions of the team' },
|
||||
{ 'id': 'creator', 'title': 'Creator', 'kind': 'success', 'description': 'Member and can create new repositories' },
|
||||
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary', 'description': 'Full admin access to the organization' }
|
||||
];
|
||||
|
||||
return roleService;
|
||||
}]);
|
Reference in a new issue