Skip to content

Commit 57a1e4b

Browse files
authored
Merge branch 'master' into adding-warning-tags-to-settings
2 parents fb92627 + 0a341e1 commit 57a1e4b

File tree

4 files changed

+45
-16
lines changed

4 files changed

+45
-16
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
Features:
44
- [plugins] Add configuration warning tags to settings UI
5+
- [white-labeling] Add sidebar footer label setting to white labeling
56

67
Fixes:
78
- [core] Use correct rights validation for loyality
9+
- [crashes] Fix free session for home widget
10+
- [crashes] Use na for free session and free user when there's no data
11+
12+
Enterprise Fixes:
13+
- [ldap] Error handling in ldap plugin on search error
814

915
## Version 25.03.11
1016
Fixes:

frontend/express/app.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,14 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
422422
app.loadThemeFiles(curTheme);
423423
app.dashboard_headers = plugins.getConfig("security").dashboard_additional_headers;
424424

425+
var overriddenCountlyNamedType = COUNTLY_NAMED_TYPE;
426+
var whiteLabelingConfig = plugins.getConfig("white-labeling");
427+
if (whiteLabelingConfig && whiteLabelingConfig.footerLabel && whiteLabelingConfig.footerLabel.length) {
428+
overriddenCountlyNamedType = whiteLabelingConfig.footerLabel;
429+
}
430+
431+
COUNTLY_NAMED_TYPE = overriddenCountlyNamedType;
432+
425433
if (typeof plugins.getConfig('frontend').countly_tracking !== 'boolean' && plugins.isPluginEnabled('tracker')) {
426434
plugins.updateConfigs(countlyDb, 'frontend', { countly_tracking: true });
427435
}
@@ -929,6 +937,12 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
929937
licenseNotification, licenseError;
930938
var isLocked = false;
931939
configs.export_limit = plugins.getConfig("api").export_limit;
940+
941+
var currentWhiteLabelingConfig = plugins.getConfig("white-labeling");
942+
var overriddenCountlyNamedType = COUNTLY_NAMED_TYPE;
943+
if (currentWhiteLabelingConfig && currentWhiteLabelingConfig.footerLabel && currentWhiteLabelingConfig.footerLabel.length) {
944+
overriddenCountlyNamedType = currentWhiteLabelingConfig.footerLabel;
945+
}
932946
app.loadThemeFiles(configs.theme, async function(theme) {
933947
if (configs._user.theme) {
934948
res.cookie("theme", configs.theme);
@@ -1004,7 +1018,7 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
10041018
licenseError,
10051019
ssr: serverSideRendering,
10061020
timezones: timezones,
1007-
countlyTypeName: COUNTLY_NAMED_TYPE,
1021+
countlyTypeName: overriddenCountlyNamedType,
10081022
countlyTypeTrack: COUNTLY_TRACK_TYPE,
10091023
countlyTypeCE: COUNTLY_TYPE_CE,
10101024
countly_tracking,
@@ -1037,7 +1051,7 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
10371051
countlyVersion: req.countly.version,
10381052
countlyType: COUNTLY_TYPE_CE,
10391053
countlyTrial: COUNTLY_TRIAL,
1040-
countlyTypeName: COUNTLY_NAMED_TYPE,
1054+
countlyTypeName: overriddenCountlyNamedType,
10411055
feedbackLink: COUNTLY_FEEDBACK_LINK,
10421056
documentationLink: COUNTLY_DOCUMENTATION_LINK,
10431057
helpCenterLink: COUNTLY_HELPCENTER_LINK,

plugins/crashes/frontend/public/javascripts/countly.models.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ function transformAppVersion(inpVersion) {
152152
* @param {bool} isPercent - Flag to just format the metric's total values as percentages.
153153
*/
154154
function populateMetric(metric, isPercent) {
155-
if (dashboard[metric].total !== 0 && dashboard[metric]["prev-total"] !== 0) {
155+
if (dashboard[metric].total === 'NA' || dashboard[metric]['prev-total'] === 'NA') {
156+
dashboard[metric].change = 'NA';
157+
}
158+
else if (dashboard[metric].total !== 0 && dashboard[metric]["prev-total"] !== 0) {
156159
if (isPercent) {
157160
dashboard[metric].change = (dashboard[metric].total - dashboard[metric]["prev-total"]).toFixed(1) + "%";
158161
}
@@ -182,7 +185,9 @@ function transformAppVersion(inpVersion) {
182185

183186
if (isPercent && ["crses", "crnfses", "crfses", "crau", "craunf", "crauf", 'crinv', 'crfinv', 'crnfinv', 'crauinv', 'craufinv', 'craunfinv'].includes(metric)) {
184187
["total", "prev-total"].forEach(function(prop) {
185-
dashboard[metric][prop] = dashboard[metric][prop].toFixed(2) + '%';
188+
if (dashboard[metric][prop] !== 'NA') {
189+
dashboard[metric][prop] = dashboard[metric][prop].toFixed(2) + '%';
190+
}
186191
});
187192
}
188193
}
@@ -219,10 +224,13 @@ function transformAppVersion(inpVersion) {
219224
}
220225

221226
// derive user count from whole users
222-
if (dashboard.crau[prop] > dashboard.cr_u[prop] && 'users' in state.rawData) {
227+
if (dashboard.crau[prop] > dashboard.cr_u[prop] && 'users' in state.rawData && wholeUsers.total > 0) {
223228
dashboard.crauf[prop] = dashboard.cr_u[prop] * ((wholeUsers.fatal / wholeUsers.total) - (dashboard.crf[prop] / dashboard.cr_s[prop]));
229+
dashboard.crauf.isEstimate = true;
224230
dashboard.craunf[prop] = dashboard.cr_u[prop] * ((wholeUsers.nonfatal / wholeUsers.total) - (dashboard.crnf[prop] / dashboard.cr_s[prop]));
231+
dashboard.craunf.isEstimate = true;
225232
dashboard.crau[prop] = dashboard.crauf[prop] + dashboard.craunf[prop];
233+
dashboard.crau.isEstimate = true;
226234
}
227235

228236
dashboard.crinv[prop] = Math.max(0, dashboard.cr_s[prop] - dashboard.cr[prop]);
@@ -234,9 +242,14 @@ function transformAppVersion(inpVersion) {
234242
populateMetric(metric);
235243
});
236244

237-
["crau", "craunf", "crauf"].forEach(function(name) {
238-
["total", "prev-total"].forEach(function(prop) {
239-
dashboard[name][prop] = Math.min(100, (dashboard.cr_u[prop] === 0 || dashboard[name][prop] === 0) ? 100 : (Math.abs(dashboard.cr_u[prop] - dashboard[name][prop]) / dashboard.cr_u[prop] * 100));
245+
['crau', 'craunf', 'crauf'].forEach(function(name) {
246+
['total', 'prev-total'].forEach(function(prop) {
247+
if (dashboard.cr_u[prop] === 0 || !Number.isFinite(dashboard[name][prop])) {
248+
dashboard[name][prop] = 'NA';
249+
}
250+
else {
251+
dashboard[name][prop] = Math.abs(dashboard.cr_u[prop] - dashboard[name][prop]) / dashboard.cr_u[prop] * 100;
252+
}
240253
});
241254
populateMetric(name, true);
242255
});
@@ -264,17 +277,13 @@ function transformAppVersion(inpVersion) {
264277
});
265278

266279
['crinv', 'crfinv', 'crnfinv'].forEach(function(name) {
267-
["total", "prev-total"].forEach(function(prop) {
268-
var propValue = 0;
269-
280+
['total', 'prev-total'].forEach(function(prop) {
270281
if (dashboard.cr_s[prop] === 0) {
271-
propValue = 100;
282+
dashboard[name][prop] = 'NA';
272283
}
273284
else {
274-
propValue = dashboard[name][prop] / dashboard.cr_s[prop] * 100;
285+
dashboard[name][prop] = dashboard[name][prop] / dashboard.cr_s[prop] * 100;
275286
}
276-
277-
dashboard[name][prop] = Math.min(100, propValue);
278287
});
279288
populateMetric(name, true);
280289
});

plugins/crashes/frontend/public/javascripts/countly.views.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@
13381338
{"name": CV.i18n('crashes.unique'), "info": CV.i18n('crashes.home.unique'), "prop": "cru", "r": true},
13391339
{"name": CV.i18n('crashes.total-per-session'), "info": CV.i18n('crashes.home.per-session'), "prop": "cr-session", "r": true},
13401340
{"name": CV.i18n('crashes.free-users'), "info": CV.i18n('crashes.help-free-users'), "prop": "crau", "p": true},
1341-
{"name": CV.i18n('crashes.free-sessions'), "info": CV.i18n('crashes.help-free-sessions'), "prop": "crses", "p": true}
1341+
{"name": CV.i18n('crashes.free-sessions'), "info": CV.i18n('crashes.help-free-sessions'), "prop": "crinv", "p": true}
13421342
];
13431343

13441344
for (var k = 0; k < getUs.length; k++) {

0 commit comments

Comments
 (0)