Wide BookingModal (2-col), RoomModal, RU channels, migration module, all modules active
- BookingModal: 2-column layout (size=2xl/max-w-3xl), no scroll needed; hourly mode toggle for rooms with allowHourly=true - RoomModal: full add/edit form with hourly rate toggle and amenities checkboxes; RoomsPage wired up - Channel manager: Яндекс Путешествия, Островок, Суточно.ру, OneTwoTrip added; split into RU/International sections - Migration module: 3-step wizard (source select → file upload → progress/results) - All modules set to active by default (version bump to reset localStorage) - BookingCalendar booking blocks: guest count badge (Xг), unpaid red dot indicator Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,12 +5,17 @@ const DEFAULT_STATUSES: Record<string, ModuleStatus> = {
|
||||
'housekeeping': 'active',
|
||||
'channel-manager': 'active',
|
||||
'wifi-auth': 'active',
|
||||
'payments': 'trial',
|
||||
'tv-welcome': 'inactive',
|
||||
'smart-locks': 'inactive',
|
||||
'payments': 'active',
|
||||
'tv-welcome': 'active',
|
||||
'smart-locks': 'active',
|
||||
'olap-reports': 'active',
|
||||
'website-builder': 'inactive',
|
||||
'booking-widget': 'inactive',
|
||||
'website-builder': 'active',
|
||||
'booking-widget': 'active',
|
||||
'pos': 'active',
|
||||
'reviews': 'active',
|
||||
'room-service': 'active',
|
||||
'rental': 'active',
|
||||
'migration': 'active',
|
||||
}
|
||||
|
||||
interface ModulesContextValue {
|
||||
@@ -21,9 +26,18 @@ interface ModulesContextValue {
|
||||
|
||||
const ModulesContext = createContext<ModulesContextValue | null>(null)
|
||||
|
||||
const MODULES_VERSION = '2'
|
||||
|
||||
export function ModulesProvider({ children }: { children: React.ReactNode }) {
|
||||
const [statuses, setStatuses] = useState<Record<string, ModuleStatus>>(() => {
|
||||
try {
|
||||
// Reset stored statuses when version changes so new defaults apply
|
||||
const storedVersion = localStorage.getItem('hotelsync-modules-ver')
|
||||
if (storedVersion !== MODULES_VERSION) {
|
||||
localStorage.removeItem('hotelsync-modules')
|
||||
localStorage.setItem('hotelsync-modules-ver', MODULES_VERSION)
|
||||
return DEFAULT_STATUSES
|
||||
}
|
||||
const stored = localStorage.getItem('hotelsync-modules')
|
||||
return stored ? { ...DEFAULT_STATUSES, ...JSON.parse(stored) } : DEFAULT_STATUSES
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user