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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Version 25.03.X
Fixes:
- [star-rating] Fixed widget asset path with subdirectory

Enterprise Fixes:
- [surveys] Fixed widget asset path with subdirectory

## Version 25.03.40
Fixes:
- [hooks] Implement domain/ip address validation for hooks with http effect
Expand Down
10 changes: 8 additions & 2 deletions plugins/star-rating/frontend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ var path = require('path');
* @param {*} res - Express response object
*/
function renderPopup(req, res) {
let countlyPath = countlyConfig.path || '';

if (countlyPath.length > 0 && !countlyPath.startsWith('/')) {
countlyPath = `/${countlyPath}`;
}

res.removeHeader('X-Frame-Options');
res.render('../../../plugins/star-rating/frontend/public/templates/feedback-popup', {});
res.render('../../../plugins/star-rating/frontend/public/templates/feedback-popup', { countlyPath });
}

app.get(countlyConfig.path + '/feedback/rating', renderPopup);
Expand Down Expand Up @@ -71,4 +77,4 @@ var path = require('path');
};
}(exported));

module.exports = exported;
module.exports = exported;
Original file line number Diff line number Diff line change
Expand Up @@ -95,70 +95,6 @@
background-repeat: no-repeat;
}

.rating-emotion-emojis {
background-image: url('/star-rating/images/star-rating/emoji.svg');
}

.rating-emotion-emojis1 {
background-image: url('/star-rating/images/star-rating/emoji_1.svg');
}

.rating-emotion-emojis2 {
background-image: url('/star-rating/images/star-rating/emoji_2.svg');
}

.rating-emotion-emojis3 {
background-image: url('/star-rating/images/star-rating/emoji_3.svg');
}

.rating-emotion-emojis4 {
background-image: url('/star-rating/images/star-rating/emoji_4.svg');
}

.rating-emotion-emojis5 {
background-image: url('/star-rating/images/star-rating/emoji_5.svg');
}

.rating-emotion-emojis-fill {
background-image: url('/star-rating/images/star-rating/emoji_filled.svg');
}

.rating-emotion-emojis1-fill {
background-image: url('/star-rating/images/star-rating/emoji_filled_1.svg');
}

.rating-emotion-emojis2-fill {
background-image: url('/star-rating/images/star-rating/emoji_filled_2.svg');
}

.rating-emotion-emojis3-fill {
background-image: url('/star-rating/images/star-rating/emoji_filled_3.svg');
}

.rating-emotion-emojis4-fill {
background-image: url('/star-rating/images/star-rating/emoji_filled_4.svg');
}

.rating-emotion-emojis5-fill {
background-image: url('/star-rating/images/star-rating/emoji_filled_5.svg');
}

.rating-emotion-thumbs {
background-image: url('/star-rating/images/star-rating/thumbs.svg');
}

.rating-emotion-thumbs-fill {
background-image: url('/star-rating/images/star-rating/thumbs_filled.svg');
}

.rating-emotion-stars {
background-image: url('/star-rating/images/star-rating/stars.svg');
}

.rating-emotion-stars-fill {
background-image: url('/star-rating/images/star-rating/stars_filled.svg');
}

.ratings-popup .success-emotions-area {
font-size: 20px;
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions plugins/star-rating/frontend/public/templates/drawer.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</div>
<div class="ratings-drawer__rp-footer" data-test-id="ratings-drawer-ratingspopup-poweredby-label">
<img v-if="imageSrc && drawerScope.editedObject.logoType === 'custom'" class="ratings-drawer__image" :src="imageSrc">
<img v-if="drawerScope.editedObject.logoType === 'default'" src="/star-rating/images/star-rating/powered-by-countly.svg">
<img v-if="drawerScope.editedObject.logoType === 'default'" src="star-rating/images/star-rating/powered-by-countly.svg">
</div>
</div>
<div class="bu-is-size-7 ratings-drawer__stage-label" v-if="drawerScope.currentStepId !== 'step3'" data-test-id="ratings-drawer-thankyoupopup-label">
Expand All @@ -76,7 +76,7 @@
<div class="bu-has-text-weight-medium ratings-drawer__tp-thanks-message bu-is-size-4" data-test-id="ratings-drawer-thankyoupopup-message-text">{{ drawerScope.editedObject.popup_thanks_message }}</div>
<div class="ratings-drawer__tp-footer" data-test-id="ratings-drawer-thankyoupopup-poweredby-label">
<img v-if="imageSrc && drawerScope.editedObject.logoType === 'custom'" class="ratings-drawer__image" :src="imageSrc">
<img v-if="drawerScope.editedObject.logoType === 'default'" src="/star-rating/images/star-rating/powered-by-countly.svg">
<img v-if="drawerScope.editedObject.logoType === 'default'" src="star-rating/images/star-rating/powered-by-countly.svg">
</div>
</div>
</div>
Expand Down
93 changes: 80 additions & 13 deletions plugins/star-rating/frontend/public/templates/feedback-popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,87 @@
<html>
<head>
<title>Countly Feedback Popup</title>
<link href="../../star-rating/stylesheets/ratings-iframe.css" rel="stylesheet"/>
<link href="../../stylesheets/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<link href="../stylesheets/ionicons/css/ionicons.min.css" rel="stylesheet"/>
<link href="<%= `${countlyPath}/star-rating/stylesheets/ratings-iframe.css` %>" rel="stylesheet"/>
<link href="<%= `${countlyPath}/stylesheets/font-awesome/css/font-awesome.min.css` %>" rel="stylesheet"/>
<link href="<%= `${countlyPath}/stylesheets/ionicons/css/ionicons.min.css` %>" rel="stylesheet"/>
<!-- TODO: check where are this themeFiles -->
<% if (themeFiles && themeFiles.css) { %>
<% for(var i=0, l=themeFiles.css.length; i < l; i++) {%>
<link href='<%= themeFiles.css[i]%>' rel='stylesheet' type='text/css'>
<% } %>
<% } %>
<meta content="width=device-width, initial-scale=1" name="viewport">
<style>
.rating-emotion-emojis {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji.svg` %>');
}

.rating-emotion-emojis1 {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_1.svg` %>');
}

.rating-emotion-emojis2 {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_2.svg` %>');
}

.rating-emotion-emojis3 {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_3.svg` %>');
}

.rating-emotion-emojis4 {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_4.svg` %>');
}

.rating-emotion-emojis5 {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_5.svg` %>');
}

.rating-emotion-emojis-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_filled.svg` %>');
}

.rating-emotion-emojis1-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_filled_1.svg` %>');
}

.rating-emotion-emojis2-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_filled_2.svg` %>');
}

.rating-emotion-emojis3-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_filled_3.svg` %>');
}

.rating-emotion-emojis4-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_filled_4.svg` %>');
}

.rating-emotion-emojis5-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/emoji_filled_5.svg` %>');
}

.rating-emotion-thumbs {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/thumbs.svg` %>');
}

.rating-emotion-thumbs-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/thumbs_filled.svg` %>');
}

.rating-emotion-stars {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/stars.svg` %>');
}

.rating-emotion-stars-fill {
background-image: url('<%= `${countlyPath}/star-rating/images/star-rating/stars_filled.svg` %>');
}
</style>
</head>
<body class="ratings-popup cly-vue-ratings-preview">
<body class="ratings-popup cly-vue-ratings-preview" data-countly-path="<%= countlyPath %>">
<div class="rating-loader-wrapper">
<img
class="rating-loader"
src="../../star-rating/images/star-rating/loader.svg"
src="<%= `${countlyPath}/star-rating/images/star-rating/loader.svg` %>"
/>
</div>
<div
Expand Down Expand Up @@ -156,7 +221,7 @@
>
<img
id="powered-by-countly"
src="../../star-rating/images/star-rating/powered-by-countly.svg"
src="<%= `${countlyPath}/star-rating/images/star-rating/powered-by-countly.svg` %>"
>
</a>
</div>
Expand Down Expand Up @@ -186,13 +251,13 @@
>
<img
id="powered-by-countly"
src="../../star-rating/images/star-rating/powered-by-countly.svg"
src="<%= `${countlyPath}/star-rating/images/star-rating/powered-by-countly.svg` %>"
>
</a>
</div>
</div>
<script src="../../star-rating/javascripts/tippy.all.min.js"></script>
<script src="../../javascripts/dom/jquery/jquery.js"></script>
<script src="<%= `${countlyPath}/star-rating/javascripts/tippy.all.min.js` %>"></script>
<script src="<%= `${countlyPath}/javascripts/dom/jquery/jquery.js` %>"></script>
<script>
var CLOSE_BUTTON_ID = '#close-btn';
var WIDGET_BODY_FULLSCREEN_CLASS = 'modal-content--fullscreen';
Expand Down Expand Up @@ -291,6 +356,8 @@
var widget_id = getParameterByName('widget_id');
let widgetVersion = null;

var countlyPath = $('body').data().countlyPath || '';

if (!platform || (platform === "undefined") || (platform === "null")) {
platform = DEFAULT_PLATFORM;
}
Expand Down Expand Up @@ -401,10 +468,10 @@
}

if (response.globalLogo) {
$('#powered-by-countly').attr('src', url + response.logo);
$('#powered-by-countly').attr('src', url + countlyPath + '/' + response.logo);
}
else {
$('#powered-by-countly').attr('src', url + '/star-rating/images/' + response.logo);
$('#powered-by-countly').attr('src', url + countlyPath + '/star-rating/images/' + response.logo);
}

$('#powered-by-countly').parent().attr('href', 'void(0)');
Expand Down Expand Up @@ -437,7 +504,7 @@
});
},
type: "GET",
url: url + "/o/feedback/widget"
url: url + countlyPath + '/o/feedback/widget'
});

var eventObject = {
Expand Down Expand Up @@ -630,7 +697,7 @@
}, 5000);
},
type: "GET",
url: url + '/i/feedback/input?events=' + encodeURIComponent(JSON.stringify([eventObject])) + '&app_key=' + app_key + '&device_id=' + device_id + '&sdk_name=' + sdk_name + (sdk_version ? '&sdk_version=' + sdk_version : '') + '&timestamp=' + Date.now() + '&hour=' + h + '&dow=' + dow + '&app_version=' + app_version
url: url + countlyPath + '/i/feedback/input?events=' + encodeURIComponent(JSON.stringify([eventObject])) + '&app_key=' + app_key + '&device_id=' + device_id + '&sdk_name=' + sdk_name + (sdk_version ? '&sdk_version=' + sdk_version : '') + '&timestamp=' + Date.now() + '&hour=' + h + '&dow=' + dow + '&app_version=' + app_version
});
}

Expand Down
Loading