Merge pull request 'feature/codeant-full-review' (#2) from feature/codeant-full-review into main
All checks were successful
CodeAnt AI Review - Stage 1 / codeant-review (push) Successful in 54s

Reviewed-on: #2
This commit is contained in:
2026-03-29 21:39:43 +00:00
11 changed files with 24 additions and 30 deletions

View File

@@ -29,8 +29,19 @@ jobs:
env:
CODEANT_API_TOKEN: ${{ secrets.CODEANT_API_TOKEN }}
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
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
run: |
@@ -48,8 +59,9 @@ jobs:
- name: Run CodeAnt Review
run: |
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
codeant review --last-commit > review.txt || true
echo "Running last-commit review"
codeant review --last-commit 2>&1 | tee review.txt || true
fi
cat review.txt

View File

@@ -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();

View File

@@ -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
}
};

View File

@@ -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

View File

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

View File

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

View File

@@ -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();

View File

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

View File

@@ -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() {
<Button
variant="outline"
onClick={() => {
console.log('Book Facility button clicked');
setIsBookingModalOpen(true);
}}
data-booking-trigger

View File

@@ -3,6 +3,7 @@ export const getReadingTime = (text: string): string => {
// Remove HTML tags if present
const cleanText = text.replace(/<[^>]+>/g, "");
if (!cleanText.trim()) return "0 min read";
// Count words
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"
*/
export const getSlugWithId = (title: string, id: string) => {
return `${createSlug(title)}-${id}`;
const normalizedId = id.trim();
return `${createSlug(title)}-${normalizedId}`;
};
/**