-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get flag details on details page #1634
Conversation
…reload or url hit
So I'm guessing the issue you're seeing is this: what's happening is that the data you see when you nav from root page is from the pre-existing flag data, not actually from the fetch-by-id response. It's a trick! Your set-up is working up to that point. You can spy on the Please add this in the reducer to pop the flag into the data store on success:
Now when the data store is updated on success, the page will render it when ready. |
Yes i get it now |
…l. Removed some necessary code
>exposures-card</app-feature-flag-exposures-section-card | ||
> | ||
</app-common-section-card-list> | ||
<div class="content-container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we sub to the feature flag directly with an async pipe in template, we can do this and eliminate half of the component code:
<ng-container *ngIf="(featureFlag$ | async) as featureFlag; else loading">
<app-common-section-card-list class="common-section-card-list">
<app-feature-flag-overview-details-section-card [data]="featureFlag" section-card></app-feature-flag-overview-details-section-card>
<app-feature-flag-inclusions-section-card [data]="featureFlag" *ngIf="(activeTabIndex$ | async) === 0" section-card>inclusions-card</app-feature-flag-inclusions-section-card>
<app-feature-flag-exclusions-section-card [data]="featureFlag" *ngIf="(activeTabIndex$ | async) === 0" section-card>exclusions-card</app-feature-flag-exclusions-section-card>
<app-feature-flag-exposures-section-card [data]="featureFlag" *ngIf="(activeTabIndex$ | async) === 1" section-card>exposures-card</app-feature-flag-exposures-section-card>
</app-common-section-card-list>
</ng-container>
<ng-template #loading>
<mat-spinner></mat-spinner>
</ng-template>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then in component code, you just need this, no need to manage anything about this subscription by hand, the "filter" pipe isn't really doing anything very helpful, and change detector ref can be eliminated
featureFlag$ = this.featureFlagsService.selectedFeatureFlag$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i'll need this as an observable like suggested above in order to complete some work I'm currently doing, let me know if this suggestion works for you, I tried it in my local and it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes works for me too
Get details on navigation. Issue to load details on page reload or url hit