Skip to content

Commit 395fcf1

Browse files
committed
Bugfix] Data migration and redirect_url
*Added missing warining if traffic is redirected *Updated app settings to allow removing redirect_urlesli
1 parent d15802b commit 395fcf1

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@
390390
},
391391
saveApp: function(doc) {
392392
doc.app_id = this.selectedApp;
393+
if (doc.redirect_url) {
394+
doc.redirect_url = doc.redirect_url.replace(" ", "");
395+
}
396+
393397
delete doc._id;
394398
var self = this;
395399
$.ajax({
@@ -575,7 +579,7 @@
575579
return differences;
576580
}
577581
else {
578-
["name", "category", "type", "key", "country", "timezone", "salt", "_id"].forEach(function(currentKey) {
582+
["name", "category", "type", "key", "country", "timezone", "salt", "_id", "redirect_url"].forEach(function(currentKey) {
579583
if (editedObject[currentKey] !== selectedApp[currentKey]) {
580584
differences.push(currentKey);
581585
}

frontend/express/public/core/app-management/templates/app-management.html

+13
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ <h2 class="bu-mb-4"> {{apps[selectedApp] ? apps[selectedApp].name : i18n('common
144144
v-model="formScope.editedObject.key">
145145
</el-input>
146146
</cly-inline-form-field>
147+
</div>
148+
<div v-if="!newApp && apps[selectedApp] && apps[selectedApp].redirect_url">
149+
<cly-inline-form-field v-if="edited" :label="i18n('management-applications.redirect_url')" :help="i18n('management-applications.redirect_url.help')">
150+
{{formScope.editedObject.redirect_url}}
151+
</cly-inline-form-field>
152+
<cly-inline-form-field v-else rules="" :label="i18n('management-applications.redirect_url')" prop="redirect_url" :help="i18n('management-applications.redirect_url.help')">
153+
<el-switch
154+
:active-value="apps[selectedApp].redirect_url"
155+
inactive-value=" "
156+
:active-text = "apps[selectedApp].redirect_url"
157+
v-model="formScope.editedObject.redirect_url">
158+
</el-switch>
159+
</cly-inline-form-field>
147160
</div>
148161
</cly-form-step>
149162
<div v-if="newApp" class="bu-has-text-right" @mouseenter="formScope.validate()">

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

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*global countlyVue, CV, countlyCommon, CountlyHelpers, countlyGlobal, countlyDataMigration, app */
1+
/*global countlyVue, CV, countlyCommon, CountlyHelpers, countlyGlobal, countlyDataMigration, app,jQuery */
22
(function() {
33
var FEATURE_NAME = 'data_migration';
44

@@ -398,5 +398,25 @@
398398
this.renderWhenReady(DataMigrationMainView);
399399
});
400400

401+
402+
//switching apps. show message if redirect url is set
403+
app.addAppSwitchCallback(function(appId) {
404+
if (appId && countlyGlobal.apps[appId] && countlyGlobal.apps[appId].redirect_url && countlyGlobal.apps[appId].redirect_url !== "") {
405+
var mm = "<h4 class='bu-pt-3 bu-pb-1'>" + jQuery.i18n.map["data-migration.app-redirected"].replace('{app_name}', countlyGlobal.apps[appId].name) + "</h4><p bu-pt-1>" + jQuery.i18n.map["data-migration.app-redirected-explanation"] + " <b>" + countlyGlobal.apps[appId].redirect_url + "</b><p><a href='#/manage/apps' style='color:rgb(1, 102, 214);'>" + jQuery.i18n.map["data-migration.app-redirected-remove"] + "</a>";
406+
var msg = {
407+
title: jQuery.i18n.map["data-migration.app-redirected"].replace('{app_name}', countlyGlobal.apps[appId].name),
408+
message: mm,
409+
info: jQuery.i18n.map["data-migration.app-redirected-remove"],
410+
sticky: true,
411+
clearAll: true,
412+
type: "warning",
413+
onClick: function() {
414+
app.navigate("#/manage/apps", true);
415+
}
416+
};
417+
CountlyHelpers.notify(msg);
418+
}
419+
});
420+
401421
app.addMenu("management", {code: "data-migration", permission: FEATURE_NAME, url: "#/manage/data-migration", text: "data-migration.page-title", icon: '<div class="logo-icon fa fa-arrows-alt-h"></div>', priority: 70});
402422
})();

0 commit comments

Comments
 (0)