Skip to content

Commit

Permalink
chore(ui): remove price increase announcement code
Browse files Browse the repository at this point in the history
  • Loading branch information
mavarius committed Nov 13, 2024
1 parent 29428a2 commit 471508c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 115 deletions.
18 changes: 1 addition & 17 deletions src/homepageExperience/ClickThroughAnnouncementHandler.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
// Libraries
import {FC, useEffect} from 'react'
import {useSelector, useDispatch} from 'react-redux'
import {useDispatch} from 'react-redux'
import {useLocalStorageState} from 'use-local-storage-state'

// Selectors
import {selectCurrentIdentity} from 'src/identity/selectors'

// Utils
import {showOverlay, dismissOverlay} from 'src/overlays/actions/overlays'
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
import {event} from 'src/cloud/utils/reporting'

export enum AnnouncementID {
MqttEol = 'mqttEolClickThroughAnnouncement',
PriceIncrease = 'pricingClickThroughAnnouncement',
}

enum AnnouncementState {
Expand All @@ -23,7 +19,6 @@ enum AnnouncementState {

export const ClickThroughAnnouncementHandler: FC = () => {
const dispatch = useDispatch()
const {account} = useSelector(selectCurrentIdentity)

const [announcementState, setAnnouncementState] = useLocalStorageState(
'clickThroughAnnouncement',
Expand Down Expand Up @@ -69,23 +64,12 @@ export const ClickThroughAnnouncementHandler: FC = () => {
// MQTT Audience: Cloud users with MQTT feature flag enabled
const isMqttAudience = isFlagEnabled('subscriptionsUI')

// PAYG Pricing Increase Audience: Pay As You Go & Direct Signups
const isPaygAccount = account.type === 'pay_as_you_go'
const isDirectSignup = account.billingProvider === 'zuora'
const isPriceIncreaseAudience = isPaygAccount && isDirectSignup

// Sequentially display announcements in order of priority
if (
isMqttAudience &&
announcementState[AnnouncementID.MqttEol] !== AnnouncementState.Dismissed
) {
handleDisplayAnnouncement(AnnouncementID.MqttEol)
} else if (
isPriceIncreaseAudience &&
announcementState[AnnouncementID.PriceIncrease] !==
AnnouncementState.Dismissed
) {
handleDisplayAnnouncement(AnnouncementID.PriceIncrease)
}
}, [announcementState])

Expand Down
13 changes: 0 additions & 13 deletions src/me/components/ClickThroughAnnouncementOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {useSelector} from 'react-redux'

// Components
import {Overlay} from '@influxdata/clockface'
import {PaygPriceIncreaseAnnouncement} from 'src/me/components/announcements/PaygPriceIncreaseAnnouncement'
import {MqttEolAnnouncement} from 'src/me/components/announcements/MqttEolAnnouncement'

// Utils
Expand All @@ -31,25 +30,13 @@ export const ClickThroughAnnouncementOverlay: FC<
event(`${announcementID}.details.clicked`)
}

const handleContactUsClick = () => {
event(`${announcementID}.contactUs.clicked`)
}

const handleAcknowledgeClick = () => {
event(`${announcementID}.acknowledge.clicked`)
onClose()
}

const announcementContents = (): JSX.Element => {
switch (announcementID) {
case AnnouncementID.PriceIncrease:
return (
<PaygPriceIncreaseAnnouncement
handleAcknowledgeClick={handleAcknowledgeClick}
handleContactUsClick={handleContactUsClick}
handleDetailsClick={handleDetailsClick}
/>
)
case AnnouncementID.MqttEol:
return (
<MqttEolAnnouncement
Expand Down
85 changes: 0 additions & 85 deletions src/me/components/announcements/PaygPriceIncreaseAnnouncement.tsx

This file was deleted.

0 comments on commit 471508c

Please sign in to comment.