Commit Graph

1361 Commits

Author SHA1 Message Date
Fringg
9aae9cc0e6 fix: mobile layout overflow on landing page
- Add min-w-0 to grid children to prevent CSS Grid blowout on mobile
- Add break-words to SanitizedHtml to wrap long URLs in footer text
2026-03-08 14:58:23 +03:00
Fringg
bda95ed23f fix: show infinity symbol for unlimited traffic on landing page
Display ∞ instead of 0 when traffic_limit_gb is 0 (unlimited),
matching the pattern used in TrialOfferCard and Dashboard.
2026-03-08 14:26:05 +03:00
Fringg
f1102d2783 fix: add purchase-options cache invalidation on balance changes
- WebSocketNotifications: invalidate purchase-options on all 10 balance-affecting events
- Dashboard: invalidate purchase-options after trial activation
- Balance: invalidate purchase-options after payment return and promocode activation
- PromoOffersSection: invalidate purchase-options and balance after promo claim
2026-03-08 14:17:45 +03:00
c0mrade
71a0111a04 revert: remove device manager redesign, restore original device UI 2026-03-08 01:00:21 +03:00
c0mrade
6dc8ca0d18 fix: unify device manager into additional options card with unbounded dot selector 2026-03-08 00:45:47 +03:00
c0mrade
edb7ef0488 feat: unified device manager with dot-based selector
Replace separate buy/reduce device sections with a single DeviceManager component featuring a dot-step selector for intuitive device limit adjustment.
2026-03-08 00:17:04 +03:00
c0mrade
7bb75aa920 fix: use platform-conditional replace for QR navigation to preserve Telegram back behavior 2026-03-07 23:35:06 +03:00
c0mrade
8ce4b1a24a refactor: move ConnectionQR into standard Layout with proper navigation
- Wrap /connection/qr route in ProtectedRoute with Layout
- Remove fullscreen overlay and custom close button
- Add AdminBackButton with replace prop to avoid history cycles
- Use replace navigation from Connection to QR page
- Add replace prop support to AdminBackButton component
2026-03-07 23:25:33 +03:00
Fringg
eed077b019 feat: add gift purchase UI states for telegram recipients
- Add recipient_in_bot and bot_link fields to PurchaseStatus API type
- Show bot link instruction when gift recipient is not in bot
- Show "gift sent via Telegram" message when recipient is in bot
- Fix duplicate text rendering in GiftPendingActivationState
- Handle recipientInBot=null edge case safely
- Add gift notification translations for ru, en, zh, fa locales
2026-03-07 20:33:55 +03:00
Egor
d8214a80e7 Merge pull request #260 from BEDOLAGA-DEV/main
w
2026-03-07 17:42:45 +03:00
Egor
818bbc2398 Merge pull request #259 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.26.0
2026-03-07 17:23:55 +03:00
github-actions[bot]
fe1d50970f chore(main): release 1.26.0 2026-03-07 14:23:21 +00:00
Egor
36d98669c2 Merge pull request #258 from BEDOLAGA-DEV/dev
Dev
2026-03-07 17:22:56 +03:00
Egor
ca938559f3 Merge pull request #257 from BEDOLAGA-DEV/main
w
2026-03-07 17:21:36 +03:00
Fringg
32091d3648 fix: replace deprecated Telegram Login Widget redirect with callback
Telegram deprecated the data-auth-url redirect flow, which returns a
blank page with "deprecated" text. Switch both TelegramLinkWidget
(account linking) and TelegramLoginButton (legacy login) to use
data-onauth callback approach that works client-side without redirects.
2026-03-07 16:15:20 +03:00
Fringg
68e6ce1bce fix: send Bearer token on email register (link to Telegram account)
/cabinet/auth/email/register requires authentication (links email to
existing Telegram account) but was in the AUTH_ENDPOINTS skip-list,
causing the request interceptor to omit the Bearer token → 401.

Change the skip-list entry to the specific /standalone path which
genuinely doesn't need a Bearer token.
2026-03-07 15:59:45 +03:00
Fringg
66bb86a5f2 fix: allow animated background to show through on landing pages
The root div had an opaque bg-dark-950 that covered the portal-rendered
animated background at zIndex:-2. Remove the opaque background when
background_config is present, matching the AppShell pattern.
2026-03-07 15:34:59 +03:00
Fringg
0ce74ea5fb fix: rename duplicate 'purchases' i18n key to 'purchaseCount'
The admin.landings namespace had two 'purchases' keys at the same level:
a string for purchase count label and an object for purchases section.
JSON last-key-wins caused the string to be overwritten by the object,
producing "returned an object instead of string" error on landings list.
2026-03-07 13:22:08 +03:00
Fringg
a404690334 feat: add configurable animated background for landing pages
Extract BackgroundConfigEditor as reusable controlled component from
BackgroundEditor. Add background settings section to landing editor.
Render per-landing backgrounds on public purchase pages.

- Extract BackgroundConfigEditor (value/onChange) from BackgroundEditor
- Refactor BackgroundEditor to thin wrapper with API persistence
- Add StaticBackgroundRenderer for prop-based config (public pages)
- Add background_config to landing API types and editor form
- Render animated background on QuickPurchase page
2026-03-07 12:46:05 +03:00
Fringg
887b13dec2 feat: add purchases list with pagination to landing stats page
Add card-based purchase list below charts with:
- Status filter dropdown (all/pending/paid/delivered/etc)
- Paginated card list with contact, gift recipient, tariff, price
- Status badges, responsive mobile/desktop layout
- Translations for ru/en
2026-03-07 09:50:03 +03:00
Fringg
30190199ed feat: add landing page statistics page with recharts
Add AdminLandingStats page with:
- Summary cards (purchases, revenue, gifts, conversion)
- AreaChart with dual Y-axis (daily purchases + revenue)
- BarChart (tariff distribution)
- PieChart donut (gift vs regular breakdown)
- Responsive layout for desktop and mobile
- Stats button on landing cards list

Includes API types, route, translations (ru/en).
2026-03-07 09:36:20 +03:00
Egor
c544b035c4 Merge pull request #254 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.25.0
2026-03-07 07:27:42 +03:00
github-actions[bot]
8465761236 chore(main): release 1.25.0 2026-03-07 04:27:17 +00:00
Egor
099f411327 Merge pull request #253 from BEDOLAGA-DEV/dev
Dev
2026-03-07 07:26:35 +03:00
Egor
63920a04c9 Merge pull request #252 from BEDOLAGA-DEV/main
w
2026-03-07 07:19:47 +03:00
Fringg
46f640a7e0 fix: add pagination to campaigns list
The campaigns page was fetching only the first 50 items with no way
to load more. Switched from useQuery to useInfiniteQuery with a
"Load more" button so all campaigns are accessible.
2026-03-07 07:04:56 +03:00
Fringg
f7afa002f0 feat: add discount UI for landing pages
Add discount configuration in admin editor and countdown timer
display on public purchase page.

- Add discount section to AdminLandingEditor with toggle, percent
  slider, datetime pickers, per-tariff overrides, live preview
- Add DiscountBanner with countdown timer to QuickPurchase page
  using AnimatePresence exit animation and proper interval cleanup
- Add strikethrough prices and discount badges to tariff cards,
  summary card and pay button with null/equality guards
- Add discount translations for ru and en locales
- Fix delete/toggle API return types to match backend contracts
- Fix isoToDatetimeLocal to preserve seconds on re-edit
- Fix preview rounding to match backend integer division
2026-03-07 07:01:46 +03:00
Fringg
c3cf805827 refactor: load RBAC users from API for audit log user filter
Instead of extracting users from log entries, fetch all users
with RBAC roles via dedicated endpoint for complete user list.
2026-03-07 06:23:39 +03:00
Fringg
40722747e3 feat: add user filter chips and resource types to audit log
- Replace user ID text input with checkbox-style user chips extracted from log entries
- Add sales_stats and landings to resource type filter
- Fix export not respecting status filter
- Remove dead auto-refresh interval code
- Add aria-pressed and focus-visible styles for accessibility
2026-03-07 06:17:25 +03:00
Fringg
5228b2dea6 feat: add landings permission section translations for role editor 2026-03-07 06:04:57 +03:00
Fringg
97959b0132 fix: prevent buyer from activating gift pending subscription
When a gift purchase results in pending_activation (recipient has active
subscription), the buyer was shown an Activate button and could replace
the recipient's subscription without consent.

- Add GiftPendingActivationState component showing "Gift sent" message
- Use ?activate=1 URL hint from recipient email to distinguish viewer
- Buyer sees success message, recipient sees activate button
- Add giftPendingActivationDesc translations (ru, en, zh, fa)
2026-03-07 06:00:17 +03:00
Fringg
bc45294487 feat: add external squad selection to tariff admin form
- Add ExternalSquadInfo type and getAvailableExternalSquads API method
- Add external_squad_uuid field to TariffDetail, TariffCreateRequest, TariffUpdateRequest
- Add radio-button external squad picker in Servers tab of tariff create/edit
- Add translations for external squad UI in all 4 locales (en, ru, zh, fa)
2026-03-07 05:44:29 +03:00
Fringg
b7c7decfd0 fix: adapt admin landings list for mobile layout
- Badges (active/inactive, gift) now wrap on narrow screens
- Action buttons move to a separate row on mobile (hidden/shown via sm:)
- Delete button pushed to the right on mobile for safety
- Reduced padding and gaps on small screens
- Desktop layout unchanged
2026-03-07 04:56:12 +03:00
Fringg
6d5c6fb9b3 fix: mobile layout and period label translations for quick purchase landing
- Add i18n period labels (ru/en/zh/fa) instead of backend English-only labels
- Period tabs wrap on mobile instead of horizontal scroll
- Prevent horizontal overflow shifting the layout
2026-03-07 04:04:39 +03:00
Fringg
dfa7a09a7c fix: add unmount safety guard to OIDC callback handler
Prevent stale navigate('/') and setState calls after unmount
using mountedRef pattern.
2026-03-07 03:27:14 +03:00
Fringg
b335d666c2 fix: OIDC login UX improvements from review
- Add loading state on button click (not just after callback)
- Add onerror handler for script load failure
- Disable button until OIDC script is loaded
2026-03-07 03:18:49 +03:00
Fringg
45e68ffac2 fix: safe error handling and numeric client_id in OIDC login
- Replace unsafe `as` cast with runtime type guard
- Pass client_id as Number() per Telegram OIDC spec
- Update TypeScript type to string | number
2026-03-07 03:04:46 +03:00
Fringg
5c11f1251a fix: address code review findings for TelegramLoginButton
- Replace useCallback with ref pattern to prevent stale closures and
  unnecessary Telegram.Login.init() re-calls
- Make isOIDC a proper boolean with Boolean() wrapper
- Clear previous error on successful login attempt
- Remove hardcoded fallback string from t() call
2026-03-07 02:51:18 +03:00
Fringg
c221c6e8bf feat: add i18n translations and admin category for Telegram OIDC 2026-03-07 02:40:04 +03:00
Fringg
91f0e9e2fc feat: TelegramLoginButton with OIDC popup + legacy widget fallback
- Add oidc_enabled/oidc_client_id to TelegramWidgetConfig interface and fallback
- Add loginTelegramOIDC API method for id_token auth
- Add loginWithTelegramOIDC to auth store
- Rewrite TelegramLoginButton: OIDC popup when enabled, legacy widget otherwise
- Extend Window.Telegram type with Login SDK in vite-env.d.ts
2026-03-07 02:37:12 +03:00
Fringg
2c65ca8a7f feat: migrate Telegram Login Widget to v23 with admin-configurable settings
- Upgrade telegram-widget.js from v22 to v23 (TelegramLoginButton + ConnectedAccounts)
- TelegramLoginButton fetches widget config from API instead of hardcoded values
- Add TelegramWidgetConfig type and API method with fallback to env defaults
- Remove botUsername prop — now sourced from backend API
- Add useEffect cleanup to prevent orphaned iframes on unmount
- Add TELEGRAM_WIDGET category to admin interface settings menu
- Add i18n translations for widget settings (ru, en, zh, fa)
2026-03-07 01:48:18 +03:00
Fringg
83fbd0e445 fix: auto-select single sub-option and remove unused return_url field
- Auto-select sub-option even when only 1 exists (backend needs suffix)
- Remove return_url from public LandingPaymentMethod (backend doesn't send it)
- Add else branch in auto-select for defensive null reset
2026-03-07 00:01:47 +03:00
Fringg
58e93cd2b7 feat: add payment sub-option selection on quick purchase page
Show sub-options (e.g. СБП, Карта) as selectable buttons when a
payment method has multiple enabled variants. Send suffixed
payment_method ID to backend for correct provider routing.
Split LandingPaymentMethod into public and admin types.
2026-03-06 23:53:31 +03:00
Fringg
d0be127d30 feat: add sub-options UI for landing payment methods + extract components
Add interactive sub-option toggles (Card/SBP/Crypto) to the landing editor
payment method configuration. Extract SortableFeatureItem and
SortableSelectedMethodCard into dedicated component files to reduce
AdminLandingEditor from ~1160 to ~860 lines.
2026-03-06 23:30:53 +03:00
Fringg
b9f1f59e3c fix: show total purchase count instead of paid on admin landings 2026-03-06 22:16:41 +03:00
Fringg
d228d997d8 feat: guest purchase cabinet credentials UI
- CabinetCredentialsState with copyable email/password fields
- Auto-login via JWT token with checkAdminStatus
- /auto-login route with ErrorBoundary and no-referrer meta
- Narrowed contact_type to 'email' | 'telegram' | null
- Disabled button styling for PendingActivation go-to-cabinet
- i18n: added landing.copy key to all 4 locales
2026-03-06 21:59:59 +03:00
Fringg
b852e1e4cd feat: guest purchase activation UI & landing editor improvements
- Add PendingActivationState component with activate button
- Add double-click ref guard on activation handler
- Add activatePurchase API function
- Update PurchaseStatus type with new fields
- Show gift message and recipient contact in success state
- Add pending activation i18n translations (ru, en, zh, fa)
- Improve AdminLandingEditor with allowed_periods support
2026-03-06 19:56:38 +03:00
Fringg
9bd58cb914 fix: handle Pydantic validation errors in notify + nullify empty optional fields
- getApiErrorMessage now formats Pydantic [{loc, msg}] arrays as readable strings
- LandingPaymentMethod description/icon_url nullable
- Send null instead of empty string for optional payment method fields
2026-03-06 18:03:27 +03:00
Fringg
6755c1dc45 fix: landing list crash — title is now LocaleDict, not string
- Update LandingListItem.title type to LocaleDict
- Add resolveLocaleDisplay() helper for extracting display string
- Use resolveLocaleDisplay() in landing list and delete confirm
2026-03-06 17:00:05 +03:00
Fringg
6a92814ce2 fix: admin landing editor — tariff period mapping and cleanup
- Use data.id instead of positional index for tariffPeriodsMap
- Clean up allowedPeriods when tariff is unchecked
- Filter out empty period arrays and orphaned tariff keys on submit
2026-03-06 16:55:13 +03:00