From ecd4c92f0962f3485440b0ce4379a637a124f954 Mon Sep 17 00:00:00 2001 From: Saniya Date: Sun, 12 Jan 2025 15:14:40 +0530 Subject: [PATCH 1/2] Resolved issue #1695: Initialized sample values in Chart activity --- activities/Chart.activity/js/activity.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/activities/Chart.activity/js/activity.js b/activities/Chart.activity/js/activity.js index be30e2592..3a524dfe1 100644 --- a/activities/Chart.activity/js/activity.js +++ b/activities/Chart.activity/js/activity.js @@ -22,6 +22,8 @@ const app = new Vue({ "csv-view": CsvView, }, data: { + isLocalized: false, + pendingNewInstance: false, currentenv: null, SugarL10n: null, SugarPresence: null, @@ -145,9 +147,15 @@ const app = new Vue({ }); }, localized() { + this.isLocalized = true; this.SugarL10n.localize(this.l10n); document.getElementById("export-csv-button").title = this.l10n.stringexportAsCSV; document.getElementById("export-img-button").title = this.l10n.stringSaveImage; + // If onJournalNewInstance was triggered before localization + if (this.pendingNewInstance) { + this.onJournalNewInstance(); // Execute the pending call + this.pendingNewInstance = false; + } }, @@ -270,6 +278,10 @@ const app = new Vue({ onJournalNewInstance() { + if (!this.isLocalized) { + this.pendingNewInstance = true; // Mark the call as pending + return; + } const randArr = this.shuffleArray([1, 2, 3, 4, 5, 6]); for(let i = 0; i < 3; i++) { const label = "EgLabel" + randArr[i]; From c234a15dfe58a76e8f8326bb8bdfc70840216993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lionel=20Lask=C3=A9?= Date: Wed, 15 Jan 2025 22:00:47 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5999d0d91..139c8ec9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Unusual Draw in Chess Activity #1678 - Pressing the start button in ColorMyWorld activity immediately shows "Congratulations! You finished!" #1691 - Broken dialog box on first screen tutorial #1418 +- Sample values in Chart activity are not initialized #1695 ## [1.8.0] - 2024-04-10 ### Added