@@ -5,10 +5,8 @@ import { IconInfo, IconStethoscope } from '@posthog/icons'
55import { LemonBanner , LemonButton , LemonTable , LemonTableColumns , LemonTag , Link , Tooltip } from '@posthog/lemon-ui'
66
77import { TZLabel } from 'lib/components/TZLabel'
8- import { FEATURE_FLAGS } from 'lib/constants'
98import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
109import { IconWithBadge } from 'lib/lemon-ui/icons'
11- import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
1210import { inStorybook , inStorybookTestRunner } from 'lib/utils'
1311import { newInternalTab } from 'lib/utils/newInternalTab'
1412import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
@@ -149,54 +147,31 @@ const COLUMNS: LemonTableColumns<AugmentedTeamSdkVersionsInfoRelease> = [
149147]
150148
151149export function SidePanelSdkDoctor ( ) : JSX . Element | null {
152- const { sdkVersionsMap, sdkVersionsLoading, teamSdkVersionsLoading, needsUpdatingCount, hasErrors, snoozedUntil } =
153- useValues ( sidePanelSdkDoctorLogic )
150+ const {
151+ augmentedData,
152+ rawDataLoading : loading ,
153+ needsUpdatingCount,
154+ hasErrors,
155+ snoozedUntil,
156+ } = useValues ( sidePanelSdkDoctorLogic )
154157 const { isDev } = useValues ( preflightLogic )
155158
156- const { loadTeamSdkVersions, snoozeSdkDoctor } = useActions ( sidePanelSdkDoctorLogic )
157-
158- const loading = sdkVersionsLoading || teamSdkVersionsLoading
159-
160- const { featureFlags } = useValues ( featureFlagLogic )
159+ const { loadRawData, snoozeSdkDoctor } = useActions ( sidePanelSdkDoctorLogic )
161160
162161 useOnMountEffect ( ( ) => {
163162 posthog . capture ( 'sdk doctor loaded' , { needsUpdatingCount } )
164163 } )
165164
166165 const scanEvents = ( ) : void => {
167166 posthog . capture ( 'sdk doctor scan events' )
168- loadTeamSdkVersions ( { forceRefresh : true } )
167+ loadRawData ( { forceRefresh : true } )
169168 }
170169
171170 const snoozeWarning = ( ) : void => {
172171 posthog . capture ( 'sdk doctor snooze warning' )
173172 snoozeSdkDoctor ( )
174173 }
175174
176- if ( ! featureFlags [ FEATURE_FLAGS . SDK_DOCTOR_BETA ] ) {
177- return (
178- < div className = "flex flex-col h-full" >
179- < SidePanelPaneHeader
180- title = {
181- < span >
182- SDK Doctor{ ' ' }
183- < LemonTag type = "warning" className = "ml-1" >
184- Beta
185- </ LemonTag >
186- </ span >
187- }
188- />
189- < div className = "m-2" >
190- < LemonBanner type = "info" >
191- < div >
192- < strong > SDK Doctor is in beta!</ strong > It's not enabled in your account yet.
193- </ div >
194- </ LemonBanner >
195- </ div >
196- </ div >
197- )
198- }
199-
200175 return (
201176 < div className = "flex flex-col h-full" >
202177 < SidePanelPaneHeader
@@ -243,7 +218,7 @@ export function SidePanelSdkDoctor(): JSX.Element | null {
243218 < div className = "text-center text-muted p-4" >
244219 Error loading SDK information. Please try again later.
245220 </ div >
246- ) : Object . keys ( sdkVersionsMap ) . length === 0 ? (
221+ ) : Object . keys ( augmentedData ) . length === 0 ? (
247222 < div className = "text-center text-muted p-4" >
248223 No SDK information found. Are you sure you have our SDK installed? You can scan events to get
249224 started.
@@ -277,7 +252,7 @@ export function SidePanelSdkDoctor(): JSX.Element | null {
277252 ) }
278253 </ div >
279254
280- { Object . keys ( sdkVersionsMap ) . map ( ( sdkType ) => (
255+ { Object . keys ( augmentedData ) . map ( ( sdkType ) => (
281256 < SdkSection key = { sdkType } sdkType = { sdkType as SdkType } />
282257 ) ) }
283258 </ div >
@@ -305,9 +280,9 @@ export const SidePanelSdkDoctorIcon = (props: { className?: string }): JSX.Eleme
305280}
306281
307282function SdkSection ( { sdkType } : { sdkType : SdkType } ) : JSX . Element {
308- const { sdkVersionsMap , teamSdkVersionsLoading } = useValues ( sidePanelSdkDoctorLogic )
283+ const { augmentedData , rawDataLoading : loading } = useValues ( sidePanelSdkDoctorLogic )
309284
310- const sdk = sdkVersionsMap [ sdkType ] !
285+ const sdk = augmentedData [ sdkType ] !
311286 const links = SDK_DOCS_LINKS [ sdkType ]
312287 const sdkName = SDK_TYPE_READABLE_NAME [ sdkType ]
313288
@@ -352,7 +327,7 @@ function SdkSection({ sdkType }: { sdkType: SdkType }): JSX.Element {
352327
353328 < LemonTable
354329 dataSource = { sdk . allReleases }
355- loading = { teamSdkVersionsLoading }
330+ loading = { loading }
356331 columns = { COLUMNS }
357332 size = "small"
358333 emptyState = "No SDK information found. Try scanning recent events."
0 commit comments