Skip to content

Commit 797a556

Browse files
authored
Merge branch 'next' into ar2rsawseen/next
2 parents 7bbae65 + 7029c6a commit 797a556

File tree

22 files changed

+422
-161
lines changed

22 files changed

+422
-161
lines changed

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,28 @@
251251
]
252252
}
253253
},
254+
{
255+
"files": [ "plugins/content/api/positioning/**/*.js" ],
256+
"parserOptions": {
257+
"ecmaVersion": 2023,
258+
"sourceType": "module"
259+
},
260+
"env": {
261+
"node": true,
262+
"es2023": true
263+
}
264+
},
265+
{
266+
"files": [ "plugins/content/api/positioning/**/*.cjs" ],
267+
"parserOptions": {
268+
"ecmaVersion": 2023,
269+
"sourceType": "commonjs"
270+
},
271+
"env": {
272+
"node": true,
273+
"es2023": true
274+
}
275+
},
254276
{
255277
"files": [
256278
"api/**/*.js",

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: CI
66
on:
77
# Triggers the workflow on push or pull request events but only for the master branch
88
pull_request:
9-
branches: [ master, next, release.* ]
9+
branches: [ master, next, release.*, flex ]
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ Dependencies:
5353
- Bump sass from 1.81.0 to 1.83.3
5454
- Bump tslib from 2.7.0 to 2.8.1
5555

56+
## Version 24.10.6
57+
58+
Fixes:
59+
- [push] Using apns-id header as message result in debug mode
60+
- [server-stats] Fix data point calculation in job
61+
- [TopEventsJob] preserver previous state if overwriting fails
62+
- [ui] scroll top on step changes in drawers
63+
64+
Enterprise fixes:
65+
- [drill] Encoding url component before changing history state
66+
- [drill] Fixed drill meta regeneration
67+
- [drill] [license] Update license loader to enable supplying db client
68+
- [users] Format data points displayed in user sidebar
69+
- [cohorts] Unescape drill texts in cohort component
70+
71+
Dependencies:
72+
- Bump fs-extra from 11.2.0 to 11.3.0
73+
- Bump nodemailer from 6.9.16 to 6.10.0
74+
75+
Enterprise Dependencies:
76+
- Bump nanoid in /plugins/cognito from 2.1.11 to 3.3.8
77+
- Bump shortid in /plugins/cognito from 2.2.16 to 2.2.17
78+
5679
## Version 24.10.3
5780
Fixes:
5881
- [dashboards] Fixing issue where dashboard widgets go into single column

api/jobs/topEvents.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class TopEventsJob extends job.Job {
1919
/**
2020
* TopEvents initialize function
2121
*/
22-
init() {
23-
this.getAllApps();
22+
async init() {
23+
return this.getAllApps();
2424
}
2525

2626
/**
@@ -144,6 +144,7 @@ class TopEventsJob extends job.Job {
144144
}
145145
catch (error) {
146146
log.e("TopEvents Job has a error: ", error);
147+
throw error;
147148
}
148149
}
149150

@@ -157,7 +158,18 @@ class TopEventsJob extends job.Job {
157158
const encodedData = this.encodeEvents(data);
158159
const timeSecond = this.timeSecond();
159160
const currentPeriood = this.mutatePeriod(period);
160-
await new Promise((res, rej) => common.db.collection(TopEventsJob.COLLECTION_NAME).insert({ app_id: _id, ts: timeSecond, period: currentPeriood, data: encodedData, totalCount: totalCount, prevTotalCount: prevTotalCount, totalSum: totalSum, prevTotalSum: prevTotalSum, totalDuration: totalDuration, prevTotalDuration: prevTotalDuration, prevSessionCount: sessionData.prevSessionCount, totalSessionCount: sessionData.totalSessionCount, prevUsersCount: usersData.prevUsersCount, totalUsersCount: usersData.totalUsersCount }, (error, records) => !error && records ? res(records) : rej(error)));
161+
await new Promise((res, rej) => common.db.collection(TopEventsJob.COLLECTION_NAME).findOneAndReplace(
162+
{
163+
app_id: _id, period: currentPeriood,
164+
},
165+
{
166+
app_id: _id, ts: timeSecond, period: currentPeriood, data: encodedData, totalCount: totalCount, prevTotalCount: prevTotalCount, totalSum: totalSum, prevTotalSum: prevTotalSum, totalDuration: totalDuration, prevTotalDuration: prevTotalDuration, prevSessionCount: sessionData.prevSessionCount, totalSessionCount: sessionData.totalSessionCount, prevUsersCount: usersData.prevUsersCount, totalUsersCount: usersData.totalUsersCount
167+
},
168+
{
169+
upsert: true
170+
},
171+
(error, records) => !error && records ? res(records) : rej(error))
172+
);
161173
}
162174

163175
/**
@@ -169,7 +181,6 @@ class TopEventsJob extends job.Job {
169181
const getEvents = await new Promise((res, rej) => common.db.collection("events").findOne({ _id: app._id }, (errorEvents, result) => errorEvents ? rej(errorEvents) : res(result)));
170182
if (getEvents && 'list' in getEvents) {
171183
const eventMap = this.eventsFilter(getEvents.list);
172-
await new Promise((res, rej) => common.db.collection(TopEventsJob.COLLECTION_NAME).remove({ app_id: app._id }, (error, result) => error ? rej(error) : res(result)));
173184
if (eventMap && eventMap instanceof Array) {
174185
for (const period of TopEventsJob.PERIODS) {
175186
const data = {};
@@ -211,9 +222,14 @@ class TopEventsJob extends job.Job {
211222
* @param {Db} db connection
212223
* @param {done} done callback
213224
*/
214-
run(db, done) {
215-
this.init();
216-
done();
225+
async run(db, done) {
226+
try {
227+
await this.init();
228+
done();
229+
}
230+
catch (error) {
231+
done(error);
232+
}
217233
}
218234
}
219235

api/parts/mgmt/app_users.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ usersApi.mergeOtherPlugins = function(options, callback) {
439439
if (result && result.length) {
440440
for (let index = 0; index < result.length; index++) {
441441
if (result[index].status === "rejected") {
442+
log.e(result[index]);
442443
retry = true;
443444
break;
444445
}

frontend/express/public/javascripts/countly/vue/components/content.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@
409409
template: CV.T('/javascripts/countly/vue/templates/content/UI/content-sidebar-input.html'),
410410

411411
props: {
412+
componentTooltip: {
413+
default: null,
414+
type: String
415+
},
416+
412417
disabled: {
413418
default: false,
414419
type: Boolean
@@ -419,6 +424,15 @@
419424
type: String
420425
},
421426

427+
labelIcon: {
428+
default: 'cly-io cly-io-question-mark-circle',
429+
type: String
430+
},
431+
labelTooltip: {
432+
default: null,
433+
type: String
434+
},
435+
422436
options: {
423437
default: () => [],
424438
type: Array
@@ -457,6 +471,16 @@
457471
size: {
458472
default: null,
459473
type: String
474+
},
475+
476+
withComponentTooltip: {
477+
default: false,
478+
type: Boolean
479+
},
480+
481+
withLabelTooltip: {
482+
default: false,
483+
type: Boolean
460484
}
461485
},
462486

@@ -498,6 +522,10 @@
498522
return this.isDropdownInput && Array.isArray(this.options) && this.options.length;
499523
},
500524

525+
isLabelTooltipVisible() {
526+
return this.withLabelTooltip && this.labelTooltip;
527+
},
528+
501529
isSliderInput() {
502530
return this.type === COUNTLY_CONTENT_SIDEBAR_INPUT_COMPONENT_BY_TYPE_SLIDER;
503531
},
@@ -519,6 +547,13 @@
519547

520548
mainComponent() {
521549
return COUNTLY_CONTENT_SIDEBAR_INPUT_COMPONENT_BY_TYPE[this.type] || 'div';
550+
},
551+
552+
tooltip() {
553+
if (this.withComponentTooltip) {
554+
return this.componentTooltip || null;
555+
}
556+
return null;
522557
}
523558
}
524559
}));

frontend/express/public/javascripts/countly/vue/components/date.js

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,9 +1660,48 @@
16601660
type: Boolean,
16611661
default: true,
16621662
required: false
1663+
},
1664+
minDateValue: {
1665+
type: Date
1666+
},
1667+
isFuture: {
1668+
type: Boolean,
1669+
default: false
1670+
}
1671+
},
1672+
computed: {
1673+
pickerOptions() {
1674+
const defaultRange = { selectableRange: '00:00:00 - 23:59:00' };
1675+
1676+
if (!this.minDateValue) {
1677+
return defaultRange;
1678+
}
1679+
1680+
const now = moment();
1681+
const minDateMoment = moment(this.minDateValue);
1682+
const isToday = minDateMoment.isSame(now, 'day');
1683+
1684+
if (this.isFuture && isToday) {
1685+
return {
1686+
selectableRange: `${now.format('HH:mm:ss')} - 23:59:00`
1687+
};
1688+
}
1689+
1690+
return defaultRange;
16631691
}
16641692
},
1665-
template: '<el-time-picker :append-to-body="appendToBody" :style="{\'width\': width + \'px\'}" class="cly-vue-time-picker" v-bind="$attrs" v-on="$listeners" :format="format" :clearable="clearable"></el-time-picker>'
1693+
template: `
1694+
<el-time-picker
1695+
:append-to-body="appendToBody"
1696+
:clearable="clearable"
1697+
:format="format"
1698+
:picker-options="pickerOptions"
1699+
:style="{\'width\': width + \'px\'}"
1700+
class="cly-vue-time-picker"
1701+
v-bind="$attrs"
1702+
v-on="$listeners"
1703+
>
1704+
</el-time-picker>`
16661705
});
16671706

16681707

frontend/express/public/javascripts/countly/vue/templates/content/UI/content-sidebar-input.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@
1717
class="cly-vue-content-builder-sidebar-input__label"
1818
>
1919
{{ label }}
20+
<i
21+
v-if="isLabelTooltipVisible"
22+
v-tooltip.left="labelTooltip"
23+
:class="labelIcon"
24+
/>
2025
</label>
2126
<slot name="content-builder-layout-step">
2227
<component
2328
:is="mainComponent"
2429
v-bind="$attrs"
2530
v-model="componentValue"
31+
v-tooltip.left="tooltip"
2632
class="cly-vue-content-builder-sidebar-input__component"
2733
:class="{ 'cly-vue-content-builder-sidebar-input__component--slider': isSliderInput }"
2834
:controls="controlsProp"

frontend/express/public/javascripts/countly/vue/templates/content/content-header.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
<div
2424
v-tooltip="inputTooltip"
2525
class="cly-vue-content-builder-header__input-container"
26+
data-test-id="content-header-input-container"
2627
@click="onInputContainerClick"
2728
>
2829
<el-input
2930
v-model="localValue"
3031
class="cly-vue-content-builder-header__input"
3132
:class="{ 'cly-vue-content-builder-header__input--editing': !isReadonlyInput }"
33+
test-id="content-header-input"
3234
:maxlength="valueMaxLength"
3335
:readonly="isReadonlyInput"
3436
@blur="onInputBlur"
@@ -66,6 +68,7 @@
6668
<el-button
6769
v-if="!hideSaveButton"
6870
class="cly-vue-content-builder-header__save-button"
71+
data-test-id="content-header-save-button"
6972
:disabled="disableSaveButton"
7073
size="small"
7174
type="success"

frontend/express/public/javascripts/countly/vue/templates/datepicker.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
<span class="text-medium">{{i18n('common.time')}}</span>
208208
</div>
209209
<div>
210-
<cly-time-picker align="right" :width="100" v-model="minTime"></cly-time-picker>
210+
<cly-time-picker align="right" :width="100" v-model="minTime" :min-date-value="minDate" :is-future="isFuture"></cly-time-picker>
211211
</div>
212212
</div>
213213
</div>

0 commit comments

Comments
 (0)