Skip to content

Commit afbaf6b

Browse files
committed
Old env badge deleted, changed everywhere to the new one
1 parent 3e0dc91 commit afbaf6b

File tree

22 files changed

+49
-191
lines changed
  • apps/webapp/app
    • components
    • routes
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts.new
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.apikeys
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables.new
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.$scheduleParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam
      • resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam
      • resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.new
      • storybook.environment-label
      • storybook.input-fields

22 files changed

+49
-191
lines changed

apps/webapp/app/components/admin/debugTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function Content({ children }: { children: React.ReactNode }) {
5858
</Property.Item>
5959
<Property.Item>
6060
<Property.Label>Project ref</Property.Label>
61-
<Property.Value>{project.ref}</Property.Value>
61+
<Property.Value>{project.externalRef}</Property.Value>
6262
</Property.Item>
6363
</>
6464
)}

apps/webapp/app/components/environments/EnvironmentLabel.tsx

Lines changed: 3 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -9,128 +9,6 @@ import {
99
} from "~/assets/icons/EnvironmentIcons";
1010

1111
type Environment = Pick<RuntimeEnvironment, "type">;
12-
const variants = {
13-
small: "h-4 text-xxs px-[0.1875rem] rounded-[2px]",
14-
large: "h-6 text-xs px-1.5 rounded",
15-
};
16-
17-
export function EnvironmentTypeLabel({
18-
environment,
19-
size = "small",
20-
className,
21-
}: {
22-
environment: Environment;
23-
size?: keyof typeof variants;
24-
className?: string;
25-
}) {
26-
return (
27-
<span
28-
className={cn(
29-
"text-midnight-900 inline-flex items-center justify-center whitespace-nowrap border font-medium uppercase tracking-wider",
30-
environmentBorderClassName(environment),
31-
environmentTextClassName(environment),
32-
variants[size],
33-
className
34-
)}
35-
>
36-
{environmentTypeTitle(environment)}
37-
</span>
38-
);
39-
}
40-
41-
export function EnvironmentLabel({
42-
environment,
43-
size = "small",
44-
userName,
45-
className,
46-
}: {
47-
environment: Environment;
48-
size?: keyof typeof variants;
49-
userName?: string;
50-
className?: string;
51-
}) {
52-
return (
53-
<span
54-
className={cn(
55-
"text-midnight-900 inline-flex items-center justify-center whitespace-nowrap border font-medium uppercase tracking-wider",
56-
environmentBorderClassName(environment),
57-
environmentTextClassName(environment),
58-
variants[size],
59-
className
60-
)}
61-
>
62-
{environmentTitle(environment, userName)}
63-
</span>
64-
);
65-
}
66-
67-
type EnvironmentWithUsername = Environment & { userName?: string };
68-
69-
export function EnvironmentLabels({
70-
environments,
71-
size = "small",
72-
className,
73-
}: {
74-
environments: EnvironmentWithUsername[];
75-
size?: keyof typeof variants;
76-
className?: string;
77-
}) {
78-
const devEnvironments = sortEnvironments(
79-
environments.filter((env) => env.type === "DEVELOPMENT")
80-
);
81-
const firstDevEnvironment = devEnvironments[0];
82-
const otherDevEnvironments = devEnvironments.slice(1);
83-
const otherEnvironments = environments.filter((env) => env.type !== "DEVELOPMENT");
84-
85-
return (
86-
<div className={cn("flex items-baseline gap-2", className)}>
87-
{firstDevEnvironment && (
88-
<EnvironmentLabel
89-
environment={firstDevEnvironment}
90-
userName={firstDevEnvironment.userName}
91-
size={size}
92-
/>
93-
)}
94-
{otherDevEnvironments.length > 0 ? (
95-
<SimpleTooltip
96-
disableHoverableContent
97-
button={
98-
<span
99-
className={cn(
100-
"inline-flex items-center justify-center whitespace-nowrap border font-medium uppercase tracking-wider",
101-
environmentBorderClassName({ type: "DEVELOPMENT" }),
102-
environmentTextClassName({ type: "DEVELOPMENT" }),
103-
variants[size]
104-
)}
105-
>
106-
+{otherDevEnvironments.length}
107-
</span>
108-
}
109-
content={
110-
<div className="flex gap-1 py-1">
111-
{otherDevEnvironments.map((environment, index) => (
112-
<EnvironmentLabel
113-
key={index}
114-
environment={environment}
115-
userName={environment.userName}
116-
size={size}
117-
/>
118-
))}
119-
</div>
120-
}
121-
/>
122-
) : null}
123-
{otherEnvironments.map((environment, index) => (
124-
<EnvironmentLabel
125-
key={index}
126-
environment={environment}
127-
userName={environment.userName}
128-
size={size}
129-
/>
130-
))}
131-
</div>
132-
);
133-
}
13412

13513
export function EnvironmentIcon({
13614
environment,
@@ -156,7 +34,7 @@ export function EnvironmentIcon({
15634
}
15735
}
15836

159-
export function FullEnvironmentCombo({
37+
export function EnvironmentCombo({
16038
environment,
16139
className,
16240
}: {
@@ -166,12 +44,12 @@ export function FullEnvironmentCombo({
16644
return (
16745
<span className={cn("flex items-center gap-1.5 text-sm text-text-bright", className)}>
16846
<EnvironmentIcon environment={environment} className="size-4" />
169-
<FullEnvironmentLabel environment={environment} />
47+
<EnvironmentLabel environment={environment} />
17048
</span>
17149
);
17250
}
17351

174-
export function FullEnvironmentLabel({
52+
export function EnvironmentLabel({
17553
environment,
17654
className,
17755
}: {

apps/webapp/app/components/navigation/EnvironmentSelector.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useNavigation } from "@remix-run/react";
22
import { useEffect, useState } from "react";
33
import { useEnvironmentSwitcher } from "~/hooks/useEnvironmentSwitcher";
44
import { type MatchedOrganization } from "~/hooks/useOrganizations";
5-
import { FullEnvironmentCombo } from "../environments/EnvironmentLabel";
5+
import { EnvironmentCombo } from "../environments/EnvironmentLabel";
66
import {
77
Popover,
88
PopoverArrowTrigger,
@@ -46,7 +46,7 @@ export function EnvironmentSelector({
4646
fullWidth
4747
className={cn("h-7 overflow-hidden py-1 pl-2", className)}
4848
>
49-
<FullEnvironmentCombo environment={environment} className="w-full text-2sm" />
49+
<EnvironmentCombo environment={environment} className="w-full text-2sm" />
5050
</PopoverArrowTrigger>
5151
<PopoverContent
5252
className="min-w-[14rem] overflow-y-auto p-0 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600"
@@ -58,7 +58,7 @@ export function EnvironmentSelector({
5858
<PopoverMenuItem
5959
key={env.id}
6060
to={urlForEnvironment(env)}
61-
title={<FullEnvironmentCombo environment={env} className="mx-auto grow text-2sm" />}
61+
title={<EnvironmentCombo environment={env} className="mx-auto grow text-2sm" />}
6262
isSelected={env.id === environment.id}
6363
/>
6464
))}
@@ -75,7 +75,7 @@ export function EnvironmentSelector({
7575
)}
7676
title={
7777
<div className="flex w-full items-center justify-between">
78-
<FullEnvironmentCombo environment={{ type: "STAGING" }} className="text-2sm" />
78+
<EnvironmentCombo environment={{ type: "STAGING" }} className="text-2sm" />
7979
<span className="text-indigo-500">Upgrade</span>
8080
</div>
8181
}

apps/webapp/app/components/navigation/SideMenuItem.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { type AnchorHTMLAttributes } from "react";
22
import { usePathName } from "~/hooks/usePathName";
33
import { cn } from "~/utils/cn";
44
import { LinkButton } from "../primitives/Buttons";
5+
import { type RenderIcon } from "../primitives/Icon";
56

67
export function SideMenuItem({
78
icon,
@@ -14,10 +15,10 @@ export function SideMenuItem({
1415
badge,
1516
target,
1617
}: {
17-
icon?: React.ComponentType<any>;
18+
icon?: RenderIcon;
1819
activeIconColor?: string;
1920
inactiveIconColor?: string;
20-
trailingIcon?: React.ComponentType<any>;
21+
trailingIcon?: RenderIcon;
2122
trailingIconClassName?: string;
2223
name: string;
2324
to: string;

apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Form, useNavigation, useSubmit } from "@remix-run/react";
33
import { useCallback, useEffect, useRef } from "react";
44
import { type UseDataFunctionReturn, useTypedFetcher } from "remix-typedjson";
55
import { JSONEditor } from "~/components/code/JSONEditor";
6-
import { FullEnvironmentCombo } from "~/components/environments/EnvironmentLabel";
6+
import { EnvironmentCombo } from "~/components/environments/EnvironmentLabel";
77
import { Button } from "~/components/primitives/Buttons";
88
import { DialogContent, DialogHeader } from "~/components/primitives/Dialog";
99
import { Header3 } from "~/components/primitives/Headers";
@@ -135,15 +135,15 @@ function ReplayForm({
135135
const env = environments.find((env) => env.id === value)!;
136136
return (
137137
<div className="flex items-center pl-1 pr-2">
138-
<FullEnvironmentCombo environment={env} />
138+
<EnvironmentCombo environment={env} />
139139
</div>
140140
);
141141
}}
142142
>
143143
{(matches) =>
144144
matches.map((env) => (
145145
<SelectItem key={env.id} value={env.id}>
146-
<FullEnvironmentCombo environment={env} />
146+
<EnvironmentCombo environment={env} />
147147
</SelectItem>
148148
))
149149
}

apps/webapp/app/components/runs/v3/SharedFilters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function EnvironmentsDropdown({
100100
value={item.id}
101101
shortcut={shortcutFromIndex(index, { shortcutsEnabled: true })}
102102
>
103-
<EnvironmentLabel environment={item} userName={item.userName} />
103+
<EnvironmentLabel environment={item} />
104104
</SelectItem>
105105
))}
106106
</SelectList>

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts.new/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useEffect, useState } from "react";
99
import { typedjson, useTypedLoaderData } from "remix-typedjson";
1010
import { z } from "zod";
1111
import { InlineCode } from "~/components/code/InlineCode";
12-
import { FullEnvironmentCombo } from "~/components/environments/EnvironmentLabel";
12+
import { EnvironmentCombo } from "~/components/environments/EnvironmentLabel";
1313
import { Button, LinkButton } from "~/components/primitives/Buttons";
1414
import { Callout, variantClasses } from "~/components/primitives/Callout";
1515
import { CheckboxWithLabel } from "~/components/primitives/Checkbox";
@@ -416,7 +416,7 @@ export default function Page() {
416416
<InputGroup>
417417
<Label>Environment</Label>
418418
<input type="hidden" name={environmentTypes.name} value={environment.type} />
419-
<FullEnvironmentCombo environment={environment} />
419+
<EnvironmentCombo environment={environment} />
420420
<FormError id={environmentTypes.errorId}>{environmentTypes.error}</FormError>
421421
</InputGroup>
422422
<FormError>{form.error}</FormError>

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ import assertNever from "assert-never";
1818
import { typedjson, useTypedLoaderData } from "remix-typedjson";
1919
import { z } from "zod";
2020
import { AlertsNoneDev, AlertsNoneDeployed } from "~/components/BlankStatePanels";
21-
import {
22-
EnvironmentTypeLabel,
23-
FullEnvironmentCombo,
24-
} from "~/components/environments/EnvironmentLabel";
21+
import { EnvironmentCombo } from "~/components/environments/EnvironmentLabel";
2522
import { MainCenteredContainer, PageBody, PageContainer } from "~/components/layout/AppLayout";
2623
import { Button, LinkButton } from "~/components/primitives/Buttons";
2724
import { ClipboardField } from "~/components/primitives/ClipboardField";
@@ -240,7 +237,7 @@ export default function Page() {
240237
<TableCell className={alertChannel.enabled ? "" : "opacity-50"}>
241238
<div className="flex items-center gap-3">
242239
{alertChannel.environmentTypes.map((environmentType) => (
243-
<FullEnvironmentCombo
240+
<EnvironmentCombo
244241
key={environmentType}
245242
environment={{ type: environmentType }}
246243
className="text-xs"

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.apikeys/route.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type MetaFunction } from "@remix-run/react";
44
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
55
import { typedjson, useTypedLoaderData } from "remix-typedjson";
66
import { AdminDebugTooltip } from "~/components/admin/debugTooltip";
7-
import { environmentTitle, FullEnvironmentCombo } from "~/components/environments/EnvironmentLabel";
7+
import { environmentTitle, EnvironmentCombo } from "~/components/environments/EnvironmentLabel";
88
import { RegenerateApiKeyModal } from "~/components/environments/RegenerateApiKeyModal";
99
import { PageBody, PageContainer } from "~/components/layout/AppLayout";
1010
import { LinkButton } from "~/components/primitives/Buttons";
@@ -106,7 +106,7 @@ export default function Page() {
106106
{environments.map((environment) => (
107107
<TableRow key={environment.id}>
108108
<TableCell>
109-
<FullEnvironmentCombo environment={environment} />
109+
<EnvironmentCombo environment={environment} />
110110
</TableCell>
111111
<TableCell>
112112
<ClipboardField
@@ -134,7 +134,7 @@ export default function Page() {
134134
{!hasStaging && (
135135
<TableRow>
136136
<TableCell>
137-
<FullEnvironmentCombo environment={{ type: "STAGING" }} />
137+
<EnvironmentCombo environment={{ type: "STAGING" }} />
138138
</TableCell>
139139
<TableCell>
140140
<LinkButton

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
99
import { Suspense } from "react";
1010
import { typeddefer, useTypedLoaderData } from "remix-typedjson";
1111
import { AdminDebugTooltip } from "~/components/admin/debugTooltip";
12-
import { FullEnvironmentCombo } from "~/components/environments/EnvironmentLabel";
12+
import { EnvironmentCombo } from "~/components/environments/EnvironmentLabel";
1313
import { Feedback } from "~/components/Feedback";
1414
import { PageBody, PageContainer } from "~/components/layout/AppLayout";
1515
import { Button, LinkButton } from "~/components/primitives/Buttons";
@@ -155,7 +155,7 @@ function EnvironmentsTable({ environments }: { environments: Environment[] }) {
155155
{environments.map((environment) => (
156156
<TableRow key={environment.id}>
157157
<TableCell>
158-
<FullEnvironmentCombo environment={environment} />
158+
<EnvironmentCombo environment={environment} />
159159
</TableCell>
160160
<TableCell alignment="right">{environment.queued}</TableCell>
161161
<TableCell alignment="right">{environment.concurrency}</TableCell>

0 commit comments

Comments
 (0)