Add UI for viewing and setting the description of a robot account
This commit is contained in:
parent
254cdfe43a
commit
96fafcdffb
5 changed files with 24 additions and 3 deletions
|
@ -36,6 +36,14 @@
|
||||||
Choose a name to inform your teammates
|
Choose a name to inform your teammates
|
||||||
about this {{ entityTitle }}. Must match {{ entityNameRegex }}.
|
about this {{ entityTitle }}. Must match {{ entityNameRegex }}.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div ng-show="allowEntityDescription" style="margin-top: 20px;">
|
||||||
|
<label>Provide an optional description for your new {{ entityTitle }}:</label>
|
||||||
|
<input type="text" class="form-control" ng-model="entityDescription" max-length="255">
|
||||||
|
<div class="help-text">
|
||||||
|
Enter a description to provide extran information to your teammates about this {{ entityTitle }}.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div> <!-- /.modal-body -->
|
</div> <!-- /.modal-body -->
|
||||||
<div class="modal-footer" ng-show="view == 'setperms'">
|
<div class="modal-footer" ng-show="view == 'setperms'">
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
<div class="create-entity-dialog" info="info" entity-title="robot account"
|
<div class="create-entity-dialog" info="info" entity-title="robot account"
|
||||||
entity-kind="robot"
|
entity-kind="robot"
|
||||||
entity-icon="ci-robot" entity-name-regex="{{ ROBOT_PATTERN }}"
|
entity-icon="ci-robot" entity-name-regex="{{ ROBOT_PATTERN }}"
|
||||||
entity-create-requested="createRobot(name, callback)"
|
allow-entity-description="true"
|
||||||
|
entity-create-requested="createRobot(name, description, callback)"
|
||||||
entity-create-completed="robotFinished(entity)"></div>
|
entity-create-completed="robotFinished(entity)"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -36,6 +36,7 @@
|
||||||
<td ng-class="TableService.tablePredicateClass('name', options.predicate, options.reverse)">
|
<td ng-class="TableService.tablePredicateClass('name', options.predicate, options.reverse)">
|
||||||
<a ng-click="TableService.orderBy('name', options)">Robot Account Name</a>
|
<a ng-click="TableService.orderBy('name', options)">Robot Account Name</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>Description</td>
|
||||||
<td ng-if="organization" ng-class="TableService.tablePredicateClass('teams_string', options.predicate, options.reverse)">
|
<td ng-if="organization" ng-class="TableService.tablePredicateClass('teams_string', options.predicate, options.reverse)">
|
||||||
<a ng-click="TableService.orderBy('teams_string', options)">Teams</a>
|
<a ng-click="TableService.orderBy('teams_string', options)">Teams</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -53,6 +54,10 @@
|
||||||
<span class="prefix" bo-text="getPrefix(robotInfo.name) + '+'"></span><span bo-text="getShortenedName(robotInfo.name)"></span>
|
<span class="prefix" bo-text="getPrefix(robotInfo.name) + '+'"></span><span bo-text="getShortenedName(robotInfo.name)"></span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="empty" bo-if="!robotInfo.description">(None)</span>
|
||||||
|
<span bo-if="robotInfo.description">{{ ::robotInfo.description }}</span>
|
||||||
|
</td>
|
||||||
<td bo-if="organization">
|
<td bo-if="organization">
|
||||||
<span class="empty" bo-if="robotInfo.teams.length == 0">
|
<span class="empty" bo-if="robotInfo.teams.length == 0">
|
||||||
No teams
|
No teams
|
||||||
|
|
|
@ -15,6 +15,7 @@ angular.module('quay').directive('createEntityDialog', function () {
|
||||||
'entityTitle': '@entityTitle',
|
'entityTitle': '@entityTitle',
|
||||||
'entityIcon': '@entityIcon',
|
'entityIcon': '@entityIcon',
|
||||||
'entityNameRegex': '@entityNameRegex',
|
'entityNameRegex': '@entityNameRegex',
|
||||||
|
'allowEntityDescription': '@allowEntityDescription',
|
||||||
|
|
||||||
'entityCreateRequested': '&entityCreateRequested',
|
'entityCreateRequested': '&entityCreateRequested',
|
||||||
'entityCreateCompleted': '&entityCreateCompleted'
|
'entityCreateCompleted': '&entityCreateCompleted'
|
||||||
|
@ -41,6 +42,7 @@ angular.module('quay').directive('createEntityDialog', function () {
|
||||||
|
|
||||||
$scope.show = function() {
|
$scope.show = function() {
|
||||||
$scope.entityName = null;
|
$scope.entityName = null;
|
||||||
|
$scope.entityDescription = null;
|
||||||
$scope.entity = null;
|
$scope.entity = null;
|
||||||
$scope.entityForPermissions = null;
|
$scope.entityForPermissions = null;
|
||||||
$scope.creating = false;
|
$scope.creating = false;
|
||||||
|
@ -67,6 +69,7 @@ angular.module('quay').directive('createEntityDialog', function () {
|
||||||
$scope.view = 'creating';
|
$scope.view = 'creating';
|
||||||
$scope.entityCreateRequested({
|
$scope.entityCreateRequested({
|
||||||
'name': $scope.entityName,
|
'name': $scope.entityName,
|
||||||
|
'description': $scope.entityDescription,
|
||||||
'callback': entityCreateCallback
|
'callback': entityCreateCallback
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,7 @@ angular.module('quay').directive('createRobotDialog', function () {
|
||||||
$scope.robotCreated({'robot': robot});
|
$scope.robotCreated({'robot': robot});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.createRobot = function(name, callback) {
|
$scope.createRobot = function(name, description, callback) {
|
||||||
var organization = $scope.info.namespace;
|
var organization = $scope.info.namespace;
|
||||||
if (!UserService.isOrganization(organization)) {
|
if (!UserService.isOrganization(organization)) {
|
||||||
organization = null;
|
organization = null;
|
||||||
|
@ -29,11 +29,15 @@ angular.module('quay').directive('createRobotDialog', function () {
|
||||||
'robot_shortname': name
|
'robot_shortname': name
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
'description': description
|
||||||
|
};
|
||||||
|
|
||||||
var errorDisplay = ApiService.errorDisplay('Cannot create robot account', function() {
|
var errorDisplay = ApiService.errorDisplay('Cannot create robot account', function() {
|
||||||
callback(null);
|
callback(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
ApiService.createRobot(organization, null, params).then(function(resp) {
|
ApiService.createRobot(organization, data, params).then(function(resp) {
|
||||||
callback(resp);
|
callback(resp);
|
||||||
}, errorDisplay);
|
}, errorDisplay);
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue