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'; return 'action';
} }
public function getAttributes() public function getInputType()
{ {
if (isset($this->attributes['type'])) { if (isset($this->attributes['type'])) {
$type = $this->attributes['type']; return $this->attributes['type'];
} else { } else {
$type = (isset($this->attributes['src'])) ? 'image' : 'submit'; return (isset($this->attributes['src'])) ? 'image' : 'submit';
} }
}
public function getAttributes()
{
return array_merge( return array_merge(
parent::getAttributes(), parent::getAttributes(),
array( array(
'disabled' => ($this->isReadonly() || $this->isDisabled()), 'disabled' => ($this->isReadonly() || $this->isDisabled()),
'value' => $this->Title(), 'value' => $this->Title(),
'type' => $type, 'type' => $this->getInputType(),
'title' => ($this->useButtonTag) ? $this->description : null, 'title' => ($this->useButtonTag) ? $this->description : null,
) )
); );

View File

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

View File

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

View File

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

View File

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