Skip to content

fix(console): refresh UI after API detach from automation source#17256

Open
ankita-gupta21 wants to merge 1 commit into
4.8.xfrom
APIM-13877-refresh-ui-after-api-detach
Open

fix(console): refresh UI after API detach from automation source#17256
ankita-gupta21 wants to merge 1 commit into
4.8.xfrom
APIM-13877-refresh-ui-after-api-detach

Conversation

@ankita-gupta21
Copy link
Copy Markdown
Contributor

Issue

https://gravitee.atlassian.net/browse/APIM-13877

Description

Reload General Info via refresh$ instead of re-running ngOnInit, refresh lastApiFetch after detach, and update danger zone detach/read-only state when originContext changes.

Additional context

api-general-info: Replace (reloadDetails)="ngOnInit()" with reloadDetails() that triggers the existing refresh$ subject, so the API is refetched without stacking duplicate subscriptions.
ApiV2Service.detach(): Chain refreshLastApiFetch() after _detach (same pattern as deploy) so getLastApiFetch() consumers (e.g. API navigation) receive the updated originContext.
api-general-info-danger-zone: Move canDetach / isReadOnly into updateOriginContextState() and call it from ngOnChanges when the [api] input changes, so the Detach action hides after reload.

Screen.Recording.2026-05-30.at.11.21.04.AM.mov

@ankita-gupta21 ankita-gupta21 requested a review from a team as a code owner May 30, 2026 05:54
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the API general info danger zone component by extracting origin context state updates into a reusable method and triggering it on changes. It also updates the API service's detach method to refresh the last API fetch automatically. Feedback on these changes includes adding optional chaining to prevent potential runtime errors when the API input is null, removing a redundant method call in ngOnInit since ngOnChanges runs first, and mapping the detach observable stream to undefined to avoid strict TypeScript type mismatches.

Comment thread gravitee-apim-console-webui/src/services-ngx/api-v2.service.ts
@ankita-gupta21 ankita-gupta21 force-pushed the APIM-13877-refresh-ui-after-api-detach branch from 06647b4 to 24d83be Compare June 2, 2026 10:45
@ankita-gupta21 ankita-gupta21 force-pushed the APIM-13877-refresh-ui-after-api-detach branch from 24d83be to 21bceaa Compare June 2, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant