Skip to content

Firefly III: a personal finances manager

Ability to show release notes.

James Coled6bb22cb7393
diff --git a/app/Api/V1/Controllers/System/ReleaseNotesController.php b/app/Api/V1/Controllers/System/ReleaseNotesController.php
new file mode 100644
index 0000000000..89717779fb
--- /dev/null
+++ b/app/Api/V1/Controllers/System/ReleaseNotesController.php
@@ -0,0 +1,54 @@
+<?php
+/*
+ * ReleaseNotesController.php
+ * Copyright (c) 2026 [email protected]
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+namespace FireflyIII\Api\V1\Controllers\System;
+
+use FireflyIII\Api\V1\Controllers\Controller;
+use FireflyIII\Exceptions\FireflyException;
+use Illuminate\Http\JsonResponse;
+use Illuminate\Support\Facades\Storage;
+
+class ReleaseNotesController extends Controller
+{
+ /**
+ * @throws FireflyException
+ */
+ public function index(): JsonResponse
+ {
+ $version = trim(str_replace('/', '-', config('firefly.version')));
+ $disk = Storage::disk('release-notes');
+ $file = sprintf('%s.md', $version);
+ $notes = null;
+ $parsed = null;
+ if ($disk->exists($file)) {
+ $notes = trim((string)$disk->get($file));
+ $parsed = trim(parse_markdown($notes));
+ }
+
+ return response()->json(
+ [
+ 'release_notes' => $parsed,
+ 'release_notes_markdown' => $notes,
+ ]
+ );
+ }
+
+}
diff --git a/app/Api/V1/Requests/User/PreferenceStoreRequest.php b/app/Api/V1/Requests/User/PreferenceStoreRequest.php
index 20802fa518..60d5fc0ac8 100644
--- a/app/Api/V1/Requests/User/PreferenceStoreRequest.php
+++ b/app/Api/V1/Requests/User/PreferenceStoreRequest.php
@@ -59,6 +59,6 @@ class PreferenceStoreRequest extends FormRequest
*/
public function rules(): array
{
- return ['name' => 'required', 'data' => 'required'];
+ return ['name' => 'required|min:1|max:255', 'data' => 'required'];
}
}
diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php
index ed07e3d584..ae92787d74 100644
--- a/app/Support/Request/ConvertsDataTypes.php
+++ b/app/Support/Request/ConvertsDataTypes.php
@@ -211,6 +211,9 @@ trait ConvertsDataTypes
public function convertString(string $field, string $default = ''): string
{
$entry = $this->get($field);
+ if($entry === true) {
+ $entry = 'true';
+ }
if (!is_scalar($entry)) {
return $default;
}
diff --git a/config/filesystems.php b/config/filesystems.php
index d26ec08f82..a548698604 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -57,6 +57,10 @@ return [
'driver' => 'local',
'root' => storage_path('app'),
],
+ 'release-notes' => [
+ 'driver' => 'local',
+ 'root' => resource_path('release-notes'),
+ ],
// local storage configuration for upload and export:
'upload' => [
diff --git a/resources/assets/v3/js/api/system/release-notes.js b/resources/assets/v3/js/api/system/release-notes.js
new file mode 100644
index 0000000000..b596c84c64
--- /dev/null
+++ b/resources/assets/v3/js/api/system/release-notes.js
@@ -0,0 +1,27 @@
+/*
+ * index.js
+ * Copyright (c) 2023 [email protected]
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import { api } from "../../boot/axios.js";
+
+export default class ReleaseNotes {
+ get() {
+ return api.get("/api/v1/release-notes");
+ }
+}
diff --git a/resources/assets/v3/js/pages/dashboard/dashboard.js b/resources/assets/v3/js/pages/dashboard/dashboard.js
index cc108e03ca..d7671bbc0a 100644
--- a/resources/assets/v3/js/pages/dashboard/dashboard.js
+++ b/resources/assets/v3/js/pages/dashboard/dashboard.js
@@ -29,6 +29,8 @@ import { getVariable } from "../../store/get-variable.js";
import { getVariables } from "../../store/get-variables.js";
import { drawMultiCurrencyChart } from "../../shared/draw-chart.js";
import formatDate from "../../util/format-date.js";
+import ReleaseNotes from '../../api/system/release-notes.js';
+import Post from '../../api/preferences/post.js';
let index = function () {
return {
@@ -45,10 +47,12 @@ let index = function () {
getVariables([whatsNewDialog, lastTimeDialog]).then((values) => {
const shownWhatsNewDialog = true === values[whatsNewDialog];
const lastShowTime = null === values[lastTimeDialog] ? 0 : parseInt(values[lastTimeDialog]) * 1000;
+ let showNewFeatures = false;
// const lastShowTime = (1791297200 - (48*60*60)) * 1000;
if (0 === lastShowTime && !shownWhatsNewDialog) {
console.log("User needs new feature dialogue.");
// alert('Show dialog because never seen before.');
+ showNewFeatures = true;
}
if (!shownWhatsNewDialog && lastShowTime > 0) {
const now = new Date().getTime();
@@ -56,8 +60,32 @@ let index = function () {
const diffInDays = diff / (1000 * 60 * 60 * 24);
if (diffInDays > 2) {
console.log("User needs new feature dialogue.");
+ showNewFeatures = true;
}
}
+ if(!showNewFeatures) {
+ console.warn('User has already seen release notes.');
+ }
+ if(showNewFeatures) {
+ // get from API.
+ (new ReleaseNotes).get().then((notes) => {
+ let releaseNotes = notes.data.release_notes;
+ if(null === releaseNotes) {
+ // mark as seen by submitting a preference.
+ // TODO make a function.
+ const now = parseInt(new Date().getTime() / 1000);
+ (new Post).post(whatsNewDialog, true);
+ (new Post).post(lastTimeDialog, now);
+ window[whatsNewDialog] = true;
+ window[lastTimeDialog] = now;
+ window.store.set(whatsNewDialog, true);
+ window.store.set(lastTimeDialog, now);
+ }
+ });
+ // make modal.
+ // show it.
+ // on close, mark as viewed (depends on box).
+ }
// alert(whatsNewDialog + ' is ' + (null === values[whatsNewDialog]));
// alert(lastTimeDialog + ' is ' + (null === values[lastTimeDialog]));
diff --git a/resources/release-notes/develop-2026-10-06.md b/resources/release-notes/develop-2026-10-06.md
new file mode 100644
index 0000000000..fd6a09d84d
--- /dev/null
+++ b/resources/release-notes/develop-2026-10-06.md
@@ -0,0 +1,14 @@
+I am the release notes of Firefly III develop version something.
+
+# Header one
+
+- with
+- a list
+
+## Header two
+
+[And a link](https://api-docs.firefly-iii.org/)
+
+### Header three
+
+🥳 And add an emoji.
diff --git a/routes/api.php b/routes/api.php
index 54f7094e16..0d7f5b6b98 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -23,6 +23,7 @@
declare(strict_types=1);
use FireflyIII\Api\V1\Controllers\System\CronController;
+use FireflyIII\Api\V1\Controllers\System\ReleaseNotesController;
use Illuminate\Support\Facades\Route;
use function Safe\define;
@@ -111,6 +112,18 @@ Route::group(
}
);
+// RELEASE NOTES ROUTES
+Route::group(
+ [
+ 'namespace' => 'FireflyIII\Api\V1\Controllers\System',
+ 'prefix' => 'v1/release-notes',
+ 'as' => 'api.v1.release-notes.',
+ ],
+ static function (): void {
+ Route::get('', [ReleaseNotesController::class,'index'])->name('index');
+ }
+);
+
// CHART ROUTES
Route::group(
[