Skip to content

Commit ee90b6a

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/lint-staged-16.1.6
2 parents 063b2ff + 1bd8911 commit ee90b6a

File tree

10 files changed

+113
-140
lines changed

10 files changed

+113
-140
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
## Version 25.03.XX
2+
Enterprise Fixes
3+
- [journeys] Fix for handling the skip threshold value when saving the journey
4+
- [journeys] Performance improvement on journey stat user list & UI bugfixes
5+
6+
## Version 25.03.18
27
Fixes:
3-
- [server-stats] Fix breakdown event calculation
48
- [server-stats] Add new events to breakdown
9+
- [server-stats] Fix breakdown event calculation
510

611
Enterprise Fixes:
12+
- [journeys] Fix for clearing content queue when journey is paused
13+
- [journeys] Fix for content shown event handling
14+
- [journeys] Fix for performance issues when huge number of journey instances created
715
- [journeys] Update skip threshold when journeys are paused
8-
- [journeys] fix for clearing content queue when journey is paused
16+
17+
Dependencies:
18+
- Bump get-random-values from 3.0.0 to 4.0.0
19+
- Bump puppeteer from 24.16.1 to 24.16.2
920

1021
## Version 25.03.17
1122
Enterprise Fixes:

api/utils/countly-request/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/utils/requestProcessor.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const validateUserForGlobalAdmin = validateGlobalAdmin;
2929
const validateUserForMgmtReadAPI = validateUser;
3030
const request = require('countly-request')(plugins.getConfig("security"));
3131
const Handle = require('../../api/parts/jobs/index.js');
32+
const render = require('../../api/utils/render.js');
3233

3334
var loaded_configs_time = 0;
3435

@@ -362,6 +363,45 @@ const processRequest = (params) => {
362363
}
363364
break;
364365
}
366+
case '/o/render': {
367+
validateUserForRead(params, function() {
368+
var options = {};
369+
var view = params.qstring.view || "";
370+
var route = params.qstring.route || "";
371+
var id = params.qstring.id || "";
372+
373+
options.view = view + "#" + route;
374+
options.id = id ? "#" + id : "";
375+
376+
var imageName = "screenshot_" + common.crypto.randomBytes(16).toString("hex") + ".png";
377+
378+
options.savePath = path.resolve(__dirname, "../../frontend/express/public/images/screenshots/" + imageName);
379+
options.source = "core";
380+
381+
authorize.save({
382+
db: common.db,
383+
multi: false,
384+
owner: params.member._id,
385+
ttl: 300,
386+
purpose: "LoginAuthToken",
387+
callback: function(err2, token) {
388+
if (err2) {
389+
common.returnMessage(params, 400, 'Error creating token: ' + err2);
390+
return false;
391+
}
392+
options.token = token;
393+
render.renderView(options, function(err3) {
394+
if (err3) {
395+
common.returnMessage(params, 400, 'Error creating screenshot: ' + err3);
396+
return false;
397+
}
398+
common.returnOutput(params, {path: common.config.path + "/images/screenshots/" + imageName});
399+
});
400+
}
401+
});
402+
});
403+
break;
404+
}
365405
case '/i/app_users': {
366406
switch (paths[3]) {
367407
case 'create': {

frontend/express/app.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ var versionInfo = require('./version.info'),
6767
url = require('url'),
6868
authorize = require('../../api/utils/authorizer.js'), //for token validations
6969
languages = require('../../frontend/express/locale.conf'),
70-
render = require('../../api/utils/render.js'),
7170
rateLimit = require("express-rate-limit"),
7271
membersUtility = require("./libs/members.js"),
7372
argon2 = require('argon2'),
@@ -1877,48 +1876,6 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
18771876
}
18781877
});
18791878

1880-
app.get(countlyConfig.path + '/render', function(req, res) {
1881-
if (!req.session.uid) {
1882-
return res.redirect(countlyConfig.path + '/login');
1883-
}
1884-
1885-
var options = {};
1886-
var view = req.query.view || "";
1887-
var route = req.query.route || "";
1888-
var id = req.query.id || "";
1889-
1890-
options.view = view + "#" + route;
1891-
options.id = id ? "#" + id : "";
1892-
1893-
var randomString = (+new Date()).toString() + (Math.random()).toString();
1894-
var imageName = "screenshot_" + sha1Hash(randomString) + ".png";
1895-
1896-
options.savePath = path.resolve(__dirname, "./public/images/screenshots/" + imageName);
1897-
options.source = "core";
1898-
1899-
authorize.save({
1900-
db: countlyDb,
1901-
multi: false,
1902-
owner: req.session.uid,
1903-
ttl: 300,
1904-
purpose: "LoginAuthToken",
1905-
callback: function(err2, token) {
1906-
if (err2) {
1907-
console.log(err2);
1908-
return res.send(false);
1909-
}
1910-
options.token = token;
1911-
render.renderView(options, function(err3) {
1912-
if (err3) {
1913-
return res.send(false);
1914-
}
1915-
1916-
return res.send({path: countlyConfig.path + "/images/screenshots/" + imageName});
1917-
});
1918-
}
1919-
});
1920-
});
1921-
19221879
app.get(countlyConfig.path + '/login/token/:token', function(req, res) {
19231880
membersUtility.loginWithToken(req, function(member) {
19241881
if (member) {

frontend/express/public/core/home/javascripts/countly.models.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global countlyVue,CV,countlyCommon*/
1+
/* global countlyVue,CV,countlyCommon,countlyGlobal*/
22

33
(function(countlyHomeView) {
44
countlyHomeView.getVuexModule = function() {
@@ -12,11 +12,12 @@
1212
var HomeViewActions = {
1313
downloadScreen: function(context) {
1414
return CV.$.ajax({
15-
type: "GET",
16-
url: "/render?view=/dashboard&route=/" + countlyCommon.ACTIVE_APP_ID + "/",
15+
type: "POST",
16+
url: "/o/render?view=/dashboard&route=/" + countlyCommon.ACTIVE_APP_ID + "/",
1717
data: {
1818
app_id: countlyCommon.ACTIVE_APP_ID,
1919
"id": "main_home_view",
20+
api_key: countlyGlobal.member.api_key,
2021
options: JSON.stringify({"dimensions": {"width": 2000, "padding": 25}})
2122
},
2223
dataType: "json"

frontend/express/public/core/home/javascripts/countly.views.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ var HomeViewView = countlyVue.views.create({
222222
CountlyHelpers.notify({type: "ok", title: jQuery.i18n.map["common.success"], message: jQuery.i18n.map["home.download.starting"], sticky: true, clearAll: true});
223223
this.$store.dispatch("countlyHomeView/downloadScreen").then(function() {
224224
if (self.$store.state.countlyHomeView.image) {
225-
CountlyHelpers.notify({type: "ok", title: jQuery.i18n.map["common.success"], message: "<a href='" + self.$store.state.countlyHomeView.image + "'>" + jQuery.i18n.map["common.download"] + "</a>", sticky: true, clearAll: true});
225+
CountlyHelpers.notify({type: "ok", title: jQuery.i18n.map["common.success"], message: "<a href='" + self.$store.state.countlyHomeView.image + "' target='_blank'>" + jQuery.i18n.map["common.download"] + "</a>", sticky: true, clearAll: true, html: true});
226226
}
227227
else {
228228
CountlyHelpers.notify({type: "error", title: jQuery.i18n.map["common.error"], message: jQuery.i18n.map["common.error"], sticky: false, clearAll: true});

frontend/express/public/javascripts/countly/countly.helpers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@
337337
}
338338
var payload = {};
339339
var persistent = msg.persistent;
340-
payload.text = countlyCommon.encodeHtml(msg.message);
340+
if (msg.html) {
341+
payload.text = msg.message;
342+
}
343+
else {
344+
payload.text = countlyCommon.encodeHtml(msg.message);
345+
}
341346
payload.autoHide = !msg.sticky;
342347
payload.id = msg.id;
343348
payload.width = msg.width;

plugins/dashboards/frontend/public/templates/email.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<td style="padding: 30px 0px 30px 0px;" class="logo" align="center">
8181
<table border="0" cellpadding="0" cellspacing="0" width="100%" >
8282
<tr>
83-
<td bgcolor="#ffffff" width="100" align="left"><a href="<%= version.page %>" target="_blank"><img alt="Logo" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/images/pre-login/countly-logo-dark.png" width="150" style="display: block; font-family: Helvetica, Arial, sans-serif; color: #666666; font-size: 16px;" border="0"></a></td>
83+
<td bgcolor="#ffffff" width="100" align="left"><a href="<%= version.page %>" target="_blank"><img alt="Logo" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/images/pre-login/countly-logo-dark.png" width="150" style="display: block; font-family: Helvetica, Arial, sans-serif; color: #666666; font-size: 16px;" border="0" data-test-id="countly-logo"></a></td>
8484
</tr>
8585
</table>
8686
</td>
@@ -99,7 +99,7 @@
9999
<td>
100100
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
101101
<tr>
102-
<td align="center" style="padding-top: 0px;" ><img alt="Dashboard" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/dashboards/images/screenshots/<%= image.name %>" width="750" style="display: block;" border="0"></img></td>
102+
<td align="center" style="padding-top: 0px;" ><img alt="Dashboard" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/dashboards/images/screenshots/<%= image.name %>" width="750" style="display: block;" border="0" data-test-id="dashboard-image"></img></td>
103103
</tr>
104104
</table>
105105
</td>
@@ -142,4 +142,4 @@
142142
<!-- /Gmail hack -->
143143

144144
</body>
145-
</html>
145+
</html>

0 commit comments

Comments
 (0)