Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 29 additions & 63 deletions plugins/star-rating/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,25 @@
methods: {
// drawer event handlers
onConsentCheckbox: function(ev) {
ev.links = {
"link": [
{
"text": "Terms and Conditions",
"link": "https://termsandconditions.com",
"textValue": "Terms and Conditions",
"linkValue": "https://termsandconditions.com"
},
{
"text": "Privacy Policy",
"link": "https://privacyPolicy.com",
"textValue": "Privacy Policy",
"linkValue": "https://privacyPolicy.com"
}
],
"finalText": "I agree to the Terms and Conditions and Privacy Policy."

};
if (!ev.links || ev.links.length < 1) {
ev.links = {
"link": [
{
"text": "Terms and Conditions",
"link": "https://termsandconditions.com",
"textValue": "Terms and Conditions",
"linkValue": "https://termsandconditions.com"
},
{
"text": "Privacy Policy",
"link": "https://privacyPolicy.com",
"textValue": "Privacy Policy",
"linkValue": "https://privacyPolicy.com"
}
],
"finalText": "I agree to the Terms and Conditions and Privacy Policy.",
};
}
},
finalTxt: function(links) {
let finalText = links.finalText;
Expand Down Expand Up @@ -222,31 +223,7 @@
onOpen: function() {
var self = this;
var loadImage = new Image();
if (this.controls.initialEditedObject.consent === true || this.controls.initialEditedObject.consent === "true") {
this.controls.initialEditedObject.consent = true;
this.consent = true;
}
else {
this.controls.initialEditedObject.consent = false;
}
if (Array.isArray(this.controls.initialEditedObject.links)) {
this.controls.initialEditedObject.links.forEach(function(link) {
if (link.linkValue.indexOf('term')) {
link.text = "Terms and Conditions";
link.link = "https://termsandconditions.com";
}
else if (link.linkValue.indexOf('privacy')) {
link.text = "Privacy Policy";
link.link = "https://privacyPolicy.com";
}
else {
link.text = "Another Link";
link.link = "https://otherlink.com";
}
link.linkValue = link.linkValue.replace(new RegExp('[?&]' + CLY_X_INT + '=[^&]*'), '').replace(/[?&]$/, '');
});
this.controls.initialEditedObject.links = {"link": this.controls.initialEditedObject.links, "finalText": this.controls.initialEditedObject.finalText};
}

if (this.controls.initialEditedObject.logo) {

if (this.controls.initialEditedObject.logo.indexOf("feedback_logo") > -1
Expand Down Expand Up @@ -806,24 +783,6 @@
}
}
this.openDrawer("widget", {
links: {
"link": [
{
"text": "Terms and Conditions",
"link": "https://termsandconditions.com",
"textValue": "Terms and Conditions",
"linkValue": "https://termsandconditions.com"
},
{
"text": "Privacy Policy",
"link": "https://privacyPolicy.com",
"textValue": "Privacy Policy",
"linkValue": "https://privacyPolicy.com"
}
],
"finalText": "I agree to the Terms and Conditions and Privacy Policy."

},
consent: false,
popup_header_text: 'What\'s your opinion about this page?',
popup_thanks_message: 'Thanks for your feedback!',
Expand Down Expand Up @@ -1145,6 +1104,14 @@
steps: null
};
}

if (this.widget.consent === true || this.widget.consent === "true") {
this.widget.consent = true;
}
else {
this.widget.consent = false;
}

if (Array.isArray(this.widget.links) && this.widget.links.length) {
this.widget.links.forEach(function(link) {
if (link.linkValue.indexOf('term')) {
Expand All @@ -1162,7 +1129,6 @@
link.linkValue = link.linkValue.replace(new RegExp('[?&]' + CLY_X_INT + '=[^&]*'), '').replace(/[?&]$/, '');
});
this.widget.links = {"link": this.widget.links, "finalText": this.widget.finalText};
this.widget.consent = true;
}
else {
this.widget.links = {
Expand All @@ -1183,8 +1149,8 @@
"finalText": "I agree to the Terms and Conditions and Privacy Policy."

};
this.widget.consent = false;
}

if (!this.widget.rating_symbol) {
this.widget.rating_symbol = "emojis";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ <h3 class="ratings-widget-detail-view__widget-name" data-test-id="ratings-detail
</cly-dynamic-tabs>

</cly-main>
<drawer @widget-edited="refresh()" :settings="drawerSettings" :controls="drawers.widget"></drawer>
</div>
<drawer @widgets-refresh="refresh()" :settings="drawerSettings" :controls="drawers.widget"></drawer>
</div>
Loading