Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/env-variables-search-by-environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: improvement
---

Extended the search filter on the environment variables page to match on environment type (production, staging, development, preview) and branch name, not just variable name and value.
4 changes: 2 additions & 2 deletions apps/webapp/app/hooks/useFuzzyFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { matchSorter } from "match-sorter";
*
* @param params - The parameters object
* @param params.items - Array of objects to filter
* @param params.keys - Array of object keys to perform the fuzzy search on
* @param params.keys - Array of object keys to perform the fuzzy search on (supports dot-notation for nested properties)
* @returns An object containing:
* - filterText: The current filter text
* - setFilterText: Function to update the filter text
Expand All @@ -28,7 +28,7 @@ export function useFuzzyFilter<T extends Object>({
keys,
}: {
items: T[];
keys: Extract<keyof T, string>[];
keys: (Extract<keyof T, string> | (string & {}))[];
}) {
const [filterText, setFilterText] = useState("");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default function Page() {
const { filterText, setFilterText, filteredItems } =
useFuzzyFilter<EnvironmentVariableWithSetValues>({
items: environmentVariables,
keys: ["key", "value"],
keys: ["key", "value", "environment.type", "environment.branchName"],
});

// Add isFirst and isLast to each environment variable
Expand Down
Loading