From f52d1b6d7912f509e43797a5690a5df762996938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20G=C3=A1mez=20Franco?= Date: Tue, 24 Feb 2026 17:46:02 +0100 Subject: [PATCH 1/5] fix: fix prev PR and add location field to notification-template, not notification --- .../content-types/notification-template/schema.json | 5 +++++ src/api/notification/content-types/notification/schema.json | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/notification-template/content-types/notification-template/schema.json b/src/api/notification-template/content-types/notification-template/schema.json index 84f9c49..1ebeb05 100644 --- a/src/api/notification-template/content-types/notification-template/schema.json +++ b/src/api/notification-template/content-types/notification-template/schema.json @@ -38,6 +38,11 @@ "allowedTypes": [ "images" ] + }, + "location": { + "type": "enumeration", + "enum": ["default", "speechBubble"], + "default": "default" } } } diff --git a/src/api/notification/content-types/notification/schema.json b/src/api/notification/content-types/notification/schema.json index 69f7fb4..5842a4c 100644 --- a/src/api/notification/content-types/notification/schema.json +++ b/src/api/notification/content-types/notification/schema.json @@ -19,11 +19,6 @@ "data": { "type": "json" }, - "location": { - "type": "enumeration", - "enum": ["default", "speechBubble"], - "default": "default" - }, "notification_template": { "type": "relation", "relation": "oneToOne", From f2bd4005e367cbc8189796e532fcc7fa1ba8a974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20G=C3=A1mez=20Franco?= Date: Tue, 24 Feb 2026 17:51:36 +0100 Subject: [PATCH 2/5] feat: update notification.ts and documentation, and regenerate types --- src/api/notification/services/notification.ts | 11 ++++++----- .../documentation/1.0.0/full_documentation.json | 8 ++++++++ src/gen/types.ts | 5 +++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/api/notification/services/notification.ts b/src/api/notification/services/notification.ts index 004bba3..439b201 100644 --- a/src/api/notification/services/notification.ts +++ b/src/api/notification/services/notification.ts @@ -11,14 +11,14 @@ const NOTIFICATIONS_LIMIT = 50 const NOTIFICATIONS_POPULATE = { notification_template: { - fields: ['id', 'title', 'description', 'url', 'push'], + fields: ['id', 'title', 'description', 'url', 'push', 'location'], populate: { thumbnail: { fields: ['url'] } } } -} +} as const const notificationsTemplateFilter = (push: boolean) => ({ $or: [ @@ -76,7 +76,8 @@ export default factories.createCoreService(MODULE_ID, ({ strapi }) => { dueDate: notification.notification_template.dueDate, url: notification.notification_template.url, createdAt: notification.createdAt, - thumbnail: notification.notification_template.thumbnail?.url + thumbnail: notification.notification_template.thumbnail?.url, + location: notification.notification_template?.location ?? 'default' })) }, async getPushNotifications() { @@ -94,7 +95,7 @@ export default factories.createCoreService(MODULE_ID, ({ strapi }) => { filters: { notification_template: notificationsTemplateFilter(push), ...(lastConsumedNotificationDate ? { - createdAt: {$gt: lastConsumedNotificationDate} + createdAt: { $gt: lastConsumedNotificationDate } } : undefined) }, populate: NOTIFICATIONS_POPULATE @@ -113,7 +114,7 @@ export default factories.createCoreService(MODULE_ID, ({ strapi }) => { } }); -export function templateNotification(description: string, data: {[key: string]: string}): string { +export function templateNotification(description: string, data: { [key: string]: string }): string { let result = description if (!data) return result diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index 66d8080..7bc50c1 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -18561,6 +18561,14 @@ "type": "string", "format": "date-time" }, + "location": { + "type": "string", + "enum": [ + "default", + "speechBubble" + ], + "default": "default" + }, "thumbnail": { "type": "object", "properties": { diff --git a/src/gen/types.ts b/src/gen/types.ts index 969d918..34a04ef 100644 --- a/src/gen/types.ts +++ b/src/gen/types.ts @@ -7499,6 +7499,11 @@ export interface components { push: boolean; /** Format: date-time */ dueDate?: string; + /** + * @default default + * @enum {string} + */ + location?: "default" | "speechBubble"; thumbnail?: { data?: { id?: number; From 5e6d631b147806b99032fcee48ed3df01bad99d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20G=C3=A1mez=20Franco?= Date: Tue, 24 Feb 2026 17:57:08 +0100 Subject: [PATCH 3/5] fix: update required Node.js versions --- README.md | 4 ++-- package.json | 2 +- src/plugins/import-notifications/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 34b59ff..80f77ef 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Swagger Docs: # 👨‍💻 Develop -Some requiremets are: +Some requirements are: -- At least Node v16 (use a LTS version) +- Node v18 or v20 (use an LTS version) - Yarn - PostgreSQL (optional), for local dev is easier to use sqlite3 (the default). Alternatively you can use PostgreSQL diff --git a/package.json b/package.json index aafbeea..1ed0837 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "uuid": "e47cb3b3-cc8d-4b31-bc86-634b30862787" }, "engines": { - "node": ">=16.0.0 <=20.x.x", + "node": ">=18.0.0 <=20.x.x", "npm": ">=6.0.0" } } diff --git a/src/plugins/import-notifications/package.json b/src/plugins/import-notifications/package.json index 0492441..bbf84f2 100644 --- a/src/plugins/import-notifications/package.json +++ b/src/plugins/import-notifications/package.json @@ -41,7 +41,7 @@ } ], "engines": { - "node": ">=16.0.0 <=20.x.x", + "node": ">=18.0.0 <=20.x.x", "npm": ">=6.0.0" }, "scripts": { From 5e38176fd21b32bddabecfe70b9cf910eba604ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20G=C3=A1mez=20Franco?= Date: Tue, 24 Feb 2026 18:11:46 +0100 Subject: [PATCH 4/5] fix: format code --- .../notification-template/schema.json | 5 ++- .../1.0.0/full_documentation.json | 31 +++++++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/api/notification-template/content-types/notification-template/schema.json b/src/api/notification-template/content-types/notification-template/schema.json index 1ebeb05..a9e0dbb 100644 --- a/src/api/notification-template/content-types/notification-template/schema.json +++ b/src/api/notification-template/content-types/notification-template/schema.json @@ -41,7 +41,10 @@ }, "location": { "type": "enumeration", - "enum": ["default", "speechBubble"], + "enum": [ + "default", + "speechBubble" + ], "default": "default" } } diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index 7bc50c1..e749773 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2026-02-04T15:36:58.456Z" + "x-generation-date": "2026-02-24T17:11:04.426Z" }, "x-strapi-config": { "path": "/documentation", @@ -18332,6 +18332,13 @@ } } }, + "location": { + "type": "string", + "enum": [ + "default", + "speechBubble" + ] + }, "createdAt": { "type": "string", "format": "date-time" @@ -18486,6 +18493,13 @@ } ], "example": "string or id" + }, + "location": { + "type": "string", + "enum": [ + "default", + "speechBubble" + ] } } } @@ -18561,14 +18575,6 @@ "type": "string", "format": "date-time" }, - "location": { - "type": "string", - "enum": [ - "default", - "speechBubble" - ], - "default": "default" - }, "thumbnail": { "type": "object", "properties": { @@ -19190,6 +19196,13 @@ } } }, + "location": { + "type": "string", + "enum": [ + "default", + "speechBubble" + ] + }, "createdAt": { "type": "string", "format": "date-time" From 07eced28ec22d4f27d09173cca2d5753f1dc3e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20G=C3=A1mez=20Franco?= Date: Tue, 24 Feb 2026 18:15:19 +0100 Subject: [PATCH 5/5] fix: update README section about running the project locally --- README.md | 39 ++++++++++++------- .../1.0.0/full_documentation.json | 2 +- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 80f77ef..a2717dd 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,37 @@ Some requirements are: ## Run locally using sqlite3 -The CMS relies on a database. The simplest is to use `Sqlite` for development. +The CMS relies on a database. The simplest is to use **Sqlite** for development (it will be created automatically at `data/sqlite.db` when you start the app). -You actually don't need to do anything for this! If you run the project with `yarn dev`, it will automatically create a sqlite database in `data/sqlite.db` +**Steps:** -``` -yarn dev -``` +1. **Build the project** (required before running): -Then visit: + ```bash + yarn build + ``` -- **Admin**: +2. **Create a `.env` file** and set at least `APP_KEYS` (required for the app to start): -On its basic setup, you don't need to add any configuration parameter, however you might want to do so. You can do this by creating a `.env` file. + ```bash + cp .env.example .env + ``` -```bash -# Create an ENV file from the example -cp .env.example .env -``` + Edit `.env` and set `APP_KEYS` to a comma-separated list of secret keys, for example: + + ``` + APP_KEYS="mySecretKey1,mySecretKey2" + ``` + + You can leave other values as in the example for local dev, or adjust them as needed (see [Strapi environment config](https://docs.strapi.io/dev-docs/configurations/environment)). + +3. **Start the dev server:** + + ```bash + yarn dev + ``` + +4. **Visit** and create your local admin user. ## Dev locally using PostreSQL @@ -64,7 +77,7 @@ yarn dev # 👷‍♀️ Build -Before running the server for the first time, you need to build it: +Before running the server for the first time, you need to build it (see [Run locally using sqlite3](#run-locally-using-sqlite3) for the full setup). To build: ```bash yarn build diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index e749773..fe417e6 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2026-02-24T17:11:04.426Z" + "x-generation-date": "2026-02-24T17:14:45.265Z" }, "x-strapi-config": { "path": "/documentation",