Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(access-alpha): remove beta access feature flag #411

Merged
merged 4 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 6 additions & 30 deletions apps/console/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { GTMProvider } from '@elgorditosalsero/react-gtm-hook'
import axios from 'axios'
import LogRocket from 'logrocket'
import posthog from 'posthog-js'
import { useCallback, useEffect, useState } from 'react'
import { useCallback, useEffect } from 'react'
import { useSelector } from 'react-redux'
import { Navigate, Route, Routes } from 'react-router-dom'
import { useIntercom } from 'react-use-intercom'
Expand All @@ -12,15 +12,7 @@ import { PageLogin, PageLogoutFeature } from '@qovery/pages/login'
import { PageOnboarding } from '@qovery/pages/onboarding'
import { useAuth } from '@qovery/shared/auth'
import { UserInterface } from '@qovery/shared/interfaces'
import {
BetaRoute,
LOGIN_URL,
LOGOUT_URL,
NO_BETA_ACCESS_URL,
NoBetaAccess,
ONBOARDING_URL,
ProtectedRoute,
} from '@qovery/shared/router'
import { LOGIN_URL, LOGOUT_URL, ONBOARDING_URL, ProtectedRoute } from '@qovery/shared/router'
import { LoadingScreen } from '@qovery/shared/ui'
import { useAuthInterceptor, useDocumentTitle } from '@qovery/shared/utils'
import { environment } from '../environments/environment'
Expand All @@ -30,8 +22,6 @@ export function App() {
useDocumentTitle('Loading...')
const { isLoading } = useAuth()

const [, setBetaAccess] = useState(false)

const gtmParams = { id: environment.gtm }

const user = useSelector(selectUser)
Expand Down Expand Up @@ -67,7 +57,6 @@ export function App() {
// if (process.env['NODE_ENV'] === 'production') {

// if onboarding feature flag activated we add onboarding routes to router
// const isOnboarding = posthog && posthog.isFeatureEnabled('v3-onboarding')
const isOnboarding = environment.onboarding === 'true'
if (isOnboarding) {
ROUTER.push({
Expand All @@ -86,10 +75,7 @@ export function App() {

useEffect(() => {
if (user && user.sub) {
if (process.env['NODE_ENV'] !== 'production') {
posthog.feature_flags.override(['v3-beta'])
setBetaAccess(posthog.isFeatureEnabled('v3-beta'))
} else {
if (process.env['NODE_ENV'] === 'production') {
initMonitorings(user)
}
}
Expand All @@ -104,14 +90,6 @@ export function App() {
<Routes>
<Route path={`${LOGIN_URL}/*`} element={<PageLogin />} />
<Route path={LOGOUT_URL} element={<PageLogoutFeature />} />
<Route
path={NO_BETA_ACCESS_URL}
element={
<ProtectedRoute>
<NoBetaAccess />
</ProtectedRoute>
}
/>
{ROUTER.map(
(route) =>
!route.layout && (
Expand All @@ -135,11 +113,9 @@ export function App() {
</DarkModeEnabler>
) : (
<ProtectedRoute>
<BetaRoute>
<DarkModeEnabler key={'dark-mode-' + route.path} isDarkMode={route.darkMode}>
<Layout topBar={route.topBar}>{route.component}</Layout>
</DarkModeEnabler>
</BetaRoute>
<DarkModeEnabler key={'dark-mode-' + route.path} isDarkMode={route.darkMode}>
<Layout topBar={route.topBar}>{route.component}</Layout>
</DarkModeEnabler>
</ProtectedRoute>
)
}
Expand Down
2 changes: 0 additions & 2 deletions libs/shared/router/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export * from './lib/router'
export * from './lib/protected-route/protected-route'
export * from './lib/beta-route/beta-route'
export * from './lib/pages/no-beta-access'
13 changes: 0 additions & 13 deletions libs/shared/router/src/lib/beta-route/beta-route.spec.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions libs/shared/router/src/lib/beta-route/beta-route.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions libs/shared/router/src/lib/pages/no-beta-access.spec.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions libs/shared/router/src/lib/pages/no-beta-access.tsx

This file was deleted.

1 change: 0 additions & 1 deletion libs/shared/router/src/lib/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const INDEX_URL = '/'
export const ORGANIZATION_URL = (organizationId = ':organizationId') => `/organization/${organizationId}`
export const OVERVIEW_URL = (organizationId = ':organizationId', projectId = ':projectId') =>
`/organization/${organizationId}/project/${projectId}/overview`
export const NO_BETA_ACCESS_URL = '/no-beta-access'
export interface Route {
component: React.ReactElement
path: string
Expand Down