Skip to content

Commit 97d6fe0

Browse files
authored
feat(laravel-insights): Remove experimental UI toggle (#89262)
Remove the experimental UI toggle for Laravel insights. This will activate the new UI for all users that have the feature flag, without an option to opt out.
1 parent f691e06 commit 97d6fe0

File tree

7 files changed

+20
-185
lines changed

7 files changed

+20
-185
lines changed

static/app/views/insights/pages/backend/backendOverviewPage.tsx

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {Fragment} from 'react';
21
import {useTheme} from '@emotion/react';
32
import styled from '@emotion/styled';
43

@@ -36,11 +35,7 @@ import {ToolRibbon} from 'sentry/views/insights/common/components/ribbon';
3635
import {useOnboardingProject} from 'sentry/views/insights/common/queries/useOnboardingProject';
3736
import {BackendHeader} from 'sentry/views/insights/pages/backend/backendPageHeader';
3837
import {LaravelOverviewPage} from 'sentry/views/insights/pages/backend/laravel';
39-
import {
40-
hasLaravelInsightsFeature,
41-
useIsLaravelInsightsEnabled,
42-
} from 'sentry/views/insights/pages/backend/laravel/features';
43-
import {NewLaravelExperienceButton} from 'sentry/views/insights/pages/backend/laravel/newLaravelExperienceButton';
38+
import {useIsLaravelInsightsAvailable} from 'sentry/views/insights/pages/backend/laravel/features';
4439
import {
4540
BACKEND_LANDING_TITLE,
4641
OVERVIEW_PAGE_ALLOWED_OPS,
@@ -97,8 +92,12 @@ export const BACKEND_COLUMN_TITLES = [
9792

9893
function BackendOverviewPage() {
9994
useOverviewPageTrackPageload();
100-
const [isLaravelPageEnabled] = useIsLaravelInsightsEnabled();
101-
return isLaravelPageEnabled ? <LaravelOverviewPage /> : <GenericBackendOverviewPage />;
95+
const isLaravelPageAvailable = useIsLaravelInsightsAvailable();
96+
return isLaravelPageAvailable ? (
97+
<LaravelOverviewPage />
98+
) : (
99+
<GenericBackendOverviewPage />
100+
);
102101
}
103102

104103
function GenericBackendOverviewPage() {
@@ -242,14 +241,7 @@ function GenericBackendOverviewPage() {
242241
organization={organization}
243242
renderDisabled={NoAccess}
244243
>
245-
<BackendHeader
246-
headerTitle={BACKEND_LANDING_TITLE}
247-
headerActions={
248-
<Fragment>
249-
<NewLaravelExperienceButton />
250-
</Fragment>
251-
}
252-
/>
244+
<BackendHeader headerTitle={BACKEND_LANDING_TITLE} />
253245
<Layout.Body>
254246
<Layout.Main fullWidth>
255247
<ModuleLayout.Layout>
@@ -320,16 +312,12 @@ function GenericBackendOverviewPage() {
320312

321313
function BackendOverviewPageWithProviders() {
322314
const organization = useOrganization();
323-
const [isLaravelInsightsEnabled] = useIsLaravelInsightsEnabled();
315+
const isLaravelPageAvailable = useIsLaravelInsightsAvailable();
324316
const {maxPickableDays} = limitMaxPickableDays(organization);
325317

326318
return (
327319
<DomainOverviewPageProviders
328-
maxPickableDays={
329-
isLaravelInsightsEnabled && hasLaravelInsightsFeature(organization)
330-
? maxPickableDays
331-
: undefined
332-
}
320+
maxPickableDays={isLaravelPageAvailable ? maxPickableDays : undefined}
333321
>
334322
<BackendOverviewPage />
335323
</DomainOverviewPageProviders>
Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import {useCallback} from 'react';
2-
31
import type {Organization} from 'sentry/types/organization';
42
import {getSelectedProjectList} from 'sentry/utils/project/useSelectedProjectsHaveField';
5-
import useMutateUserOptions from 'sentry/utils/useMutateUserOptions';
63
import useOrganization from 'sentry/utils/useOrganization';
74
import usePageFilters from 'sentry/utils/usePageFilters';
85
import useProjects from 'sentry/utils/useProjects';
9-
import {useUser} from 'sentry/utils/useUser';
106

117
export function hasLaravelInsightsFeature(organization: Organization) {
128
return organization.features.includes('laravel-insights');
@@ -25,37 +21,3 @@ export function useIsLaravelInsightsAvailable() {
2521

2622
return hasLaravelInsightsFeature(organization) && isOnlyLaravelSelected;
2723
}
28-
29-
// It started out as a dictionary of project IDs, but as we now want a global toggle we use a special key
30-
// to represent all projects. (This user option is a temporary feature and will be removed in the future.)
31-
const ALL_PROJECTS_KEY = 'all';
32-
33-
export function useIsLaravelInsightsEnabled() {
34-
const organization = useOrganization();
35-
const user = useUser();
36-
const isAvailable = useIsLaravelInsightsAvailable();
37-
38-
const isEnabled = Boolean(
39-
isAvailable &&
40-
(user.options.prefersSpecializedProjectOverview[ALL_PROJECTS_KEY] ?? true)
41-
);
42-
43-
const {mutate: mutateUserOptions} = useMutateUserOptions();
44-
45-
const setIsEnabled = useCallback(
46-
(enabled: boolean) => {
47-
if (!hasLaravelInsightsFeature(organization)) {
48-
return;
49-
}
50-
51-
mutateUserOptions({
52-
prefersSpecializedProjectOverview: {
53-
[ALL_PROJECTS_KEY]: enabled,
54-
},
55-
});
56-
},
57-
[mutateUserOptions, organization]
58-
);
59-
60-
return [isEnabled, setIsEnabled] as const;
61-
}

static/app/views/insights/pages/backend/laravel/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {CachesWidget} from 'sentry/views/insights/pages/backend/laravel/cachesWi
2828
import {DurationWidget} from 'sentry/views/insights/pages/backend/laravel/durationWidget';
2929
import {IssuesWidget} from 'sentry/views/insights/pages/backend/laravel/issuesWidget';
3030
import {JobsWidget} from 'sentry/views/insights/pages/backend/laravel/jobsWidget';
31-
import {NewLaravelExperienceButton} from 'sentry/views/insights/pages/backend/laravel/newLaravelExperienceButton';
3231
import {PathsTable} from 'sentry/views/insights/pages/backend/laravel/pathsTable';
3332
import {QueriesWidget} from 'sentry/views/insights/pages/backend/laravel/queriesWidget';
3433
import {RequestsWidget} from 'sentry/views/insights/pages/backend/laravel/requestsWidget';
@@ -101,7 +100,6 @@ export function LaravelOverviewPage() {
101100
headerActions={
102101
<Fragment>
103102
<ViewTrendsButton />
104-
<NewLaravelExperienceButton />
105103
</Fragment>
106104
}
107105
/>

static/app/views/insights/pages/backend/laravel/newLaravelExperienceButton.tsx

Lines changed: 0 additions & 113 deletions
This file was deleted.

static/app/views/insights/pages/domainViewHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
type RoutableModuleNames,
2424
useModuleURLBuilder,
2525
} from 'sentry/views/insights/common/utils/useModuleURL';
26-
import {useIsLaravelInsightsEnabled} from 'sentry/views/insights/pages/backend/laravel/features';
26+
import {useIsLaravelInsightsAvailable} from 'sentry/views/insights/pages/backend/laravel/features';
2727
import {OVERVIEW_PAGE_TITLE} from 'sentry/views/insights/pages/settings';
2828
import {
2929
isModuleConsideredNew,
@@ -63,7 +63,7 @@ export function DomainViewHeader({
6363
const location = useLocation();
6464
const navigate = useNavigate();
6565
const moduleURLBuilder = useModuleURLBuilder();
66-
const [isLaravelInsightsEnabled] = useIsLaravelInsightsEnabled();
66+
const isLaravelInsightsAvailable = useIsLaravelInsightsAvailable();
6767
const useEap = useInsightsEap();
6868
const hasEapFlag = organization.features.includes('insights-modules-use-eap');
6969

@@ -136,7 +136,7 @@ export function DomainViewHeader({
136136
) : (
137137
<FeedbackWidgetButton
138138
optionOverrides={
139-
isLaravelInsightsEnabled
139+
isLaravelInsightsAvailable
140140
? {
141141
tags: {
142142
['feedback.source']: 'laravel-insights',

static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
AI_LANDING_SUB_PATH,
1515
AI_SIDEBAR_LABEL,
1616
} from 'sentry/views/insights/pages/ai/settings';
17-
import {useIsLaravelInsightsEnabled} from 'sentry/views/insights/pages/backend/laravel/features';
17+
import {useIsLaravelInsightsAvailable} from 'sentry/views/insights/pages/backend/laravel/features';
1818
import {
1919
BACKEND_LANDING_SUB_PATH,
2020
BACKEND_SIDEBAR_LABEL,
@@ -44,7 +44,7 @@ export function InsightsSecondaryNav() {
4444
const organization = useOrganization();
4545
const location = useLocation();
4646
const baseUrl = `/organizations/${organization.slug}/${DOMAIN_VIEW_BASE_URL}`;
47-
const [isLaravelInsightsEnabled] = useIsLaravelInsightsEnabled();
47+
const isLaravelInsightsAvailable = useIsLaravelInsightsAvailable();
4848

4949
const {projects} = useProjects();
5050

@@ -63,7 +63,7 @@ export function InsightsSecondaryNav() {
6363
return (
6464
project.platform &&
6565
platformsUsingOverviewAsProjectDetails.includes(project.platform) &&
66-
isLaravelInsightsEnabled
66+
isLaravelInsightsAvailable
6767
);
6868
}
6969

@@ -95,7 +95,7 @@ export function InsightsSecondaryNav() {
9595
location.pathname
9696
) &&
9797
// The starred param indicates that the overview is being accessed via the starred projects nav item
98-
(!isStarredProjectSelected || !isLaravelInsightsEnabled)
98+
(!isStarredProjectSelected || !isLaravelInsightsAvailable)
9999
}
100100
to={`${baseUrl}/${BACKEND_LANDING_SUB_PATH}/`}
101101
analyticsItemName="insights_backend"

static/app/views/projectDetail/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import useProjects from 'sentry/utils/useProjects';
44
import withOrganization from 'sentry/utils/withOrganization';
55
import {
66
hasLaravelInsightsFeature,
7-
useIsLaravelInsightsEnabled,
7+
useIsLaravelInsightsAvailable,
88
} from 'sentry/views/insights/pages/backend/laravel/features';
99

1010
import ProjectDetail from './projectDetail';
@@ -17,7 +17,7 @@ function ProjectDetailContainer(
1717
) {
1818
const {organization} = props;
1919
const {projects} = useProjects();
20-
const [isLaravelInsightsEnabled] = useIsLaravelInsightsEnabled();
20+
const isLaravelInsightsAvailable = useIsLaravelInsightsAvailable();
2121

2222
const project = projects.find(p => p.slug === props.params.projectId);
2323
useRouteAnalyticsParams(
@@ -32,7 +32,7 @@ function ProjectDetailContainer(
3232
if (
3333
project?.platform === 'php-laravel' &&
3434
hasLaravelInsightsFeature(organization) &&
35-
isLaravelInsightsEnabled
35+
isLaravelInsightsAvailable
3636
) {
3737
return (
3838
<Redirect

0 commit comments

Comments
 (0)