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 @@ -
+ diff --git a/PWA/src/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.ts b/PWA/src/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.ts index 2d4d3d6..856256a 100644 --- a/PWA/src/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.ts +++ b/PWA/src/Services/FetchEventHandlers/DownloadSpreadsheetTemplateHandler.ts @@ -1,11 +1,9 @@ import { RouteEvents } from "../../RouteEvents.js"; import { FetchEvent } from "../../Interfaces/FetchEvent.js"; import { FetchEventHandler } from "../../Interfaces/FetchEventHandler.js"; -import { ActiveSessionContainer } from "../ActiveSession.js"; import { SpreadSheetService } from "../SpreadSheetService.js"; -import { BeneficiaryStatusService } from "../BeneficiaryStatusService.js"; -export class DownloadSpreadsheetTemplateHandler extends ActiveSessionContainer implements FetchEventHandler { +export class DownloadSpreadsheetTemplateHandler implements FetchEventHandler { canHandleEvent(event: FetchEvent): boolean { return event.request.url.includes(RouteEvents.downloadSpreadsheetTemplate); } diff --git a/PWA/src/Services/FetchEventHandlers/FetchEventHandlers.ts b/PWA/src/Services/FetchEventHandlers/FetchEventHandlers.ts index ff59895..c8833b8 100644 --- a/PWA/src/Services/FetchEventHandlers/FetchEventHandlers.ts +++ b/PWA/src/Services/FetchEventHandlers/FetchEventHandlers.ts @@ -18,6 +18,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 implements FetchEventHandler { all: FetchEventHandler[] = [ @@ -37,7 +38,8 @@ export class FetchEventHandlers extends ActiveSessionContainer implements FetchE new MarkAsReceivedPostHandler(this.activeSession), new HomepageHandler(), new ContinueDistributionHandler(this.activeSession), - new DownloadDataHandler(this.activeSession) + new DownloadDataHandler(this.activeSession), + new DownloadSpreadsheetTemplateHandler() ]; handlersForEvent(event: FetchEvent): FetchEventHandler[] {