From 08035e9f75548d7571efa1d79ed3551fa7b26a88 Mon Sep 17 00:00:00 2001 From: rcmenno <129762469+rcmenno@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:17:02 +0200 Subject: [PATCH] Make sure spreadsheethandler is part of known fetch event handlers bump 0.5.4 --- PWA/package.json | 2 +- .../FetchEventHandlers/DownloadSpreadsheetTemplateHandler.js | 3 +-- PWA/public/Services/FetchEventHandlers/FetchEventHandlers.js | 4 +++- PWA/public/index.html | 2 +- .../FetchEventHandlers/DownloadSpreadsheetTemplateHandler.ts | 4 +--- PWA/src/Services/FetchEventHandlers/FetchEventHandlers.ts | 4 +++- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/PWA/package.json b/PWA/package.json index 5845527..5b801ff 100644 --- a/PWA/package.json +++ b/PWA/package.json @@ -1,6 +1,6 @@ { "name": "ReliefBox", - "version": "0.5.3", + "version": "0.5.4", "description": "A tool for managing the distribution of relief items during humanitarian emergencies.", "main": "index.js", "scripts": { diff --git a/PWA/public/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.js b/PWA/public/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.js index c15e65f..21a1727 100644 --- a/PWA/public/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.js +++ b/PWA/public/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.js @@ -1,7 +1,6 @@ import { RouteEvents } from "../../RouteEvents.js"; -import { ActiveSessionContainer } from "../ActiveSession.js"; import { SpreadSheetService } from "../SpreadSheetService.js"; -export class DownloadSpreadsheetTemplateHandler extends ActiveSessionContainer { +export class DownloadSpreadsheetTemplateHandler { canHandleEvent(event) { return event.request.url.includes(RouteEvents.downloadSpreadsheetTemplate); } diff --git a/PWA/public/Services/FetchEventHandlers/FetchEventHandlers.js b/PWA/public/Services/FetchEventHandlers/FetchEventHandlers.js index 3b8c165..119bcf8 100644 --- a/PWA/public/Services/FetchEventHandlers/FetchEventHandlers.js +++ b/PWA/public/Services/FetchEventHandlers/FetchEventHandlers.js @@ -16,6 +16,7 @@ import { MarkAsReceivedPostHandler } from "./MarkAsReceivedPostHandler.js"; import { HomepageHandler } from "./HomepageHandler.js"; import { ContinueDistributionHandler } from "./ContinueDistributionHandler.js"; import { DownloadDataHandler } from "./DownloadDataHandler.js"; +import { DownloadSpreadsheetTemplateHandler } from "./DownloadSpreadsheetTemplateHandler.js"; export class FetchEventHandlers extends ActiveSessionContainer { constructor() { super(...arguments); @@ -36,7 +37,8 @@ export class FetchEventHandlers extends ActiveSessionContainer { new MarkAsReceivedPostHandler(this.activeSession), new HomepageHandler(), new ContinueDistributionHandler(this.activeSession), - new DownloadDataHandler(this.activeSession) + new DownloadDataHandler(this.activeSession), + new DownloadSpreadsheetTemplateHandler() ]; } handlersForEvent(event) { diff --git a/PWA/public/index.html b/PWA/public/index.html index 77b3d47..697d87f 100644 --- a/PWA/public/index.html +++ b/PWA/public/index.html @@ -39,7 +39,7 @@ - +