Skip to content

Commit

Permalink
Remove the feature flag for Sources and Deployments (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
eabruzzese authored May 1, 2024
1 parent 93bb3e8 commit c6f295b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 36 deletions.
16 changes: 2 additions & 14 deletions src/ui/layouts/app-detail-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
} from "@app/deploy";
import { fetchDeploymentById, selectDeploymentById } from "@app/deployment";
import { findLoaderComposite } from "@app/loaders";
import { selectHasBetaFeatures } from "@app/organizations";
import { useDispatch, useQuery, useSelector } from "@app/react";
import {
appActivityUrl,
Expand Down Expand Up @@ -44,7 +43,6 @@ import {
DockerImage,
GitCommitMessage,
GitRef,
SourceName,
TabItem,
} from "../shared";
import { AppSidebarLayout } from "./app-sidebar-layout";
Expand All @@ -57,8 +55,6 @@ export function AppHeader({
selectLatestDeployOp(s, { appId: app.id }),
);

const hasBetaFeatures = useSelector(selectHasBetaFeatures);

useQuery(fetchDeploymentById({ id: app.currentDeploymentId }));
const deployment = useSelector((s) =>
selectDeploymentById(s, { id: app.currentDeploymentId }),
Expand Down Expand Up @@ -100,11 +96,7 @@ export function AppHeader({
</DetailInfoItem>

<DetailInfoItem title="Source">
{hasBetaFeatures && source.id ? (
<Link to={sourceDetailUrl(source.id)}>{source.displayName}</Link>
) : (
<SourceName app={app} deployment={deployment} />
)}
<Link to={sourceDetailUrl(source.id)}>{source.displayName}</Link>
</DetailInfoItem>
<DetailInfoItem title="Commit Message">
<div className="max-h-[21px]">
Expand Down Expand Up @@ -165,15 +157,11 @@ function AppPageHeader() {
const hasConfigAccess = useSelector((s) =>
selectUserHasPerms(s, { envId: app.environmentId, scope: "read" }),
);
const hasBetaFeatures = useSelector(selectHasBetaFeatures);

const tabs: TabItem[] = [{ name: "Services", href: appServicesUrl(id) }];

if (hasBetaFeatures) {
tabs.push({ name: "Deployments", href: appDetailDeploymentsUrl(id) });
}

tabs.push(
{ name: "Deployments", href: appDetailDeploymentsUrl(id) },
{ name: "Endpoints", href: appEndpointsUrl(id) },
{ name: "Activity", href: appActivityUrl(id) },
{ name: "Configuration", href: appConfigUrl(id) },
Expand Down
9 changes: 1 addition & 8 deletions src/ui/layouts/deployment-detail-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
selectOperationById,
} from "@app/deploy";
import { fetchDeploymentById, selectDeploymentById } from "@app/deployment";
import { selectHasBetaFeatures } from "@app/organizations";
import { useQuery, useSelector } from "@app/react";
import {
appDetailDeploymentsUrl,
Expand All @@ -31,7 +30,6 @@ import {
GitCommitMessage,
GitRef,
OpStatus,
SourceName,
TabItem,
} from "../shared";
import { AppSidebarLayout } from "./app-sidebar-layout";
Expand All @@ -48,7 +46,6 @@ export function DeploymentHeader({
const source = useSelector((s) =>
selectSourceById(s, { id: deployment.sourceId }),
);
const hasBetaFeatures = useSelector(selectHasBetaFeatures);

return (
<DetailHeader>
Expand All @@ -66,11 +63,7 @@ export function DeploymentHeader({
<DetailInfoGrid>
<DetailInfoItem title="Type">{capitalize(op.type)}</DetailInfoItem>
<DetailInfoItem title="Source">
{hasBetaFeatures && source.id ? (
<Link to={sourceDetailUrl(source.id)}>{source.displayName}</Link>
) : (
<SourceName app={app} deployment={deployment} />
)}
<Link to={sourceDetailUrl(source.id)}>{source.displayName}</Link>
</DetailInfoItem>

<DetailInfoItem title="App">
Expand Down
18 changes: 4 additions & 14 deletions src/ui/shared/application-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { selectEnv } from "@app/config";
import { selectNav, setCollapsed } from "@app/nav";
import { selectHasBetaFeatures } from "@app/organizations";
import { useDispatch, useSelector } from "@app/react";
import {
activityUrl,
Expand Down Expand Up @@ -58,7 +57,6 @@ export const ApplicationSidebar = () => {
);
const hasSystemStatus =
systemStatus?.description && systemStatus?.indicator !== "none";
const hasBetaFeatures = useSelector(selectHasBetaFeatures);
const navigate = useNavigate();
const navigation = [
{ name: "Stacks", to: stacksUrl(), icon: <IconLayers /> },
Expand All @@ -67,12 +65,7 @@ export const ApplicationSidebar = () => {
{ name: "Databases", to: databaseUrl(), icon: <IconCylinder /> },
{ name: "Endpoints", to: endpointsUrl(), icon: <IconEndpoint /> },
{ name: "Services", to: servicesUrl(), icon: <IconService /> },
{
name: "Sources",
to: sourcesUrl(),
icon: <IconSource />,
hidden: !hasBetaFeatures,
},
{ name: "Sources", to: sourcesUrl(), icon: <IconSource /> },
{ name: "Deployments", to: deploymentsUrl(), icon: <IconCloud /> },
{ name: "Activity", to: activityUrl(), icon: <IconHeart /> },
{
Expand Down Expand Up @@ -138,12 +131,9 @@ export const ApplicationSidebar = () => {

<div className="mt-2 flex-1 px-2">
<nav className="bg-white">
{navigation.map(
(item) =>
item.hidden || (
<LinkNav key={item.name} {...item} hideName={collapsed} />
),
)}
{navigation.map((item) => (
<LinkNav key={item.name} {...item} hideName={collapsed} />
))}
</nav>

{!collapsed ? <OrgRequirements /> : null}
Expand Down

0 comments on commit c6f295b

Please sign in to comment.