diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 0bf41a8..f4bf1a5 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -254,6 +254,15 @@ const coreRoutes: Routes = [ breadcrumb: [{ labelKey: 'adminShell.nav.analytics' }] } }, + { + path: 'partners/seller-management', + loadComponent: () => import('./features/admin/seller-management/pages/admin-seller-management-page.component').then(m => m.AdminSellerManagementPageComponent), + data: { + titleKey: 'adminShell.pages.sellerManagement.title', + descriptionKey: 'adminShell.pages.sellerManagement.description', + breadcrumb: [{ labelKey: 'adminShell.nav.sellerManagement' }] + } + }, { path: '**', redirectTo: 'dashboard' } ] }, diff --git a/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.html b/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.html new file mode 100644 index 0000000..1944d29 --- /dev/null +++ b/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.html @@ -0,0 +1,107 @@ +
+ +
+ +
+
+ + {{ 'adminSellerManagement.emptyState.requestAccess' | translate }} + + + {{ 'adminSellerManagement.emptyState.learnMore' | translate }} + +
+
+
+ + +
+ + + + + + + + + + + + +
+ + {{ 'adminSellerManagement.requestDialog.cancel' | translate }} + + + {{ 'adminSellerManagement.requestDialog.send' | translate }} + +
+
+
+ + +

{{ 'adminSellerManagement.requestSuccessDialog.message' | translate }}

+
+ + {{ 'adminSellerManagement.requestSuccessDialog.close' | translate }} + +
+
+ + + {{ 'adminSellerManagement.learnMoreDialog.comingSoonBadge' | translate }} + +
+ + {{ 'adminSellerManagement.learnMoreDialog.close' | translate }} + +
+
diff --git a/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.scss b/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.scss new file mode 100644 index 0000000..678cba6 --- /dev/null +++ b/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.scss @@ -0,0 +1,100 @@ +.admin-seller-management-page { + display: flex; + align-items: center; + justify-content: center; + min-height: 60vh; + padding: var(--space-lg, 1.5rem); +} + +.admin-seller-management-page__icon { + display: flex; + align-items: center; + justify-content: center; + width: 72px; + height: 72px; + border-radius: var(--radius-full, 999px); + background: color-mix(in srgb, var(--primary-color, #2f6e5d) 12%, transparent); + color: var(--primary-color, #2f6e5d); + margin-inline: auto; +} + +.admin-seller-management-page__actions { + display: flex; + gap: var(--space-sm, 0.5rem); + flex-wrap: wrap; + justify-content: center; +} + +.admin-seller-management-page__form { + display: flex; + flex-direction: column; + gap: var(--space-md, 1rem); +} + +.admin-seller-management-page__textarea { + width: 100%; + min-height: 96px; + resize: vertical; + border: 1px solid var(--border-color, #e4e4e7); + border-radius: var(--radius-md, 6px); + background: var(--bg-primary, #fff); + color: var(--text-primary, #1f322d); + font-family: inherit; + font-size: var(--font-size-md, 0.9375rem); + padding: var(--space-sm, 0.5rem) var(--space-md, 1rem); + transition: border-color var(--transition-fast, 120ms ease), + box-shadow var(--transition-fast, 120ms ease); + + &::placeholder { + color: var(--text-secondary, #6b7280); + } + + &:hover:not(:disabled) { + border-color: var(--primary-color, #2f6e5d); + } + + &:focus-visible { + outline: none; + border-color: var(--primary-color, #2f6e5d); + box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #2f6e5d) 25%, transparent); + } +} + +.admin-seller-management-page__dialog-actions { + display: flex; + justify-content: flex-end; + gap: var(--space-sm, 0.5rem); + margin-top: var(--space-md, 1rem); +} + +.admin-seller-management-page__feature-list { + display: flex; + flex-direction: column; + gap: var(--space-xs, 0.375rem); + margin: var(--space-md, 1rem) 0 0; + padding-inline-start: var(--space-md, 1rem); + color: var(--text-primary, #1f322d); + font-size: var(--font-size-md, 0.9375rem); +} + +@media (prefers-reduced-motion: reduce) { + .admin-seller-management-page__textarea { + transition: none; + } +} + +@media (max-width: 640px) { + .admin-seller-management-page { + min-height: auto; + padding: var(--space-md, 1rem); + } + + .admin-seller-management-page__actions { + flex-direction: column; + width: 100%; + + app-button { + width: 100%; + } + } +} diff --git a/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.ts b/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.ts new file mode 100644 index 0000000..6cfa1ad --- /dev/null +++ b/src/app/features/admin/seller-management/pages/admin-seller-management-page.component.ts @@ -0,0 +1,108 @@ +import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { TranslatePipe } from '../../../../i18n/translate.pipe'; +import { TranslateService } from '../../../../i18n/translate.service'; +import { ConfigService } from '../../../../core/config/config.service'; +import { ButtonComponent } from '../../../../shared/ui/button/button.component'; +import { DialogComponent } from '../../../../shared/ui/dialog/dialog.component'; +import { EmptyStateComponent } from '../../../../shared/ui/empty-state/empty-state.component'; +import { FormFieldComponent } from '../../../../shared/ui/form-field/form-field.component'; +import { InputComponent } from '../../../../shared/ui/input/input.component'; +import { IconComponent } from '../../../../shared/ui/icon/icon.component'; +import { BadgeComponent } from '../../../../shared/ui/badge/badge.component'; + +interface SellerAccessRequest { + company: string; + email: string; + message: string; +} + +/** + * Phase 1 UI for the optional Seller Management module (ADR-011). The module + * has no backend/business logic yet, so this page's entire content today is + * the "not available" empty state - request-access and learn-more dialogs + * only. Reads `modules.sellerManagement.enabled` per ADR-011's capability- + * guard rule rather than assuming a hardcoded state; there is no enabled- + * state UI to switch to yet, that's separate future work once the module is + * actually built. + */ +@Component({ + selector: 'app-admin-seller-management-page', + standalone: true, + imports: [ + FormsModule, + TranslatePipe, + ButtonComponent, + DialogComponent, + EmptyStateComponent, + FormFieldComponent, + InputComponent, + IconComponent, + BadgeComponent + ], + templateUrl: './admin-seller-management-page.component.html', + styleUrl: './admin-seller-management-page.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class AdminSellerManagementPageComponent { + private readonly configService = inject(ConfigService); + private readonly i18n = inject(TranslateService); + + protected readonly sellerManagementEnabled = signal( + this.configService.getBootstrapSnapshot()?.modules?.sellerManagement?.enabled ?? false + ); + + protected readonly requestDialogOpen = signal(false); + protected readonly successDialogOpen = signal(false); + protected readonly learnMoreDialogOpen = signal(false); + protected readonly submitting = signal(false); + + protected readonly form = signal({ company: '', email: '', message: '' }); + + protected openRequestDialog(): void { + this.form.set({ company: '', email: '', message: '' }); + this.requestDialogOpen.set(true); + } + + protected closeRequestDialog(): void { + this.requestDialogOpen.set(false); + } + + protected openLearnMoreDialog(): void { + this.learnMoreDialogOpen.set(true); + } + + protected closeLearnMoreDialog(): void { + this.learnMoreDialogOpen.set(false); + } + + protected closeSuccessDialog(): void { + this.successDialogOpen.set(false); + } + + protected updateCompany(value: string): void { + this.form.update(f => ({ ...f, company: value })); + } + + protected updateEmail(value: string): void { + this.form.update(f => ({ ...f, email: value })); + } + + protected updateMessage(value: string): void { + this.form.update(f => ({ ...f, message: value })); + } + + /** Mocked submission - no backend/API exists for this yet (Phase 1 UI only). */ + protected submitRequest(): void { + this.submitting.set(true); + setTimeout(() => { + this.submitting.set(false); + this.requestDialogOpen.set(false); + this.successDialogOpen.set(true); + }, 400); + } + + protected dialogTitle(key: string): string { + return this.i18n.t(key); + } +} diff --git a/src/app/features/admin/shell/admin-nav.model.ts b/src/app/features/admin/shell/admin-nav.model.ts index ca92285..5152232 100644 --- a/src/app/features/admin/shell/admin-nav.model.ts +++ b/src/app/features/admin/shell/admin-nav.model.ts @@ -37,6 +37,8 @@ export const ADMIN_NAV_PRIMARY: AdminNavEntry[] = [ { type: 'link', id: 'transactions', icon: 'creditCard', labelKey: 'adminShell.nav.transactions', path: ['transactions'] }, { type: 'link', id: 'moderation', icon: 'star', labelKey: 'adminShell.nav.moderation', path: ['moderation'] }, { type: 'link', id: 'reports', icon: 'chartBar', labelKey: 'adminShell.nav.reports', comingSoon: true }, + { type: 'group', labelKey: 'adminShell.nav.partnersGroup' }, + { type: 'link', id: 'seller-management', icon: 'store', labelKey: 'adminShell.nav.sellerManagement', path: ['partners', 'seller-management'] }, { type: 'link', id: 'content', icon: 'edit', labelKey: 'adminShell.nav.content', absolutePath: ['edit', 'static-pages'] }, { type: 'link', id: 'media', icon: 'images', labelKey: 'adminShell.nav.mediaLibrary', path: ['media'] }, { type: 'link', id: 'marketplace-builder', icon: 'network', labelKey: 'adminShell.nav.marketplaceBuilder', absolutePath: ['edit'] }, diff --git a/src/app/i18n/en.ts b/src/app/i18n/en.ts index 518b016..3ab258c 100644 --- a/src/app/i18n/en.ts +++ b/src/app/i18n/en.ts @@ -1990,6 +1990,8 @@ export const en: Translations = { moderation: 'Reviews & Moderation', reviews: 'Reviews', reports: 'Reports', + partnersGroup: 'Partners', + sellerManagement: 'Seller Management', content: 'Content', mediaLibrary: 'Media Library', marketplaceBuilder: 'Marketplace Builder', @@ -2035,6 +2037,44 @@ export const en: Translations = { users: { title: 'Users', description: 'Admin team members and permissions' }, monitoring: { title: 'Monitoring', description: 'Queue, webhook, and system event status' }, analytics: { title: 'Analytics', description: 'Sales, products, and shopper behavior' }, + sellerManagement: { title: 'Seller Management', description: 'Onboard and manage independent sellers on your marketplace' }, + }, + }, + adminSellerManagement: { + emptyState: { + title: 'Seller Management', + description: 'Allow shopping malls, marketplaces and enterprise customers to onboard independent sellers while keeping centralized administration. This module is currently under development.', + requestAccess: 'Request Access', + learnMore: 'Learn More', + }, + requestDialog: { + title: 'Request Access', + companyLabel: 'Company', + companyPlaceholder: 'Your company name', + emailLabel: 'Email', + emailPlaceholder: 'you@company.com', + messageLabel: 'Message', + messagePlaceholder: 'Tell us about your marketplace and seller needs', + cancel: 'Cancel', + send: 'Send Request', + }, + requestSuccessDialog: { + title: 'Thank you', + message: 'Our team received your request. We will contact you once Seller Management becomes available.', + close: 'Close', + }, + learnMoreDialog: { + title: 'Seller Management', + comingSoonBadge: 'Coming Soon', + features: { + sellerDashboards: 'Independent seller dashboards', + sellerStorefronts: 'Seller storefronts', + sellerPermissions: 'Seller permissions', + sellerAnalytics: 'Seller analytics', + productOwnership: 'Product ownership', + marketplaceAdministration: 'Marketplace administration', + }, + close: 'Close', }, }, }; diff --git a/src/app/i18n/hy.ts b/src/app/i18n/hy.ts index d76fcd0..c8e52a4 100644 --- a/src/app/i18n/hy.ts +++ b/src/app/i18n/hy.ts @@ -1985,6 +1985,8 @@ export const hy: Translations = { transactions: 'Գործարքներ', reviews: 'Կարծիքներ', reports: 'Հաշվետվություններ', + partnersGroup: 'Գործընկերներ', + sellerManagement: 'Վաճառողների կառավարում', content: 'Բովանդակություն', mediaLibrary: 'Մեդիադարան', marketplaceBuilder: 'Մարկետփլեյսի կոնստրուկտոր', @@ -2030,6 +2032,44 @@ export const hy: Translations = { users: { title: 'Օգտատերեր', description: 'Ադմինիստրատորների թիմը և իրավունքները' }, monitoring: { title: 'Մոնիտորինգ', description: 'Հերթերի, webhook-ների և համակարգային իրադարձությունների վիճակը' }, analytics: { title: 'Վերլուծություն', description: 'Վաճառքներ, ապրանքներ և գնորդների վարքագիծ' }, + sellerManagement: { title: 'Վաճառողների կառավարում', description: 'Թույլ տվեք անկախ վաճառողներին միանալ ձեր մարքեթփլեյսին՝ պահպանելով կենտրոնացված կառավարումը' }, + }, + }, + adminSellerManagement: { + emptyState: { + title: 'Վաճառողների կառավարում', + description: 'Թույլ տվեք առևտրի կենտրոններին, մարքեթփլեյսներին և կորպորատիվ հաճախորդներին միացնել անկախ վաճառողների՝ պահպանելով կենտրոնացված կառավարումը: Այս մոդուլը ներկայումս մշակման փուլում է:', + requestAccess: 'Հայցել մուտք', + learnMore: 'Իմանալ ավելին', + }, + requestDialog: { + title: 'Հայցել մուտք', + companyLabel: 'Ընկերություն', + companyPlaceholder: 'Ձեր ընկերության անվանումը', + emailLabel: 'Էլ. փոստ', + emailPlaceholder: 'you@company.com', + messageLabel: 'Հաղորդագրություն', + messagePlaceholder: 'Պատմեք ձեր մարքեթփլեյսի և վաճառողների կարիքների մասին', + cancel: 'Չեղարկել', + send: 'Ուղարկել հայցը', + }, + requestSuccessDialog: { + title: 'Շնորհակալություն', + message: 'Մեր թիմը ստացել է ձեր հայցը: Մենք կապ կհաստատենք ձեզ հետ, երբ Վաճառողների կառավարումը հասանելի դառնա:', + close: 'Փակել', + }, + learnMoreDialog: { + title: 'Վաճառողների կառավարում', + comingSoonBadge: 'Շուտով', + features: { + sellerDashboards: 'Անկախ վաճառողների վահանակներ', + sellerStorefronts: 'Վաճառողների խանութներ', + sellerPermissions: 'Վաճառողների իրավունքներ', + sellerAnalytics: 'Վաճառողների վերլուծություն', + productOwnership: 'Ապրանքի սեփականություն', + marketplaceAdministration: 'Մարքեթփլեյսի կառավարում', + }, + close: 'Փակել', }, }, }; diff --git a/src/app/i18n/ru.ts b/src/app/i18n/ru.ts index c6c194f..62418c5 100644 --- a/src/app/i18n/ru.ts +++ b/src/app/i18n/ru.ts @@ -1985,6 +1985,8 @@ export const ru: Translations = { transactions: 'Транзакции', reviews: 'Отзывы', reports: 'Отчёты', + partnersGroup: 'Партнёры', + sellerManagement: 'Управление продавцами', content: 'Контент', mediaLibrary: 'Медиатека', marketplaceBuilder: 'Конструктор маркетплейса', @@ -2030,6 +2032,44 @@ export const ru: Translations = { users: { title: 'Пользователи', description: 'Команда администраторов и права доступа' }, monitoring: { title: 'Мониторинг', description: 'Состояние очередей, вебхуков и системных событий' }, analytics: { title: 'Аналитика', description: 'Продажи, товары и поведение покупателей' }, + sellerManagement: { title: 'Управление продавцами', description: 'Подключайте независимых продавцов к вашему маркетплейсу с централизованным администрированием' }, + }, + }, + adminSellerManagement: { + emptyState: { + title: 'Управление продавцами', + description: 'Позвольте торговым центрам, маркетплейсам и корпоративным клиентам подключать независимых продавцов, сохраняя централизованное администрирование. Этот модуль сейчас в разработке.', + requestAccess: 'Запросить доступ', + learnMore: 'Узнать больше', + }, + requestDialog: { + title: 'Запросить доступ', + companyLabel: 'Компания', + companyPlaceholder: 'Название вашей компании', + emailLabel: 'Email', + emailPlaceholder: 'you@company.com', + messageLabel: 'Сообщение', + messagePlaceholder: 'Расскажите о вашем маркетплейсе и потребностях в продавцах', + cancel: 'Отмена', + send: 'Отправить запрос', + }, + requestSuccessDialog: { + title: 'Спасибо', + message: 'Наша команда получила ваш запрос. Мы свяжемся с вами, как только Управление продавцами станет доступно.', + close: 'Закрыть', + }, + learnMoreDialog: { + title: 'Управление продавцами', + comingSoonBadge: 'Скоро', + features: { + sellerDashboards: 'Личные кабинеты продавцов', + sellerStorefronts: 'Витрины продавцов', + sellerPermissions: 'Права доступа продавцов', + sellerAnalytics: 'Аналитика продавцов', + productOwnership: 'Владение товарами', + marketplaceAdministration: 'Администрирование маркетплейса', + }, + close: 'Закрыть', }, }, }; diff --git a/src/app/i18n/translations.ts b/src/app/i18n/translations.ts index 2219ca0..714149f 100644 --- a/src/app/i18n/translations.ts +++ b/src/app/i18n/translations.ts @@ -1998,6 +1998,8 @@ export interface Translations { reviews: string; moderation: string; reports: string; + partnersGroup: string; + sellerManagement: string; content: string; mediaLibrary: string; marketplaceBuilder: string; @@ -2043,6 +2045,44 @@ export interface Translations { users: { title: string; description: string }; monitoring: { title: string; description: string }; analytics: { title: string; description: string }; + sellerManagement: { title: string; description: string }; + }; + }; + adminSellerManagement: { + emptyState: { + title: string; + description: string; + requestAccess: string; + learnMore: string; + }; + requestDialog: { + title: string; + companyLabel: string; + companyPlaceholder: string; + emailLabel: string; + emailPlaceholder: string; + messageLabel: string; + messagePlaceholder: string; + cancel: string; + send: string; + }; + requestSuccessDialog: { + title: string; + message: string; + close: string; + }; + learnMoreDialog: { + title: string; + comingSoonBadge: string; + features: { + sellerDashboards: string; + sellerStorefronts: string; + sellerPermissions: string; + sellerAnalytics: string; + productOwnership: string; + marketplaceAdministration: string; + }; + close: string; }; }; }