-
Notifications
You must be signed in to change notification settings - Fork 7
feat(warning-page): Implement new design and action on opt-in button click #22
Conversation
6929518
to
9a0dc6e
Compare
@rohitkrai03 please review the PR |
9a0dc6e
to
a92bf58
Compare
projects/ngx-feature-flag/src/lib/feature-wrapper/feature-toggle.component.ts
Outdated
Show resolved
Hide resolved
projects/ngx-feature-flag/src/lib/feature-wrapper/feature-toggle.component.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,92 @@ | |||
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http'; |
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.
@divyanshiGupta I guess this is a duplicate service from fabric8-ui
. I am thinking if there is a way to reuse the same service here but because of cyclic dependency it would not be easy. We could have it done the way PipelineService
is done in ngx-launcher
but thats not the best way for me as well. I think this will be solved by the SDK refactoring.
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.
@rohitkrai03 this is a duplicate service because at this point I didnt find any better and less time consuming way of doing this. You are right about the cyclic dependency issue and hence I tried to do it by creating the service interface in ngx-feature-flag and implementing it in fabric8-ui the way PipelineService is done in ngx-launcher but this also didnt worked out for me as some other issues were coming up. I agree with you that this can be solved once we get all the services in the SDK and we can use this service both in fabric8-ui and ngx-feature-flag from the SDK.
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.
@divyanshiGupta Understood. I'll add this use case in SDK doc.
<i class="fa fa-flask fa-5x"></i> | ||
<h2>Ooops</h2> | ||
<p>This feature has been disabled by your admin page.</p> | ||
<div *ngIf="featureWarning" class="container-fluid container-cards-pf"> |
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.
@divyanshiGupta Is this backwards compatible with the way it was being used earlier with FeatureFlagResolver
?
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 @rohitkrai03 this is backwards compatible, I have implemented this in a way that it doesn't breaks when used with FeatureFlagResolver
. I have also tested it with a feature using FeatureFlagResolver
at the route level.
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.
That's good. Nice work there.
a92bf58
to
0ae24b5
Compare
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.
Tried it with the demo app. Works fine. Code looks good to me.
projects/ngx-feature-flag/src/lib/warning-page/feature-warning-page.component.ts
Outdated
Show resolved
Hide resolved
projects/ngx-feature-flag/src/lib/warning-page/feature-warning-page.component.ts
Outdated
Show resolved
Hide resolved
projects/ngx-feature-flag/src/lib/warning-page/feature-warning-page.component.less
Outdated
Show resolved
Hide resolved
projects/ngx-feature-flag/src/lib/service/enable-feature.service.ts
Outdated
Show resolved
Hide resolved
projects/ngx-feature-flag/src/lib/feature-wrapper/feature-toggle.component.ts
Outdated
Show resolved
Hide resolved
670221d
to
c3ffb92
Compare
🎉 This PR is included in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Parent Story: https://openshift.io/openshiftio/Openshift_io/plan/detail/1110
This PR adds :
feature-wrapper
to either show the default warning page with the option to opt-in the feature or a different template provided by the parent component when the feature is not enabled.Note :
![feature-toggle](https://user-images.githubusercontent.com/20724543/50833263-a2359500-1376-11e9-96f9-9857aaaa7ada.gif)
I have tested the above changes with the ngx-feature-flag demo app. I also tried to test these changes with fabric8-ui and planner by linking but I am getting
Null Injector for HttpClient
error. This might be due to something going wrong while linking or because of the way the dependencies are being resolved in the new monorepo structure.I think the linking issues will be resolved once we move ngx-feature-flag to monorepo.
@christianvogt what do you think about it?