Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/layouts/LandingLayout/LandingLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const LandingLayout = () => {
className={styles['main-content']}
>
<Suspense fallback={<SkeletonGenerator />}>
<WithFeature featureId="nyBanner">
<WithFeature featureId="dashboard.subscription.show-ny-banner">
<NYBanner isOpenBanner={!isOpenNYBanner} lsKey={LS_BANNER_NY_LANDING_KEY} />
</WithFeature>
<Outlet />
Expand Down
2 changes: 1 addition & 1 deletion src/app/layouts/MainLayout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const MainLayout = ({ sidebarItems, onlyAdmin }: MainLayoutProps) => {
<ErrorBoundary fallback={<ErrorElement path={ROUTES.appRoute} />}>
<main className={styles.main}>
<div className={styles.container}>
<WithFeature featureId="nyBanner">
<WithFeature featureId="dashboard.subscription.show-ny-banner">
<NYBanner isOpenBanner={!isOpenNYBanner} lsKey={LS_BANNER_NY_DASHBOARD_KEY} />
</WithFeature>
<WithFeature featureId="nyModal">
Expand Down
10 changes: 0 additions & 10 deletions src/entities/featureFlag/api/__mocks__/data/featureFlagsMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ import { FeatureFlagApiItem } from '../../../model/types/featureFlag';

export const featureFlagsMock: Response<FeatureFlagApiItem[]> = {
data: [
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[ISSUE] - Добавь реальный ответ по твоему флагу сюда вместо удаленного

id: 'nyBanner',
flag: 'Новогодний баннер',
enabled: false,
description: 'Скидки на подписку для всех новых пользователей',
roles: ['admin'],
clientType: 'WEB',
createdAt: '2025-12-01T00:00:00.000Z',
updatedAt: '2025-12-01T00:00:00.000Z',
},
{
id: 'nyModal',
flag: 'Новогодняя модалка',
Expand Down
5 changes: 0 additions & 5 deletions src/entities/featureFlag/model/constants/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { FeatureFlags, ClientType } from '../types/featureFlag';

export const featureFlags: FeatureFlags = {
nyBanner: {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[ISSUE] - В админке твой флаг включен и имеет роли. В задаче указано другое

id: 'nyBanner',
enabled: false,
description: 'Новогодний баннер со скидками на подписку',
},
nyModal: {
id: 'nyModal',
enabled: false,
Expand Down
4 changes: 2 additions & 2 deletions src/entities/featureFlag/model/types/featureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Response } from '@/shared/libs';
import { RoleName } from '@/entities/auth/@x/featureFlag';

export type FeatureFlagType =
| 'nyBanner'
| 'dashboard.subscription.show-ny-banner'
| 'nyModal'
| 'usersRating'
| 'changeLanguage'
Expand All @@ -16,7 +16,7 @@ export interface FeatureFlag {
description: string;
}

export type FeatureFlags = Record<FeatureFlagType, FeatureFlag>;
export type FeatureFlags = Partial<Record<FeatureFlagType, FeatureFlag>>;

export type ClientType = 'WEB' | 'IOS' | 'ANDROID';

Expand Down