Skip to content

Commit

Permalink
[SDPSUP-485] Add honeypot to content rating form (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-cole authored and conantran committed Jul 10, 2019
1 parent fe985a7 commit f268352
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions packages/ripple-nuxt-tide/lib/components/AppContentRating.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export default {
model: {
url: '',
was_this_page_helpful: null,
comments: ''
comments: '',
honeypot: ''
},
schema: {
groups: [
Expand All @@ -58,6 +59,14 @@ export default {
},
{
fields: [
{
type: 'input',
inputType: 'text',
label: 'Tell me your email',
model: 'honeypot',
styleClasses: 'tide-tell-me-your-email',
autocomplete: 'off'
},
{
type: 'textArea',
label: 'Please add your comments:',
Expand Down Expand Up @@ -115,20 +124,30 @@ export default {
const formData = this.formData.model
const formId = this.formData.tideId
const res = await this.$tide.postForm(formId, formData)
if (res) {
if (formData.honeypot) {
this.formData.formState = {
response: {
status: 'success',
message: this.messages.success
}
}
} else {
this.formData.formState = {
response: {
status: 'danger',
message: this.messages.error
const res = await this.$tide.postForm(formId, formData)
if (res) {
this.formData.formState = {
response: {
status: 'success',
message: this.messages.success
}
}
} else {
this.formData.formState = {
response: {
status: 'danger',
message: this.messages.error
}
}
}
}
Expand Down Expand Up @@ -221,6 +240,9 @@ $app-content-text-color: rpl-color('dark_neutral') !default;
background-color: rpl-color('danger');
}
.tide-tell-me-your-email {
display: none !important;
}
}
</style>

0 comments on commit f268352

Please sign in to comment.