Skip to content

Commit 5d0d0ae

Browse files
committed
Progress on new env vars
1 parent 8ec543b commit 5d0d0ae

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

apps/webapp/app/models/organization.server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import slug from "slug";
1111
import { prisma, type PrismaClientOrTransaction } from "~/db.server";
1212
import { env } from "~/env.server";
1313
import { featuresForUrl } from "~/features.server";
14-
import { type BranchGit } from "~/presenters/v3/BranchesPresenter.server";
1514
import { createApiKeyForEnv, createPkApiKeyForEnv, envSlug } from "./api-key.server";
1615

1716
export type { Organization };

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export default function Page() {
230230
newSet.delete(previewEnv.id);
231231
}
232232
newSet.add(environmentId);
233+
setSelectedBranchIds([]);
233234
}
234235
} else {
235236
newSet.delete(environmentId);
@@ -348,17 +349,25 @@ export default function Page() {
348349

349350
{previewIsSelected && (
350351
<InputGroup fullWidth>
351-
<Label>Preview branches</Label>
352+
<Label>Preview branch override (optional)</Label>
352353
<Select
354+
variant="tertiary/medium"
353355
value={selectedBranchIds}
354356
setValue={handleBranchChange}
355-
placeholder="Default for Preview"
357+
placeholder="No override"
356358
items={branchEnvironments}
359+
className="w-fit"
360+
filter={{
361+
keys: [(item) => item.branchName?.replace(/\//g, " ").replace(/_/g, " ") ?? ""],
362+
}}
357363
text={(vals) =>
358-
vals
359-
?.map((env) => branchEnvironments.find((b) => b.id === env)?.branchName)
360-
.join(", ")
364+
vals.length > 0
365+
? vals
366+
?.map((env) => branchEnvironments.find((b) => b.id === env)?.branchName)
367+
.join(", ")
368+
: null
361369
}
370+
dropdownIcon
362371
>
363372
{(matches) =>
364373
matches?.map((env) => (
@@ -369,7 +378,10 @@ export default function Page() {
369378
}
370379
</Select>
371380
<Hint>
372-
Select specific preview branches to apply these environment variables to.
381+
You can select branches to override variables.{" "}
382+
{selectedBranchIds.length > 0
383+
? "The variables below will be overriden for runs on these branches."
384+
: "No overrides are currently set."}
373385
</Hint>
374386
</InputGroup>
375387
)}

0 commit comments

Comments
 (0)