From addd50191bd99d30ab91b2a2048fc7966c18bd44 Mon Sep 17 00:00:00 2001 From: AdeyinkaOresanya Date: Mon, 6 May 2024 12:12:48 +0100 Subject: [PATCH 1/4] [FEAT] (AssignChecklist): Add checklist for new metrics Added checklist for new metrics---Event Accessibility for Virtual events & three new metrics for In-person events including Event Accessibility, Event Location Inclusivity, and Public Health and Safety. Signed-off-by: AdeyinkaOresanya --- event_badging/logic/assignChecklist.js | 61 +++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/event_badging/logic/assignChecklist.js b/event_badging/logic/assignChecklist.js index 50fd2bf..025bc04 100644 --- a/event_badging/logic/assignChecklist.js +++ b/event_badging/logic/assignChecklist.js @@ -76,10 +76,21 @@ const assignChecklist = async (octokit, payload) => { ) + "\n" + "\n" + - body.slice(body.indexOf("## Diversity Access Tickets")) + + body.slice( + body.indexOf("## Diversity Access Tickets"), + body.indexOf("## Event Accessibility")) + "\n" + - checklist.slice(checklist.indexOf("### Diversity Access tickets")) + - "\n"; + checklist.slice( + checklist.indexOf("### Diversity Access tickets"), + checklist.indexOf("## Event Accessibility")) + + "\n" + + "\n" + + body.slice( + body.indexOf("## Event Accessibility")) + + "\n" + + checklist.slice( + checklist.indexOf("## Event Accessibility")) + + "\n"; /******************************************************************/ } else { const { @@ -151,10 +162,48 @@ const assignChecklist = async (octokit, payload) => { ) + "\n" + "\n" + - body.slice(body.indexOf("## Family Friendliness")) + + body.slice( + body.indexOf("## Family Friendliness"), + body.indexOf("## Event Accessibility") + + ) + "\n" + - checklist.slice(checklist.indexOf("### Family Friendliness")) + - "\n"; + checklist.slice( + checklist.indexOf("### Family Friendliness"), + checklist.indexOf("## Event Accessibility")) + + "\n" + + "\n" + + body.slice( + body.indexOf("## Event Accessibility"), + body.indexOf("## Event Location Inclusivity") + + ) + + "\n" + + checklist.slice( + checklist.indexOf("### Event Accessiblity"), + checklist.indexOf("## Event Location Inclusivity"))+ + "\n" + + "\n" + + body.slice( + body.indexOf("## Event Location Inclusivity"), + body.indexOf("## Public Health and Safety") + + ) + + "\n" + + checklist.slice( + checklist.indexOf("### Event Location Inclusivity"), + checklist.indexOf("## Public Health and Safety"))+ + "\n" + + "\n" + + body.slice( + body.indexOf("##Public Health and Safety") + + ) + + "\n" + + checklist.slice( + checklist.indexOf("### Public Health and Safety") + )+ + "\n"; /******************************************************************/ } From b79408f502f67ccb933a2c8db2a45d8be9f53448 Mon Sep 17 00:00:00 2001 From: AdeyinkaOresanya Date: Mon, 6 May 2024 15:28:04 +0100 Subject: [PATCH 2/4] [FIX] (env.example): Add SmeeClient_URL placeholder Signed-off-by: AdeyinkaOresanya --- .env.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.env.example b/.env.example index 0b10e4b..3c0db38 100644 --- a/.env.example +++ b/.env.example @@ -30,3 +30,7 @@ DB_HOST= # default is 'localhost' DB_NAME= DB_USER= DB_PASSWORD= + +# smeeClient URL for testing + +SMEECLIENT_URL= From f639afe4bd7d03800d14f2db3a09706774f24c2e Mon Sep 17 00:00:00 2001 From: AdeyinkaOresanya Date: Wed, 8 May 2024 10:56:57 +0100 Subject: [PATCH 3/4] git commit -S -s -m "[FIX] (AssignChecklist): Fixed the typos in the code preventing the program to run as it should" --- event_badging/logic/assignChecklist.js | 55 ++++++++++++-------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/event_badging/logic/assignChecklist.js b/event_badging/logic/assignChecklist.js index 025bc04..0901805 100644 --- a/event_badging/logic/assignChecklist.js +++ b/event_badging/logic/assignChecklist.js @@ -78,19 +78,19 @@ const assignChecklist = async (octokit, payload) => { "\n" + body.slice( body.indexOf("## Diversity Access Tickets"), - body.indexOf("## Event Accessibility")) + + body.indexOf("## Event Accessibility") + ) + "\n" + checklist.slice( checklist.indexOf("### Diversity Access tickets"), - checklist.indexOf("## Event Accessibility")) + - "\n" + - "\n" + - body.slice( - body.indexOf("## Event Accessibility")) + - "\n" + - checklist.slice( - checklist.indexOf("## Event Accessibility")) + - "\n"; + checklist.indexOf("### Event Accessibility") + ) + + "\n" + + "\n" + + body.slice(body.indexOf("## Event Accessibility")) + + "\n" + + checklist.slice(checklist.indexOf("### Event Accessibility")) + + "\n"; /******************************************************************/ } else { const { @@ -165,45 +165,40 @@ const assignChecklist = async (octokit, payload) => { body.slice( body.indexOf("## Family Friendliness"), body.indexOf("## Event Accessibility") - - ) + + ) + "\n" + checklist.slice( - checklist.indexOf("### Family Friendliness"), - checklist.indexOf("## Event Accessibility")) + + checklist.indexOf("### Family Friendliness"), + checklist.indexOf("### Event Accessibility") + ) + "\n" + "\n" + body.slice( body.indexOf("## Event Accessibility"), body.indexOf("## Event Location Inclusivity") - - ) + + ) + "\n" + checklist.slice( - checklist.indexOf("### Event Accessiblity"), - checklist.indexOf("## Event Location Inclusivity"))+ + checklist.indexOf("### Event Accessibility"), + checklist.indexOf("### Event Location Inclusivity") + ) + "\n" + "\n" + body.slice( body.indexOf("## Event Location Inclusivity"), body.indexOf("## Public Health and Safety") - - ) + + ) + "\n" + checklist.slice( - checklist.indexOf("### Event Location Inclusivity"), - checklist.indexOf("## Public Health and Safety"))+ + checklist.indexOf("### Event Location Inclusivity"), + checklist.indexOf("### Public Health and Safety") + ) + "\n" + "\n" + - body.slice( - body.indexOf("##Public Health and Safety") - - ) + + body.slice(body.indexOf("## Public Health and Safety")) + "\n" + - checklist.slice( - checklist.indexOf("### Public Health and Safety") - )+ - "\n"; + checklist.slice(checklist.indexOf("### Public Health and Safety")) + + "\n"; /******************************************************************/ } From 829de1af97476c153341fc31c2cc8e12ffeed6dd Mon Sep 17 00:00:00 2001 From: AdeyinkaOresanya Date: Wed, 8 May 2024 11:56:28 +0100 Subject: [PATCH 4/4] [FIX] (AssignChecklist): Update SMEECLIENT_URL to SMEE_CLIENT_URL in inde.jsand env.example files to maintain naming convention Signed-off-by: AdeyinkaOresanya --- .env.example | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 3c0db38..4d31704 100644 --- a/.env.example +++ b/.env.example @@ -33,4 +33,4 @@ DB_PASSWORD= # smeeClient URL for testing -SMEECLIENT_URL= +SMEE_CLIENT_URL= diff --git a/index.js b/index.js index b5121d3..42b7ac5 100644 --- a/index.js +++ b/index.js @@ -45,7 +45,7 @@ routes.setupRoutes(app); const SmeeClient = require("smee-client"); if (process.env.NODE_ENV === "development") { const smee = new SmeeClient({ - source: `${process.env.SMEECLIENT_URL}`, + source: `${process.env.SMEE_CLIENT_URL}`, target: `http://localhost:${process.env.PORT}/api/event_badging`, logger: console, });