Skip to content

Commit 35bf125

Browse files
talissoncostaclaude
andcommitted
fix(Dependencies): Show pending change requests only where the API lists them
Hidden without the create change request permission, which the API needs, and one published or deleted since listing drops out instead of failing the section. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 1ea7e59 commit 35bf125

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎frontend/common/services/useFeatureDependency.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@ export const pendingFeatureDependencyService =
226226
),
227227
),
228228
)
229-
if (lists.some((list) => list.isError)) {
229+
// Published or deleted since it was listed, so nothing is pending.
230+
const isGone = (list: (typeof lists)[number]) =>
231+
!!list.error &&
232+
'status' in list.error &&
233+
(list.error.status === 400 || list.error.status === 404)
234+
if (lists.some((list) => list.isError && !isGone(list))) {
230235
return {
231236
error: {
232237
error: "Could not load a change request's dependencies.",

‎frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/FeatureDependenciesTab.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ const FeatureDependenciesTab: FC<FeatureDependenciesTabProps> = ({
202202
/>
203203
)}
204204

205-
{isChangeRequest && (
205+
{/* The API lists them only to those who can create change requests. */}
206+
{isChangeRequest && permission && (
206207
<PendingChangeRequests
207208
environmentId={environmentId}
208209
featureId={projectFlag.id}

0 commit comments

Comments
 (0)