fix(console): refresh UI after API detach from automation source#17256
Open
ankita-gupta21 wants to merge 1 commit into
Open
fix(console): refresh UI after API detach from automation source#17256ankita-gupta21 wants to merge 1 commit into
ankita-gupta21 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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.
06647b4 to
24d83be
Compare
24d83be to
21bceaa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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