Skip to content

Commit 4753828

Browse files
authored
Merge branch 'release.24.05' into ar2rsawseen/24.05
2 parents aa33b31 + ad98dde commit 4753828

File tree

3 files changed

+68
-27
lines changed

3 files changed

+68
-27
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
## Version 24.05.XX
1+
## Version 24.05.xx
2+
Enterprise Fixes:
3+
- [data-manager] Fixed bug when merging events with ampersand symbol in the name
4+
- [groups] Add logs for user updates
5+
6+
7+
## Version 24.05.44
8+
Enterprise Fixes:
9+
- [groups] Fix user permission update after updating user group permission
10+
- [revenue] Card in revenue page are now correctly identified
11+
12+
13+
## Version 24.05.43
214
Features:
315
- [core] Implement go to link in notification
16+
- [data-manager] Fixed bug preventing transformation of events ending in a dot
417

518
Fixes:
619
- [dashboard] Allow users to select text inside the widget without dragging it
20+
- [jobs] Fix condition for scheduling alert job
721

822
Enterprise Fixes:
923
- [data-manager] Fixed segment data deletion
24+
- [license] Stop sending metric after license expired
1025
- [users] Fix add/remove user to profile group
1126
- [users] Remove link to profile group page after removing user from group
1227

api/parts/jobs/job.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -254,32 +254,33 @@ class Job extends EventEmitter {
254254

255255
this._json.next = next.getTime();
256256
}
257-
if (this.name !== "alerts:monitor") {
258-
//check if any job already scheduled or running
259-
let query = {
260-
status: {"$in": [STATUS.SCHEDULED, STATUS.RUNNING]},
261-
name: this.name,
262-
};
263-
if (this._id) {
264-
query._id = {$ne: this._id};
265-
}
266-
var self = this;
267-
return new Promise((resolve, reject) => {
268-
Job.findMany(this.db(), query).then(existing => {
269-
if (existing && existing.length) {
270-
log.d('Job already scheduled or running: %j', existing);
271-
this._json.status = STATUS.CANCELLED; //set this as cancelled now as we have other scheduled
272-
}
273-
else {
274-
self._save().then(resolve, reject);
275-
}
276257

277-
});
278-
});
258+
//check if any job already scheduled or running
259+
let query = {
260+
status: {"$in": [STATUS.SCHEDULED, STATUS.RUNNING]},
261+
name: this.name,
262+
};
263+
264+
if (this.name === 'alerts:monitor' && this.data && Object.keys(this.data).length) {
265+
query.data = this.data;
279266
}
280-
else {
281-
return this._save();
267+
268+
if (this._id) {
269+
query._id = {$ne: this._id};
282270
}
271+
272+
var self = this;
273+
return new Promise((resolve, reject) => {
274+
Job.findMany(this.db(), query).then(existing => {
275+
if (existing && existing.length) {
276+
log.d('Job already scheduled or running: %j', existing);
277+
this._json.status = STATUS.CANCELLED; //set this as cancelled now as we have other scheduled
278+
}
279+
else {
280+
self._save().then(resolve, reject);
281+
}
282+
});
283+
});
283284
}
284285

285286
/**
@@ -1135,4 +1136,4 @@ module.exports = {
11351136
STATUS: STATUS,
11361137
STATUS_MAP: STATUS_MAP,
11371138
debounce: debounce
1138-
};
1139+
};

frontend/express/public/core/user-management/javascripts/countly.views.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@
847847
}
848848
},
849849
onOpen: function() {
850+
this.patchUserPermission();
850851
this.changePasswordFlag = false;
851852
// types
852853
var types = ['c', 'r', 'u', 'd'];
@@ -860,7 +861,7 @@
860861
// if it's in edit mode
861862
if (this.settings.editMode) {
862863
// is user member of a group?
863-
if (this.user.group_id && countlyGlobal.plugins.indexOf('groups') > -1) {
864+
if (this.user.group_id && this.user.group_id.length && countlyGlobal.plugins.indexOf('groups') > -1) {
864865
// set groups state
865866
if (Array.isArray(this.user.group_id)) {
866867
this.groups = this.user.group_id;
@@ -963,7 +964,31 @@
963964
},
964965
onRoleChange: function(role) {
965966
this.roles[role.name] = role;
966-
}
967+
},
968+
patchUserPermission: function() {
969+
if (this.user && this.user.permission && this.user.permission._ && this.user.permission._.u) {
970+
var appIdReducer = function(acc, curr) {
971+
if (curr.length > 0) {
972+
acc.push(curr);
973+
}
974+
return acc;
975+
};
976+
977+
var _u = this.user.permission._.u.reduce(function(acc, curr) {
978+
if (curr.length > 0) {
979+
var appIds = curr.reduce(appIdReducer, []);
980+
981+
if (appIds.length > 0) {
982+
acc.push(appIds);
983+
}
984+
}
985+
return acc;
986+
}, []);
987+
988+
this.user.permission._.u = _u;
989+
this.$refs.userDrawer.editedObject.permission._.u = _u;
990+
}
991+
},
967992
},
968993
watch: {
969994
'groups': function() {

0 commit comments

Comments
 (0)