Skip to content

Commit 657b244

Browse files
committed
Merge branch 'master' into next
2 parents 0246b84 + 3d89727 commit 657b244

File tree

20 files changed

+391
-230
lines changed

20 files changed

+391
-230
lines changed

CHANGELOG.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
## Version 22.03.12
2+
3+
Fixes:
4+
- [UI] Custom file name for export functionality in the datatable
5+
- [dashboards] Subheading and label prop in the select app component
6+
- [jobs] More rescheduling attempts
7+
- [push] Adding lastRuns
8+
- [push] Adding too late to send error
9+
- [push] Filtering messages by status
10+
- [push] Variables for API messages
11+
- [push] Waiting for connect promise to resolve
12+
- [systemlogs] Make sure we store correct MongoDB documents
13+
- [user-management] Apply filter when reset filter button is clicked
14+
- [user-management] Set filter dropdown width
15+
16+
Enterprise fixes:
17+
- [cohorts] Cohort name is not editable after creation
18+
- [cohorts] Cohorts aren't sortable in "Current Users" column
19+
- [concurrent_users] Don't show period in online users widget
20+
- [concurrent_users] Max online user values should be resettable from an app level configuration
21+
- [concurrent_users] x-Axis labels of this online users graph on dashboards horizontally
22+
- [config-transfer] Config transfer supports Fitlering rules
23+
- [drill] Make default visualization 'Bar Chart' if query contains BY in Drill
24+
- [drill] When exporting BY query table result in drill to excel file, key column is empty
25+
- [formulas] Expression value checks for copy formulas
26+
- [users] Decode event name in userprofile event timeline section
27+
128
## Version 22.03.11
229

330
Fixes:

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

+25-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global jQuery, Vue, _, CV, countlyCommon, countlyGlobal, CountlyHelpers, moment, countlyTaskManager, _merge */
1+
/* global jQuery, Vue, _, CV, countlyCommon, countlyGlobal, CountlyHelpers, countlyTaskManager, _merge */
22

33
(function(countlyVue, $) {
44

@@ -588,6 +588,11 @@
588588
type: Boolean,
589589
default: true,
590590
required: false
591+
},
592+
customExportFileName: {
593+
type: Boolean,
594+
default: true,
595+
required: false
591596
}
592597
},
593598
data: function() {
@@ -599,7 +604,8 @@
599604
{'name': '.JSON', value: 'json'},
600605
{'name': '.XLSX', value: 'xlsx'}
601606
],
602-
searchQuery: ''
607+
searchQuery: '',
608+
exportFileName: this.getDefaultFileName(),
603609
};
604610
},
605611
methods: {
@@ -608,20 +614,20 @@
608614
type: this.selectedExportType
609615
});
610616
},
611-
getDefaultFileName: function(params) {
612-
var name = "countly";
613-
if (params.title) {
614-
name = params.title.replace(/[\r\n]+/g, "");
615-
}
616-
if (params.timeDependent) {
617-
//include export range
618-
name += "_for_" + countlyCommon.getDateRange();
617+
getDefaultFileName: function() {
618+
var siteName = countlyGlobal.countlyTitle;
619+
var sectionName = "";
620+
var selectedMenuItem = this.$store.getters["countlySidebar/getSelectedMenuItem"];
621+
if (selectedMenuItem && selectedMenuItem.item && selectedMenuItem.item.title) {
622+
sectionName = this.i18n(selectedMenuItem.item.title);
619623
}
620-
else {
621-
//include export date
622-
name += "_on_" + moment().format("DD-MMM-YYYY");
624+
var appName = "";
625+
if (this.$store.getters["countlyCommon/getActiveApp"]) {
626+
appName = this.$store.getters["countlyCommon/getActiveApp"].name;
623627
}
624-
return (name.charAt(0).toUpperCase() + name.slice(1).toLowerCase());
628+
var date = countlyCommon.getDateRange();
629+
630+
return siteName + " " + appName + " " + sectionName + " " + date;
625631
},
626632
getLocalExportContent: function() {
627633
if (this.exportFormat) {
@@ -630,7 +636,6 @@
630636
return this.rows;
631637
},
632638
initiateExport: function(params) {
633-
634639
var formData = null,
635640
url = null;
636641

@@ -666,7 +671,7 @@
666671
type: params.type,
667672
path: path,
668673
prop: "aaData",
669-
filename: this.getDefaultFileName(params),
674+
filename: this.exportFileName,
670675
api_key: countlyGlobal.member.api_key
671676
};
672677
}
@@ -675,10 +680,13 @@
675680
formData = {
676681
type: params.type,
677682
data: JSON.stringify(this.getLocalExportContent()),
678-
filename: this.getDefaultFileName(params),
683+
filename: this.exportFileName,
679684
api_key: countlyGlobal.member.api_key
680685
};
681686
}
687+
if (!formData.filename) {
688+
formData.filename = this.exportFileName;
689+
}
682690

683691
if (formData.url === "/o/export/requestQuery") {
684692
if (Array.isArray(formData.prop)) {
@@ -714,7 +722,6 @@
714722
}
715723
else {
716724
var form = $('<form method="POST" action="' + url + '">');
717-
718725
$.each(formData, function(k, v) {
719726
if (CountlyHelpers.isJSON(v)) {
720727
form.append($('<textarea style="visibility:hidden;position:absolute;display:none;" name="' + k + '">' + v + '</textarea>'));

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

+12-6
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
<template>
3535
<div class="bu-mx-4 bu-mt-4">
3636
<p class="bu-mb-4 color-cool-gray-100">{{i18n('export.export-as')}}</p>
37-
<el-radio-group
38-
class="bu-mb-5"
39-
v-model="selectedExportType">
40-
<el-radio-button v-for="exportType in availableExportTypes" :key="exportType.value" :label="exportType.value" style="width: 99px; display: inline-grid;">{{exportType.name}}</el-radio-button>
41-
</el-radio-group>
37+
<div class="cly-vue-eldatatable__export--radio-button bu-mb-5">
38+
<el-radio-group v-model="selectedExportType">
39+
<el-radio-button v-for="exportType in availableExportTypes" :key="exportType.value" :label="exportType.value">{{exportType.name}}</el-radio-button>
40+
</el-radio-group>
41+
</div>
4242
</div>
4343
<div v-if="exportColumnSelection" class="cly-vue-eldatatable__export--extended">
4444
<div class="bu-mx-4 bu-mb-3">
@@ -74,8 +74,14 @@
7474
:options.sync="getMatching(availableDynamicCols)">
7575
</cly-checklistbox>
7676
</div>
77-
<slot name="export-config"></slot>
7877
</div>
78+
<div v-if="customExportFileName" :class="{'cly-vue-eldatatable__export--fileExport': exportColumnSelection}">
79+
<div class="bu-my-4 bu-mx-4">
80+
<p class="bu-mb-1 text-medium"> {{i18n('export.file-name')}} </p>
81+
<el-input v-model="exportFileName"></el-input>
82+
</div>
83+
</div>
84+
<slot name="export-config"></slot>
7985
<div class="bu-mx-4 bu-mb-4">
8086
<el-button size="medium" @click="onExportClick" type="success" style="width: 100%">{{i18n('export.export')}}</el-button>
8187
</div>

frontend/express/public/localization/dashboard/dashboard.properties

+1
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ export.export-started = Export file is being generated. When ready you will see
717717
export.export-failed = Error upon attempting to export table data.
718718
export.export-finished = Export completed.
719719
export.export-finished-click = Click to download exported file.
720+
export.file-name = File name
720721

721722
#management-applications
722723
management-applications.title = Application Management

frontend/express/public/stylesheets/styles/blocks/_table.scss

+9
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
opacity: 0.12;
4444
}
4545
}
46+
&--fileExport {
47+
border-top: 1px solid #E2E4E8;
48+
}
49+
&--radio-button {
50+
.el-radio-button {
51+
width: 99px;
52+
display: inline-grid;
53+
}
54+
}
4655
&--search {
4756
input[type=text] {
4857
background-color: #F6F6F6;

plugins/dashboards/frontend/public/javascripts/countly.helpers.js

+8
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,14 @@
559559
var SourceAppsComponent = countlyVue.views.create({
560560
template: CV.T('/dashboards/templates/helpers/drawer/source-apps.html'),
561561
props: {
562+
subheading: {
563+
type: String,
564+
required: false
565+
},
566+
label: {
567+
type: String,
568+
required: false
569+
},
562570
multipleLimit: {
563571
type: Number,
564572
default: 4

plugins/dashboards/frontend/public/templates/helpers/drawer/source-apps.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<cly-form-field
22
name="apps"
33
rules="required"
4-
:label="i18nM('dashboards.source-apps')">
4+
:subheading="subheading ? subheading: undefined"
5+
:label="label ? label: i18nM('dashboards.source-apps')">
56
<cly-app-select
67
:key="rerender"
78
style="width: 100%;"

plugins/push/api/api-auto.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ module.exports.autoOnCohort = function(entry, cohort, uids) {
5353
logCohorts.d('processing %s %s, result: %j', typ, msg._id, result);
5454
if (result.total) {
5555
return msg.update({$inc: {'result.total': result.total}}, () => {
56-
result.total += result.total;
57-
}).then(() => Audience.resetQueue(result.next));
56+
msg.result.total += result.total;
57+
});
5858
}
5959
}).then(() => {
6060
logCohorts.d('done processing %s %s', typ, msg._id);

plugins/push/api/api-dashboard.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ function add(from, to) {
2020
*
2121
* @param {object} params params object
2222
*
23-
* @api {get} o/push/dashboard dashboard
23+
* @api {get} o/push/dashboard Get dashboard data
2424
* @apiName dashboard
2525
* @apiDescription Get push notification dashboard data
26-
* @apiGroup push
26+
* @apiGroup Push Notifications
2727
*
2828
* @apiQuery {ObjectID} app_id application id
2929
*

plugins/push/api/api-message.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ async function validate(args, draft = false) {
131131
*
132132
* @param {object} params params object
133133
*
134-
* @api {POST} i/push/message/test message/test
134+
* @api {POST} i/push/message/test Message / test
135135
* @apiName message/test
136136
* @apiDescription Send push notification to test users specified in application plugin configuration
137-
* @apiGroup push
137+
* @apiGroup Push Notifications
138138
*
139139
* @apiQuery {ObjectID} app_id application id
140140
* @apiUse PushMessageBody
@@ -238,11 +238,11 @@ module.exports.test = async params => {
238238
*
239239
* @param {object} params params object
240240
*
241-
* @api {POST} i/push/message/create message/create
241+
* @api {POST} i/push/message/create Message / create
242242
* @apiName message/create
243243
* @apiDescription Create push notification.
244244
* Set status to "draft" to create a draft, leave it unspecified otherwise.
245-
* @apiGroup push
245+
* @apiGroup Push Notifications
246246
*
247247
* @apiQuery {ObjectID} app_id application id
248248
* @apiUse PushMessageBody
@@ -290,10 +290,10 @@ module.exports.create = async params => {
290290
*
291291
* @param {object} params params object
292292
*
293-
* @api {POST} i/push/message/update message/update
293+
* @api {POST} i/push/message/update Message / update
294294
* @apiName message/update
295295
* @apiDescription Update push notification
296-
* @apiGroup push
296+
* @apiGroup Push Notifications
297297
*
298298
* @apiQuery {ObjectID} app_id application id
299299
* @apiUse PushMessageBody
@@ -350,10 +350,10 @@ module.exports.update = async params => {
350350
*
351351
* @param {object} params params object
352352
*
353-
* @api {POST} i/push/message/remove message/remove
353+
* @api {POST} i/push/message/remove Message / remove
354354
* @apiName message/remove
355-
* @apiDescription Remove push notification
356-
* @apiGroup push
355+
* @apiDescription Remove message by marking it as deleted (it stays in the database for consistency)
356+
* @apiGroup Push Notifications
357357
*
358358
* @apiQuery {ObjectID} _id message id
359359
* @apiSuccessExample {json} Success
@@ -408,12 +408,12 @@ module.exports.remove = async params => {
408408
*
409409
* @param {object} params params object
410410
*
411-
* @api {POST} i/push/message/toggle message/toggle
411+
* @api {POST} i/push/message/toggle Message / API or Automated / toggle
412412
* @apiName message/toggle
413-
* @apiDescription Stop or start automated message
414-
* @apiGroup push
413+
* @apiDescription Stop active or start inactive API or automated message
414+
* @apiGroup Push Notifications
415415
*
416-
* @apiQuery {ObjectID} _id message id
416+
* @apiQuery {ObjectID} _id message ID
417417
* @apiQuery {Boolean} active true to start the message, false to stop it
418418
* @apiUse PushMessage
419419
* @apiUse PushValidationError
@@ -490,10 +490,10 @@ module.exports.toggle = async params => {
490490
*
491491
* @param {object} params params object
492492
*
493-
* @api {POST} o/push/message/estimate message/estimate
493+
* @api {POST} o/push/message/estimate Message / estimate audience
494494
* @apiName message/estimate
495495
* @apiDescription Estimate message audience
496-
* @apiGroup push
496+
* @apiGroup Push Notifications
497497
*
498498
* @apiBody {ObjectID} app Application ID
499499
* @apiBody {String[]} platforms Array of platforms to send to
@@ -585,10 +585,10 @@ module.exports.estimate = async params => {
585585
*
586586
* @param {object} params params object
587587
*
588-
* @api {GET} o/push/message/mime message/mime
588+
* @api {GET} o/push/message/mime Message / attachment MIME
589589
* @apiName message/mime
590590
* @apiDescription Get MIME information of the URL specified by sending HEAD request and then GET if HEAD doesn't work. Respects proxy setting, follows redirects and returns end URL along with content type & length.
591-
* @apiGroup push
591+
* @apiGroup Push Notifications
592592
*
593593
* @apiQuery {String} url URL to check
594594
*
@@ -644,10 +644,10 @@ module.exports.mime = async params => {
644644
*
645645
* @param {object} params params object
646646
*
647-
* @api {GET} o/push/message/GET message/GET
647+
* @api {GET} o/push/message/GET Message / GET
648648
* @apiName message/GET
649-
* @apiDescription Get message by id
650-
* @apiGroup push
649+
* @apiDescription Get message by ID
650+
* @apiGroup Push Notifications
651651
*
652652
* @apiQuery {ObjectID} _id Message ID
653653
*
@@ -689,11 +689,11 @@ module.exports.one = async params => {
689689
* @param {object} params params
690690
* @returns {Promise} resolves to true
691691
*
692-
* @api {GET} o/push/user user
692+
* @api {GET} o/push/user User notifications
693693
* @apiName user
694694
* @apiDescription Get notifications sent to a particular user.
695695
* Makes a look up either by user id (uid) or did (device id). Returns ids of messages & dates, optionally returns corresponding message objects.
696-
* @apiGroup push
696+
* @apiGroup Push Notifications
697697
*
698698
* @apiQuery {String} app_id Application ID
699699
* @apiQuery {Boolean} messages Whether to return Message objects as well
@@ -773,11 +773,11 @@ module.exports.user = async params => {
773773
* @param {object} params params
774774
* @returns {Promise} resolves to true
775775
*
776-
* @api {GET} o/push/message/all message/all
776+
* @api {GET} o/push/message/all Message / find
777777
* @apiName message/all
778778
* @apiDescription Get messages
779779
* Returns one of three groups: one time messages (neither auto, nor api params set or set to false), automated messages (auto = "true"), API messages (api = "true")
780-
* @apiGroup push
780+
* @apiGroup Push Notifications
781781
*
782782
* @apiQuery {String} app_id Application ID
783783
* @apiQuery {Boolean} auto Whether to return only automated messages

0 commit comments

Comments
 (0)