mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: show all experiments in deployments list if opted into (#10722)
This commit is contained in:
@@ -97,7 +97,11 @@ describe("optionValue", () => {
|
||||
value: ["moons"],
|
||||
},
|
||||
additionalValues: ["single_tailnet", "deployment_health_page"],
|
||||
expected: { single_tailnet: false, deployment_health_page: false },
|
||||
expected: {
|
||||
single_tailnet: false,
|
||||
deployment_health_page: false,
|
||||
moons: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
option: {
|
||||
@@ -108,6 +112,15 @@ describe("optionValue", () => {
|
||||
additionalValues: ["single_tailnet", "deployment_health_page"],
|
||||
expected: { single_tailnet: true, deployment_health_page: true },
|
||||
},
|
||||
{
|
||||
option: {
|
||||
...defaultOption,
|
||||
name: "Experiments",
|
||||
value: ["*", "moons", "single_tailnet"],
|
||||
},
|
||||
additionalValues: ["single_tailnet"],
|
||||
expected: { moons: true, single_tailnet: true },
|
||||
},
|
||||
{
|
||||
option: {
|
||||
...defaultOption,
|
||||
|
||||
@@ -50,8 +50,10 @@ export function optionValue(
|
||||
break;
|
||||
}
|
||||
|
||||
// We show all experiments (including unsafe) that are currently enabled on a deployment
|
||||
// but only show safe experiments that are not.
|
||||
for (const v of option.value) {
|
||||
if (Object.hasOwn(experimentMap, v)) {
|
||||
if (v !== "*") {
|
||||
experimentMap[v] = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user