GUAC-1176: Remove all human-readable title properties from the REST form objects.

This commit is contained in:
Michael Jumper
2015-06-08 16:15:31 -07:00
parent 4eb5989c18
commit dcd82f9e63
23 changed files with 79 additions and 611 deletions

View File

@@ -29,12 +29,12 @@ angular.module('form').controller('checkboxFieldController', ['$scope',
// Update typed value when model is changed
$scope.$watch('model', function modelChanged(model) {
$scope.typedValue = (model === $scope.field.options[0].value);
$scope.typedValue = (model === $scope.field.options[0]);
});
// Update string value in model when typed value is changed
$scope.$watch('typedValue', function typedValueChanged(typedValue) {
$scope.model = (typedValue ? $scope.field.options[0].value : '');
$scope.model = (typedValue ? $scope.field.options[0] : '');
});
}]);

View File

@@ -1 +1 @@
<select ng-model="model" ng-options="option.value as getFieldOption(option.value) | translate for option in field.options | orderBy: value"></select>
<select ng-model="model" ng-options="option as getFieldOption(option) | translate for option in field.options | orderBy: value"></select>

View File

@@ -46,13 +46,6 @@ angular.module('rest').factory('Field', [function defineField() {
*/
this.name = template.name;
/**
* A human-readable name for this parameter.
*
* @type String
*/
this.title = template.title;
/**
* The type string defining which values this parameter may contain,
* as well as what properties are applicable. Valid types are listed
@@ -66,7 +59,7 @@ angular.module('rest').factory('Field', [function defineField() {
/**
* All possible legal values for this parameter.
*
* @type FieldOption[]
* @type String[]
*/
this.options = template.options;

View File

@@ -1,61 +0,0 @@
/*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Service which defines the FieldOption class.
*/
angular.module('rest').factory('FieldOption', [function defineFieldOption() {
/**
* The object returned by REST API calls when representing a single possible
* legal value of a field.
*
* @constructor
* @param {FieldOption|Object} [template={}]
* The object whose properties should be copied within the new
* FieldOption.
*/
var FieldOption = function FieldOption(template) {
// Use empty object by default
template = template || {};
/**
* A human-readable name for this parameter value.
*
* @type String
*/
this.title = template.title;
/**
* The actual value to set the parameter to, if this option is
* selected.
*
* @type String
*/
this.value = template.value;
};
return FieldOption;
}]);

View File

@@ -40,21 +40,13 @@ angular.module('rest').factory('Form', [function defineForm() {
template = template || {};
/**
* The name which uniquely identifies this parameter, or null if this
* field has no name.
* The name which uniquely identifies this form, or null if this form
* has no name.
*
* @type String
*/
this.name = template.name;
/**
* A human-readable name for this form, or null if this form has no
* name.
*
* @type String
*/
this.title = template.title;
/**
* All fields contained within this form.
*

View File

@@ -46,13 +46,6 @@ angular.module('rest').factory('Protocol', [function defineProtocol() {
*/
this.name = template.name;
/**
* A human-readable name for this protocol.
*
* @type String
*/
this.title = template.title;
/**
* An array of forms containing all known parameters for this protocol,
* their types, and other information.