From 9ec5604e5ef61f90e607d29442e307e5812930fe Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Mon, 30 Mar 2026 02:42:41 +0530 Subject: [PATCH 1/3] fix: handle empty values in slug+id generation --- .gitea/workflows/src/utils/urlHelpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/src/utils/urlHelpers.ts b/.gitea/workflows/src/utils/urlHelpers.ts index e8b2c6a..b39bcdc 100644 --- a/.gitea/workflows/src/utils/urlHelpers.ts +++ b/.gitea/workflows/src/utils/urlHelpers.ts @@ -18,7 +18,8 @@ export const createSlug = (text: string): string => { * Example: "Ad ut neque enim omn", "e7d611b6-853b-4785-b508-599eeed2af92" -> "ad-ut-neque-enim-omn-e7d611b6-853b-4785-b508-599eeed2af92" */ export const getSlugWithId = (title: string, id: string) => { - return `${createSlug(title)}-${id}`; + const slug = createSlug(title); + return slug && id ? `${slug}-${id}` : slug || id; }; /** -- 2.34.1 From e0e4f79ebe8803a4d86006eecb9c31b748a39860 Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Mon, 30 Mar 2026 02:48:26 +0530 Subject: [PATCH 2/3] chore: clean debug logs and harden helper utils --- .gitea/workflows/src/components/BookingModal.tsx | 1 - .gitea/workflows/src/components/CTAPopupModal.tsx | 14 +++----------- .gitea/workflows/src/components/Contact.tsx | 2 -- .gitea/workflows/src/components/Router.tsx | 3 +-- .gitea/workflows/src/components/StatsSection.tsx | 2 +- .../src/components/VirtualSpaceSection.tsx | 1 - .gitea/workflows/src/components/VirtualTour.tsx | 1 - .../src/components/services/LearningFacility.tsx | 6 ------ .gitea/workflows/src/utils/getReadingTime.ts | 1 + .gitea/workflows/src/utils/urlHelpers.ts | 4 ++-- 10 files changed, 8 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/src/components/BookingModal.tsx b/.gitea/workflows/src/components/BookingModal.tsx index e1637cc..cb59ba9 100644 --- a/.gitea/workflows/src/components/BookingModal.tsx +++ b/.gitea/workflows/src/components/BookingModal.tsx @@ -38,7 +38,6 @@ export function BookingModal({ isOpen, onClose, initialFacilityZone = "" }: Book const handleBookingSubmit = (e: React.FormEvent) => { e.preventDefault(); - console.log('Booking form submitted:', bookingForm); // Here you would typically send the form data to your backend alert('Booking request submitted successfully! We will contact you within 24 hours.'); onClose(); diff --git a/.gitea/workflows/src/components/CTAPopupModal.tsx b/.gitea/workflows/src/components/CTAPopupModal.tsx index 4f0bf58..9da3a17 100644 --- a/.gitea/workflows/src/components/CTAPopupModal.tsx +++ b/.gitea/workflows/src/components/CTAPopupModal.tsx @@ -9,8 +9,7 @@ interface CTAPopupModalProps { } export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) { - console.log('CTAPopupModal render - isOpen:', isOpen); // Debug log - + const handleVirtualTour = () => { navigateTo('/services/learning-facility'); onClose(); @@ -25,22 +24,17 @@ export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) { }; const handleBooking = () => { - console.log('Booking button clicked in modal'); // Debug log - + // Use URL parameter approach for more reliable booking modal triggering navigateTo('/services/learning-facility?autoBooking=true'); onClose(); // Also try the element-based approach as backup const attemptBookingTrigger = (attempt = 1, maxAttempts = 5) => { - console.log(`Booking trigger attempt #${attempt}`); // Debug log - // Look for the booking trigger element const bookingBtn = document.querySelector('[data-booking-trigger]') as HTMLButtonElement; - console.log('Found booking trigger:', bookingBtn); // Debug log - + if (bookingBtn) { - console.log('Clicking booking trigger...'); // Debug log bookingBtn.click(); return; } @@ -48,8 +42,6 @@ export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) { // If not found and we haven't reached max attempts, try again if (attempt < maxAttempts) { setTimeout(() => attemptBookingTrigger(attempt + 1, maxAttempts), 200); - } else { - console.log('Element-based approach failed, relying on URL parameter approach'); // Debug log } }; diff --git a/.gitea/workflows/src/components/Contact.tsx b/.gitea/workflows/src/components/Contact.tsx index 3545841..05d2693 100644 --- a/.gitea/workflows/src/components/Contact.tsx +++ b/.gitea/workflows/src/components/Contact.tsx @@ -38,11 +38,9 @@ export function Contact({ topic }: ContactProps) { const [createLead] = useCreateLeadMutation(); useEffect(() => { - console.log('Contact component mounted with topic:', topic); // Set default interested in based on topic parameter if (topic) { const interestedIn = getTopicSubject(topic); - console.log('Setting form interestedIn to:', interestedIn); setFormData(prev => ({ ...prev, interestedIn: interestedIn diff --git a/.gitea/workflows/src/components/Router.tsx b/.gitea/workflows/src/components/Router.tsx index e38d5d9..ce991d8 100644 --- a/.gitea/workflows/src/components/Router.tsx +++ b/.gitea/workflows/src/components/Router.tsx @@ -4,8 +4,7 @@ const listeners: (() => void)[] = []; export function navigateTo(path: string) { try { - console.log(`Navigating to: ${path}`); - + // Update current path currentPath = path; diff --git a/.gitea/workflows/src/components/StatsSection.tsx b/.gitea/workflows/src/components/StatsSection.tsx index b9d271e..c832bb0 100644 --- a/.gitea/workflows/src/components/StatsSection.tsx +++ b/.gitea/workflows/src/components/StatsSection.tsx @@ -91,7 +91,7 @@ export function StatsSection({ stats = [], isLoading }: StatsSectionProps) { console.log("About us clicked")} + onClick={() => {}} ariaLabel="Learn more about KLC" /> diff --git a/.gitea/workflows/src/components/VirtualSpaceSection.tsx b/.gitea/workflows/src/components/VirtualSpaceSection.tsx index 086f935..e048604 100644 --- a/.gitea/workflows/src/components/VirtualSpaceSection.tsx +++ b/.gitea/workflows/src/components/VirtualSpaceSection.tsx @@ -208,7 +208,6 @@ function BookingModal({ const handleFormSubmit = (e: React.FormEvent) => { e.preventDefault(); - console.log('Booking form submitted:', bookingForm); // Here you would typically send the form data to your backend alert('Booking request submitted successfully! We will contact you soon.'); onClose(); diff --git a/.gitea/workflows/src/components/VirtualTour.tsx b/.gitea/workflows/src/components/VirtualTour.tsx index 4c34d67..c5551fd 100644 --- a/.gitea/workflows/src/components/VirtualTour.tsx +++ b/.gitea/workflows/src/components/VirtualTour.tsx @@ -310,7 +310,6 @@ export function VirtualTour() { const handleBookingSubmit = (e: React.FormEvent) => { e.preventDefault(); - console.log('Booking submitted:', bookingForm); setIsBookingModalOpen(false); setBookingForm({ companyName: '', diff --git a/.gitea/workflows/src/components/services/LearningFacility.tsx b/.gitea/workflows/src/components/services/LearningFacility.tsx index f9a8820..f97a288 100644 --- a/.gitea/workflows/src/components/services/LearningFacility.tsx +++ b/.gitea/workflows/src/components/services/LearningFacility.tsx @@ -415,12 +415,10 @@ export function LearningFacility() { }); useEffect(() => { - console.log('LearningFacility component mounted'); // Debug log window.scrollTo(0, 0); // Listen for custom booking modal event from CTAPopupModal const handleOpenBookingModal = () => { - console.log('Custom booking modal event received'); // Debug log setIsBookingModalOpen(true); }; @@ -429,7 +427,6 @@ export function LearningFacility() { // Also check if we should auto-open the booking modal based on URL parameters const urlParams = new URLSearchParams(window.location.search); if (urlParams.get('autoBooking') === 'true') { - console.log('Auto-opening booking modal from URL parameter'); // Debug log setTimeout(() => setIsBookingModalOpen(true), 100); } @@ -461,7 +458,6 @@ export function LearningFacility() { const handleBookingSubmit = (e: React.FormEvent) => { e.preventDefault(); - console.log('Booking submitted:', bookingForm); setIsBookingModalOpen(false); setBookingForm({ companyName: '', @@ -484,7 +480,6 @@ export function LearningFacility() { }; const handleBookingModalClose = (open: boolean) => { - console.log('Booking modal close triggered, open:', open); // Debug log setIsBookingModalOpen(open); if (!open) { @@ -541,7 +536,6 @@ export function LearningFacility() {