Update tests

This commit is contained in:
Saophalkun Ponlu 2017-05-09 16:42:08 +12:00
parent 97dac7028c
commit fd51f35bc2
5 changed files with 37 additions and 19 deletions

View File

@ -173,20 +173,23 @@ class FormAction extends FormField
return 'action';
}
public function getAttributes()
public function getInputType()
{
if (isset($this->attributes['type'])) {
$type = $this->attributes['type'];
return $this->attributes['type'];
} else {
$type = (isset($this->attributes['src'])) ? 'image' : 'submit';
return (isset($this->attributes['src'])) ? 'image' : 'submit';
}
}
public function getAttributes()
{
return array_merge(
parent::getAttributes(),
array(
'disabled' => ($this->isReadonly() || $this->isDisabled()),
'value' => $this->Title(),
'type' => $type,
'type' => $this->getInputType(),
'title' => ($this->useButtonTag) ? $this->description : null,
)
);

View File

@ -30,6 +30,8 @@ class PopoverField extends FieldGroup
*/
protected $popoverTitle = null;
protected $inputType = null;
/**
* Placement of the popup box, relative to the element triggering it.
* Valid values: bottom, top, left, right.

View File

@ -16,7 +16,8 @@
{
"id": "Form_TestForm_Name",
"name": "Name",
"type": "Text",
"type": "text",
"schemaType": "Text",
"component": null,
"holderId": "Form_TestForm_Name_Holder",
"title": "Name",
@ -35,7 +36,8 @@
{
"id": "Form_TestForm_SecurityID",
"name": "SecurityID",
"type": "Hidden",
"type": "hidden",
"schemaType": "Hidden",
"component": null,
"holderId": "Form_TestForm_SecurityID_Holder",
"title": "Security ID",
@ -57,7 +59,8 @@
"id": "Form_TestForm_action_save",
"title": "Save",
"name": "action_save",
"type": null,
"type": "submit",
"schemaType": null,
"component": "FormAction",
"holderId": "Form_TestForm_action_save_Holder",
"source": null,
@ -80,7 +83,8 @@
"id": "Form_TestForm_action_cancel",
"title": "Cancel",
"name": "action_cancel",
"type": null,
"type": "submit",
"schemaType": null,
"component": "FormAction",
"holderId": "Form_TestForm_action_cancel_Holder",
"source": null,
@ -103,7 +107,8 @@
"id": "Form_TestForm_Moreoptions",
"title": "More options",
"name": "Moreoptions",
"type": "Structural",
"schemaType": "Structural",
"type": null,
"component": "PopoverField",
"holderId": "Form_TestForm_Moreoptions_Holder",
"source": null,
@ -133,7 +138,8 @@
"id": "Form_TestForm_action_publish",
"title": "Publish record",
"name": "action_publish",
"type": null,
"type": "submit",
"schemaType": null,
"component": "FormAction",
"holderId": "Form_TestForm_action_publish_Holder",
"source": null,
@ -156,7 +162,8 @@
"id": "Form_TestForm_action_archive",
"title": "Archive",
"name": "action_archive",
"type": null,
"type": "submit",
"schemaType": null,
"component": "FormAction",
"holderId": "Form_TestForm_action_archive_Holder",
"source": null,

View File

@ -16,7 +16,8 @@
{
"id": "Form_TestForm_SecurityID",
"name": "SecurityID",
"type": "Hidden",
"type": "hidden",
"schemaType": "Hidden",
"component": null,
"holderId": "Form_TestForm_SecurityID_Holder",
"title": "Security ID",
@ -34,4 +35,4 @@
}
],
"actions": []
}
}

View File

@ -16,7 +16,8 @@
{
"name": "Name",
"id": "Form_TestForm_Name",
"type": "Text",
"type": "text",
"schemaType": "Text",
"component": null,
"holderId": "Form_TestForm_Name_Holder",
"title": "Name",
@ -40,7 +41,8 @@
{
"name": "Date",
"id": "Form_TestForm_Date",
"type": "Date",
"type": "date",
"schemaType": "Date",
"component": null,
"holderId": "Form_TestForm_Date_Holder",
"title": "Date",
@ -66,7 +68,8 @@
{
"name": "Number",
"id": "Form_TestForm_Number",
"type": "Decimal",
"type": "number",
"schemaType": "Decimal",
"component": null,
"holderId": "Form_TestForm_Number_Holder",
"title": "Number",
@ -87,7 +90,8 @@
{
"name": "Money",
"id": "Form_TestForm_Money",
"type": "Text",
"type": "text",
"schemaType": "Text",
"component": null,
"holderId": "Form_TestForm_Money_Holder",
"title": "Money",
@ -108,7 +112,8 @@
{
"name": "SecurityID",
"id": "Form_TestForm_SecurityID",
"type": "Hidden",
"type": "hidden",
"schemaType": "Hidden",
"component": null,
"holderId": "Form_TestForm_SecurityID_Holder",
"title": "Security ID",
@ -126,4 +131,4 @@
}
],
"actions": []
}
}