@product7/feedback-sdk 1.7.1 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/feedback-sdk.js
CHANGED
|
@@ -7209,6 +7209,7 @@
|
|
|
7209
7209
|
this._closeSurvey(false);
|
|
7210
7210
|
|
|
7211
7211
|
const config = this._getSurveyConfig();
|
|
7212
|
+
if (!config) return;
|
|
7212
7213
|
const isMultiPage = this._isMultiPageSurvey();
|
|
7213
7214
|
const isLastPage = this._isLastPage();
|
|
7214
7215
|
const showFeedbackInput = this._shouldShowFeedbackInput();
|
|
@@ -7244,7 +7245,7 @@
|
|
|
7244
7245
|
<button class="feedback-survey-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg></button>
|
|
7245
7246
|
${showTitle ? `<h3 class="feedback-survey-title">${config.title}</h3>` : ''}
|
|
7246
7247
|
${showDescription ? `<p class="feedback-survey-description">${config.description}</p>` : ''}
|
|
7247
|
-
${isMultiPage ? `<div class="feedback-survey-progress">${pageProgress}</div>` : ''}
|
|
7248
|
+
${isMultiPage && this.surveyOptions.pages.length > 1 ? `<div class="feedback-survey-progress">${pageProgress}</div>` : ''}
|
|
7248
7249
|
<div class="feedback-survey-content">${config.html}</div>
|
|
7249
7250
|
${
|
|
7250
7251
|
showFeedbackInput
|
|
@@ -7373,7 +7374,7 @@
|
|
|
7373
7374
|
},
|
|
7374
7375
|
};
|
|
7375
7376
|
|
|
7376
|
-
return configs[this.surveyOptions.surveyType] ||
|
|
7377
|
+
return configs[this.surveyOptions.surveyType] || null;
|
|
7377
7378
|
}
|
|
7378
7379
|
|
|
7379
7380
|
_getNPSScale() {
|
|
@@ -7453,6 +7454,10 @@
|
|
|
7453
7454
|
|
|
7454
7455
|
_shouldShowActions() {
|
|
7455
7456
|
if (this._isMultiPageSurvey()) {
|
|
7457
|
+
const page = this._getCurrentPage();
|
|
7458
|
+
if (page && page.type === 'link') {
|
|
7459
|
+
return false;
|
|
7460
|
+
}
|
|
7456
7461
|
return true;
|
|
7457
7462
|
}
|
|
7458
7463
|
if (typeof this.surveyOptions.showSubmitButton === 'boolean') {
|
|
@@ -7483,24 +7488,16 @@
|
|
|
7483
7488
|
_getCurrentPageConfig() {
|
|
7484
7489
|
const page = this._getCurrentPage();
|
|
7485
7490
|
if (!page) {
|
|
7486
|
-
return
|
|
7491
|
+
return null;
|
|
7487
7492
|
}
|
|
7488
7493
|
|
|
7489
7494
|
return {
|
|
7490
|
-
title: page.title ||
|
|
7491
|
-
description: page.description ||
|
|
7495
|
+
title: page.title || '',
|
|
7496
|
+
description: page.description || '',
|
|
7492
7497
|
html: this._renderSurveyPage(page),
|
|
7493
7498
|
};
|
|
7494
7499
|
}
|
|
7495
7500
|
|
|
7496
|
-
_getFallbackSurveyConfig() {
|
|
7497
|
-
return {
|
|
7498
|
-
title: this.surveyOptions.title || 'Quick Feedback',
|
|
7499
|
-
description: this.surveyOptions.description || '',
|
|
7500
|
-
html: this._renderCustomQuestions(),
|
|
7501
|
-
};
|
|
7502
|
-
}
|
|
7503
|
-
|
|
7504
7501
|
_renderSurveyPage(page) {
|
|
7505
7502
|
switch (page.type) {
|
|
7506
7503
|
case 'rating':
|
|
@@ -7512,7 +7509,7 @@
|
|
|
7512
7509
|
case 'link':
|
|
7513
7510
|
return this._renderLinkPage(page);
|
|
7514
7511
|
default:
|
|
7515
|
-
return
|
|
7512
|
+
return '';
|
|
7516
7513
|
}
|
|
7517
7514
|
}
|
|
7518
7515
|
|