GUAC-1160: Generalize parameters into fields. Depend on title in field.

This commit is contained in:
Michael Jumper
2015-04-15 13:51:07 -07:00
parent c413b8a1e1
commit 6d0d7b127f
7 changed files with 100 additions and 172 deletions

View File

@@ -21,20 +21,20 @@
*/
/**
* Service which defines the ProtocolParameter class.
* Service which defines the Field class.
*/
angular.module('rest').factory('ProtocolParameter', [function defineProtocolParameter() {
angular.module('rest').factory('Field', [function defineField() {
/**
* The object returned by REST API calls when representing the data
* associated with a configuration parameter of a remote desktop protocol.
*
* @constructor
* @param {ProtocolParameter|Object} [template={}]
* @param {Field|Object} [template={}]
* The object whose properties should be copied within the new
* ProtocolParameter.
* Field.
*/
var ProtocolParameter = function ProtocolParameter(template) {
var Field = function Field(template) {
// Use empty object by default
template = template || {};
@@ -56,12 +56,12 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
/**
* The type string defining which values this parameter may contain,
* as well as what properties are applicable. Valid types are listed
* within ProtocolParameter.Type.
* within Field.Type.
*
* @type String
* @default ProtocolParameter.Type.TEXT
* @default Field.Type.TEXT
*/
this.type = template.type || ProtocolParameter.Type.TEXT;
this.type = template.type || Field.Type.TEXT;
/**
* The value to set the parameter to, in the case of a BOOLEAN
@@ -75,7 +75,7 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
* All possible legal values for this parameter. This property is only
* applicable to ENUM type parameters.
*
* @type ProtocolParameterOption[]
* @type FieldOption[]
*/
this.options = template.options;
@@ -84,7 +84,7 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
/**
* All valid protocol parameter types.
*/
ProtocolParameter.Type = {
Field.Type = {
/**
* The type string associated with parameters that may contain a single
@@ -147,6 +147,6 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
};
return ProtocolParameter;
return Field;
}]);

View File

@@ -21,20 +21,20 @@
*/
/**
* Service which defines the ProtocolParameterOption class.
* Service which defines the FieldOption class.
*/
angular.module('rest').factory('ProtocolParameterOption', [function defineProtocolParameterOption() {
angular.module('rest').factory('FieldOption', [function defineFieldOption() {
/**
* The object returned by REST API calls when representing a single possible
* legal value of a configuration parameter of a remote desktop protocol.
*
* @constructor
* @param {ProtocolParameterOption|Object} [template={}]
* @param {FieldOption|Object} [template={}]
* The object whose properties should be copied within the new
* ProtocolParameterOption.
* FieldOption.
*/
var ProtocolParameterOption = function ProtocolParameterOption(template) {
var FieldOption = function FieldOption(template) {
// Use empty object by default
template = template || {};
@@ -56,6 +56,6 @@ angular.module('rest').factory('ProtocolParameterOption', [function defineProtoc
};
return ProtocolParameterOption;
return FieldOption;
}]);

View File

@@ -57,7 +57,7 @@ angular.module('rest').factory('Protocol', [function defineProtocol() {
* An array of all known parameters for this protocol, their types,
* and other information.
*
* @type ProtocolParameter[]
* @type Field[]
* @default []
*/
this.parameters = template.parameters || [];