Skip to content

Commit c69cb2a

Browse files
committed
When editing older schedules (that have multi-env) show preview branches correctly
1 parent a2f324e commit c69cb2a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

apps/webapp/app/presenters/v3/EditSchedulePresenter.server.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class EditSchedulePresenter {
5050
},
5151
},
5252
},
53+
branchName: true,
5354
},
5455
},
5556
},
@@ -85,11 +86,17 @@ export class EditSchedulePresenter {
8586
})
8687
: [];
8788

88-
const possibleEnvironments = filterOrphanedEnvironments(project.environments).map(
89-
(environment) => {
90-
return displayableEnvironment(environment, userId);
91-
}
92-
);
89+
const possibleEnvironments = filterOrphanedEnvironments(project.environments)
90+
.map((environment) => {
91+
return {
92+
...displayableEnvironment(environment, userId),
93+
branchName: environment.branchName ?? undefined,
94+
};
95+
})
96+
.filter((env) => {
97+
if (env.type === "PREVIEW" && !env.branchName) return false;
98+
return true;
99+
});
93100

94101
return {
95102
possibleTasks: possibleTasks.map((task) => task.slug).sort(),

0 commit comments

Comments
 (0)