From ef1b30c04cdf0db96ec421cf82b337d9b6e65846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=B1nar=20Gen=C3=A7?= Date: Tue, 1 Aug 2023 14:29:38 +0300 Subject: [PATCH] [SER-786] Report manager export table issue --- .../report-manager/javascripts/countly.views.js | 13 ++++++++----- .../public/javascripts/countly/countly.template.js | 6 +++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/express/public/core/report-manager/javascripts/countly.views.js b/frontend/express/public/core/report-manager/javascripts/countly.views.js index adbd732c311..79f3efa11d1 100644 --- a/frontend/express/public/core/report-manager/javascripts/countly.views.js +++ b/frontend/express/public/core/report-manager/javascripts/countly.views.js @@ -1,4 +1,4 @@ -/*global app, countlyVue, CV, Vue, countlyGlobal, countlyCommon, moment, CountlyHelpers, countlyTaskManager */ +/*global app, countlyVue, CV, Vue, countlyGlobal, countlyCommon, moment, CountlyHelpers, countlyTaskManager, countlyAuth */ (function() { @@ -395,8 +395,7 @@ } }, getExportAPI: function() { - var requestPath = '/o/tasks/list?api_key=' + countlyGlobal.member.api_key + - "&app_id=" + countlyCommon.ACTIVE_APP_ID + '&iDisplayStart=0&iDisplayLength=10000', + var requestPath = '/o/tasks/list?api_key=' + countlyGlobal.member.api_key + '&iDisplayStart=0&iDisplayLength=10000', self = this; if (this.lastRequestPayload) { @@ -565,8 +564,12 @@ component: ReportManagerView, }); }; - app.route("/manage/tasks", "manageJobs", function() { - this.renderWhenReady(getMainView()); + if (countlyAuth.validateRead("reports")) { + this.renderWhenReady(getMainView()); + } + else { + app.navigate("/", true); + } }); })(); \ No newline at end of file diff --git a/frontend/express/public/javascripts/countly/countly.template.js b/frontend/express/public/javascripts/countly/countly.template.js index b8d83e6de6a..035b506abb7 100644 --- a/frontend/express/public/javascripts/countly/countly.template.js +++ b/frontend/express/public/javascripts/countly/countly.template.js @@ -1159,9 +1159,9 @@ var AppRouter = Backbone.Router.extend({ } }); - // if (countlyAuth.validateRead('core')) { - // self.addSubMenu("management", {code: "longtasks", url: "#/manage/tasks", text: "sidebar.management.longtasks", priority: 10}); - // } + if (countlyAuth.validateRead('core')) { + self.addSubMenu("management", {code: "longtasks", url: "#/manage/tasks", text: "sidebar.management.longtasks", priority: 10}); + } //management is also a menu category which goes in default menu i.e. visible to all users