@orsetra/shared-ui 1.5.18 → 1.5.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ export interface EnvironmentPickerDialogProps {
16
16
  fetchEnvironments: (projectName: string) => Promise<{ envs: Environment[] }>
17
17
  onSelect: (envName: string, envAlias: string) => void
18
18
  excludeEnvs?: string[]
19
+ includeEnvs?: string[]
19
20
  title?: string
20
21
  description?: string
21
22
  }
@@ -27,6 +28,7 @@ export function EnvironmentPickerDialog({
27
28
  fetchEnvironments,
28
29
  onSelect,
29
30
  excludeEnvs = [],
31
+ includeEnvs,
30
32
  title = "Select an environment",
31
33
  description,
32
34
  }: EnvironmentPickerDialogProps) {
@@ -41,8 +43,10 @@ export function EnvironmentPickerDialog({
41
43
  setLoading(true)
42
44
  try {
43
45
  const response = await fetchEnvironments(projectName)
44
- const all = response.envs || []
45
- setEnvironments(excludeEnvs.length ? all.filter((e) => !excludeEnvs.includes(e.name)) : all)
46
+ let all = response.envs || []
47
+ if (includeEnvs) all = all.filter((e) => includeEnvs.includes(e.name))
48
+ else if (excludeEnvs.length) all = all.filter((e) => !excludeEnvs.includes(e.name))
49
+ setEnvironments(all)
46
50
  } catch {
47
51
  // silent
48
52
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orsetra/shared-ui",
3
- "version": "1.5.18",
3
+ "version": "1.5.19",
4
4
  "description": "Shared UI components for Orsetra platform",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",