Skip to content

Commit 652613f

Browse files
author
Lionel Laské
committed
Merge branch 'undefined-titles' of https://github.com/cherylpinto/sugarizer into pr/2117
2 parents 62794a3 + a80e13e commit 652613f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

activities/Chart.activity/js/activity.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ const app = new Vue({
303303
this.LZ = this.SugarJournal.LZString;
304304
if (metadata.mimetype === "text/csv") {
305305
this.isCsvFile = true;
306-
this.csvTitle = this.currentenv.activityName;
306+
this.csvTitle = metadata.title || (this.currentenv ? this.currentenv.activityName : "Chart Data.csv");
307+
this.updateActivityTitle(this.csvTitle);
307308
this.pref.chartType = "csvMode";
308309
const json = CSVParser.csvToJson(data);
309310
if (this.$refs.csvView) {

activities/Measure.activity/js/activity.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,12 @@ var app = new Vue({
858858
}
859859

860860
var vm = this;
861+
var userName = (vm.currentenv && vm.currentenv.user && vm.currentenv.user.name) ? vm.currentenv.user.name : "Unknown";
862+
var logTitle = this.SugarL10n.get("MeasureLoggingBy", { name: userName });
863+
var csvTitle = logTitle ? logTitle + ".csv" : "Measure Data.csv";
861864
var metadata = {
862865
mimetype: "text/csv",
863-
title: this.SugarL10n.get("MeasureLoggingBy", { name: vm.currentenv.user.name}) + ".csv",
866+
title: csvTitle,
864867
activity: "org.sugarlabs.ChartActivity",
865868
timestamp: new Date().getTime(),
866869
creation_time: new Date().getTime(),

0 commit comments

Comments
 (0)