Skip to content

Commit

Permalink
Merge pull request #4750 from HedvigInsurance/09-19-remove_hide_revie…
Browse files Browse the repository at this point in the history
…ws_from_product_average_rating_feature_flag_always_enabled

Remove HIDE_REVIEWS_FROM_PRODUCT_AVERAGE_RATING feature flag, always enabled
  • Loading branch information
alebedev authored Sep 19, 2024
2 parents 56c3b6b + bae7b86 commit 42f8739
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
28 changes: 7 additions & 21 deletions apps/store/src/components/ProductReviews/ProductAverageRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { useTranslation } from 'next-i18next'
import { CertifiedIcon } from 'ui'
import type { ProductData } from '@/components/ProductData/ProductData.types'
import { useProductData } from '@/components/ProductData/ProductDataProvider'
import { ReviewsDialog } from '@/components/ProductReviews/ReviewsDialog'
import { MAX_SCORE } from '@/features/memberReviews/memberReviews.constants'
import { useProuctReviewsMetadata } from '@/features/memberReviews/ProductReviewsMetadataProvider'
import { sendDialogEvent } from '@/utils/dialogEvent'
import { Features } from '@/utils/Features'
import { useFormatter } from '@/utils/useFormatter'
import { AverageRating } from './AverageRating'
import { wrapper, trigger, certifiedIcon, disclaimerText } from './ProductAverageRating.css'
Expand Down Expand Up @@ -70,25 +68,13 @@ export const ProductAverageRating = () => {

<div className={wrapper}>
<CertifiedIcon className={certifiedIcon} size="1.15rem" />

{Features.enabled('HIDE_REVIEWS_FROM_PRODUCT_AVERAGE_RATING') ? (
<ReviewsDistributionDialog
Header={Header}
reviewsDistribution={reviewsDistribution}
onClose={closeDialog}
>
{Trigger}
</ReviewsDistributionDialog>
) : (
<ReviewsDialog
productIds={[productData.name]}
Header={Header}
reviewsDistribution={reviewsDistribution}
onClose={closeDialog}
>
{Trigger}
</ReviewsDialog>
)}
<ReviewsDistributionDialog
Header={Header}
reviewsDistribution={reviewsDistribution}
onClose={closeDialog}
>
{Trigger}
</ReviewsDistributionDialog>
</div>
</>
)
Expand Down
5 changes: 3 additions & 2 deletions apps/store/src/utils/Features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ export const Features = {
}

const config = {
// We're using it to disable cookie banner outside of production and staging
COOKIE_BANNER: process.env.NEXT_PUBLIC_FEATURE_COOKIE_BANNER === 'true',
// Keeping it around as a way to quickly disable Insurely if anything goes wrong
INSURELY: process.env.NEXT_PUBLIC_FEATURE_INSURELY === 'true',

MYMONEY: process.env.NEXT_PUBLIC_FEATURE_MYMONEY === 'true',
HIDE_REVIEWS_FROM_PRODUCT_AVERAGE_RATING:
process.env.NEXT_PUBLIC_HIDE_REVIEWS_FROM_PRODUCT_AVERAGE_RATING === 'true',
PRICE_CALCULATOR_PAGE: process.env.NEXT_PUBLIC_FEATURE_PRICE_CALCULATOR_PAGE === 'true',
PRODUCT_PAGE_V2: process.env.NEXT_PUBLIC_FEATURE_PRODUCT_PAGE_V2 === 'true',
} as const
Expand Down

0 comments on commit 42f8739

Please sign in to comment.