Skip to content

feat(booking-calendar): add free integration shell - #193

Open
RishadAlam wants to merge 5 commits into
mainfrom
feat/booking-calendar
Open

feat(booking-calendar): add free integration shell#193
RishadAlam wants to merge 5 commits into
mainfrom
feat/booking-calendar

Conversation

@RishadAlam

Copy link
Copy Markdown
Member

Description

Adds the Booking Calendar integration shell to Bit Integrations Free, including setup UI, registration, logo, and backend dispatch routes. It also adds booking/resource refresh endpoints and keeps boolean options in the Utilities section.

Motivation & Context

This lets users configure Booking Calendar create/update booking actions from the Free UI while keeping actual execution Pro-only. Fetchable IDs are handled with dropdowns instead of field mapping.

Related Links: (if applicable)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ⚡ Improvement
  • 🔄 Code refactor

Key Changes

Integration

  • Added Booking Calendar action shell and registration.
  • Added create/update booking setup screens.
  • Added booking and resource dropdown refresh endpoints.

Frontend

  • Added Booking Calendar wizard, edit, info, field map, logo, and action selector entry.
  • Updated boolean booking options to use the Utilities section.

Backend

  • Added Free action controller, routes, and Pro hook dispatch.
  • Fixed Booking Calendar activation message wording.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated if needed
  • README updated if needed

Changelog

  • Feature: Added Booking Calendar create/update booking setup.
  • Improvement: Added booking/resource dropdown refreshes for easier setup.
  • Fix: Corrected Booking Calendar activation message text.

Copilot AI review requested due to automatic review settings July 9, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new integration for the Booking Calendar plugin, adding backend controllers, helpers, and routes, alongside frontend components for authorization, action mapping, and configuration editing. The review feedback highlights two important improvements: preventing a potential undefined array key warning in BookingCalendarController.php when $formFields is empty, and adding a .catch block to the asynchronous authorization request in BookingCalendarAuthorization.jsx to ensure robust error handling and proper resetting of loading states.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +48 to +50
if (!empty($formFields[0]['value'])) {
$label .= ' - ' . $formFields[0]['value'];
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If $formFields is empty, attempting to access $formFields[0]['value'] will trigger an undefined array key warning in PHP 8.0+. Verify that $formFields is not empty before accessing its elements.

            if (!empty($formFields) && !empty($formFields[0]['value'])) {
                $label .= ' - ' . $formFields[0]['value'];
            }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented. The booking label now checks that parsed form fields are non-empty before reading the first value.

Comment on lines +21 to +34
const authorizeHandler = () => {
setIsLoading('auth')
bitsFetch({}, 'booking_calendar_authorize').then(result => {
if (result?.success) {
setIsAuthorized(true)
setSnackbar?.({
show: true,
msg: __('Connected with Booking Calendar Successfully', 'bit-integrations')
})
}
setIsLoading(false)
setShowAuthMsg(true)
})
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When handling asynchronous API requests, always append a .catch block to ensure that loading states are reset and error messages are displayed if the request fails or encounters a network error.

Suggested change
const authorizeHandler = () => {
setIsLoading('auth')
bitsFetch({}, 'booking_calendar_authorize').then(result => {
if (result?.success) {
setIsAuthorized(true)
setSnackbar?.({
show: true,
msg: __('Connected with Booking Calendar Successfully', 'bit-integrations')
})
}
setIsLoading(false)
setShowAuthMsg(true)
})
}
const authorizeHandler = () => {
setIsLoading('auth')
bitsFetch({}, 'booking_calendar_authorize')
.then(result => {
if (result?.success) {
setIsAuthorized(true)
setSnackbar?.({
show: true,
msg: __('Connected with Booking Calendar Successfully', 'bit-integrations')
})
}
setIsLoading(false)
setShowAuthMsg(true)
})
.catch(() => {
setIsLoading(false)
setShowAuthMsg(true)
})
}
References
  1. When handling asynchronous API requests, always append a .catch block to ensure that loading states are reset and error messages are displayed if the request fails or encounters a network error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented. Authorization now has a catch handler and a finally block so loading/message state is reset on request failure as well.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
3 0 3

⚠️ Warnings (3)

📁 backend/Actions/BookingCalendar/BookingCalendarController.php (2 warnings)
📍 Line 🔖 Check 💬 Message
36 WordPress.DB.PreparedSQL.InterpolatedNotPrepared Use placeholders and $wpdb->prepare(); found interpolated variable {$table} at "SELECT booking_id, form FROM {$table} ORDER BY booking_id DESC LIMIT 500"
119 WordPress.DB.PreparedSQL.InterpolatedNotPrepared Use placeholders and $wpdb->prepare(); found interpolated variable {$table} at "SELECT * FROM {$table} ORDER BY title ASC, booking_type_id ASC"
📁 readme.txt (1 warning)
📍 Line 🔖 Check 💬 Message
0 mismatched_plugin_name Plugin name "Bit integrations - Form Integration, Webhook, Spreadsheets, CRM, LMS & Email Automation" is different from the name declared in plugin header "Bit Integrations".

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Copilot AI review requested due to automatic review settings July 9, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 18, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants