From dec91f08eea156de4601f2cdcb05754ef1b71cde Mon Sep 17 00:00:00 2001 From: GamercraftStudios <58826382+BurnhamR@users.noreply.github.com> Date: Tue, 25 Feb 2025 22:09:47 -0700 Subject: [PATCH 01/14] Update 32sirens.md --- docs/introduction/32sirens.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/introduction/32sirens.md b/docs/introduction/32sirens.md index 3486570..d2ab057 100644 --- a/docs/introduction/32sirens.md +++ b/docs/introduction/32sirens.md @@ -8,7 +8,7 @@ Welcome to the installation guide for the SirenSetting Limit Adjuster 2.0.2, als ## 📥 **Download Links** -- **[Click Here to Download (cdn.skyy.cc)](https://cdn.skyy.cc/FiveM/SirenSetting_Limit_Adjuster_v2.zip)** +- **[Click Here to Download (cdn.skyy.cc)](https://cdn.skyy.cc/SirenSetting_Limit_Adjuster_v3.zip)** - **[Official Download and Page](https://www.lcpdfr.com/downloads/gta5mods/scripts/28560-sirensetting-limit-adjuster/)**. - **[Virus Total Scan](https://www.virustotal.com/gui/file/74fec47012be517504fb515abc913ece559f0ad680d0f16058ae6fb2ea46a9aa)** From 989668ac3d8a2f0dfe9ef1d3ff1eceab149dedf6 Mon Sep 17 00:00:00 2001 From: GamercraftStudios <58826382+BurnhamR@users.noreply.github.com> Date: Sun, 2 Mar 2025 17:20:29 -0700 Subject: [PATCH 02/14] Moving to DPS --- src/components/Roster copy.js | 192 ++++++++++++++++++++++++++++++++++ src/components/Roster.js | 88 ++-------------- 2 files changed, 198 insertions(+), 82 deletions(-) create mode 100644 src/components/Roster copy.js diff --git a/src/components/Roster copy.js b/src/components/Roster copy.js new file mode 100644 index 0000000..4c5c907 --- /dev/null +++ b/src/components/Roster copy.js @@ -0,0 +1,192 @@ +import React, { useEffect, useState } from 'react'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +const Roster = () => { +const [rosterData, setRosterData] = useState({ + sahp: [], + bcso: [], + lspd: [] +}); +const staticSahpRoster = [ + { callSign: '1C-01', rank: 'Colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-02', rank: 'Lieutenant colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-03', rank: 'Major', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-05', rank: 'Lieutenant', status: 'Vacant', role: 'LIA Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1U-16', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-17', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-18', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-19', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-20', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-21', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-22', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-23', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-24', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-25', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-26', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-27', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-28', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-29', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1N-30', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-31', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-32', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, +]; +const staticBcsoRoster = [ + { callSign: '2C-01', rank: 'Sheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '2C-02', rank: 'Undersheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '2C-03', rank: 'Chief Deputy', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2U-16', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-17', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-18', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-19', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-20', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-21', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-22', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-23', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-24', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-25', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-26', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-27', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-28', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-29', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2N-30', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '2N-31', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '2N-32', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } +]; +const staticLspdRoster = [ + { callSign: '4C-01', rank: 'Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '4C-02', rank: 'Asst. Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '4C-03', rank: 'Captain', status: 'Vacant', role: 'Division Management', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'TEU Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4U-16', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-17', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-18', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-19', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-20', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-21', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-22', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-23', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-24', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-25', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-26', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-27', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-28', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-29', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4N-30', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '4N-31', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '4N-32', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } +]; + +useEffect(() => { +const fetchRosterData = async () => { + try { + const response = await fetch('https://api.kcdojrp.com/v1/roster'); + const data = await response.json(); + const apiRoster = data.response || []; + const mergeRosters = (staticRoster) => { + return staticRoster.map(staticEntry => { + const dynamicEntry = apiRoster.find(entry => entry.callsign === staticEntry.callSign); + return dynamicEntry + ? { + ...staticEntry, + name: dynamicEntry.name, + rank: dynamicEntry.rank, + role: dynamicEntry.position, + startDate: dynamicEntry.startDate, + status: dynamicEntry.suspended === "false" ? "Active" : "Suspended", + hours: dynamicEntry.hours + } + : staticEntry; + }); + }; + setRosterData({ + sahp: mergeRosters(staticSahpRoster), + bcso: mergeRosters(staticBcsoRoster), + lspd: mergeRosters(staticLspdRoster) + }); + } catch (error) { + console.error('Error fetching roster data:', error); + } + }; + fetchRosterData(); +}, []); + +const renderTable = (roster) => ( + + + + + + + + + + + + + + + {roster.map((member, index) => ( + + + + + + + + + + + ))} + +
Call SignNameRankStatusRole/DetailStart DateFTOHours
{member.callSign}{member.name || ''}{member.rank}{member.status}{member.role}{member.startDate || ''}{member.fto || ''}{member.hours || ''}
+); + +return ( + + {renderTable(rosterData.sahp)} + {renderTable(rosterData.bcso)} + {renderTable(rosterData.lspd)} + +); +}; + +export default Roster; diff --git a/src/components/Roster.js b/src/components/Roster.js index 4c5c907..ebc657d 100644 --- a/src/components/Roster.js +++ b/src/components/Roster.js @@ -4,11 +4,9 @@ import TabItem from '@theme/TabItem'; const Roster = () => { const [rosterData, setRosterData] = useState({ - sahp: [], - bcso: [], - lspd: [] + dps: [], }); -const staticSahpRoster = [ +const staticDpsRoster = [ { callSign: '1C-01', rank: 'Colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, { callSign: '1C-02', rank: 'Lieutenant colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, { callSign: '1C-03', rank: 'Major', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, @@ -42,74 +40,6 @@ const staticSahpRoster = [ { callSign: '1N-31', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, { callSign: '1N-32', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, ]; -const staticBcsoRoster = [ - { callSign: '2C-01', rank: 'Sheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '2C-02', rank: 'Undersheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '2C-03', rank: 'Chief Deputy', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, - { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2U-16', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-17', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-18', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-19', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-20', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-21', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-22', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-23', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-24', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-25', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-26', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-27', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-28', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-29', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2N-30', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '2N-31', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '2N-32', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } -]; -const staticLspdRoster = [ - { callSign: '4C-01', rank: 'Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '4C-02', rank: 'Asst. Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '4C-03', rank: 'Captain', status: 'Vacant', role: 'Division Management', startDate: '', fto: '', hours: '' }, - { callSign: '1C-04', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'TEU Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4U-16', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-17', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-18', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-19', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-20', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-21', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-22', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-23', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-24', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-25', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-26', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-27', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-28', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-29', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4N-30', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '4N-31', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '4N-32', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } -]; useEffect(() => { const fetchRosterData = async () => { @@ -134,9 +64,7 @@ const fetchRosterData = async () => { }); }; setRosterData({ - sahp: mergeRosters(staticSahpRoster), - bcso: mergeRosters(staticBcsoRoster), - lspd: mergeRosters(staticLspdRoster) + dps: mergeRosters(staticDpsRoster) }); } catch (error) { console.error('Error fetching roster data:', error); @@ -177,14 +105,10 @@ const renderTable = (roster) => ( ); return ( - - {renderTable(rosterData.sahp)} - {renderTable(rosterData.bcso)} - {renderTable(rosterData.lspd)} + {renderTable(rosterData.dps)} ); }; From cd4f954fe218f5f292771b59f3d165ff78502a07 Mon Sep 17 00:00:00 2001 From: GamercraftStudios <58826382+BurnhamR@users.noreply.github.com> Date: Sun, 2 Mar 2025 17:27:37 -0700 Subject: [PATCH 03/14] Updated Roles/Positions --- src/components/Roster.js | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/components/Roster.js b/src/components/Roster.js index ebc657d..725d7fb 100644 --- a/src/components/Roster.js +++ b/src/components/Roster.js @@ -7,12 +7,12 @@ const [rosterData, setRosterData] = useState({ dps: [], }); const staticDpsRoster = [ - { callSign: '1C-01', rank: 'Colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '1C-02', rank: 'Lieutenant colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-01', rank: 'Commissioner', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-02', rank: 'Asst. Commissioner', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, { callSign: '1C-03', rank: 'Major', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, - { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-05', rank: 'Lieutenant', status: 'Vacant', role: 'LIA Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Department Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Department Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'Department Supervisor', startDate: '', fto: '', hours: '' }, { callSign: '1S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, { callSign: '1S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, { callSign: '1S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, @@ -22,23 +22,23 @@ const staticDpsRoster = [ { callSign: '1V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, { callSign: '1V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, { callSign: '1V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '1U-16', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-17', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-18', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-19', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-20', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-21', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-22', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-23', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-24', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-25', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-26', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-27', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-28', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-29', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1N-30', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '1N-31', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '1N-32', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1U-16', rank: 'Senior Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-17', rank: 'Senior Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-18', rank: 'Senior Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-19', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-20', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-21', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-22', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-23', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-24', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-25', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-26', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-27', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-28', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-29', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1N-30', rank: '3nd Class Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-31', rank: '3nd Class Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-32', rank: '3nd Class Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, ]; useEffect(() => { @@ -57,7 +57,7 @@ const fetchRosterData = async () => { rank: dynamicEntry.rank, role: dynamicEntry.position, startDate: dynamicEntry.startDate, - status: dynamicEntry.suspended === "false" ? "Active" : "Suspended", + status: dynamicEntry.suspended === "false" ? "Active" : "On Leave", hours: dynamicEntry.hours } : staticEntry; From 229b77b066b21b443700146c51d0a355daaa4843 Mon Sep 17 00:00:00 2001 From: Paneedah <76911089+Paneedah@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:04:15 -0700 Subject: [PATCH 04/14] docs(internal): fix workflow for discord integration on branch 'main' --- .github/workflows/discord.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/discord.yml diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml new file mode 100644 index 0000000..399d0f8 --- /dev/null +++ b/.github/workflows/discord.yml @@ -0,0 +1,41 @@ +name: Notify Discord + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Grab Commit Message + id: build + run: | + echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> "$GITHUB_OUTPUT" + + - name: Notify Discord + env: + COMMIT_MESSAGE: ${{ steps.build.outputs.COMMIT_MESSAGE }} + run: | + payload=$(jq -n \ + --arg title "Documentation Update (Branch: 'main')" \ + --arg description "$(cat < Date: Thu, 17 Apr 2025 19:17:21 -0700 Subject: [PATCH 05/14] docs(internal): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). --- .github/workflows/discord.yml | 48 +++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 399d0f8..abc05c5 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -4,38 +4,60 @@ on: pull_request: branches: - main + - dev jobs: build: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Grab Commit Message - id: build + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get Commit Message + id: commit_info run: | - echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> "$GITHUB_OUTPUT" - + # Get Author Name of the latest commit + COMMIT_AUTHOR=$(git log -1 --pretty=%an) + echo "COMMIT_AUTHOR=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT + + # Get Commit Message of the latest commit + COMMIT_MSG=$(git log -1 --pretty=%B) + echo "COMMIT_MESSAGE<> $GITHUB_OUTPUT + echo "$COMMIT_MSG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Notify Discord env: - COMMIT_MESSAGE: ${{ steps.build.outputs.COMMIT_MESSAGE }} + DISCORD_WEBHOOK_URL: "https://discord.com/api/webhooks/1362607277441552517/2WT7hZBlyQ6boJejURiRxAYMr12PEp3S5I2KtvBmO_IKL5oktZ-pXE5xAo5twEktVRAS" + COMMIT_MESSAGE: ${{ steps.commit_info.outputs.COMMIT_MESSAGE }} + COMMIT_AUTHOR: ${{ steps.commit_info.outputs.COMMIT_AUTHOR }} + TARGET_BRANCH: ${{ github.base_ref }} run: | + discord_title="Commit to branch '${TARGET_BRANCH}' by ${PR_AUTHOR}: ${PR_TITLE}" + + discord_description=$(cat < Date: Thu, 17 Apr 2025 19:24:01 -0700 Subject: [PATCH 06/14] docs(internal): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). --- .github/workflows/discord.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index abc05c5..7318d31 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -60,4 +60,4 @@ jobs: curl -X POST -H "Content-Type: application/json" \ -d "$payload" \ - "$DISCORD_WEBHOOK_URL" \ No newline at end of file + "$DISCORD_WEBHOOK_URL" From 65c49695a91bf74a7b48072c9dc931748642cbaf Mon Sep 17 00:00:00 2001 From: Paneedah Date: Thu, 17 Apr 2025 19:25:52 -0700 Subject: [PATCH 07/14] docs(internal): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). --- .github/workflows/discord.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 7318d31..73a9ed3 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -1,7 +1,7 @@ name: Notify Discord on: - pull_request: + push: branches: - main - dev From c46fc5e23ad5aacde16ef8388486196918c4bb40 Mon Sep 17 00:00:00 2001 From: Paneedah Date: Thu, 17 Apr 2025 19:28:18 -0700 Subject: [PATCH 08/14] docs(internal): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). --- .github/workflows/discord.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 73a9ed3..7679e3f 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -36,10 +36,12 @@ jobs: COMMIT_AUTHOR: ${{ steps.commit_info.outputs.COMMIT_AUTHOR }} TARGET_BRANCH: ${{ github.base_ref }} run: | - discord_title="Commit to branch '${TARGET_BRANCH}' by ${PR_AUTHOR}: ${PR_TITLE}" + discord_title="Commit to branch '${TARGET_BRANCH}' by ${COMMIT_AUTHOR}" discord_description=$(cat < Date: Thu, 17 Apr 2025 19:31:09 -0700 Subject: [PATCH 09/14] docs(internal): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). docs(internal): optimize fetchers for data docs(internal): fix commit message & branch grabber --- .github/workflows/discord.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 7679e3f..2c7c1a1 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -16,25 +16,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Get Commit Message - id: commit_info - run: | - # Get Author Name of the latest commit - COMMIT_AUTHOR=$(git log -1 --pretty=%an) - echo "COMMIT_AUTHOR=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - - # Get Commit Message of the latest commit - COMMIT_MSG=$(git log -1 --pretty=%B) - echo "COMMIT_MESSAGE<> $GITHUB_OUTPUT - echo "$COMMIT_MSG" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - name: Notify Discord + - name: Send Notification env: DISCORD_WEBHOOK_URL: "https://discord.com/api/webhooks/1362607277441552517/2WT7hZBlyQ6boJejURiRxAYMr12PEp3S5I2KtvBmO_IKL5oktZ-pXE5xAo5twEktVRAS" - COMMIT_MESSAGE: ${{ steps.commit_info.outputs.COMMIT_MESSAGE }} - COMMIT_AUTHOR: ${{ steps.commit_info.outputs.COMMIT_AUTHOR }} - TARGET_BRANCH: ${{ github.base_ref }} + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }} + TARGET_BRANCH: ${{ github.event.base_ref }} run: | discord_title="Commit to branch '${TARGET_BRANCH}' by ${COMMIT_AUTHOR}" From 2f6484ecfe78bee14aa2dad5f68fb229ed565468 Mon Sep 17 00:00:00 2001 From: Paneedah Date: Thu, 17 Apr 2025 19:38:11 -0700 Subject: [PATCH 10/14] docs(internal): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). docs(internal): optimize fetchers for data docs(internal): fix commit message & branch grabber docs(internal): QoL changes --- .github/workflows/discord.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 2c7c1a1..430bc47 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -18,35 +18,54 @@ jobs: - name: Send Notification env: - DISCORD_WEBHOOK_URL: "https://discord.com/api/webhooks/1362607277441552517/2WT7hZBlyQ6boJejURiRxAYMr12PEp3S5I2KtvBmO_IKL5oktZ-pXE5xAo5twEktVRAS" + DISCORD_WEBHOOK_URL: "https://discord.com/api/webhooks/1362607277441552517/2WT7hZBlyQ6boJejURiRxAYMr12PEp3S5I2KtvBmO_IKL5oktZ-pXE5xAo5twEktVRAS" # <-- Insecure: Hardcoded URL + + # --- Commit details --- COMMIT_MESSAGE: ${{ github.event.head_commit.message }} - COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }} - TARGET_BRANCH: ${{ github.event.base_ref }} + COMMIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }} + COMMIT_TIMESTAMP: ${{ github.event.head_commit.timestamp }} + COMMIT_URL: ${{ github.event.head_commit.url }} + + # --- Branch details --- + TARGET_BRANCH: ${{ github.ref_name }} + + # --- Pusher details (User who ran 'git push') --- + PUSHER_USERNAME: ${{ github.actor }} + PUSHER_AVATAR_URL: "https://github.com/${{ github.actor }}.png" + run: | - discord_title="Commit to branch '${TARGET_BRANCH}' by ${COMMIT_AUTHOR}" + discord_title="Push to '${TARGET_BRANCH}' by ${PUSHER_USERNAME}" + COMMIT_SHA_SHORT=$(echo "${{ github.sha }}" | cut -c1-7) discord_description=$(cat < Date: Thu, 17 Apr 2025 19:42:42 -0700 Subject: [PATCH 11/14] docs(discord-integration): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). docs(discord-integration): optimize fetchers for data docs(discord-integration): fix commit message & branch grabber docs(discord-integration): improve design of embed for discord --- .github/workflows/discord.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 430bc47..2398660 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -34,9 +34,8 @@ jobs: PUSHER_AVATAR_URL: "https://github.com/${{ github.actor }}.png" run: | - discord_title="Push to '${TARGET_BRANCH}' by ${PUSHER_USERNAME}" + discord_title="Push to '${TARGET_BRANCH}' on 'MTDOJRP/docs'" - COMMIT_SHA_SHORT=$(echo "${{ github.sha }}" | cut -c1-7) discord_description=$(cat < Date: Thu, 17 Apr 2025 19:45:46 -0700 Subject: [PATCH 12/14] docs(discord-integration): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). docs(discord-integration): optimize fetchers for data docs(discord-integration): fix commit message & branch grabber docs(discord-integration): improve design of embed for discord --- .github/workflows/discord.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 2398660..dd2f216 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -57,7 +57,7 @@ jobs: "title": $title, "description": $description, "timestamp": $timestamp, - "footer": "Kelly County Documentation", + "footer": { "text": "docs | Kelly County" } "color": $color } ] From 9a2dc5549b4f7805d63064c53016c8e75360665b Mon Sep 17 00:00:00 2001 From: Paneedah Date: Thu, 17 Apr 2025 19:46:23 -0700 Subject: [PATCH 13/14] docs(discord-integration): add support for discord logging when pushing a change to the documentation (support for both 'main' and 'dev' branch). docs(discord-integration): optimize fetchers for data docs(discord-integration): fix commit message & branch grabber docs(discord-integration): improve design of embed for discord --- .github/workflows/discord.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index dd2f216..e693b2a 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -57,7 +57,7 @@ jobs: "title": $title, "description": $description, "timestamp": $timestamp, - "footer": { "text": "docs | Kelly County" } + "footer": { "text": "docs | Kelly County" }, "color": $color } ] From 54a993a09b5e2409731b0974ba0658e6e88d2f7b Mon Sep 17 00:00:00 2001 From: Paneedah Date: Sat, 19 Apr 2025 14:16:05 -0700 Subject: [PATCH 14/14] docs(internal): fix insecure url in discord.yml --- .github/workflows/discord.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index e693b2a..e8812fb 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - backup-v1 - dev jobs: @@ -18,7 +19,7 @@ jobs: - name: Send Notification env: - DISCORD_WEBHOOK_URL: "https://discord.com/api/webhooks/1362607277441552517/2WT7hZBlyQ6boJejURiRxAYMr12PEp3S5I2KtvBmO_IKL5oktZ-pXE5xAo5twEktVRAS" # <-- Insecure: Hardcoded URL + DISCORD_WEBHOOK_URL: ${{ secrets.COMMIT_WEBHOOK_URL }} # --- Commit details --- COMMIT_MESSAGE: ${{ github.event.head_commit.message }} @@ -66,4 +67,4 @@ jobs: echo "Sending notification for push to branch: $TARGET_BRANCH by $PUSHER_USERNAME" curl -X POST -H "Content-Type: application/json" \ -d "$payload" \ - "$DISCORD_WEBHOOK_URL" + "$DISCORD_WEBHOOK_URL" \ No newline at end of file