Skip to content

Commit

Permalink
Fix dynamic feature status label in push providers
Browse files Browse the repository at this point in the history
  • Loading branch information
NipuniBhagya committed Feb 7, 2025
1 parent b4cba28 commit 563668d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,19 @@ const PushProviderCard: FunctionComponent<PushProviderCardPropsInterface> = ({
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
);

const featureStatus: PushProviderTemplateFeatureStatus = useMemo(() => {
if (!template?.customAttributes
|| !Array.isArray(template?.customAttributes)
|| template?.customAttributes.length === 0) {
return false;

return null;
}

const property: CustomAttributeInterface = template?.customAttributes?.find(
Expand All @@ -88,7 +89,7 @@ const PushProviderCard: FunctionComponent<PushProviderCardPropsInterface> = ({
return property?.value as PushProviderTemplateFeatureStatus;
}

return property?.value;
return null;
}, [ template ]);

const resolveRibbonLabel = (featureStatus: PushProviderTemplateFeatureStatus): string => {
Expand Down

0 comments on commit 563668d

Please sign in to comment.