From 563668d3ad23eaf41d79ff38017e0e53dcbb44c2 Mon Sep 17 00:00:00 2001 From: NipuniBhagya Date: Fri, 7 Feb 2025 09:01:43 +0530 Subject: [PATCH] Fix dynamic feature status label in push providers --- .../constants/feature-flag-constants.ts | 2 ++ .../components/push-provider-card.scss | 8 ++------ .../components/push-provider-card.tsx | 9 +++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/features/admin.feature-gate.v1/constants/feature-flag-constants.ts b/features/admin.feature-gate.v1/constants/feature-flag-constants.ts index 8b473065981..2a68f3f19e0 100644 --- a/features/admin.feature-gate.v1/constants/feature-flag-constants.ts +++ b/features/admin.feature-gate.v1/constants/feature-flag-constants.ts @@ -49,6 +49,8 @@ class FeatureFlagConstants { LOGIN_AND_REGISTRATION_ORGANIZATION_DISCOVERY: "loginAndRegistration.organizationSettings.discovery", LOGIN_AND_REGISTRATION_ORGANIZATION_IMPERSONATION: "loginAndRegistration.organizationSettings.impersonation", ORGANIZATION_BRANDING_TEXT: "branding.stylesAndText.organization.text", + PUSH_PROVIDERS: "pushProviders", + PUSH_PROVIDER_TEMPLATES: "pushProviders.templates", SMS_TEMPLATES: "smsTemplates", USER_ROLES: "userRoles" }; diff --git a/features/admin.push-providers.v1/components/push-provider-card.scss b/features/admin.push-providers.v1/components/push-provider-card.scss index 30021f9adbd..fcf96b62121 100644 --- a/features/admin.push-providers.v1/components/push-provider-card.scss +++ b/features/admin.push-providers.v1/components/push-provider-card.scss @@ -33,8 +33,8 @@ .push-provider-template-ribbon { border-radius: 0; - position: absolute; - right: 0; + position: relative; + right: -23px; font-size: .8em; height: 24px; width: 75px; @@ -55,10 +55,6 @@ align-items: center; padding: 10px; - .push-provider-template-name-label{ - margin-right: 40px; - } - .push-provider-template-image-container { min-height: 35px; min-width: 35px; diff --git a/features/admin.push-providers.v1/components/push-provider-card.tsx b/features/admin.push-providers.v1/components/push-provider-card.tsx index 2eb1133f455..2c35fba8e9a 100644 --- a/features/admin.push-providers.v1/components/push-provider-card.tsx +++ b/features/admin.push-providers.v1/components/push-provider-card.tsx @@ -65,10 +65,10 @@ const PushProviderCard: FunctionComponent = ({ const { t } = useTranslation(); const pushProviderFeatureFlagsConfig: FeatureFlagsInterface[] = useSelector( - (state: AppState) => state.config.ui.features.pushProviders.featureFlags + (state: AppState) => state.config.ui.features.pushProviders?.featureFlags ); - const featureFlag: string = useFeatureFlag(FeatureFlagConstants.FEATURE_FLAG_KEY_MAP.APPLICATION_TEMPLATES, + const featureFlag: string = useFeatureFlag(FeatureFlagConstants.FEATURE_FLAG_KEY_MAP.PUSH_PROVIDER_TEMPLATES, pushProviderFeatureFlagsConfig ); @@ -76,7 +76,8 @@ const PushProviderCard: FunctionComponent = ({ if (!template?.customAttributes || !Array.isArray(template?.customAttributes) || template?.customAttributes.length === 0) { - return false; + + return null; } const property: CustomAttributeInterface = template?.customAttributes?.find( @@ -88,7 +89,7 @@ const PushProviderCard: FunctionComponent = ({ return property?.value as PushProviderTemplateFeatureStatus; } - return property?.value; + return null; }, [ template ]); const resolveRibbonLabel = (featureStatus: PushProviderTemplateFeatureStatus): string => {