feature/codeant-full-review #2

Merged
Rajendra.Reddy merged 3 commits from feature/codeant-full-review into main 2026-03-29 21:39:44 +00:00
11 changed files with 24 additions and 30 deletions

View File

@@ -29,8 +29,19 @@ jobs:
env: env:
CODEANT_API_TOKEN: ${{ secrets.CODEANT_API_TOKEN }} CODEANT_API_TOKEN: ${{ secrets.CODEANT_API_TOKEN }}
run: | run: |
if [ -z "${CODEANT_API_TOKEN}" ]; then
echo "ERROR: CODEANT_API_TOKEN secret is not set in repository settings."
echo "Go to: Settings → Secrets → Add Secret → Name: CODEANT_API_TOKEN"
exit 1
fi
mkdir -p $HOME/.codeant mkdir -p $HOME/.codeant
printf '{"apiKey":"%s"}\n' "$CODEANT_API_TOKEN" > $HOME/.codeant/config.json printf '{"apiKey":"%s","baseUrl":"https://service.codeant.ai"}\n' "$CODEANT_API_TOKEN" > $HOME/.codeant/config.json
echo "Config written (key length: ${#CODEANT_API_TOKEN})"
- name: Verify CodeAnt connectivity
run: |
echo "Base URL: $(codeant get-base-url)"
echo "CLI version: $(codeant --version)"
- name: Debug Commit Info - name: Debug Commit Info
run: | run: |
@@ -48,8 +59,9 @@ jobs:
- name: Run CodeAnt Review - name: Run CodeAnt Review
run: | run: |
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF}" ]; then if [ "${GITHUB_EVENT_NAME}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF}" ]; then
codeant review --base "${GITHUB_BASE_REF}" > review.txt || true echo "Running PR review against base: ${GITHUB_BASE_REF}"
codeant review --base "${GITHUB_BASE_REF}" 2>&1 | tee review.txt || true
else else
codeant review --last-commit > review.txt || true echo "Running last-commit review"
codeant review --last-commit 2>&1 | tee review.txt || true
fi fi
cat review.txt

View File

@@ -38,7 +38,6 @@ export function BookingModal({ isOpen, onClose, initialFacilityZone = "" }: Book
const handleBookingSubmit = (e: React.FormEvent) => { const handleBookingSubmit = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
console.log('Booking form submitted:', bookingForm);
// Here you would typically send the form data to your backend // Here you would typically send the form data to your backend
alert('Booking request submitted successfully! We will contact you within 24 hours.'); alert('Booking request submitted successfully! We will contact you within 24 hours.');
onClose(); onClose();

View File

@@ -9,7 +9,6 @@ interface CTAPopupModalProps {
} }
export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) { export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) {
console.log('CTAPopupModal render - isOpen:', isOpen); // Debug log
const handleVirtualTour = () => { const handleVirtualTour = () => {
navigateTo('/services/learning-facility'); navigateTo('/services/learning-facility');
@@ -25,7 +24,6 @@ export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) {
}; };
const handleBooking = () => { const handleBooking = () => {
console.log('Booking button clicked in modal'); // Debug log
// Use URL parameter approach for more reliable booking modal triggering // Use URL parameter approach for more reliable booking modal triggering
navigateTo('/services/learning-facility?autoBooking=true'); navigateTo('/services/learning-facility?autoBooking=true');
@@ -33,14 +31,10 @@ export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) {
// Also try the element-based approach as backup // Also try the element-based approach as backup
const attemptBookingTrigger = (attempt = 1, maxAttempts = 5) => { const attemptBookingTrigger = (attempt = 1, maxAttempts = 5) => {
console.log(`Booking trigger attempt #${attempt}`); // Debug log
// Look for the booking trigger element // Look for the booking trigger element
const bookingBtn = document.querySelector('[data-booking-trigger]') as HTMLButtonElement; const bookingBtn = document.querySelector('[data-booking-trigger]') as HTMLButtonElement;
console.log('Found booking trigger:', bookingBtn); // Debug log
if (bookingBtn) { if (bookingBtn) {
console.log('Clicking booking trigger...'); // Debug log
bookingBtn.click(); bookingBtn.click();
return; return;
} }
@@ -48,8 +42,6 @@ export function CTAPopupModal({ isOpen, onClose }: CTAPopupModalProps) {
// If not found and we haven't reached max attempts, try again // If not found and we haven't reached max attempts, try again
if (attempt < maxAttempts) { if (attempt < maxAttempts) {
setTimeout(() => attemptBookingTrigger(attempt + 1, maxAttempts), 200); setTimeout(() => attemptBookingTrigger(attempt + 1, maxAttempts), 200);
} else {
console.log('Element-based approach failed, relying on URL parameter approach'); // Debug log
} }
}; };

View File

@@ -38,11 +38,9 @@ export function Contact({ topic }: ContactProps) {
const [createLead] = useCreateLeadMutation(); const [createLead] = useCreateLeadMutation();
useEffect(() => { useEffect(() => {
console.log('Contact component mounted with topic:', topic);
// Set default interested in based on topic parameter // Set default interested in based on topic parameter
if (topic) { if (topic) {
const interestedIn = getTopicSubject(topic); const interestedIn = getTopicSubject(topic);
console.log('Setting form interestedIn to:', interestedIn);
setFormData(prev => ({ setFormData(prev => ({
...prev, ...prev,
interestedIn: interestedIn interestedIn: interestedIn

View File

@@ -4,7 +4,6 @@ const listeners: (() => void)[] = [];
export function navigateTo(path: string) { export function navigateTo(path: string) {
try { try {
console.log(`Navigating to: ${path}`);
// Update current path // Update current path
currentPath = path; currentPath = path;

View File

@@ -91,7 +91,7 @@ export function StatsSection({ stats = [], isLoading }: StatsSectionProps) {
<PrimaryCTAButton <PrimaryCTAButton
text="About Us" text="About Us"
onClick={() => console.log("About us clicked")} onClick={() => {}}
ariaLabel="Learn more about KLC" ariaLabel="Learn more about KLC"
/> />
</div> </div>

View File

@@ -208,7 +208,6 @@ function BookingModal({
const handleFormSubmit = (e: React.FormEvent) => { const handleFormSubmit = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
console.log('Booking form submitted:', bookingForm);
// Here you would typically send the form data to your backend // Here you would typically send the form data to your backend
alert('Booking request submitted successfully! We will contact you soon.'); alert('Booking request submitted successfully! We will contact you soon.');
onClose(); onClose();

View File

@@ -310,7 +310,6 @@ export function VirtualTour() {
const handleBookingSubmit = (e: React.FormEvent) => { const handleBookingSubmit = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
console.log('Booking submitted:', bookingForm);
setIsBookingModalOpen(false); setIsBookingModalOpen(false);
setBookingForm({ setBookingForm({
companyName: '', companyName: '',

View File

@@ -415,12 +415,10 @@ export function LearningFacility() {
}); });
useEffect(() => { useEffect(() => {
console.log('LearningFacility component mounted'); // Debug log
window.scrollTo(0, 0); window.scrollTo(0, 0);
// Listen for custom booking modal event from CTAPopupModal // Listen for custom booking modal event from CTAPopupModal
const handleOpenBookingModal = () => { const handleOpenBookingModal = () => {
console.log('Custom booking modal event received'); // Debug log
setIsBookingModalOpen(true); setIsBookingModalOpen(true);
}; };
@@ -429,7 +427,6 @@ export function LearningFacility() {
// Also check if we should auto-open the booking modal based on URL parameters // Also check if we should auto-open the booking modal based on URL parameters
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('autoBooking') === 'true') { if (urlParams.get('autoBooking') === 'true') {
console.log('Auto-opening booking modal from URL parameter'); // Debug log
setTimeout(() => setIsBookingModalOpen(true), 100); setTimeout(() => setIsBookingModalOpen(true), 100);
} }
@@ -461,7 +458,6 @@ export function LearningFacility() {
const handleBookingSubmit = (e: React.FormEvent) => { const handleBookingSubmit = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
console.log('Booking submitted:', bookingForm);
setIsBookingModalOpen(false); setIsBookingModalOpen(false);
setBookingForm({ setBookingForm({
companyName: '', companyName: '',
@@ -484,7 +480,6 @@ export function LearningFacility() {
}; };
const handleBookingModalClose = (open: boolean) => { const handleBookingModalClose = (open: boolean) => {
console.log('Booking modal close triggered, open:', open); // Debug log
setIsBookingModalOpen(open); setIsBookingModalOpen(open);
if (!open) { if (!open) {
@@ -541,7 +536,6 @@ export function LearningFacility() {
<Button <Button
variant="outline" variant="outline"
onClick={() => { onClick={() => {
console.log('Book Facility button clicked');
setIsBookingModalOpen(true); setIsBookingModalOpen(true);
}} }}
data-booking-trigger data-booking-trigger

View File

@@ -3,6 +3,7 @@ export const getReadingTime = (text: string): string => {
// Remove HTML tags if present // Remove HTML tags if present
const cleanText = text.replace(/<[^>]+>/g, ""); const cleanText = text.replace(/<[^>]+>/g, "");
if (!cleanText.trim()) return "0 min read";
// Count words // Count words
const words = cleanText.trim().split(/\s+/).length; const words = cleanText.trim().split(/\s+/).length;

View File

@@ -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" * 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) => { export const getSlugWithId = (title: string, id: string) => {
return `${createSlug(title)}-${id}`; const normalizedId = id.trim();
return `${createSlug(title)}-${normalizedId}`;
}; };
/** /**