Skip to content

Commit

Permalink
\#156 Merging in form changes from issues/136 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
qial committed Sep 4, 2020
2 parents f3f372f + 056aa96 commit e6508b9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fragments/form/sample-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"title": "Form - Input Types",
"group": "Features",
"model": {
"schema": "{\n\"fields\": [\n {\n \"type\": \"label\",\n \"label\": \"Label\",\n \"model\": \"label\"\n },{\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"Text\",\n \"model\": \"text\",\n \"id\": \"text\",\n \"placeholder\": \"Text\"\n },{\n \"type\": \"textArea\",\n \"label\": \"Text Area\",\n \"model\": \"textarea\",\n \"id\": \"textarea\",\n \"rows\": 4,\n \"placeholder\": \"Enter text here\"\n },{\n \"type\": \"radios\",\n \"label\": \"Radios\",\n \"model\": \"radios\",\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"checkbox\",\n \"label\": \"Checkbox\",\n \"model\": \"checkbox\",\n \"default\": true\n },{\n \"type\": \"checklist\",\n \"label\": \"Checklist\",\n \"model\": \"checklist\",\n \"listBox\": true,\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"select\",\n \"label\": \"Select\",\n \"model\": \"select\",\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n }\n]}"
"schema": "{\n\"groups\":[\n{\n\"legend\":\"Text Inputs\",\n\"fields\": [\n {\n \"type\": \"label\",\n \"label\": \"Label\",\n \"model\": \"label\"\n },{\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"Text\",\n \"model\": \"text\",\n \"id\": \"text\",\n \"placeholder\": \"Text\"\n },{\n \"type\": \"textArea\",\n \"label\": \"Text Area\",\n \"model\": \"textarea\",\n \"id\": \"textarea\",\n \"rows\": 4,\n \"placeholder\": \"Enter text here\"\n }\n ]\n},\n{\n\"legend\":\"Other Inputs\",\n\"fields\": [\n {\n \"type\": \"radios\",\n \"label\": \"Radios\",\n \"model\": \"radios\",\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"checkbox\",\n \"label\": \"Checkbox\",\n \"model\": \"checkbox\",\n \"default\": true\n },{\n \"type\": \"checklist\",\n \"label\": \"Checklist\",\n \"model\": \"checklist\",\n \"listBox\": true,\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"select\",\n \"label\": \"Select\",\n \"model\": \"select\",\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"submit\",\n \"buttonText\": \"Submit Button\",\n \"validateBeforeSubmit\": false\n }\n]}]}"
}
}
3 changes: 0 additions & 3 deletions fragments/form/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ export default {
}
console.log('window.' + this.model.submitfunction + ' not found')
Vue.set(this, 'failureText', this.model.failmessage);
setTimeout(() => {
Vue.set(this, 'failureText', '');
}, 1500)
return
}
axios.post(this.model.endpointurl, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<jcr:content jcr:primaryType="nt:unstructured" schema="\{&#xA;&quot;fields&quot;: [&#xA; {&#xA; &quot;type&quot;: &quot;input&quot;,&#xA; &quot;inputType&quot;: &quot;text&quot;,&#xA; &quot;label&quot;: &quot;Name&quot;,&#xA; &quot;model&quot;: &quot;name&quot;,&#xA; &quot;id&quot;: &quot;user_name&quot;,&#xA; &quot;placeholder&quot;: &quot;Your name&quot;,&#xA; &quot;featured&quot;: true,&#xA; &quot;required&quot;: true&#xA; }&#xA;]}"/>
</sample>
<sample-all jcr:primaryType="nt:unstructured" title="Form - Input Types" group="Features">
<jcr:content jcr:primaryType="nt:unstructured" schema="\{&#xA;&quot;fields&quot;: [&#xA; {&#xA; &quot;type&quot;: &quot;label&quot;,&#xA; &quot;label&quot;: &quot;Label&quot;,&#xA; &quot;model&quot;: &quot;label&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;input&quot;,&#xA; &quot;inputType&quot;: &quot;text&quot;,&#xA; &quot;label&quot;: &quot;Text&quot;,&#xA; &quot;model&quot;: &quot;text&quot;,&#xA; &quot;id&quot;: &quot;text&quot;,&#xA; &quot;placeholder&quot;: &quot;Text&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;textArea&quot;,&#xA; &quot;label&quot;: &quot;Text Area&quot;,&#xA; &quot;model&quot;: &quot;textarea&quot;,&#xA; &quot;id&quot;: &quot;textarea&quot;,&#xA; &quot;rows&quot;: 4,&#xA; &quot;placeholder&quot;: &quot;Enter text here&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;radios&quot;,&#xA; &quot;label&quot;: &quot;Radios&quot;,&#xA; &quot;model&quot;: &quot;radios&quot;,&#xA; &quot;values&quot;: [&#xA; &quot;Option 1&quot;,&#xA; &quot;Option 2&quot;&#xA; ]&#xA; },{&#xA; &quot;type&quot;: &quot;checkbox&quot;,&#xA; &quot;label&quot;: &quot;Checkbox&quot;,&#xA; &quot;model&quot;: &quot;checkbox&quot;,&#xA; &quot;default&quot;: true&#xA; },{&#xA; &quot;type&quot;: &quot;checklist&quot;,&#xA; &quot;label&quot;: &quot;Checklist&quot;,&#xA; &quot;model&quot;: &quot;checklist&quot;,&#xA; &quot;listBox&quot;: true,&#xA; &quot;values&quot;: [&#xA; &quot;Option 1&quot;,&#xA; &quot;Option 2&quot;&#xA; ]&#xA; },{&#xA; &quot;type&quot;: &quot;select&quot;,&#xA; &quot;label&quot;: &quot;Select&quot;,&#xA; &quot;model&quot;: &quot;select&quot;,&#xA; &quot;values&quot;: [&#xA; &quot;Option 1&quot;,&#xA; &quot;Option 2&quot;&#xA; ]&#xA; }&#xA;]}"/>
<jcr:content jcr:primaryType="nt:unstructured" schema="\{&#xA;&quot;groups&quot;:[&#xA;{&#xA;&quot;legend&quot;:&quot;Text Inputs&quot;,&#xA;&quot;fields&quot;: [&#xA; {&#xA; &quot;type&quot;: &quot;label&quot;,&#xA; &quot;label&quot;: &quot;Label&quot;,&#xA; &quot;model&quot;: &quot;label&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;input&quot;,&#xA; &quot;inputType&quot;: &quot;text&quot;,&#xA; &quot;label&quot;: &quot;Text&quot;,&#xA; &quot;model&quot;: &quot;text&quot;,&#xA; &quot;id&quot;: &quot;text&quot;,&#xA; &quot;placeholder&quot;: &quot;Text&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;textArea&quot;,&#xA; &quot;label&quot;: &quot;Text Area&quot;,&#xA; &quot;model&quot;: &quot;textarea&quot;,&#xA; &quot;id&quot;: &quot;textarea&quot;,&#xA; &quot;rows&quot;: 4,&#xA; &quot;placeholder&quot;: &quot;Enter text here&quot;&#xA; }&#xA; ]&#xA;},&#xA;{&#xA;&quot;legend&quot;:&quot;Other Inputs&quot;,&#xA;&quot;fields&quot;: [&#xA; {&#xA; &quot;type&quot;: &quot;radios&quot;,&#xA; &quot;label&quot;: &quot;Radios&quot;,&#xA; &quot;model&quot;: &quot;radios&quot;,&#xA; &quot;values&quot;: [&#xA; &quot;Option 1&quot;,&#xA; &quot;Option 2&quot;&#xA; ]&#xA; },{&#xA; &quot;type&quot;: &quot;checkbox&quot;,&#xA; &quot;label&quot;: &quot;Checkbox&quot;,&#xA; &quot;model&quot;: &quot;checkbox&quot;,&#xA; &quot;default&quot;: true&#xA; },{&#xA; &quot;type&quot;: &quot;checklist&quot;,&#xA; &quot;label&quot;: &quot;Checklist&quot;,&#xA; &quot;model&quot;: &quot;checklist&quot;,&#xA; &quot;listBox&quot;: true,&#xA; &quot;values&quot;: [&#xA; &quot;Option 1&quot;,&#xA; &quot;Option 2&quot;&#xA; ]&#xA; },{&#xA; &quot;type&quot;: &quot;select&quot;,&#xA; &quot;label&quot;: &quot;Select&quot;,&#xA; &quot;model&quot;: &quot;select&quot;,&#xA; &quot;values&quot;: [&#xA; &quot;Option 1&quot;,&#xA; &quot;Option 2&quot;&#xA; ]&#xA; },{&#xA; &quot;type&quot;: &quot;submit&quot;,&#xA; &quot;buttonText&quot;: &quot;Submit Button&quot;,&#xA; &quot;validateBeforeSubmit&quot;: false&#xA; }&#xA;]}]}"/>
</sample-all>
<sample-contact jcr:primaryType="nt:unstructured" title="Form - Contact" group="Features">
<jcr:content jcr:primaryType="nt:unstructured" schema="\{&#xA;&quot;fields&quot;: [&#xA; {&#xA; &quot;type&quot;: &quot;input&quot;,&#xA; &quot;inputType&quot;: &quot;text&quot;,&#xA; &quot;label&quot;: &quot;First Name&quot;,&#xA; &quot;model&quot;: &quot;first_name&quot;,&#xA; &quot;id&quot;: &quot;first_name&quot;,&#xA; &quot;placeholder&quot;: &quot;First Name&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;input&quot;,&#xA; &quot;inputType&quot;: &quot;text&quot;,&#xA; &quot;label&quot;: &quot;Last Name&quot;,&#xA; &quot;model&quot;: &quot;last_name&quot;,&#xA; &quot;id&quot;: &quot;last_name&quot;,&#xA; &quot;placeholder&quot;: &quot;Last Name&quot;&#xA; },{&#xA; &quot;type&quot;: &quot;input&quot;,&#xA; &quot;inputType&quot;: &quot;text&quot;,&#xA; &quot;label&quot;: &quot;Email&quot;,&#xA; &quot;model&quot;: &quot;email&quot;,&#xA; &quot;id&quot;: &quot;email&quot;,&#xA; &quot;placeholder&quot;: &quot;Email&quot;,&#xA; &quot;featured&quot;: true,&#xA; &quot;required&quot;: true&#xA; },{&#xA; &quot;type&quot;: &quot;textArea&quot;,&#xA; &quot;label&quot;: &quot;Text&quot;,&#xA; &quot;model&quot;: &quot;text&quot;,&#xA; &quot;id&quot;: &quot;text&quot;,&#xA; &quot;rows&quot;: 4,&#xA; &quot;placeholder&quot;: &quot;Enter text here&quot;,&#xA; &quot;featured&quot;: true,&#xA; &quot;required&quot;: true&#xA; }&#xA;]}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ export default {
}
console.log('window.' + this.model.submitfunction + ' not found')
Vue.set(this, 'failureText', this.model.failmessage);
setTimeout(() => {
Vue.set(this, 'failureText', '');
}, 1500)
return
}
axios.post(this.model.endpointurl, {
Expand Down

0 comments on commit e6508b9

Please sign in to comment.