Commit Graph

1513 Commits

Author SHA1 Message Date
Fringg
8ab740f8cb fix: route PendingGiftCard to gift activation tab instead of landing endpoint
PendingGiftCard was linking to /buy/success/:token which uses the landing
API (exact token match). Since gift tokens are now truncated to 12 chars
in API responses, this caused 404s. Route to /gift?tab=activate&code=
which uses the gift API with prefix-based lookup.
2026-03-10 07:08:13 +03:00
Fringg
51cc1221d0 fix: add null guard for purchase_token before rendering CodeOnlySuccessState 2026-03-10 06:56:16 +03:00
Fringg
7945071893 refactor: rename GIFTCODE_ start parameter prefix to GIFT_ 2026-03-10 06:48:57 +03:00
Fringg
7549ae70eb feat: show localized error for self-activation attempt 2026-03-10 06:45:14 +03:00
Fringg
51ec799c0c feat: split my gifts into Active/Activated/Received sections
Sent gifts are now sorted into "Active gifts" (awaiting activation)
and "Activated" (already used). Received gifts remain separate.
2026-03-10 06:39:50 +03:00
Fringg
73d67bceed fix: use short 12-char code in bot and cabinet share links
GIFTCODE_ prefix (9 chars) + full 64-char token = 73 chars,
exceeding Telegram's 64-char start parameter limit. Now all
share links use the same short code shown in the UI (first 12
chars). Backend already supports prefix-based lookup.
2026-03-10 06:30:49 +03:00
Fringg
b213535738 fix: remove dark backdrop overlay from share modal 2026-03-10 06:25:06 +03:00
Fringg
a627eb0b30 fix: gift code display + share modal backdrop
- Don't uppercase gift codes (tokens are case-sensitive base64)
- Lighten share modal backdrop (bg-dark-900/40 instead of bg-black/60)
2026-03-10 06:20:29 +03:00
Fringg
d852bfe969 fix: activation broken — token uppercased + wrong env var for bot username
- Remove .toUpperCase() from activation code input — tokens are case-sensitive base64
- Fix VITE_BOT_USERNAME → VITE_TELEGRAM_BOT_USERNAME (correct env var name)
- Add Escape key handler, scroll lock, role="dialog" to ShareModal
2026-03-10 06:13:50 +03:00
Fringg
1bafcca1ef fix: gift UI improvements — declension, GB display, share modal, deep links
- Fix Russian device count declension (_one/_few/_many)
- Show traffic GB and tariff description in buy tab
- Replace copy/share buttons with share modal (bot + cabinet links)
- GiftResult: code-only success state with formatted share message
- Support ?tab=activate&code=TOKEN for auto-activation via cabinet link
- Add is_code_only + purchase_token to API types
2026-03-10 06:03:28 +03:00
Fringg
af3e535c69 feat: gift subscription redesign — code-only purchase + 3-tab UI
- Remove recipient input from buy flow (code-only gifts)
- 3-tab UI: Buy, Activate, My Gifts with animations
- After purchase, switch to My Gifts tab to show gift code
- Gift code display with copy/share buttons
- Activate tab: enter gift code to activate subscription
- My Gifts tab: sent/received gifts with status badges
- Fix: use navigator.language instead of hardcoded ru-RU for dates
- Fix: spread array before sort to prevent React Query cache mutation
- Fix: ARIA tab linkage with proper id/aria-labelledby
- Fix: guard VITE_BOT_USERNAME against undefined in share URLs
- Fix: wrap clipboard/share fallbacks in try/catch
- Add error state to MyGiftsTabContent
2026-03-10 05:37:57 +03:00
Egor
f57593ea67 Merge pull request #271 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.29.1
2026-03-10 03:40:43 +03:00
github-actions[bot]
eea0520b6a chore(main): release 1.29.1 2026-03-10 00:40:05 +00:00
Egor
574212811a Merge pull request #270 from BEDOLAGA-DEV/dev
Dev
2026-03-10 03:39:44 +03:00
Egor
d946c83357 Merge pull request #269 from BEDOLAGA-DEV/main
w
2026-03-10 03:37:33 +03:00
Fringg
8629cfea18 fix: daily tariff renewal uses purchaseTariff instead of renewSubscription
- Expired daily tariffs now call purchaseTariff(tariff_id, 1) for 1-day purchase
- Balance check uses daily_price_kopeks for daily tariffs instead of 100 kopeks minimum
- Disabled daily tariffs still use togglePause for resume
2026-03-10 03:30:13 +03:00
Fringg
ea06ad1d8f fix: show fallback when tariff has no available periods for renewal
When all periods are removed from a tariff, users saw an empty
purchase form with no way to renew. Now shows a message explaining
the situation and a button to choose a different tariff.
2026-03-10 01:27:48 +03:00
Egor
0bc2acb5ec Merge pull request #268 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.29.0
2026-03-09 23:42:06 +03:00
github-actions[bot]
79fabc3e48 chore(main): release 1.29.0 2026-03-09 20:41:52 +00:00
Egor
8351c93bec Merge pull request #267 from BEDOLAGA-DEV/dev
Dev
2026-03-09 23:41:22 +03:00
Egor
4ac3792971 Merge pull request #266 from BEDOLAGA-DEV/main
w
2026-03-09 23:40:15 +03:00
Fringg
638844ef47 feat: add open_in setting for custom buttons (external browser / Telegram miniapp) 2026-03-09 23:33:05 +03:00
Fringg
082471bf92 feat: add button reordering within rows and replace modal with inline add panel
- Add up/down arrow buttons to reorder buttons within rows (builtin + custom)
- Replace AddButtonDialog modal (bg-black/50 overlay) with inline expandable panel
- Add moveUp/moveDown i18n keys for all locales (en/ru/zh/fa)
- Add aria-labels for accessibility on reorder buttons
2026-03-09 23:26:16 +03:00
Fringg
23aa86f1a8 feat: add menu editor tab with drag-and-drop rows, custom URL buttons, and button configuration
- Add menuLayout.ts API client with normalizeConfig and type definitions
- Add MenuEditorTab.tsx with DnD rows, button CRUD, style/emoji/label editors
- Replace ButtonsTab with MenuEditorTab on admin settings page
- Add menu editor translations for ru, en, zh, fa locales
- Loading/error states, useMemo optimizations, proper ref patterns
2026-03-09 23:07:38 +03:00
Fringg
78fda22679 fix: add missing nameRequired i18n key for promo group form validation 2026-03-09 22:16:37 +03:00
Fringg
9c7ab4b789 fix: admin promo groups - add default toggle, fix threshold reset to 0
- Added is_default toggle to promo group create/edit form
- Send 0 instead of null when clearing auto-assign threshold
- Added isDefault i18n keys for ru, en, zh, fa
2026-03-09 22:08:43 +03:00
Fringg
dc740ae266 fix: restore session from refresh token when access token is missing
When access token is absent from sessionStorage (tab reopen, page refresh)
but refresh token exists in localStorage, the request interceptor now
attempts token refresh before sending the request. Previously it would
send the request without Authorization header, causing 401 errors on
endpoints like /cabinet/auth/email/register.
2026-03-09 21:58:46 +03:00
Fringg
45203dac59 fix: remove noreferrer from payment links to preserve Referer header
WATA DDoS Guard blocks requests without Referer (403 error).
Removed noreferrer from window.open and <a> tags on payment URLs.
noopener alone is sufficient for security (prevents window.opener access).
2026-03-09 21:53:55 +03:00
Fringg
4322d58ff8 feat: read gift warning from status response, soften poll error state
- Add warning field to GiftPurchaseStatus type
- Read warning from status response with URL param fallback
- Show PollErrorState for all poll errors (softer UX for gateway payments)
2026-03-09 21:26:02 +03:00
Fringg
622172f038 feat: add gradient fade indicators to scrollable desktop nav 2026-03-09 21:09:37 +03:00
Fringg
ab7d1b7f25 fix: make desktop nav horizontally scrollable on narrow screens 2026-03-09 21:05:36 +03:00
Fringg
c8ec221111 fix: remove bg-dark-950 from gift pages to preserve animated background 2026-03-09 21:03:05 +03:00
Fringg
9542607832 feat: add gift subscription toggle to admin branding settings
Add CABINET_GIFT_ENABLED toggle in Admin Settings > Branding > Interface Options,
alongside existing fullscreen and email auth toggles. Includes updateGiftEnabled
API method and i18n keys for all 4 locales (ru/en/zh/fa).
2026-03-09 20:56:42 +03:00
Fringg
6ea1de2e8a fix: harden gift subscription frontend after multi-agent review
- Handle expired status in GiftResult (stop polling + show FailedState)
- Add PollErrorState for balance mode poll errors (softer UX)
- Remove non-null assertions in handleSubmit (explicit narrowing)
- Wrap gift routes in ErrorBoundary
- Add pollErrorTitle/pollErrorDesc i18n keys to all 4 locales
2026-03-09 20:34:41 +03:00
Fringg
7890d480e0 feat: add gift navigation, routes, and i18n translations 2026-03-09 19:04:50 +03:00
Fringg
814b1f5e96 feat: add GiftSubscription and GiftResult pages 2026-03-09 18:56:16 +03:00
Fringg
a49520566e feat: add gift subscription API client and feature flag 2026-03-09 18:49:21 +03:00
Fringg
880b2d45fe fix: support OIDC mode in TelegramLinkWidget for account linking
TelegramLinkWidget used legacy widget only, ignoring OIDC config.
Now queries widgetConfig from backend, supports OIDC popup flow with
id_token, and falls back to bot_username from server config.
2026-03-09 06:23:02 +03:00
Egor
6e1e232150 Merge pull request #265 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.28.0
2026-03-09 05:07:59 +03:00
github-actions[bot]
7f3441a517 chore(main): release 1.28.0 2026-03-09 02:07:15 +00:00
Egor
16bf7c5f02 Merge pull request #264 from BEDOLAGA-DEV/dev
Dev
2026-03-09 05:06:49 +03:00
Fringg
6a9fdac75c refactor: extract shared payment status sets to utility module
- Move PAID_STATUSES/FAILED_STATUSES from Balance.tsx and TopUpResult.tsx
  to src/utils/paymentStatus.ts
- Eliminates code duplication between the two pages
2026-03-09 05:00:08 +03:00
Fringg
7ce5341e95 fix: support method query param fallback for external browser redirects
When payment providers redirect to external browser, sessionStorage is
unavailable. TopUpResult now reads method from URL query params and
polls via /latest endpoint as fallback.
2026-03-09 04:34:37 +03:00
Fringg
8897561fb2 fix: cover all payment provider statuses in TopUpResult
Add overpaid (PAL24) to PAID_STATUSES, system_fail and refund_paid
(Heleket) to FAILED_STATUSES. Harmonize Balance.tsx redirect detection
with the same full status sets and case-insensitive matching.
2026-03-09 04:08:28 +03:00
Fringg
b59122818c feat: add dedicated TopUpResult page for payment return flow
Replace toast-based payment return with animated result page showing
pending/success/failed/timeout states. Extract shared Spinner,
AnimatedCheckmark and AnimatedCrossmark components. Add sessionStorage
persistence with validation and TTL for cross-redirect payment data.
Unify ProtectedRoute with withLayout prop, add aria-live accessibility.
2026-03-09 03:58:56 +03:00
Egor
d7b1ff1052 Merge pull request #263 from BEDOLAGA-DEV/main
w
2026-03-09 03:03:31 +03:00
Fringg
69a8fe8e03 fix: force fresh balance data on purchase-options query
Added staleTime: 0 and refetchOnMount: 'always' to purchase-options
queries in SubscriptionPurchase and Subscription pages to prevent
stale balance_kopeks from causing incorrect insufficient funds display.
2026-03-09 01:07:49 +03:00
Fringg
115c684fe0 fix: device purchase guard condition and cache invalidation
- Fix guard: available === false alone now properly gates the unavailability
  message (was incorrectly AND-ed with !max_device_limit)
- Remove dead code block that was unreachable after guard fix
- Add device-price cache invalidation after successful purchase
2026-03-08 23:08:49 +03:00
Fringg
7940410d7d feat: support disabled daily subscription status in cabinet UI
- Show SubscriptionCardExpired for disabled daily subscriptions
- Use togglePause() API for resume instead of renewSubscription()
- Add "Suspended" status badge and balance query invalidation
- Add dashboard.suspended and subscription.pause.suspended translations (ru, en, zh, fa)
2026-03-08 21:36:10 +03:00
Egor
6276c30839 Merge pull request #262 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.27.0
2026-03-08 15:47:29 +03:00