Skip to content

Commit

Permalink
Make sure spreadsheethandler is part of known fetch event handlers bu…
Browse files Browse the repository at this point in the history
…mp 0.5.4
  • Loading branch information
rcmenno committed Oct 14, 2024
1 parent 99fae04 commit 08035e9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion PWA/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
Expand Down
4 changes: 3 additions & 1 deletion PWA/public/Services/FetchEventHandlers/FetchEventHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion PWA/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<!-- <a class="navbar-item">-->
<img src="images/ReliefBox-horizontal-nobackground.png" width="220" height="30">
<!-- </a>-->
<div class="navbar-item">Alpha 0.5.3</div>
<div class="navbar-item">Alpha 0.5.4</div>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
Expand Down
4 changes: 3 additions & 1 deletion PWA/src/Services/FetchEventHandlers/FetchEventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand All @@ -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[] {
Expand Down

0 comments on commit 08035e9

Please sign in to comment.