From 41ae47c9952e98af56d194498583f88474ca9eb6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 20 Jun 2016 14:33:40 -0400 Subject: [PATCH 1/2] Toggle for add permissions dialog Fixes #1553 --- static/css/core-ui.css | 13 +++++++++++++ static/directives/create-entity-dialog.html | 16 ++++++++++++++-- static/js/core-ui.js | 4 ++++ static/js/directives/ui/create-entity-dialog.js | 12 ++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/static/css/core-ui.css b/static/css/core-ui.css index 0f51c29f9..667fcc781 100644 --- a/static/css/core-ui.css +++ b/static/css/core-ui.css @@ -1107,6 +1107,19 @@ a:focus { text-align: center; } +.co-table .checkbox-col .co-checkable-menu a { + color: black; + text-transform: none; +} + +.co-table thead td.checkbox-menu-col:after { + display: none; +} + +.co-table .offset-check-col { + padding-left: 22px; +} + .co-table td.options-col { width: 36px; text-align: center; diff --git a/static/directives/create-entity-dialog.html b/static/directives/create-entity-dialog.html index eff7fa581..90d59f959 100644 --- a/static/directives/create-entity-dialog.html +++ b/static/directives/create-entity-dialog.html @@ -31,7 +31,19 @@ - + @@ -45,7 +57,7 @@ ng-repeat="repo in orderedRepositories.visibleEntries" ng-class="checkedRepos.isChecked(repo, checkedRepos.checked) ? 'checked' : ''" bindonce> -
+ +
+ All Repositories +
+
+ No Repositories +
+
+ Missing Permissions +
+
+
Repository Name + diff --git a/static/js/core-ui.js b/static/js/core-ui.js index 0d9e9388c..f7457ce0a 100644 --- a/static/js/core-ui.js +++ b/static/js/core-ui.js @@ -659,6 +659,10 @@ angular.module("core-ui", []) }, controller: function($rootScope, $scope, $element) { $scope.getClass = function(items, checked) { + if (!checked) { + return 'none'; + } + if (checked.length == 0) { return 'none'; } diff --git a/static/js/directives/ui/create-entity-dialog.js b/static/js/directives/ui/create-entity-dialog.js index 781e07747..c70a2128c 100644 --- a/static/js/directives/ui/create-entity-dialog.js +++ b/static/js/directives/ui/create-entity-dialog.js @@ -175,6 +175,18 @@ angular.module('quay').directive('createEntityDialog', function () { }); }; + $scope.allRepositoriesFilter = function(item) { + return true; + }; + + $scope.noRepositoriesFilter = function(item) { + return false; + }; + + $scope.missingPermsRepositoriesFilter = function(item) { + return !item.perm; + }; + $scope.$watch('options.predicate', setRepoState); $scope.$watch('options.reverse', setRepoState); $scope.$watch('options.filter', setRepoState); From ab8709d7bb58cc52aa4f5f21ad14fb401e90403f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 20 Jun 2016 14:35:14 -0400 Subject: [PATCH 2/2] Fix robot and team patterns to match server --- static/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 49d4bdf9b..3d5ae593a 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1,5 +1,5 @@ -var TEAM_PATTERN = '^[a-zA-Z][a-zA-Z0-9]+$'; -var ROBOT_PATTERN = '^[a-zA-Z][a-zA-Z0-9_]{3,29}$'; +var TEAM_PATTERN = '^[a-z][a-z0-9]+$'; +var ROBOT_PATTERN = '^[a-z][a-z0-9_]{3,29}$'; var USER_PATTERN = '^[a-z0-9_]{4,30}$'; // Define the pages module.