From 96fafcdffb0616a000d202242c441f6baab792c9 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 9 Mar 2018 16:28:52 -0500 Subject: [PATCH] Add UI for viewing and setting the description of a robot account --- static/directives/create-entity-dialog.html | 8 ++++++++ static/directives/create-robot-dialog.html | 3 ++- static/directives/robots-manager.html | 5 +++++ static/js/directives/ui/create-entity-dialog.js | 3 +++ static/js/directives/ui/create-robot-dialog.js | 8 ++++++-- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/static/directives/create-entity-dialog.html b/static/directives/create-entity-dialog.html index 5e8bec9bf..100913817 100644 --- a/static/directives/create-entity-dialog.html +++ b/static/directives/create-entity-dialog.html @@ -36,6 +36,14 @@ Choose a name to inform your teammates about this {{ entityTitle }}. Must match {{ entityNameRegex }}. + +
+ + +
+ Enter a description to provide extran information to your teammates about this {{ entityTitle }}. +
+
\ No newline at end of file diff --git a/static/directives/robots-manager.html b/static/directives/robots-manager.html index 1890a3ed1..9acbfa5aa 100644 --- a/static/directives/robots-manager.html +++ b/static/directives/robots-manager.html @@ -36,6 +36,7 @@ Robot Account Name + Description Teams @@ -53,6 +54,10 @@ + + (None) + {{ ::robotInfo.description }} + No teams diff --git a/static/js/directives/ui/create-entity-dialog.js b/static/js/directives/ui/create-entity-dialog.js index 605701eda..142090a38 100644 --- a/static/js/directives/ui/create-entity-dialog.js +++ b/static/js/directives/ui/create-entity-dialog.js @@ -15,6 +15,7 @@ angular.module('quay').directive('createEntityDialog', function () { 'entityTitle': '@entityTitle', 'entityIcon': '@entityIcon', 'entityNameRegex': '@entityNameRegex', + 'allowEntityDescription': '@allowEntityDescription', 'entityCreateRequested': '&entityCreateRequested', 'entityCreateCompleted': '&entityCreateCompleted' @@ -41,6 +42,7 @@ angular.module('quay').directive('createEntityDialog', function () { $scope.show = function() { $scope.entityName = null; + $scope.entityDescription = null; $scope.entity = null; $scope.entityForPermissions = null; $scope.creating = false; @@ -67,6 +69,7 @@ angular.module('quay').directive('createEntityDialog', function () { $scope.view = 'creating'; $scope.entityCreateRequested({ 'name': $scope.entityName, + 'description': $scope.entityDescription, 'callback': entityCreateCallback }); }; diff --git a/static/js/directives/ui/create-robot-dialog.js b/static/js/directives/ui/create-robot-dialog.js index 6b2a24b23..3ef3912cc 100644 --- a/static/js/directives/ui/create-robot-dialog.js +++ b/static/js/directives/ui/create-robot-dialog.js @@ -19,7 +19,7 @@ angular.module('quay').directive('createRobotDialog', function () { $scope.robotCreated({'robot': robot}); }; - $scope.createRobot = function(name, callback) { + $scope.createRobot = function(name, description, callback) { var organization = $scope.info.namespace; if (!UserService.isOrganization(organization)) { organization = null; @@ -29,11 +29,15 @@ angular.module('quay').directive('createRobotDialog', function () { 'robot_shortname': name }; + var data = { + 'description': description + }; + var errorDisplay = ApiService.errorDisplay('Cannot create robot account', function() { callback(null); }); - ApiService.createRobot(organization, null, params).then(function(resp) { + ApiService.createRobot(organization, data, params).then(function(resp) { callback(resp); }, errorDisplay); };