Skip to content

Commit bda2a0e

Browse files
authored
Merge branch 'master' into license-warning
2 parents 364e7ac + b81f88d commit bda2a0e

File tree

9 files changed

+88
-40
lines changed

9 files changed

+88
-40
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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

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,

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"mocha": "10.8.2",
3737
"nyc": "17.1.0",
3838
"should": "13.2.3",
39-
"supertest": "7.1.3",
39+
"supertest": "7.1.4",
4040
"typescript": "^5.8.2"
4141
},
4242
"dependencies": {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@
318318

319319
// Tooltip color mappings
320320
var TOOLTIP_COLORS = {
321-
dataIngestion: "color-yellow-100",
322-
uiFiltering: "color-blue-100",
323-
serverPerformance: "color-red-100"
321+
dataIngestion: { bgColor: '#FCF5E5', textColor: '#E49700' },
322+
serverPerformance: { bgColor: '#FBECE5', textColor: '#D23F00' },
323+
uiFiltering: { bgColor: '#E1EFFF', textColor: '#0166D6' }
324324
};
325325

326326
/**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,8 @@
540540
return warnings.map(function(warning) {
541541
return {
542542
tooltipText: CV.i18n(warning.text),
543-
color: tooltipColors[warning.type],
543+
bgColor: tooltipColors[warning.type].bgColor,
544+
textColor: tooltipColors[warning.type].textColor,
544545
label: countlyPlugins.getTooltipLabel(warning.type)
545546
};
546547
});

plugins/plugins/frontend/public/localization/plugins.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ configs.tooltip.server-performance-warning = Adjusting this value may impact sys
247247
configs.tooltip.data-ingestion-warning = Adjusting this value may affect data processing
248248
configs.tooltip.ui-filtering-warning = Adjusting this value controls how much data is shown in the UI
249249
configs.tooltip.data-ingestion = Data Processing
250-
configs.tooltip.ui-filtering = UI Display
251-
configs.tooltip.server-performance = Performance Impact
250+
configs.tooltip.ui-filtering = Interface
251+
configs.tooltip.server-performance = Performance
252252

253253
systemlogs.action.change_configs = Setting Changed
254254
systemlogs.action.change_plugins = Plugins Changed

plugins/plugins/frontend/public/stylesheets/main.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@
7373
}
7474
}
7575

76+
.config-section {
77+
&__header {
78+
width: max-content;
79+
}
80+
}
81+
82+
.configuration-warning-container {
83+
border-radius: 4px;
84+
display: flex;
85+
height: 20px;
86+
width: auto;
87+
88+
&__text {
89+
font-size: 10px;
90+
font-weight: 500;
91+
margin: 4px 6px;
92+
text-transform: uppercase;
93+
}
94+
}
95+
7696
.apikey {
7797
.el-input {
7898
width: 320px;

plugins/plugins/frontend/public/templates/configurations.html

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,31 @@ <h3 v-if="predefinedStructure[selectedConfig].groups.length > 1 || group.label"
5151
v-for="key in group.list" :key="key"
5252
class="bu-columns bu-is-vcentered bu-p-5 config-section">
5353
<div class="bu-column bu-is-7">
54-
<div
55-
v-if="getWarningTags(selectedConfig, key).length"
56-
class="bu-is-flex bu-is-align-items-center bu-is-justify-content-start bu-mb-2">
57-
<div
58-
v-for="(tag, index) in getWarningTags(selectedConfig, key)"
59-
:key="index"
60-
class="bu-is-flex bu-is-align-items-center bu-is-justify-content-center"
61-
v-tooltip="tag.tooltipText"
62-
>
63-
<i
64-
class="cly-io cly-io-exclamation text-big"
65-
:class="tag.color"
66-
/>
67-
<span class="bu-ml-1 bu-mr-4 text-smallest" :class="tag.color">{{ tag.label }}</span>
68-
</div>
69-
</div>
70-
<div class="bu-has-text-weight-medium bu-is-flex bu-is-align-items-center" :data-test-id="'settings-title-label-' + key.toLowerCase().replaceAll('_', '-')">
54+
<div class="bu-has-text-weight-medium bu-is-flex bu-is-align-items-center config-section__header" :data-test-id="'settings-title-label-' + key.toLowerCase().replaceAll('_', '-')">
7155
<div>
7256
<span class="bu-mr-2"> {{ getLabelName(key) }} </span>
7357
</div>
58+
<div class="bu-is-flex bu-is-align-items-center">
59+
<div
60+
v-for="(tag, index) in getWarningTags(selectedConfig, key)"
61+
:key="index"
62+
class="bu-is-flex bu-is-align-items-center bu-is-justify-content-center bu-mr-2"
63+
>
64+
<div
65+
:style="{ backgroundColor: tag.bgColor }"
66+
v-tooltip="tag.tooltipText"
67+
class="configuration-warning-container"
68+
69+
>
70+
<span
71+
class="configuration-warning-container__text"
72+
:style="{ color: tag.textColor }"
73+
>
74+
{{ tag.label }}
75+
</span>
76+
</div>
77+
</div>
78+
</div>
7479
</div>
7580
<p class="bu-has-text-weight-normal bu-mt-2 bu-mb-0" v-html="getHelperLabel(key)" v-if="getHelperLabel(key)" :data-test-id="'settings-description-label-' + key.toLowerCase().replaceAll('_', '-')"></p>
7681
<div v-if="checkIfOverwritten(key)" class="config-section-overwritten">

0 commit comments

Comments
 (0)